*** empty log message ***
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
81c82a68
ILT
12012-07-10 Dodji Seketeli <dodji@redhat.com>
2 Ian Lance Taylor <iant@google.com>
3
4 PR gold/14309
5 * configure.ac: Test whether std::tr1::hash<off_t> works.
6 * gold.h: Add a specialization for std::tr1::hash<off_t> if
7 needed.
8 * output.h (class Output_fill): Add virtual destructor.
9 * configure, config.in: Rebuild.
10
eabc84f4
RM
112012-06-22 Roland McGrath <mcgrathr@google.com>
12
13 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
14
370e30b6
RÁE
152012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
16
17 * plugin.cc (Plugin::load): Handle position independent executables.
18
fb1b895d
CC
192012-06-06 Cary Coutant <ccoutant@google.com>
20
21 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
22 add .debug_macro.
23 (lines_only_debug_sections): Likewise.
24 (gdb_fast_lookup_sections): New static array.
25 (is_gdb_debug_section): Rename formal parameter.
26 (is_lines_only_debug_section): Likewise.
27 (is_gdb_fast_lookup_section): New function.
28 (Layout::include_section): Check for ".zdebug_" prefix; pass
29 section name suffix to is_gdb_debug_section, et al.; check for
30 fast-lookup sections when building .gdb_index.
31 * options.h (--strip-debug-gdb): Update GDB version number.
32
7c0640fa
CC
332012-06-06 Cary Coutant <ccoutant@google.com>
34
35 * configure.ac: Add check for fallocate.
36 * configure: Regenerate.
37 * config.in: Regenerate.
38
39 * options.h (class General_options): Add --mmap-output-file and
40 --posix-fallocate options.
41 * output.cc: (posix_fallocate): Remove; replace with...
42 (gold_fallocate): New function.
43 (Output_file::map_no_anonymous): Call gold_fallocate.
44 (Output_file::map): Check --mmap-output-file option.
45
2a49eb69
DK
462012-06-05 Jing Yu <jingyu@google.com>
47
48 * gold.h (textdomain): Add do {} to empty while(0).
49 (bindtextdomain): Likewise.
50
fad072ac
CC
512012-06-04 Cary Coutant <ccoutant@google.com>
52
53 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
54 has_dynsym_index.
55
8cc69fb6
ST
562012-05-25 Sriraman Tallam <tmsriram@google.com>
57
58 * symtab.cc (Symbol_table::define_special_symbol):
59 Initialize *poldsym to prevent uninitialized variable errors.
60
1be75daa
CC
612012-05-23 Cary Coutant <ccoutant@google.com>
62
63 * layout.cc (Layout::section_name_mapping): Add rules to handle
64 exact match on .data.rel.ro.local or .data.rel.ro.
65 (Layout::output_section_name): Check for exact matches.
66
9b689de0
CC
672012-05-23 Cary Coutant <ccoutant@google.com>
68
69 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
70 more carefully.
71
b24fdbf5
CC
722012-05-22 Cary Coutant <ccoutant@google.com>
73
74 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
75 object before exporting symbol.
76
e550e1a2
L
772012-05-21 H.J. Lu <hongjiu.lu@intel.com>
78
79 * testsuite/tls_test.cc: Include "config.h" first.
80 * testsuite/tls_test_c.c: Likewise.
81
df7b86aa
NC
822012-05-17 Daniel Richard G. <skunk@iskunk.org>
83 Nick Clifton <nickc@redhat.com>
84
85 PR 14072
86 * configure.in: Add check that sysdep.h has been included before
87 any system header files.
88 * configure: Regenerate.
89 * config.in: Regenerate.
90
1007b503
CC
912012-05-14 Cary Coutant <ccoutant@google.com>
92
93 * layout.cc (Layout::make_output_section): Mark .tdata section
94 as RELRO.
95 * testsuite/relro_test.cc: Add a TLS variable.
96
fd885f3a
L
972012-05-10 H.J. Lu <hongjiu.lu@intel.com>
98
99 PR gold/14091
100 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
101 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
102 R_X86_64_64.
103
80f5885c
CC
1042012-05-08 Cary Coutant <ccoutant@google.com>
105
106 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
107 (lines_only_debug_sections): Likewise.
108
2e702c99
RM
1092012-05-02 Roland McGrath <mcgrathr@google.com>
110
111 * nacl.cc: New file.
112 * nacl.h: New file.
113 * Makefile.am (CCFILES, HFILES): Add them.
114 * Makefile.in: Regenerate.
115 * i386.cc (Output_data_plt_i386_nacl): New class.
116 (Output_data_plt_i386_nacl_exec): New class.
117 (Output_data_plt_i386_nacl_dyn): New class.
118 (Target_i386_nacl): New class.
119 (Target_selector_i386_nacl): New class.
120 (target_selector_i386): Use it instead of Target_selector_i386.
121 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
122 (Target_x86_64_nacl): New class.
123 (Target_selector_x86_64_nacl): New class.
124 (target_selector_x86_64, target_selector_x32): Use it instead of
125 Target_selector_x86_64.
126 * arm.cc (Output_data_plt_arm_nacl): New class.
127 (Target_arm_nacl): New class.
128 (Target_selector_arm_nacl): New class.
129 (target_selector_arm, target_selector_armbe): Use it instead of
130 Target_selector_arm.
131
132 * target-select.cc (select_target): Take new Input_file* and off_t
133 arguments, pass them on to recognize method of selector.
134 * object.cc (make_elf_sized_object): Update caller.
135 * parameters.cc (parameters_force_valid_target): Likewise.
136 * incremental.cc (make_sized_incremental_binary): Likewise.
137 * target-select.h: Update decl.
138 (Target_selector::recognize): Take new Input_file* argument,
139 pass it on to do_recognize.
140 (Target_selector::do_recognize): Take new Input_file* argument.
141 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
142 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
143 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
144 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
145
146 * target.h (Target::Target_info): New members isolate_execinstr
147 and rosegment_gap.
148 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
149 * arm.cc (Target_arm::arm_info): Update initializer.
150 * i386.cc (Target_i386::i386_info): Likewise.
151 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
152 * sparc.cc (Target_sparc::sparc_info): Likewise.
153 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
154 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
155 * layout.cc (Layout::attach_allocated_section_to_segment):
156 Take new const Target* argument. If target->isolate_execinstr(), act
157 like --rosegment.
158 (Layout::find_first_load_seg): Take new const Target* argument;
159 if target->isolate_execinstr(), reject PF_X segments.
160 (Layout::relaxation_loop_body): Update caller.
161 (Layout::set_segment_offsets): If target->isolate_execinstr(),
162 reset file offset to zero when we hit LOAD_SEG, and then do a second
163 loop over the segments before LOAD_SEG to reassign offsets after
164 addresses have been determined. Handle target->rosegment_gap().
165 (Layout::attach_section_to_segment): Take new const Target* argument;
166 pass it to attach_allocated_section_to_segment.
167 (Layout::make_output_section): Update caller.
168 (Layout::attach_sections_to_segments): Take new const Target* argument;
169 pass it to attach_section_to_segment.
170 * gold.cc (queue_middle_tasks): Update caller.
171 * layout.h (Layout): Update method decls with new arguments.
172
173 * arm.cc (Target_arm::Target_arm): Take optional argument for the
174 Target_info pointer to use.
175 (Target_arm::do_make_data_plt): New virtual method.
176 (Target_arm::make_data_plt): New method that calls it.
177 (Target_arm::make_plt_entry): Use it.
178 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
179 for the section alignment.
180 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
181 method.
182 (Output_data_plt_arm::first_plt_entry_offset): Call it.
183 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
184 method.
185 (Output_data_plt_arm::get_plt_entry_size): Call it.
186 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
187 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
188 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
189 method.
190 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
191 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
192 method instead of sizeof(plt_entry).
193 (Output_data_plt_arm::add_entry): Likewise.
194 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
195 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
196 than static method.
197 (Target_arm::plt_entry_size): Likewise.
198 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
199 Move to ...
200 (Output_data_plt_arm_standard): ... here, new class.
201 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
202 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
203 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
204
205 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
206 Take additional argument for the PLT entry size.
207 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
208 Use get_plt_entry_size method rather than plt_entry_size variable.
209 (Output_data_plt_x86_64::reserve_slot): Likewise.
210 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
211 (Output_data_plt_x86_64::add_entry): Likewise.
212 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
213 (Output_data_plt_x86_64::address_for_global): Likewise.
214 (Output_data_plt_x86_64::address_for_local): Likewise.
215 (Output_data_plt_x86_64::set_final_data_size): Likewise.
216 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
217 Make method non-static.
218 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
219 method.
220 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
221 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
222 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
223 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
224 virtual method.
225 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
226 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
227 virtual method.
228 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
229 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
230 virtual method.
231 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
232 (Output_data_plt_x86_64::plt_entry_size)
233 (Output_data_plt_x86_64::first_plt_entry)
234 (Output_data_plt_x86_64::plt_entry)
235 (Output_data_plt_x86_64::tlsdesc_plt_entry)
236 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
237 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
238 (Output_data_plt_x86_64_standard): ... here, new class.
239 (Target_x86_64::Target_x86_64): Take optional argument for the
240 Target_info pointer to use.
241 (Target_x86_64::do_make_data_plt): New virtual method.
242 (Target_x86_64::make_data_plt): New method to call it.
243 (Target_x86_64::init_got_plt_for_update): Use that.
244 Call this->plt_->add_eh_frame method here.
245 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
246 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
247 rather than static method.
248 (Target_x86_64::plt_entry_size): Likewise.
249 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
250 rather than plt_entry_size variable. Move guts of PLT filling to...
251 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
252 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
253 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
254
255 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
256 additional argument for the section alignment.
257 Don't do add_eh_frame_for_plt here.
258 (Output_data_plt_i386::first_plt_entry_offset): Make the method
259 non-static. Use get_plt_entry_size method rather than plt_entry_size
260 variable.
261 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
262 method.
263 (Output_data_plt_i386::get_plt_entry_size): Call it.
264 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
265 (Output_data_plt_i386::add_eh_frame): New method to call it.
266 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
267 method.
268 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
269 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
270 method.
271 (Output_data_plt_i386::fill_plt_entry): New method to call it.
272 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
273 method instead of plt_entry_size.
274 (Output_data_plt_i386::plt_entry_size)
275 (Output_data_plt_i386::plt_eh_frame_fde_size)
276 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
277 (Output_data_plt_i386_standard): ... here, new class.
278 (Output_data_plt_i386_exec): New class.
279 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
280 (Output_data_plt_i386_exec::first_plt_entry): ... here.
281 (Output_data_plt_i386::exec_plt_entry): Move to ...
282 (Output_data_plt_i386_exec::plt_entry): ... here.
283 (Output_data_plt_i386_dyn): New class.
284 (Output_data_plt_i386::first_plt_entry): Move to ...
285 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
286 (Output_data_plt_i386::dyn_plt_entry): Move to ...
287 (Output_data_plt_i386_dyn::plt_entry): ... here.
288 (Target_i386::Target_i386): Take optional argument for the Target_info
289 pointer to use.
290 (Target_i386::do_make_data_plt): New virtual method.
291 (Target_i386::make_data_plt): New method to call it.
292 (Target_i386::make_plt_section): Use that.
293 Call this->plt_->add_eh_frame method here.
294 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
295 rather than plt_entry_size variable.
296 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
297 (Output_data_plt_i386::address_for_local): Likewise.
298 (Output_data_plt_i386::do_write): Likewise.
299 Move guts of PLT filling to...
300 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
301 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
302 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
303 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
304
b9b9f2ee
CC
3052012-05-01 Cary Coutant <ccoutant@google.com>
306
307 * dwarf_reader.cc (Dwarf_die::read_attributes)
308 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
309 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
310 * reduced_debug_output.cc
311 (Output_reduced_debug_info_section::get_die_end): Remove
312 DW_FORM_GNU_ref_index. Add default case.
313
57923f48
MW
3142012-04-26 Mark Wielaard <mjw@redhat.com>
315
316 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
317 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
318 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
319 DW_AT_high_pc as offset from DW_AT_low_pc.
320
321 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
322 * testsuite/Makefile.in: Regenerate.
323 * testsuite/gdb_index_test_3.c: New test source file.
324 * testsuite/gdb_index_test_3.sh: New test source file.
325
2c54b4f4
ILT
3262012-04-25 Ian Lance Taylor <iant@google.com>
327
328 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
329 pointer.
330 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
331 as a class, not a struct.
332 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
333 (Target_arm::apply_cortex_a8_workaround): Likewise.
334 * gc.h: Declare Reloc_types as a struct, not a class.
335 * object.h: Declare Symbols_data as a struct.
336 * reloc.h: Declare Read_relocs_data as a struct.
337 * target.h: Declare Relocate_info as a struct.
338
a5a5f7a3
DM
3392012-04-24 David S. Miller <davem@davemloft.net>
340
341 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
342 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
343 and R_SPARC_WPLT30.
344
f038d496
CC
3452012-04-24 Cary Coutant <ccoutant@google.com>
346
347 * incremental-dump.cc (find_input_containing_global): Replace
348 magic number with symbolic constant.
349 (dump_incremental_inputs): Update version number.
350 * incremental.cc (Output_section_incremental_inputs): Update version
351 number; import symbolic constants from Incremental_inputs_reader.
352 (Incremental_inputs::create_data_sections): Align relocations
353 section correctly for 64-bit targets.
354 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
355 constants; add padding.
356 (Output_section_incremental_inputs::write_header): Add assert for
357 header_size.
358 (Output_section_incremental_inputs::write_input_files): Add assert
359 for input_entry_size.
360 (Output_section_incremental_inputs::write_info_blocks): Add padding;
361 add assert for object_info_size, input_section_entry_size,
362 global_sym_entry_size.
363 * incremental.h (Incremental_inputs_reader): Add symbolic constants
364 for data structure sizes; use them.
365 (Incremental_input_entry_reader): Import symbolic constants from
366 Incremental_inputs_reader; use them.
367
a4d85145
DM
3682012-04-23 David S. Miller <davem@davemloft.net>
369
370 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
371 and elf_flags_set_.
372 (Target_sparc::Target_sparc): Initialize new fields.
373 (Target_sparc::do_make_elf_object): New function.
374 (Target_sparc::do_adjust_elf_header): New function.
375
1d509098
CC
3762012-04-23 Cary Coutant <ccoutant@google.com>
377
378 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
379 CU range table of gdb index.
380
7ebeff7f
DM
3812012-04-20 David S. Miller <davem@davemloft.net>
382
383 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
384 instead of false.
385
13cf9988
DM
3862012-04-16 David S. Miller <davem@davemloft.net>
387
2a1079e8
DM
388 * sparc.cc (Target_sparc::got_address): New function.
389 (Sparc_relocate_functions::gdop_hix22): New function.
390 (Sparc_relocate_functions::gdop_lox10): New function.
391 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
392 relocs.
393 (Target_sparc::Scan::local): Likewise if the global symbol is not
394 preemptible and is not IFUNC.
395 (Target_sparc::Relocate::relocate): Perform GOTDATA code
396 transformations for local and non-preemptible non-IFUNC global
397 symbols.
398
0bc964fc
DM
399 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
400 writing out 64-bit part of ranges.
401
661d7a80
DM
402 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
403 -fpic and -fpie respectively.
404 * Makefile.in: Regenerate.
405
8c2bf391
DM
406 * sparc.cc (class Target_sparc): Add rela_ifunc_.
407 (Target_sparc::Target_sparc): Initialize new field.
408 (Target_sparc::do_plt_section_for_global): New function.
409 (Target_sparc::do_plt_section_for_local): New function.
410 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
411 (Target_sparc::make_plt_section): New function, broken out of
412 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
413 (Target_sparc::make_plt_entry): Call make_plt_section.
414 (Target_sparc::make_local_ifunc_plt_entry): New function.
415 (Target_sparc::rela_ifunc_section): New function.
416 (Target_sparc::plt_section): Remove const.
417 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
418 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
419 and ifunc_count_ fields.
420 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
421 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
422 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
423 (Output_data_plt_sparc::rela_ifunc): New function.
424 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
425 (Output_data_plt_sparc::has_ifunc_section): New function.
426 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
427 (Output_data_plt_sparc::address_for_global): New function.
428 (Output_data_plt_sparc::address_for_local): New function.
429 (Output_data_plt_sparc::plt_index_to_offset): New function.
430 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
431 and entry_count.
432 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
433 entry_count.
434 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
435 R_SPARC_JMP_IREL to switch.
436 (Target_sparc::Scan::check_non_pic): Likewise.
437 (Target_sparc::Scan::local): Handle IFUNC symbols.
438 (Target_sparc::Scan::local): Likewise.
439 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
440 and plt_address_for_local.
441 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
442 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
443
13cf9988
DM
444 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
445 (class Output_data_reloc): Adjust calls to Output_reloc_type.
446 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
447 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
448 global relocs too.
449 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
450 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
451 calls.
452 * sparc.cc (Target_sparc::Scan::global): Likewise.
453 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
454
31821be0
CC
4552012-04-16 Cary Coutant <ccoutant@google.com>
456
457 * archive.cc (Library_base::should_include_member): Check for
458 --export-dynamic-symbol.
459 * options.h (class General_options): Add --export-dynamic-symbol.
460 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
461 --export-dynamic-symbol.
462 (Symbol_table::gc_mark_undef_symbols): Likewise.
463 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
464
2615994e
DM
4652012-04-12 David S. Miller <davem@davemloft.net>
466
467 * sparc.cc (Reloc::wdisp10): New relocation method.
468 (Reloc::h34): Likewise.
469 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
470 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
471 R_SPARC_WDISP10.
472 (Target_sparc::Scan::local): Likewise.
473 (Target_sparc::Scan::global): Likewise.
474 (Target_sparc::Relocate::relocate): Likewise.
475
6782735d
CC
4762012-04-09 Cary Coutant <ccoutant@google.com>
477
478 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
479 low_pc == 0.
480
8c7a0b00
ILT
4812012-04-06 Ian Lance Taylor <iant@google.com>
482
483 * timer.cc: #include <unistd.h>.
484
58797674
RM
4852012-04-06 Roland McGrath <mcgrathr@google.com>
486
487 * configure.in (AC_CHECK_HEADERS): Add locale.h.
488 * config.in: Regenerate.
489 * configure: Regenerate.
490
44350750
NC
4912012-04-05 Nick Clifton <nickc@redhat.com>
492
493 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
494 (AM_LC_MESSAGES): Add.
495 * aclocal.m4: Regenerate.
496 * config.in: Regenerate.
497 * configure: Regenerate.
498
c1027032
CC
4992012-03-21 Cary Coutant <ccoutant@google.com>
500
501 * Makefile.am: Add gdb-index.cc, gdb-index.h.
502 * Makefile.in: Regenerate.
503 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
504 (Sized_elf_reloc_mapper::symbol_section): New function.
505 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
506 (make_elf_reloc_mapper): New function.
507 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
508 (Dwarf_abbrev_table::do_read_abbrevs): New function.
509 (Dwarf_abbrev_table::do_get_abbrev): New function.
510 (Dwarf_ranges_table::read_ranges_table): New function.
511 (Dwarf_ranges_table::read_range_list): New function.
512 (Dwarf_pubnames_table::read_section): New function.
513 (Dwarf_pubnames_table::read_header): New function.
514 (Dwarf_pubnames_table::next_name): New function.
515 (Dwarf_die::Dwarf_die): New function.
516 (Dwarf_die::read_attributes): New function.
517 (Dwarf_die::skip_attributes): New function.
518 (Dwarf_die::set_name): New function.
519 (Dwarf_die::set_linkage_name): New function.
520 (Dwarf_die::attribute): New function.
521 (Dwarf_die::string_attribute): New function.
522 (Dwarf_die::int_attribute): New function.
523 (Dwarf_die::uint_attribute): New function.
524 (Dwarf_die::ref_attribute): New function.
525 (Dwarf_die::child_offset): New function.
526 (Dwarf_die::sibling_offset): New function.
527 (Dwarf_info_reader::check_buffer): New function.
528 (Dwarf_info_reader::parse): New function.
529 (Dwarf_info_reader::do_parse): New function.
530 (Dwarf_info_reader::do_read_string_table): New function.
531 (Dwarf_info_reader::lookup_reloc): New function.
532 (Dwarf_info_reader::get_string): New function.
533 (Dwarf_info_reader::visit_compilation_unit): New function.
534 (Dwarf_info_reader::visit_type_unit): New function.
535 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
536 Sized_elf_reloc_mapper.
537 (Sized_dwarf_line_info::symbol_section): Remove function.
538 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
539 (Sized_dwarf_line_info::read_line_mappings): Remove object
540 parameter, adjust callers.
541 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
542 * dwarf_reader.h: Include <sys/types.h>.
543 (class Track_relocs): Remove forward declaration.
544 (class Elf_reloc_mapper): New class.
545 (class Sized_elf_reloc_mapper): New class.
546 (class Dwarf_abbrev_table): New class.
547 (class Dwarf_range_list): New class.
548 (class Dwarf_ranges_table): New class.
549 (class Dwarf_pubnames_table): New class.
550 (class Dwarf_die): New class.
551 (class Dwarf_info_reader): New class.
552 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
553 (Sized_dwarf_line_info::symbol_section): Remove member function.
554 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
555 base class.
556 * gdb-index.cc: New source file.
557 * gdb-index.h: New source file.
558 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
559 and .debug_types sections, call Layout::add_to_gdb_index.
560 (Sized_relobj_incr::do_section_name): Implement.
561 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
562 return type; Implement.
563 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
564 return type.
565 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
566 parameter list and return type.
567 (Sized_incr_dynobj::do_section_contents): Likewise.
568 * layout.cc: Include gdb-index.h.
569 (Layout::Layout): Initialize gdb_index_data_.
570 (Layout::init_fixed_output_section): Check for .gdb_index section.
571 (Layout::add_to_gdb_index): New function. Instantiate.
572 * layout.h: Add forward declaration for class Gdb_index.
573 (Layout::add_to_gdb_index): New member function.
574 (Layout::gdb_index_data_): New data member.
575 * main.cc: Include gdb-index.h.
576 (main): Print statistics for gdb index.
577 * object.cc (Object::section_contents): Move code into
578 do_section_contents.
579 (need_decompressed_section): Check for sections needed when building
580 gdb index.
581 (build_compressed_section_map): Likewise.
582 (Sized_relobj_file::do_read_symbols): Need local symbols when building
583 gdb index.
584 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
585 sections; call Layout::add_to_gdb_index.
586 (Sized_relobj_file::do_decompressed_section_contents): Call
587 do_section_contents directly.
588 * object.h (Object::do_section_contents): Adjust parameter list and
589 return type.
590 (Object::do_decompressed_section_contents): Call do_section_contents
591 directly.
592 (Sized_relobj_file::do_section_contents): Adjust parameter list and
593 return type.
594 * options.h (class General_options): Add --gdb-index option.
595 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
596 list and return type.
597 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
598 * reloc.h (Track_relocs::checkpoint): New function.
599 (Track_relocs::reset): New function.
600
601 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
602 New test cases.
603 * testsuite/Makefile.in: Regenerate.
604 * testsuite/gdb_index_test.cc: New test source file.
605 * testsuite/gdb_index_test_1.sh: New test source file.
606 * testsuite/gdb_index_test_2.sh: New test source file.
607
647f1574
DK
6082012-03-19 Doug Kwan <dougkwan@google.com>
609
610 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 611 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
612 __exidx_start and __exidx_end. Make symbol table parameter
613 anonymous as it is not used.
614 * gold.cc (queue_middle_tasks): Call target hook to define any
615 target-specific symbols.
616 * target.h (Target::define_standard_symbols): New method.
617 (Target::do_define_standard_symbols): Same.
618 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
619 * testsuite/Makefile.in: Regenerate.
620 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
621 and __exidx_end.
622 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
623 relocations are generated for __exidx_start and __exidx_end.
624
7c6109da
DK
6252012-03-16 Doug Kwan <dougkwan@google.com>
626
627 * testsuite/Makefile.am: Disable test initpri3b.
628 * testsuite/Makefile.in: Regenerate.
629
7b8957f8
DK
6302012-03-15 Doug Kwan <dougkwan@google.com>
631
632 * arm.cc (Target_arm::got_section): Make .got section read-only
633 if -z now is given.
634
14dc9ef7
ILT
6352012-03-15 Ian Lance Taylor <iant@google.com>
636
637 PR gold/13850
638 * layout.cc (Layout::make_output_section): Correctly mark
639 SHT_INIT_ARRAY, et. al., as relro.
640
fa40b62a
DK
6412012-03-14 Doug Kwan <dougkwan@google.com>
642
643 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
644 dynamic relocations for protected symbols in shared objects.
645
fd325007
ILT
6462012-03-13 Ian Lance Taylor <iant@google.com>
647
648 * resolve.cc (Symbol_table::resolve): When merging common symbols,
649 keep the larger alignment.
650
e8dd54e1
CC
6512012-03-12 Cary Coutant <ccoutant@google.com>
652
653 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
654 handling of DW_LNE_define_file.
655
feb5f3b0
CC
6562012-03-12 Cary Coutant <ccoutant@google.com>
657
658 * reduced_debug_output.cc
659 (Output_reduced_debug_info_section::get_die_end): Add new FORM
660 codes to switch.
661
a1fb4256
CC
6622012-02-29 Cary Coutant <ccoutant@google.com>
663
664 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
665
5dd8762a
CC
6662012-02-29 Cary Coutant <ccoutant@google.com>
667
668 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
669 Call Object::decompressed_section_contents.
670 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
671 New dtor.
672 (Sized_dwarf_line_info::buffer_start_): New data member.
673 * merge.cc (Output_merge_data::do_add_input_section): Call
674 Object::decompressed_section_contents.
675 (Output_merge_string::do_add_input_section): Likewise.
676 * object.cc (need_decompressed_section): New function.
677 (build_compressed_section_map): Decompress sections needed later.
678 (Sized_relobj_file::do_decompressed_section_contents): New function.
679 (Sized_relobj_file::do_discard_decompressed_sections): New function.
680 * object.h (Object::decompressed_section_contents): New function.
681 (Object::discard_decompressed_sections): New function.
682 (Object::do_decompressed_section_contents): New function.
683 (Object::do_discard_decompressed_sections): New function.
684 (Compressed_section_info): New type.
685 (Compressed_section_map): Include decompressed section contents.
686 (Sized_relobj_file::do_decompressed_section_contents): New function.
687 (Sized_relobj_file::do_discard_decompressed_sections): New function.
688
7b5de7ee
CC
6892012-02-16 Cary Coutant <ccoutant@google.com>
690
691 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
692 * testsuite/Makefile.in: Regenerate.
693
f9fa4a63
CC
6942012-02-14 Cary Coutant <ccoutant@google.com>
695
696 * options.cc (General_options::finalize): Disallow -pie and -static.
697
2c175ebc
DK
6982012-02-03 Doug Kwan <dougkwan@google.com>
699
700 * arm.cc (Arm_relocate_functions::abs8,
701 Arm_relocate_functions::abs16): Use
702 Bits::has_signed_unsigned_overflow32.
703 (Arm_relocate_functions::thm_abs8): Correct range of
704 overflow check.
705 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
706 in assertions.
707
90cff06f
DK
7082012-02-02 Doug Kwan <dougkwan@google.com>
709
710 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
711 position independent outputs, not just shared objects.
712
63887f3d
L
7132012-01-30 H.J. Lu <hongjiu.lu@intel.com>
714
715 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
716 * configure: Regenerated.
717
bef2b434
ILT
7182012-01-27 Ian Lance Taylor <iant@google.com>
719
720 * reloc.h (Bits): New class with static functions, copied from
721 namespace utils in arm.cc.
722 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
723 instead.
724
c335b55d
L
7252012-01-27 H.J. Lu <hongjiu.lu@intel.com>
726
727 * incremental.cc (write_info_blocks): Correct relocation offset.
728
41194d9f
L
7292012-01-27 H.J. Lu <hongjiu.lu@intel.com>
730
731 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
732 (Relocate::tls_gd_to_le): Likewise.
733
1bae613c
L
7342012-01-27 H.J. Lu <hongjiu.lu@intel.com>
735
736 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
737
24482ca0
L
7382012-01-27 H.J. Lu <hongjiu.lu@intel.com>
739
740 * configure.ac: Check if -mcmodel=medium works.
741 * configure: Regenerated.
742
c2c7840a
CC
7432012-01-24 Cary Coutant <ccoutant@google.com>
744
745 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
746 definition and ...
747 (read_unsigned_LEB_128_x): ... this new function.
748 (read_signed_LEB_128): Replaced with inline definition and ...
749 (read_signed_LEB_128_x): ... this new function.
750 * int_encoding.h (read_unsigned_LEB_128_x): New function.
751 (read_unsigned_LEB_128): Add inline definition.
752 (read_signed_LEB_128_x): New function.
753 (read_signed_LEB_128): Add inline definition.
754 * testsuite/Makefile.am (leb128_unittest): New unit test.
755 * testsuite/Makefile.in: Regenerate.
756 * testsuite/leb128_unittest.cc: New unit test.
757
833de760 7582012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
759
760 PR gold/13617
761 * i386.cc (Target_i386::do_code_fill): When using a jmp
762 instruction, pad with nop instructions.
763 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
764
618d6666
L
7652012-01-22 H.J. Lu <hongjiu.lu@intel.com>
766
767 * x86_64.cc (gc_process_relocs): Add typename on types used in
768 template.
769 (scan_relocs): Likewise.
770 (relocate_section): Likewise.
771 (apply_relocation): Likewise.
772
3660ff06
L
7732012-01-10 H.J. Lu <hongjiu.lu@intel.com>
774
775 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
776 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
777 under x32.
778
fc51264f
L
7792012-01-09 H.J. Lu <hongjiu.lu@intel.com>
780
781 * x86_64.cc: Initial support for x32.
782
dd74ae06
CC
7832012-01-03 Cary Coutant <ccoutant@google.com>
784
785 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
786 Use abstract base class for GOT.
787 * gold/output.h (class Output_data_got_base): New abstract base class.
788 (class Output_data_got): Derive from new base class, adjust ctors.
789 (Output_data_got::reserve_slot): Make virtual; rename to
790 do_reserve_slot; Adjust callers.
791 * gold/target.h (Sized_target::init_got_plt_for_update): Return
792 pointer to abstract base class.
793 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
794
83896202
ILT
7952011-12-18 Ian Lance Taylor <iant@google.com>
796
797 * object.h (Relobj::local_symbol_value): New function.
798 (Relobj::local_plt_offset): New function.
799 (Relobj::local_has_got_offset): New function.
800 (Relobj::local_got_offset): New function.
801 (Relobj::set_local_got_offset): New function.
802 (Relobj::do_local_symbol_value): New pure virtual function.
803 (Relobj::do_local_plt_offset): Likewise.
804 (Relobj::do_local_has_got_offset): Likewise.
805 (Relobj::do_local_got_offset): Likewise.
806 (Relobj::do_set_local_got_offset): Likewise.
807 (Sized_relobj::do_local_has_got_offset): Rename from
808 local_has_got_offset.
809 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
810 (Sized_relobj::do_set_local_got_offset): Rename from
811 set_local_got_offset.
812 (Sized_relobj_file::do_local_plt_offset): Rename from
813 local_plt_offset.
814 (Sized_relobj_file::do_local_symbol_value): New function.
815 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
816 local_plt_offset.
817 * output.cc (Output_data_got::Got_entry::write): Change object to
818 Relobj. Use local_symbol_value.
819 (Output_data_got::add_global_with_rel): Change rel_dyn to
820 Output_data_reloc_generic*. Use add_global_generic.
821 (Output_data_got::add_global_with_rela): Remove. Change all
822 callers to use add_global_with_rel.
823 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
824 Output_data_reloc_generic*. Use add_global_generic.
825 (Output_data_got::add_global_pair_with_rela): Remove. Change all
826 callers to use add_global_pair_with_rel.
827 (Output_data_got::add_local): Change object to Relobj*.
828 (Output_data_got::add_local_plt): Likewise.
829 (Output_data_got::add_local_with_rel): Change object to Relobj*,
830 change rel_dyn to Output_data_reloc_generic*. Use
831 add_local_generic.
832 (Output_data_got::add_local_with_rela): Remove. Change all
833 callers to use all_local_with_rel.
834 (Output_data_got::add_local_pair_with_rel): Change object to
835 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
836 add_output_section_generic.
837 (Output_data_got::add_local_pair_with_rela): Remove. Change all
838 callers to use add_local_pair_with_rel.
839 (Output_data_got::reserve_local): Change object to Relobj*.
840 * output.h: (class Output_data_reloc_generic): Add pure virtual
841 declarations for add_global_generic, add_local_generic,
842 add_output_section_generic.
843 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
844 functions for Output_data_reloc_generic. Update declarations for
845 changes listed in output.cc.
846 (class Output_data_got): Change template parameter to got_size.
847 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
848 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
849 function.
850 (Sized_relobj_incr::do_local_plt_offset): New function.
851 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
852 add_global_generic.
853
76677ad0
CC
8542011-12-17 Cary Coutant <ccoutant@google.com>
855
856 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
857 * resolve.cc (Symbol_table::resolve): Likewise.
858 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
859 arrays.
860 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
861
8b8dd8d5
ILT
8622011-12-16 Ian Lance Taylor <iant@google.com>
863
864 * output.h (Output_data_reloc_generic::add): Only call
865 add_dynamic_reloc if this is a dynamic reloc section.
866
d55525b9
L
8672011-12-15 H.J. Lu <hongjiu.lu@intel.com>
868
869 PR gold/13505
870 * target-reloc.h (apply_relocation): Replace <64, false> with
871 <size, big_endian>.
872
ff81c7c1
NC
8732011-11-25 Nick Clifton <nickc@redhat.com>
874
875 * po/it.po: New Italian translation.
876
628f39be
SA
8772011-11-17 Sterling Augustine <saugustine@google.com>
878
879 * script.cc (script_include_directive): Implement.
880 (read_script_file): New local variables name and search_path. Update
881 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
882 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
883 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
884
98ef3ea4
SA
8852011-11-11 Sterling Augustine <saugustine@google.com>
886
887 * yyscript.y (section_cmd): Add support for INCLUDE directive.
888 (file_or_sections_cmd): Likewise.
889
f4a8b6d7
DK
8902011-11-11 Doug Kwan <dougkwan@google.com>
891
892 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
893 if --just-symbols is given.
894
29ab395d
DK
8952011-11-10 Doug Kwan <dougkwan@google.com>
896
897 PR gold/13362
898 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
899 when processing data relocs.
900 * reloc.h (Relocate_functions::rel_unaligned): New method.
901 (Relocate_functions::pcrel_unaligned): Ditto.
902 (Relocate_functions::rel32_unaligned): Ditto.
903 (Relocate_functions::pcrel32_unaligned): Ditto.
904
2c339f71
DK
9052011-11-09 Doug Kwan <dougkwan@google.com>
906
907 PR gold/13362
908 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
909 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
910 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
911 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
912 (Relocate_functions::rel_unaligned): New.
913 (Relocate_functions::rel32_unaligned): New.
914 * target-reloc.h (relocate_for_relocatable): Add code to handle
915 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
916 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
917 arm_unaligned_reloc_r): New targets.
918 * testsuite/Makefile.in: Regenerate.
919 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
920 linking.
921
3f3cddf1
ILT
9222011-11-02 Ian Lance Taylor <iant@google.com>
923
924 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
925 NATIVE_LINKER.
926 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
927 * options.cc (General_options::finalize): Use library search path
928 from configure script if specified. If not native and no sysroot,
929 only search TOOLLIBDIR.
930 * options.h (Search_directory::Search_directory): Change name to
931 const std::string&.
932 (General_options::add_to_library_path_with_sysroot): Change arg to
933 const std::string&.
934 * configure, Makefile.in, config.in: Rebuild.
935
a8e2273b
ILT
9362011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
937
938 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
939 we are working around the ARM1176 Erratum.
940 * options.h (General_options::fix_arm1176): Add option.
941 * testsuite/Makefile.am: Add testcases, and keep current ones
942 working.
943 * testsuite/Makefile.in: Regenerate.
944 * testsuite/arm_fix_1176.s: New file.
945 * testsuite/arm_fix_1176.sh: Likewise.
946
cd6eab1c
ILT
9472011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
948
949 * arm.cc (Target_arm::Target_arm): Remove initialisation of
950 may_use_blx_.
951 (Target_arm::may_use_blx): Remove method.
952 (Target_arm::set_may_use_blx): Likewise.
953 (Target_arm::may_use_v4t_interworking): New method.
954 (Target_arm::may_use_v5t_interworking): Likewise.
955 (Target_arm::may_use_blx_): Remove member variable.
956 (Arm_relocate_functions::arm_branch_common): Check for v5T
957 interworking.
958 (Arm_relocate_functions::thumb_branch_common): Likewise.
959 (Reloc_stub::stub_type_for_reloc): Likewise.
960 (Target_arm::do_finalize_sections): Correct interworking checks.
961 * testsuite/Makefile.am: Add new tests.
962 * testsuite/Makefile.in: Regenerate.
963 * testsuite/arm_farcall_arm_arm.s: New test.
964 * testsuite/arm_farcall_arm_arm.sh: Likewise.
965 * testsuite/arm_farcall_arm_thumb.s: Likewise.
966 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
967 * testsuite/arm_farcall_thumb_arm.s: Likewise.
968 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
969 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
970 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
971
286adcf4
CC
9722011-10-31 Cary Coutant <ccoutant@google.com>
973
974 PR gold/13023
975 * expression.cc (Expression::eval_with_dot): Add
976 is_section_dot_assignment parameter.
977 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
978 absolute and assigning to dot within a section.
979 * script-sections.cc
980 (Output_section_element_assignment::set_section_addresses): Pass
981 dot_section to set_if_absolute.
982 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
983 as is_section_dot_assignment flag to eval_with_dot.
984 (Output_section_element_dot_assignment::set_section_addresses):
985 Likewise.
986 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
987 parameter. Also set value if relative to dot_section; set the
988 symbol's output_section.
989 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
990 parameter. Adjust all callers.
991 (Expression::eval_maybe_dot): Likewise.
992 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
993 Adjust all callers.
994 * testsuite/script_test_2.t: Test assignment of an absolute value
995 to dot within an output section element.
996
9634ed06
CC
9972011-10-31 Cary Coutant <ccoutant@google.com>
998
999 * options.h (class General_options): Add --[no-]gnu-unique options.
1000 * symtab.cc (Symbol_table::sized_write_globals): Convert
1001 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
1002
de4101c7
CC
10032011-10-31 Cary Coutant <ccoutant@google.com>
1004
1005 PR gold/13359
1006 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
1007 unnecessary assertion.
1008 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
1009
7257cc92
ST
10102011-10-31 Sriraman Tallam <tmsriram@google.com>
1011
1012 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1013 gc_mark_symbol.
1014 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1015 gc_mark_symbol.
1016 Change to just keep the section associated with symbol.
1017 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
1018 they are externally visible and --export-dynamic is turned on.
1019 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
1020
bfc34b3f
ILT
10212011-10-19 Ian Lance Taylor <iant@google.com>
1022
1023 PR gold/13163
1024 * script-sections.cc
1025 (Output_section_element_dot_assignment::needs_output_section): New
1026 function.
1027
ea0d8c47
ILT
10282011-10-19 Ian Lance Taylor <iant@google.com>
1029
1030 PR gold/13204
1031 * layout.cc (Layout::segment_precedes): Don't assert failure if a
1032 --section-start option was seen.
1033 * options.h (General_options::any_section_start): New function.
1034
abd242a9
DM
10352011-10-18 David S. Miller <davem@davemloft.net>
1036
1037 PR binutils/13301
1038 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
1039 member to track relocation locations that have moved during TLS
1040 reloc optimizations.
1041 (Target_sparc::Relocate::Relocate): Initialize to NULL.
1042 (Target_sparc::Relocate::relocate): Adjust view down by 4
1043 bytes if it matches reloc_adjust_addr_.
1044 (Target_sparc::Relocate::relocate_tls): Always move the
1045 __tls_get_addr call delay slot instruction forward 4 bytes when
1046 performing relaxation.
1047
bab9090f
CC
10482011-10-18 Cary Coutant <ccoutant@google.com>
1049
1050 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
1051 (Output_file::map_no_anonymous): Check for non-zero
1052 return code from posix_fallocate.
1053
f7c5b166
CC
10542011-10-17 Cary Coutant <ccoutant@google.com>
1055
1056 PR gold/13245
1057 * plugin.cc (is_visible_from_outside): Check for symbols
1058 referenced from dynamic objects.
1059 * resolve.cc (Symbol_table::resolve): Don't count references
1060 from dynamic objects as references from real ELF files.
1061 * testsuite/plugin_test_2.sh: Adjust expected result.
1062
b490c0bb
CC
10632011-10-17 Cary Coutant <ccoutant@google.com>
1064
1065 * gold.cc: Include timer.h.
1066 (queue_middle_tasks): Stamp time.
1067 (queue_final_tasks): Likewise.
1068 * main.cc (main): Store timer in parameters. Print timers
1069 for each pass.
1070 * parameters.cc (Parameters::Parameters): Initialize timer_.
1071 (Parameters::set_timer): New function.
1072 (set_parameters_timer): New function.
1073 * parameters.h (Parameters::set_timer): New function.
1074 (Parameters::timer): New function.
1075 (Parameters::timer_): New data member.
1076 (set_parameters_timer): New function.
1077 * timer.cc (Timer::stamp): New function.
1078 (Timer::get_pass_time): New function.
1079 * timer.h (Timer::stamp): New function.
1080 (Timer::get_pass_time): New function.
1081 (Timer::pass_times_): New data member.
1082
f475cf7b
CC
10832011-10-17 Cary Coutant <ccoutant@google.com>
1084
1085 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
1086 task for members of lib groups.
1087
cdd7e244
CC
10882011-10-17 Cary Coutant <ccoutant@google.com>
1089
1090 PR gold/13288
4f95c8b4 1091 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
1092 (File_read::make_view): Move bounds check (replace with assert)...
1093 (File_read::find_or_make_view): ... to here.
1094
dfb45471
CC
10952011-10-12 Cary Coutant <ccoutant@google.com>
1096
4f95c8b4 1097 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
1098 ::read returns less than requested size.
1099
53bbcc1b
CC
11002011-10-10 Cary Coutant <ccoutant@google.com>
1101
4f95c8b4 1102 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
1103 Initialize defined_count_.
1104 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
1105 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
1106 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
1107 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
1108 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 1109 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
1110 member.
1111 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 1112 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
1113 Return zeroes instead of internal error.
1114
397b129b
CC
11152011-10-10 Cary Coutant <ccoutant@google.com>
1116
1117 PR gold/13249
4f95c8b4 1118 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 1119 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 1120 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
1121 (Output_reloc::type_): Adjust size of bit field.
1122 (Output_reloc::use_plt_offset_): New bit field.
1123 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
1124 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
1125 flag. Adjust all callers.
4f95c8b4 1126 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
1127 creating RELATIVE relocations.
1128
d5698657
NC
11292011-10-10 Nick Clifton <nickc@redhat.com>
1130
1131 * po/es.po: Updated Spanish translation.
1132 * po/fi.po: Updated Finnish translation.
1133
6a59a5c2
DN
11342011-10-03 Diego Novillo <dnovillo@google.com>
1135
1136 * options.cc (parse_uint): Fix dereference of RETVAL.
1137
f0558624
ST
11382011-09-29 Sriraman Tallam <tmsriram@google.com>
1139
1140 * layout.h (section_order_map_): New member.
1141 (get_section_order_map): New member function.
1142 * output.cc (Output_section::add_input_section): Check for patterns
1143 only when --section-ordering-file is specified.
1144 * gold.cc (queue_middle_tasks): Delay updating order of sections till
1145 output_sections have been formed.
1146 * layout.cc (Layout_Layout): Initialize section_order_map_.
1147 * plugin.cc (update_section_order): Store order in order_map. Do not
1148 update the order.
1149 * testsuite/Makefile.am: Add test case for plugin_final_layout.
1150 * testsuite/Makefile.in: Regenerate.
1151 * testsuite/plugin_section_order.c: New file.
1152 * testsuite/plugin_final_layout.cc: New file.
1153 * testsuite/plugin_final_layout.sh: New file.
1154
a7dac153
CC
11552011-09-29 Cary Coutant <ccoutant@google.com>
1156
4f95c8b4 1157 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 1158 Check for NULL.
4f95c8b4 1159 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
1160 symbols during incremental update.
1161 (Symbol_table::add_from_dynobj): Likewise.
1162
eebd87a5
ILT
11632011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1164 Ian Lance Taylor <iant@google.com>
1165
1166 * symtab.cc (Symbol_table::define_special_symbol): Always
1167 canonicalize version string.
1168
403a3331
CC
11692011-09-26 Cary Coutant <ccoutant@google.com>
1170
4f95c8b4
CC
1171 * gold.cc (queue_initial_tasks): Move option checks ...
1172 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
1173 some options; make others fatal.
1174
235061c2
CC
11752011-09-26 Cary Coutant <ccoutant@google.com>
1176
1177 gcc PR lto/47247
1178 * plugin.cc (get_symbols_v2): New function.
1179 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
1180 (is_referenced_from_outside): New function.
1181 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
1182 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
1183 (get_symbols): Pass version parameter.
1184 (get_symbols_v2): New function.
1185 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
1186 parameter.
1187 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
1188 (onload): Add LDPT_GET_SYMBOLS_V2.
1189 (all_symbols_read_hook): Use get_symbols_v2; check for
1190 LDPR_PREVAILING_DEF_IRONLY_EXP.
1191 * testsuite/plugin_test_3.sh: Update expected results.
1192
dc87f620
ILT
11932011-09-23 Simon Baldwin <simonb@google.com>
1194
1195 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
1196 configuration options.
1197 * configure: Regenerate.
1198 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
1199 * Makefile.in: Regenerate.
1200 * testsuite/Makefile.in: Regenerate.
1201
a8279f82
ST
12022011-09-19 Sriraman Tallam <tmsriram@google.com>
1203
1204 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
1205
0c9350c8
CC
12062011-09-19 Cary Coutant <ccoutant@google.com>
1207
1208 * incremental.cc (can_incremental_update): Fix typo in comment.
1209 * incremental.h (can_incremental_update): Likewise.
1210
aa06ae28
CC
12112011-09-18 Cary Coutant <ccoutant@google.com>
1212
1213 * incremental.cc (can_incremental_update): New function.
1214 * incremental.h (can_incremental_update): New function.
1215 * layout.cc (Layout::init_fixed_output_section): Call it.
1216 (Layout::make_output_section): Don't allow patch space in .eh_frame.
1217 * object.cc (Sized_relobj_file::do_layout): Call
1218 can_incremental_update.
1219
ebb300b2
CC
12202011-09-13 Cary Coutant <ccoutant@google.com>
1221
1222 * configure.ac: Check for glibc support for gnu_indirect_function
1223 support with static linking, setting automake conditional
1224 IFUNC_STATIC.
1225 * Makefile.in: Regenerate.
1226 * configure: Regenerate.
1227
1228 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
1229 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
1230 for IFUNC_STATIC.
1231 * testsuite/Makefile.in: Regenerate.
1232
1206d0d5
CC
12332011-09-13 Cary Coutant <ccoutant@google.com>
1234
1235 * incremental.cc (Sized_relobj_incr::do_layout): Call
1236 report_comdat_group for kept comdat sections.
1237 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
1238 * testsuite/Makefile.in: Regenerate.
1239 * testsuite/incr_comdat_test_1.cc: New source file.
1240 * testsuite/incr_comdat_test_2_v1.cc: New source file.
1241 * testsuite/incr_comdat_test_2_v2.cc: New source file.
1242 * testsuite/incr_comdat_test_2_v3.cc: New source file.
1243
40b29874
ILT
12442011-09-13 Ian Lance Taylor <iant@google.com>
1245
1246 * object.cc (Sized_relobj_file::do_layout): Remove unused local
1247 variable external_symbols_offset.
1248
1b045aac
ILT
12492011-09-12 Ian Lance Taylor <iant@google.com>
1250
1251 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
1252 triggered if object has no symbols.
1253
24c6c55a
DM
12542011-09-09 David S. Miller <davem@davemloft.net>
1255
1256 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
1257 (Output_fill_debug_line::do_write): Likewise.
1258
66570254
CC
12592011-08-29 Cary Coutant <ccoutant@google.com>
1260
1261 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
1262 casts to match formatting specs.
1263 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
1264
8ea8cd50
CC
12652011-08-26 Cary Coutant <ccoutant@google.com>
1266
1267 * layout.cc (Free_list::allocate): Provide guarantee of minimum
1268 remaining hole size when allocating.
1269 (Layout::make_output_section): Set fill methods for debug sections.
1270 * layout.h (Free_list::Free_list_node): Move from private to
1271 public.
1272 (Free_list::set_min_hole_size): New function.
1273 (Free_list::begin, Free_list::end): New functions.
1274 (Free_list::min_hole_): New data member.
1275 * output.cc: Include dwarf.h.
1276 (Output_fill_debug_info::do_minimum_hole_size): New function.
1277 (Output_fill_debug_info::do_write): New function.
1278 (Output_fill_debug_line::do_minimum_hole_size): New function.
1279 (Output_fill_debug_line::do_write): New function.
1280 (Output_section::Output_section): Initialize new data member.
1281 (Output_section::set_final_data_size): Ensure patch space is larger
1282 than minimum hole size.
1283 (Output_section::do_write): Fill holes in debug sections.
1284 * output.h (Output_fill): New class.
1285 (Output_fill_debug_info): New class.
1286 (Output_fill_debug_line): New class.
1287 (Output_section::set_free_space_fill): New function.
1288 (Output_section::free_space_fill_): New data member.
1289 * testsuite/Makefile.am (incremental_test_3): Add
1290 --incremental-patch option.
1291 (incremental_test_4): Likewise.
1292 (incremental_test_5): Likewise.
1293 (incremental_test_6): Likewise.
1294 (incremental_copy_test): Likewise.
1295 (incremental_common_test_1): Likewise.
1296 * testsuite/Makefile.in: Regenerate.
1297
7cf80422
NC
12982011-08-26 Nick Clifton <nickc@redhat.com>
1299
1300 * po/es.po: Updated Spanish translation.
1301
c3f7b0e5
CC
13022011-08-01 Cary Coutant <ccoutant@google.com>
1303
1304 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
1305 * gold/testsuite/Makefile.in: Regenerate.
1306 * gold/testsuite/justsyms_exec.c: New source file.
1307 * gold/testsuite/justsyms_lib.c: New source file.
1308
9590bf25
CC
13092011-08-01 Cary Coutant <ccoutant@google.com>
1310
1311 * layout.cc (Layout::set_segment_offsets): Don't realign text
1312 segment if -Ttext was specified.
1313 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
1314 file type.
1315 * object.h (Sized_relobj_file::e_type): New function.
1316 (Sized_relobj_file::e_type_): New data member.
1317 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
1318 base address for ET_EXEC files.
1319 * target.cc (Target::do_make_elf_object_implementation): Allow
1320 ET_EXEC files with --just-symbols option.
1321
dcd8d12e
CC
13222011-07-28 Cary Coutant <ccoutant@google.com>
1323
1324 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
1325 Add thread_number parameter.
1326 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
1327 * workqueue-threads.cc
1328 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
1329 current thread if its thread number is greater than desired thread
1330 count.
1331 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
1332 Add thread_number parameter.
1333 (Workqueue::should_cancel_thread): Likewise.
1334 (Workqueue::find_runnable_or_wait): Pass thread_number to
1335 should_cancel_thread.
1336 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
1337 parameter.
1338
804eb480
ST
13392011-07-22 Sriraman Tallam <tmsriram@google.com>
1340
1341 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
1342 only after checking if it cannot be forced local.
1343 * symtab.h (is_externally_visible): Check if the symbol is not forced
1344 local.
1345
f1ddb600
ILT
13462011-07-15 Ian Lance Taylor <iant@google.com>
1347
1348 * options.h (class General_options): Add --print-output-format.
1349 Move -EL next to -EB, for better --help output.
1350 * target-select.cc: Include <cstdio>, "options.h", and
1351 "parameters.h".
1352 (Target_selector::do_target_bfd_name): New function.
1353 (print_output_format): New function.
1354 * target-select.h (class Target_selector): Update declarations.
1355 (Target_selector::target_bfd_name): New function.
1356 (print_output_format): Declare.
1357 * main.cc: Include "target-select.h".
1358 (main): Handle --print-output-format.
1359 * gold.cc: Include "target-select.h".
1360 (queue_initial_tasks): Handle --print-output-format when there are
1361 no input files.
1362 * parameters.cc (parameters_force_valid_target): Give a better
1363 error message if -EB/-EL does not match target.
1364 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
1365 function.
1366
7d172687
ILT
13672011-07-15 Ian Lance Taylor <iant@google.com>
1368
1369 * i386.cc (class Output_data_plt_i386): Add layout_ field.
1370 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
1371 (Output_data_plt_i386::do_write): Write address of .dynamic
1372 section to first entry in .got.plt section.
1373 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
1374 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1375 Initialize layout_.
1376 (Output_data_plt_x86_64::do_write): Write address of .dynamic
1377 section to first entry in .got.plt section.
1378 * layout.h (Layout::dynamic_section): New function.
1379
e9552f7e
ST
13802011-07-13 Sriraman Tallam <tmsriram@google.com>
1381
1382 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
1383 to claim_file call.
1384 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
1385 input_section_position_, and input_section_glob_.
1386 (read_layout_from_file): Call function section_ordering_specified.
1387 * layout.h (is_section_ordering_specified): New function.
1388 (section_ordering_specified): New function.
1389 (section_ordering_specified_): New boolean member.
1390 * main.cc(main): Call load_plugins after layout object is defined.
1391 * output.cc (Output_section::add_input_section): Use
1392 function section_ordering_specified to check if section ordering is
1393 needed.
1394 * output.cc (Output_section::add_relaxed_input_section): Use
1395 function section_ordering_specified to check if section ordering is
1396 needed.
1397 (Output_section::update_section_layout): New function.
1398 (Output_section::sort_attached_input_sections): Check if input section
1399 must be reordered.
1400 * output.h (Output_section::update_section_layout): New function.
1401 * plugin.cc (get_section_count): New function.
1402 (get_section_type): New function.
1403 (get_section_name): New function.
1404 (get_section_contents): New function.
1405 (update_section_order): New function.
58797674 1406 (allow_section_ordering): New function.
e9552f7e
ST
1407 (Plugin::load): Add the new interfaces to the transfer vector.
1408 (Plugin_manager::load_plugins): New parameter.
1409 (Plugin_manager::all_symbols_read): New parameter.
1410 (Plugin_manager::claim_file): New parameter. Save the elf object for
1411 unclaimed objects.
1412 (Plugin_manager::get_elf_object): New function.
1413 (Plugin_manager::get_view): Change to directly use the bool to check
1414 if get_view is called from claim_file_hook.
1415 * plugin.h (input_objects): New function
1416 (Plugin__manager::load_plugins): New parameter.
1417 (Plugin_manager::claim_file): New parameter.
1418 (Plugin_manager::get_elf_object): New function.
1419 (Plugin_manager::in_claim_file_handler): New function.
1420 (Plugin_manager::in_claim_file_handler_): New member.
1421 (layout): New function.
1422 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
1423 handler with an extra parameter. Make the elf object before calling
1424 claim_file handler.
1425 * testsuite/plugin_test.c (get_section_count): New function pointer.
1426 (get_section_type): New function pointer.
1427 (get_section_name): New function pointer.
1428 (get_section_contents): New function pointer.
1429 (update_section_order): New function pointer.
1430 (allow_section_ordering): New function pointer.
1431 (onload): Check if the new interfaces exist.
1432
9446efde
ILT
14332011-07-13 Ian Lance Taylor <iant@google.com>
1434
1435 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
1436 relro section.
1437 * x86_64.cc (Target_x86_64::got_section): Likewise.
1438 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
1439 (relro_now_test_SOURCES): New variable.
1440 (relro_now_test_DEPENDENCIES): New variable.
1441 (relro_now_test_LDFLAGS): New variable.
1442 (relro_now_test_LDADD): New variable.
1443 (relro_now_test.so): New target.
1444 * testsuite/Makefile.in: Rebuild.
1445
07aa62f2
ILT
14462011-07-12 Ian Lance Taylor <iant@google.com>
1447
1448 PR gold/12980
1449 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
1450 GLOB_DAT relocation rather than a RELATIVE relocation for a
1451 protected symbol when creating a shared library.
1452 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
1453 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
1454 * testsuite/protected_main_1.cc (main): Test that protected
1455 function has same address.
1456
e2153196
ILT
14572011-07-11 Ian Lance Taylor <iant@google.com>
1458
1459 PR gold/12979
1460 * options.h (class General_options): Add -Bgroup.
1461 * options.cc (General_options::finalize): If -Bgroup is set,
1462 default to --unresolved-symbols=report-all.
1463 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
1464 * target-reloc.h (issue_undefined_symbol_error): Handle
1465 --unresolved-symbols=report-all.
1466
6daf5215
ILT
14672011-07-08 Ian Lance Taylor <iant@google.com>
1468
1469 PR gold/11985
1470 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
1471 if linker script discards key sections.
1472 (Layout::create_dynamic_symtab): Likewise.
1473 (Layout::assign_local_dynsym_offsets): Likewise.
1474 (Layout::sized_create_version_sections): Likewise.
1475 (Layout::create_interp): Likewise.
1476 (Layout::finish_dynamic_section): Likewise.
1477 (Layout::set_dynamic_symbol_size): Likewise.
1478
beabb2c6
ILT
14792011-07-08 Ian Lance Taylor <iant@google.com>
1480
1481 PR gold/12386
1482 * options.h (class General_options): Add --unresolved-symbols.
1483 * target-reloc.h (issue_undefined_symbol_error): Check
1484 --unresolved-symbols. Add comments.
1485
9c16daf1
ILT
14862011-07-08 Ian Lance Taylor <iant@google.com>
1487
1488 * testsuite/odr_violation2.cc (Ordering::operator()): Make
1489 expression more complex.
1490
191f1a2d
ILT
14912011-07-08 Ian Lance Taylor <iant@google.com>
1492
1493 PR gold/11317
1494 * target-reloc.h (issue_undefined_symbol_error): New inline
1495 function, broken out of relocate_section.
1496 (relocate_section): Call issue_undefined_symbol_error.
1497 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1498 there is no TLS segment if we are about to issue an undefined
1499 symbol error.
1500 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1501
62855347
ILT
15022011-07-08 Ian Lance Taylor <iant@google.com>
1503
1504 PR gold/12279
1505 * resolve.cc (Symbol_table::should_override): Add fromtype
1506 parameter. Change all callers. Give error when linking together
1507 TLS and non-TLS symbol.
1508 (Symbol_table::should_override_with_special): Add fromtype
1509 parameter. Change all callers.
1510 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1511 there is no TLS segment if we have reported some errors.
1512 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1513
67181c72
ILT
15142011-07-08 Ian Lance Taylor <iant@google.com>
1515
1516 PR gold/12372
1517 * target.h (Target::plt_address_for_global): New function.
1518 (Target::plt_address_for_local): New function.
1519 (Target::plt_section_for_global): Remove.
1520 (Target::plt_section_for_local): Remove.
1521 (Target::do_plt_address_for_global): New virtual function.
1522 (Target::do_plt_address_for_local): New virtual function.
1523 (Target::do_plt_section_for_global): Remove.
1524 (Target::do_plt_section_for_local): Remove.
1525 (Target::register_global_plt_entry): Add Symbol_table and Layout
1526 parameters.
1527 * output.cc (Output_data_got::Got_entry::write): Use
1528 plt_address_for_global and plt_address_for_local.
1529 * layout.cc (Layout::add_target_dynamic_tags): Use size and
1530 address of output section.
1531 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
1532 got_irelative_, and irelative_count_ fields. Update
1533 declarations.
1534 (Output_data_plt_i386::has_irelative_section): New function.
1535 (Output_data_plt_i386::entry_count): Add irelative_count_.
1536 (Output_data_plt_i386::set_final_data_size): Likewise.
1537 (class Target_i386): Add got_irelative_ and rel_irelative_
1538 fields. Update declarations.
1539 (Target_i386::Target_i386): Initialize new fields.
1540 (Target_i386::do_plt_address_for_global): New function replacing
1541 do_plt_section_for_global.
1542 (Target_i386::do_plt_address_for_local): New function replacing
1543 do_plt_section_for_local.
1544 (Target_i386::got_section): Create got_irelative_.
1545 (Target_i386::rel_irelative_section): New function.
1546 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
1547 fields. Don't define __rel_iplt_{start,end}.
1548 (Output_data_plt_i386::add_entry): Add symtab and layout
1549 parameters. Change all callers. Use different PLT and GOT for
1550 IFUNC symbols.
1551 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
1552 layout parameters. Change all callers. Use different PLT and
1553 GOT.
1554 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
1555 (Output_data_plt_i386::rel_irelative): New function.
1556 (Output_data_plt_i386::address_for_global): New function.
1557 (Output_data_plt_i386::address_for_local): New function.
1558 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
1559 IRELATIVE GOT when changing IFUNC GOT entries.
1560 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
1561 reloc.
1562 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
1563 if we didn't create an IRELATIVE GOT.
1564 (Target_i386::Relocate::relocate): Use plt_address_for_global and
1565 plt_address_for_local.
1566 (Target_i386::do_dynsym_value): Use plt_address_for_global.
1567 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
1568 got_irelative_, and irelative_count_ fields. Update
1569 declarations.
1570 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1571 Initialize new fields. Remove symtab parameter. Change all
1572 callers.
1573 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
1574 irelative_count_.
1575 (Output_data_plt_x86_64::has_irelative_section): New function.
1576 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
1577 (class Target_x86_64): Add got_irelative_ and rel_irelative_
1578 fields. Update declarations.
1579 (Target_x86_64::Target_x86_64): Initialize new fields.
1580 (Target_x86_64::do_plt_address_for_global): New function replacing
1581 do_plt_section_for_global.
1582 (Target_x86_64::do_plt_address_for_local): New function replacing
1583 do_plt_section_for_local.
1584 (Target_x86_64::got_section): Create got_irelative_.
1585 (Target_x86_64::rela_irelative_section): New function.
1586 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
1587 all callers. Don't create __rel_iplt_{start,end}.
1588 (Output_data_plt_x86_64::add_entry): Add symtab and layout
1589 parameters. Change all callers. Use different PLT and GOT for
1590 IFUNC symbols.
1591 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
1592 layout parameters. Change all callers. Use different PLT and
1593 GOT.
1594 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
1595 parameters. Change all callers. Use different PLT and GOT for
1596 IFUNC symbols.
1597 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
1598 (Output_data_plt_x86_64::rela_irelative): New function.
1599 (Output_data_plt_x86_64::address_for_global): New function.
1600 (Output_data_plt_x86_64::address_for_local): New function.
1601 (Output_data_plt_x86_64::set_final_data_size): Likewise.
1602 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
1603 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
1604 (Target_x86_64::register_global_plt_entry): Add symtab and layout
1605 parameters.
1606 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
1607 reloc.
1608 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
1609 symbols if we didn't create an IRELATIVE GOT.
1610 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
1611 plt_address_for_local.
1612 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
1613 * testsuite/ifuncvar1.c: New test file.
1614 * testsuite/ifuncvar2.c: New test file.
1615 * testsuite/ifuncvar3.c: New test file.
1616 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
1617 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
1618 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
1619 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
1620 * testsuite/Makefile.in: Rebuild.
1621
33c15b45
CC
16222011-07-07 Cary Coutant <ccoutant@google.com>
1623
1624 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
1625 (two_file_test_1_ndebug.o): Likewise.
1626 (two_file_test_1b_ndebug.o): Likewise.
1627 (two_file_test_2_ndebug.o): Likewise.
1628 (two_file_test_main_ndebug.o): Likewise.
1629 (incremental_test_2): Link with no-debug versions.
1630
f48b5fb7
CC
16312011-07-06 Cary Coutant <ccoutant@google.com>
1632
1633 * gold/incremental.cc
1634 (Output_section_incremental_inputs::write_info_blocks): Check for
1635 hidden and internal symbols.
1636
221597a5
CC
16372011-07-06 Cary Coutant <ccoutant@google.com>
1638
1639 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
1640 Check disposition for startup file.
1641 (Incremental_inputs::report_command_line): Ignore
1642 --incremental-startup-unchanged option.
1643 * options.cc (General_options::parse_incremental_startup_unchanged):
1644 New function.
1645 (General_options::General_options): Initialize new data member.
1646 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
1647 (General_options): Add --incremental-startup-unchanged option.
1648 (General_options::incremental_startup_disposition): New function.
1649 (General_options::incremental_startup_disposition_): New data member.
1650
e24719f6
CC
16512011-07-06 Cary Coutant <ccoutant@google.com>
1652
1653 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
1654 input file index to Script_info ctor.
1655 (Sized_incremental_binary::do_file_has_changed): Find the
1656 command-line argument for files named in scripts.
1657 * incremental.h (Script_info::Script_info): New ctor
1658 with input file index.
1659 (Script_info::input_file_index): New function.
1660 (Script_info::input_file_index_): New data member.
1661 (Incremental_binary::get_library): Add const.
1662 (Incremental_binary::get_script_info): Add const.
1663 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
1664 * testsuite/Makefile.am (incremental_test_5): New test case.
1665 (incremental_test_6): New test case.
1666 * testsuite/Makefile.in: Regenerate.
1667
8f7c81e8
CC
16682011-07-06 Cary Coutant <ccoutant@google.com>
1669
1670 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
1671 debug output when command lines differ.
1672
9fbd3822
CC
16732011-07-06 Cary Coutant <ccoutant@google.com>
1674
1675 * incremental.cc (Incremental_inputs::report_command_line): Ignore
1676 --incremental-patch option.
1677 * layout.cc (Free_list::allocate): Extend allocation beyond original
1678 end if enabled.
1679 (Layout::make_output_section): Mark sections that should get
1680 patch space.
1681 * options.cc (parse_percent): New function.
1682 * options.h (parse_percent): New function.
1683 (DEFINE_percent): New macro.
1684 (General_options): Add --incremental-patch option.
1685 * output.cc (Output_section::Output_section): Initialize new data
1686 members.
1687 (Output_section::add_input_section): Print section name when out
1688 of patch space.
1689 (Output_section::add_output_section_data): Likewise.
1690 (Output_section::set_final_data_size): Add patch space when
1691 doing --incremental-full.
1692 (Output_section::do_reset_address_and_file_offset): Remove patch
1693 space.
1694 (Output_segment::set_section_list_addresses): Print debug output
1695 only if --incremental-update.
1696 * output.h (Output_section::set_is_patch_space_allowed): New function.
1697 (Output_section::is_patch_space_allowed_): New data member.
1698 (Output_section::patch_space_): New data member.
1699 * parameters.cc (Parameters::incremental_full): New function.
1700 * parameters.h (Parameters::incremental_full): New function
1701 * testsuite/Makefile.am (incremental_test_2): Add test for
1702 --incremental-patch option.
1703 * testsuite/Makefile.in: Regenerate.
1704 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
1705 (t18): Remove function body.
1706
f6cccc2c
DK
17072011-07-05 Doug Kwan <dougkwan@google.com>
1708
1709 PR gold/12771
1710 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
1711 Arm_Address type for relocation result.
1712 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
1713 overflow check.
1714 (Arm_relocate_functions::abs32): Use unaligned access.
1715 (Arm_relocate_functions::rel32): Ditto.
1716 (Arm_relocate_functions::prel31): Ditto.
1717 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
1718 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
1719 static data relocations.
1720 * testsuite/Makefile.in: Regnerate.
1721 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
1722
28a13fec
ILT
17232011-07-05 Ian Lance Taylor <iant@google.com>
1724
1725 PR gold/12392
1726 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
1727 symbols if necessary.
1728 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
1729
24d47b34
ILT
17302011-07-05 Ian Lance Taylor <iant@google.com>
1731
1732 PR gold/12952
1733 * resolve.cc (Symbol::override_base_with_special): Simply override
1734 version with special symbol version, ignoring previous version.
1735
41f9cbbe
ILT
17362011-07-05 Ian Lance Taylor <iant@google.com>
1737
1738 * object.cc (Sized_relobj_file::include_section_group): Add
1739 information to comment about signature location.
1740
886288f1
ILT
17412011-07-02 Ian Lance Taylor <iant@google.com>
1742
1743 PR gold/12957
1744 * options.h (class General_options): Add -f and -F.
1745 * options.cc (General_options::finalize): Fatal error if -f/-F
1746 are used without -shared.
1747 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
1748
ae3a6d4f
ILT
17492011-07-02 Ian Lance Taylor <iant@google.com>
1750
1751 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
1752
21131061
ILT
17532011-07-01 Ian Lance Taylor <iant@google.com>
1754
1755 PR gold/12525
1756 PR gold/12952
1757 * resolve.cc (Symbol::override_base_with_special): Don't override
1758 the version if the overriding symbol has a different name.
1759 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
1760 all callers. If we give an error about an undefined version,
1761 define the base version if necessary.
1762 * dynobj.h (class Versions): Update declaration.
1763 * testsuite/weak_alias_test_5.cc: New file.
1764 * testsuite/weak_alias_test.script: New file.
1765 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
1766 and versioned_alias have the right value, and call t2.
1767 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
1768 weak_alias_test_5.so.
1769 (weak_alias_test_LDADD): Likewise.
1770 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
1771 * testsuite/Makefile.in: Rebuild.
1772
611062c0
ILT
17732011-07-01 Ian Lance Taylor <iant@google.com>
1774
1775 PR gold/12525
1776 * options.h (class General_options): Support -z notext.
1777 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
1778 -Wl,-z,notext.
1779 (two_file_shared_nonpic.so): Likewise.
1780 (two_file_shared_mixed.so): Likewise.
1781 (two_file_shared_mixed_1.so): Likewise.
1782 (weak_undef_lib_nonpic.so): Likewise.
1783 (alt/weak_undef_lib_nonpic.so): Likewise.
1784 (tls_test_shared_nonpic.so): Likewise.
1785 * testsuite/Makefile.in: Rebuild.
1786
328c7c2f
ILT
17872011-07-01 Ian Lance Taylor <iant@google.com>
1788
1789 PR gold/12525
1790 * configure.ac: Test whether static linking works, setting
1791 the automake conditional HAVE_STATIC.
1792 * testsuite/Makefile.am: Disable tests using -static if
1793 HAVE_STATIC is not true.
1794 * configure, testsuite/Makefile.in: Rebuild.
1795
02d7cd44
ILT
17962011-07-01 Ian Lance Taylor <iant@google.com>
1797
1798 PR gold/12525
1799 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
1800 Assert if we see DW_EH_PE_indirect.
1801 * target.h (Target::ehframe_datarel_base): New function.
1802 (Target::do_ehframe_datarel_base): New target function.
1803 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
1804 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
1805 function.
1806
07a60597
ILT
18072011-07-01 Ian Lance Taylor <iant@google.com>
1808
1809 PR gold/12571
1810 * options.h (class General_options): Add
1811 --ld-generated-unwind-info.
1812 * ehframe.cc (Fde::write): Add address parameter. Change all
1813 callers. If associated with PLT, fill in address and size.
1814 (Cie::set_output_offset): Only add merge mapping if there is an
1815 object.
1816 (Cie::write): Add address parameter. Change all callers.
1817 (Eh_frame::add_ehframe_for_plt): New function.
1818 * ehframe.h (class Fde): Update declarations. Move shndx_ and
1819 input_offset_ fields into union u_, with new plt field.
1820 (Fde::Fde): Adjust for new union field.
1821 (Fde::Fde) [Output_data version]: New constructor.
1822 (Fde::add_mapping): Only add merge mapping if there is an object.
1823 (class Cie): Update declarations.
1824 (class Eh_frame): Declare add_ehframe_for_plt.
1825 * layout.cc (Layout::layout_eh_frame): Break out code into
1826 make_eh_frame_section, and call it.
1827 (Layout::make_eh_frame_section): New function.
1828 (Layout::add_eh_frame_for_plt): New function.
1829 * layout.h (class Layout): Update declarations.
1830 * merge.cc (Merge_map::add_mapping): Add assertion.
1831 * i386.cc: Include "dwarf.h".
1832 (class Output_data_plt_i386): Make first_plt_entry,
1833 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
1834 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1835 and plt_eh_frame_fde.
1836 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
1837 boundary. Call add_eh_frame_for_plt if appropriate.
1838 * x86_64.cc: Include "dwarf.h".
1839 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
1840 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
1841 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1842 and plt_eh_frame_fde.
1843 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
1844 appropriate.
1845
14788a3f
ILT
18462011-06-29 Ian Lance Taylor <iant@google.com>
1847
1848 PR gold/12629
1849 * object.cc (Sized_relobj_file::layout_section): Change shdr
1850 parameter to be const.
1851 (Sized_relobj_file::layout_eh_frame_section): New function, broken
1852 out of do_layout.
1853 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
1854 appropriate. Call layout_eh_frame_section.
1855 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
1856 sections.
1857 * object.h (class Sized_relobj_file): Update declarations.
1858
6c21fce1
ILT
18592011-06-29 Ian Lance Taylor <iant@google.com>
1860
37e41b03 1861 PR gold/12652
6c21fce1
ILT
1862 * script.cc (Token::integer_value): Accept trailing M/m/K/k
1863 modifier.
1864 (Lex::gather_token): Accept trailing M/m/K/k for integers.
1865
4d5e4e62
ILT
18662011-06-29 Ian Lance Taylor <iant@google.com>
1867
1868 PR gold/12675
1869 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
1870 SHT_X86_64_UNWIND.
1871 * layout.cc (Layout::layout_eh_frame): Likewise.
1872
886f533a
ILT
18732011-06-29 Ian Lance Taylor <iant@google.com>
1874
1875 PR gold/12695
1876 * layout.cc (Layout::symtab_section_shndx): New function.
1877 * layout.h (class Layout): Declare symtab_section_shndx.
1878 * output.cc (Output_section::write_header): Call it.
1879
f3ae1b28
ILT
18802011-06-29 Ian Lance Taylor <iant@google.com>
1881
1882 PR gold/12818
1883 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
1884 symbols which are not used in a relocation.
1885
aecf301f
ILT
18862011-06-28 Ian Lance Taylor <iant@google.com>
1887
1888 PR gold/12898
1889 * layout.cc (Layout::segment_precedes): Don't crash if a linker
1890 script create indistinguishable segments.
1891 (Layout::set_segment_offsets): Use stable_sort when sorting
1892 segments. Pass this to Compare_segments constructor.
1893 * layout.h (class Layout): Make segment_precedes non-static.
1894 (class Compare_segments): Change from struct to class. Add
1895 layout_ field. Add constructor.
1896 * script-sections.cc
1897 (Script_sections::attach_sections_using_phdrs_clause): Rename
1898 local orphan to is_orphan. Don't report failure to put empty
1899 section in segment. On attachment failure, report name of
1900 section, and attach to first PT_LOAD segment.
1901
03ef7571
ILT
19022011-06-28 Ian Lance Taylor <iant@google.com>
1903
1904 PR gold/12934
1905 * target-select.cc (Target_selector::Target_selector): Add
1906 emulation parameter. Change all callers.
1907 (select_target_by_bfd_name): Rename from select_target_by_name.
1908 Change all callers.
1909 (select_target_by_emulation): New function.
1910 (supported_emulation_names): New function.
1911 * target-select.h (class Target_selector): Add emulation_ field.
1912 Update declarations.
1913 (Target_selector::recognize_by_bfd_name): Rename from
1914 recognize_by_name. Change all callers.
1915 (Target_selector::supported_bfd_names): Rename from
1916 supported_names. Change all callers.
1917 (Target_selector::recognize_by_emulation): New function.
1918 (Target_selector::supported_emulations): New function.
1919 (Target_selector::emulation): New function.
1920 (Target_selector::do_recognize_by_bfd_name): Rename from
1921 do_recognize_by_name. Change all callers.
1922 (Target_selector::do_supported_bfd_names): Rename from
1923 do_supported_names. Change all callers.
1924 (Target_selector::do_recognize_by_emulation): New function.
1925 (Target_selector::do_supported_emulations): New function.
1926 (select_target_by_bfd_name): Change name in declaration.
1927 (select_target_by_emulation): Declare.
1928 (supported_emulation_names): Declare.
1929 * parameters.cc (parameters_force_valid_target): Try to find
1930 target based on emulation from -m option.
1931 * options.h (class General_options): Change doc string for -m.
1932 * options.cc (help): Print emulations.
1933 (General_options::parse_V): Likewise.
1934 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
1935 Add emulation parameter. Change all callers.
1936
200b2bb9
ILT
19372011-06-28 Ian Lance Taylor <iant@google.com>
1938
1939 * target.h (class Target): Add osabi_ field.
1940 (Target::osabi): New function.
1941 (Target::set_osabi): New function.
1942 (Target::Target): Initialize osabi_.
1943 (Target::do_adjust_elf_header): Make pure virtual.
1944 (Sized_target::do_adjust_elf_header): Declare.
1945 * target.cc (Sized_target::do_adjust_elf_header): New function.
1946 (class Sized_target): Instantiate all versions.
1947 * freebsd.h (class Target_freebsd): Remove.
1948 (Target_selector_freebsd::do_recognize): Call set_osabi on
1949 Target.
1950 (Target_selector_freebsd::do_recognize_by_name): Likewise.
1951 (Target_selector_freebsd::set_osabi): Remove.
1952 * i386.cc (class Target_i386): Inherit from Sized_target rather
1953 than Target_freebsd.
1954 * x86_64.cc (class Target_x86_64): Likewise.
1955
b3ce541e
ILT
19562011-06-28 Ian Lance Taylor <iant@google.com>
1957
1958 * target.h (Target::can_check_for_function_pointers): Rewrite.
1959 Make non-virtual.
1960 (Target::can_icf_inline_merge_sections): Likewise.
1961 (Target::section_may_have_icf_unsafe_poineters): Likewise.
1962 (Target::Target_info): Add can_icf_inline_merge_sections field.
1963 (Target::do_can_check_for_function_pointers): New virtual
1964 function.
1965 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
1966 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
1967 from can_check_for_function_pointers, move in file.
1968 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
1969 section_may_have_icf_unsafe_poineters, move in file.
1970 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
1971 * i386.cc (Target_i386::do_can_check_for_function_pointers):
1972 Rename from can_check_for_function_pointers, move in file.
1973 (Target_i386::can_icf_inline_merge_sections): Remove.
1974 (Target_i386::i386_info): Initialize
1975 can_icf_inline_merge_sections.
1976 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
1977 Initialize can_icf_inline_merge_sections.
1978 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
1979 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
1980 Rename from can_check_for_function_pointers, move in file.
1981 (Target_x86_64::can_icf_inline_merge_sections): Remove.
1982 (Target_x86_64::x86_64_info): Initialize
1983 can_icf_inline_merge_sections.
1984 * testsuite/testfile.cc (Target_test::test_target_info):
1985 Likewise.
1986 * icf.cc (get_section_contents): Correct formatting.
1987
6d1c4efb
ILT
19882011-06-27 Ian Lance Taylor <iant@google.com>
1989
1990 * symtab.cc (Symbol::versioned_name): New function.
1991 (Symbol_table::add_to_final_symtab): Use versioned_name when
1992 appropriate.
1993 (Symbol_table::sized_write_symbol): Likewise.
1994 * symtab.h (class Symbol): Declare versioned_name.
1995 * stringpool.h (class Stringpool_template): Add variant of add
1996 which takes a std::basic_string.
1997 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
1998 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
1999 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
2000 (ver_test_12.o): New target.
2001 * testsuite/Makefile.in: Rebuild.
2002
57eb9b50
DK
20032011-06-27 Doug Kwan <dougkwan@google.com>
2004
2005 * arm.cc (Arm_relocate_functions::thm_jump8,
2006 Arm_relocate_functions::thm_jump11): Use a wider signed
2007 type to compute offset.
2008 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
2009 arm_thm_jump8.
2010 * testsuite/Makefile.in: Regenerate.
2011 * testsuite/arm_branch_in_range.sh: Check test results of
2012 arm_thm_jump11 and arm_thm_jump8.
2013 * testsuite/arm_thm_jump11.s: New test source file.
2014 * testsuite/arm_thm_jump11.t: New linker script.
2015 * testsuite/arm_thm_jump8.s: New test source file.
2016 * testsuite/arm_thm_jump8.t: New linker script.
2017
487b39df
ILT
20182011-06-24 Ian Lance Taylor <iant@google.com>
2019
2020 * layout.cc: Include "object.h".
2021 (ctors_sections_in_init_array): New static variable.
2022 (Layout::is_ctors_in_init_array): New function.
2023 (Layout::layout): Add entry to ctors_sections_in_init_array if
2024 appropriate.
2025 * layout.h (class Layout): Declare is_ctors_in_init_array.
2026 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
2027 is_ctors_reverse_view is set.
2028 (Sized_relobj_file::write_sections): Add layout parameter. Change
2029 all callers. Set is_ctors_reverse_view field of View_size.
2030 (Sized_relobj_file::reverse_words): New function.
2031 * object.h (Sized_relobj_file::View_size): Add
2032 is_ctors_reverse_view field.
2033 (class Sized_relobj_file): Update declarations.
2034 * testsuite/initpri3.c: New test.
2035 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
2036 initpri3b.
2037 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
2038 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
2039 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
2040 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
2041 * testsuite/Makefile.in: Rebuild.
2042
472076e4
CC
20432011-06-24 Cary Coutant <ccoutant@google.com>
2044
2045 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
2046 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
2047 (debug_msg_cdebug.err): New targets.
2048 * testsuite/Makefile.in: Regenerate.
2049 * testsuite/debug_msg.sh: Check output of link with compressed debug.
2050 Fix checks for link with shared library.
2051
a60af0db
DK
20522011-06-24 Doug Kwan <dougkwan@google.com>
2053
2054 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
2055 skip empty text sections.
2056 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
2057
5393d741
ILT
20582011-06-22 Ian Lance Taylor <iant@google.com>
2059
2060 PR gold/12910
2061 * options.h (class General_options): Add --ctors-in-init-array.
2062 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
2063 friends as SHT_PROGBITS for merging sections.
2064 (Layout::layout): Remove special handling of .init_array and
2065 friends. Don't sort if doing relocatable link. Sort for .ctors
2066 and .dtors if ctors_in_init_array.
2067 (Layout::make_output_section): Force correct section types for
2068 .init_array and friends. Don't sort if doing relocatable link,
2069 Don't sort .ctors and .dtors if ctors_in_init_array.
2070 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
2071 (Layout::output_section_name): Add relobj parameter. Change all
2072 callers. Handle .ctors. and .dtors. in code rather than table.
2073 Handle .ctors and .dtors if ctors_in_init_array.
2074 (Layout::match_file_name): New function, moved from output.cc.
2075 * layout.h (class Layout): Update declarations.
2076 * output.cc: Include "layout.h".
2077 (Input_section_sort_entry::get_priority): New function.
2078 (Input_section_sort_entry::match_file_name): Just call
2079 Layout::match_file_name.
2080 (Output_section::Input_section_sort_init_fini_compare::operator()):
2081 Handle .ctors and .dtors. Sort by explicit priority rather than
2082 by name.
2083 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
2084 * testsuite/initpri2.c: New test.
2085 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
2086 (check_PROGRAMS): Add initpri2.
2087 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
2088 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
2089 * configure, testsuite/Makefile.in: Rebuild.
2090
e1f74f98
ILT
20912011-06-19 Ian Lance Taylor <iant@google.com>
2092
2093 PR gold/12880
2094 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
2095 .interp section to a PT_INTERP segment even if we have seen a
2096 --dynamic-linker option. Don't do it if we have seen a PHDRS
2097 clause in a linker script.
2098 (Layout::finalize): Don't create a .interp section if we've
2099 already create a PT_INTERP segment.
2100 (Layout::create_interp): Always call choose_output_section (revert
2101 patch of 2011-06-17). Don't create PT_INTERP segment.
2102 * script-sections.cc
2103 (Script_sections::create_note_and_tls_segments): Add a .interp
2104 section to a PT_INTERP segment even if we have seen a
2105 --dynamic-linker option.
2106
766f91bb
ILT
21072011-06-18 Ian Lance Taylor <iant@google.com>
2108
2109 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
2110 merely because a non-PT_LOAD segment has a dynamic reloc.
2111
0d212c3a
ILT
21122011-06-18 Ian Lance Taylor <iant@google.com>
2113
2114 * layout.cc (Layout::finish_dynamic_section): Don't create
2115 DT_FLAGS entry if not needed.
2116
911a5072
ILT
21172011-06-18 Ian Lance Taylor <iant@google.com>
2118
2119 PR gold/12745
2120 * layout.cc (Layout::layout_eh_frame): Correct handling of
2121 writable .eh_frame section.
2122
534b4e5f
ILT
21232011-06-17 Ian Lance Taylor <iant@google.com>
2124
2125 PR gold/12893
2126 * resolve.cc (Symbol_table::resolve): Don't give an error if a
2127 symbol is redefined with the exact same object and value.
2128
10b4f102
ILT
21292011-06-17 Ian Lance Taylor <iant@google.com>
2130
2131 PR gold/12880
2132 * layout.h (class Layout): Add interp_segment_ field.
2133 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
2134 (Layout::attach_allocated_section_to_segment): If making shared
2135 library, put .interp section in PT_INTERP segment.
2136 (Layout::finalize): Also call create_interp if -dynamic-linker
2137 option was used.
2138 (Layout::create_interp): Assert that there is no PT_INTERP
2139 segment. If not using a SECTIONS clause, use make_output_section.
2140 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
2141 * script-sections.cc
2142 (Script_sections::create_note_and_tls_segments): If making shared
2143 library, put .interp section in PT_INTERP segment.
2144
a29b0dad
ILT
21452011-06-17 Ian Lance Taylor <iant@google.com>
2146
e588ea8d
ILT
2147 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
2148 when making a shared library.
2149
21502011-06-17 Ian Lance Taylor <iant@google.com>
2151
2152 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
2153 parameter. Change all callers. Don't issue warning about PC32
2154 against locally defined symbol.
a29b0dad 2155
9d3b0698
ILT
21562011-06-16 Ian Lance Taylor <iant@google.com>
2157
2158 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
2159 occurs in same object.
2160
85b0f90c
AM
21612011-06-14 Alan Modra <amodra@gmail.com>
2162
2163 * po/POTFILES.in: Regenerate.
2164
a94907d9
ILT
21652011-06-09 Ian Lance Taylor <iant@google.com>
2166
2167 * script-sections.cc
2168 (Orphan_output_section::set_section_addresses): For a relocatable
2169 link set address to 0.
2170
4fb3a1c3
CC
21712011-06-09 Cary Coutant <ccoutant@google.com>
2172
2173 PR gold/12804
2174 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
2175 used with --compress-debug-sections.
2176 * gold/object.cc (Sized_relobj_file::do_layout): Report
2177 uncompressed size of compressed input sections.
2178
61220854
CC
21792011-06-08 Cary Coutant <ccoutant@google.com>
2180
2181 PR gold/12804
2182 * testsuite/two_file_test_2_v1.cc: Change initialization of
2183 v2 to keep it in .data.
2184
e6455dfb
CC
21852011-06-07 Cary Coutant <ccoutant@google.com>
2186
2187 * common.cc (Symbol_table::do_allocate_commons_list): Call
2188 gold_fallback.
2189 * errors.cc (Errors::fatal): Adjust call to gold_exit.
2190 (Errors::fallback): New function.
2191 (gold_fallback): New function.
2192 * errors.h (Errors::fallback): New function.
2193 * gold.cc (gold_exit): Change status parameter to enum; adjust
2194 all callers.
2195 (queue_initial_tasks): Call gold_fallback.
2196 * gold.h: Include cstdlib.
2197 (Exit_status): New enum type.
2198 (gold_exit): Change status parameter to enum.
2199 (gold_fallback): New function.
2200 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
2201 (Layout::create_symtab_sections): Likewise.
2202 (Layout::create_shdrs): Likewise.
2203 * main.cc (main): Adjust call to gold_exit.
2204 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
2205 (Output_data_got::add_got_entry_pair): Likewise.
2206 (Output_section::add_input_section): Likewise.
2207 (Output_section::add_output_section_data): Likewise.
2208 (Output_segment::set_section_list_addresses): Likewise.
2209 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
2210
fb0e076f
CC
22112011-06-07 Cary Coutant <ccoutant@google.com>
2212
2213 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
2214 for incremental links.
2215 * output.cc (Output_segment::set_section_list_addresses): Remove
2216 FIXME and test for TLS or BSS.
2217
a5ee4d5d
CC
22182011-06-07 Cary Coutant <ccoutant@google.com>
2219
2220 * testsuite/Makefile.am: Add incremental_copy_test,
2221 incremental_common_test_1.
2222 * testsuite/Makefile.in: Regenerate.
2223 * testsuite/common_test_1_v1.c: New source file.
2224 * testsuite/common_test_1_v2.c: New source file.
2225 * testsuite/copy_test_v1.cc: New source file.
2226
5146f448
CC
22272011-06-07 Cary Coutant <ccoutant@google.com>
2228
2229 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
2230 update, allocate common from bss section's free list.
2231 * incremental-dump.cc (dump_incremental_inputs): Print flag for
2232 linker-defined symbols.
2233 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
2234 Skip GOT and PLT entries that are no longer referenced.
2235 (Output_section_incremental_inputs::write_info_blocks): Mark
2236 linker-defined symbols.
2237 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
2238 * output.cc (Output_section::allocate): New function.
2239 * output.h (Output_section::allocate): New function.
2240 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
2241 linker-defined symbols.
2242 (Symbol::override_base_with_special): Copy is_predefined_ flag.
2243 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
2244 (Symbol::init_base_output_data): Likewise.
2245 (Symbol::init_base_output_segment): Likewise.
2246 (Symbol::init_base_constant): Likewise.
2247 (Sized_symbol::init_output_data): Likewise.
2248 (Sized_symbol::init_output_segment): Likewise.
2249 (Sized_symbol::init_constant): Likewise.
2250 (Symbol_table::do_define_in_output_data): Likewise.
2251 (Symbol_table::do_define_in_output_segment): Likewise.
2252 (Symbol_table::do_define_as_constant): Likewise.
2253 * symtab.h (Symbol::is_predefined): New function.
2254 (Symbol::init_base_output_data): Add is_predefined parameter.
2255 (Symbol::init_base_output_segment): Likewise.
2256 (Symbol::init_base_constant): Likewise.
2257 (Symbol::is_predefined_): New data member.
2258 (Sized_symbol::init_output_data): Add is_predefined parameter.
2259 (Sized_symbol::init_output_segment): Likewise.
2260 (Sized_symbol::init_constant): Likewise.
2261 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
2262
26d3c67d
CC
22632011-06-07 Cary Coutant <ccoutant@google.com>
2264
2265 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
2266 instead of emit_copy_reloc.
2267 (Copy_relocs::emit_copy_reloc): Refactor.
2268 (Copy_relocs::make_copy_reloc): New function.
2269 (Copy_relocs::add_copy_reloc): Remove.
2270 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
2271 section.
2272 (Copy_relocs::make_copy_reloc): New function.
2273 (Copy_relocs::add_copy_reloc): Remove.
2274 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
2275 unchanged input files.
2276 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
2277 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
2278 Reserve BSS space for COPY relocations.
2279 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2280 (Output_section_incremental_inputs::write_info_blocks): Record
2281 whether a symbol is copied from a shared object.
2282 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
2283 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
2284 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
2285 (Incremental_input_entry_reader::get_output_symbol_index): Add
2286 is_copy parameter.
2287 (Incremental_binary::emit_copy_relocs): New function.
2288 (Incremental_binary::do_emit_copy_relocs): New function.
2289 (Sized_incremental_binary::Sized_incremental_binary): Initialize
2290 new data member.
2291 (Sized_incremental_binary::add_copy_reloc): New function.
2292 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2293 (Sized_incremental_binary::Copy_reloc): New struct.
2294 (Sized_incremental_binary::Copy_relocs): New typedef.
2295 (Sized_incremental_binary::copy_relocs_): New data member.
2296 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
2297 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
2298 * target.h (Sized_target::emit_copy_reloc): New function.
2299 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
2300
7cdb37d9
CC
23012011-06-02 Cary Coutant <ccoutant@google.com>
2302
2303 PR gold/12163
2304 * gold/archive.cc (Archive::Archive): Initialize new data member.
2305 (Archive::include_all_members): Return if archive has already been
2306 included.
2307 * gold/archive.h (Archive::include_all_members_): New data member.
2308
cc643b88
NC
23092011-06-02 Nick Clifton <nickc@redhat.com>
2310
2311 * dynobj.h: Fix spelling mistake in comment.
2312 * output.cc: Likewise.
2313
f62a3ca7 23142011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 2315 Asier Llano
f62a3ca7
DK
2316
2317 PR gold/12826
cc643b88 2318 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
2319 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
2320 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
2321 redundant arm_exidx_test.so.
2322 * testsuite/Makefile.in: Regenerate.
2323 (check_SCRIPTS): Add pr12826.sh
2324 (check_DATA): Add pr12826.stdout
2325 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
2326 * testsuite/pr12826.sh: New file.
2327 * testsuite/pr12826_1.s: Ditto.
2328 * testsuite/pr12826_1.s: Ditto.
2329
8dbe1edc
ILT
23302011-05-30 Ian Lance Taylor <iant@google.com>
2331
2332 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
2333 sections.
2334
c49875be
ILT
23352011-05-29 Ian Lance Taylor <iant@google.com>
2336
2337 PR gold/12804
2338 * testsuite/Makefile.am: Use different file name for two_file_test
2339 temporary file for each incremental test.
2340 * testsuite/Makefile.in: Rebuild.
2341
69d53f7a
ILT
23422011-05-29 Ian Lance Taylor <iant@google.com>
2343
2344 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
2345 binary input file is empty.
2346
41d0ab5f
ILT
23472011-05-27 Ian Lance Taylor <iant@google.com>
2348
2349 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
2350 (ver_test_9.so): Likewise.
2351 * testsuite/Makefile.in: Rebuild.
2352
89d8a36b
CC
23532011-05-26 Cary Coutant <ccoutant@google.com>
2354
2355 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
2356 * incremental.cc (Incremental_inputs::report_input_section): Fix
2357 comment, indentation.
2358 (Incremental_inputs::report_comdat_group): New function.
2359 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2360 of data for incremental input file entry.
2361 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
2362 group count, COMDAT group signatures.
2363 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
2364 an unchanged input file.
2365 * incremental.h (Incremental_object_entry::Incremental_object_entry):
2366 Initialize new data member.
2367 (Incremental_object_entry::add_comdat_group): New function.
2368 (Incremental_object_entry::get_comdat_group_count): New function.
2369 (Incremental_object_entry::get_comdat_signature_key): New function.
2370 (Incremental_object_entry::groups_): New data member.
2371 (Incremental_inputs::report_comdat_group): New function.
2372 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
2373 data for incremental input file entry.
2374 (Incremental_input_entry_reader::get_comdat_group_count): New function.
2375 (Incremental_input_entry_reader::get_input_section): Adjust size of
2376 data for incremental input file entry.
2377 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
2378 (Incremental_input_entry_reader::get_comdat_group_signature): New
2379 function.
2380 * object.cc (Sized_relobj::include_section_group): Report kept
2381 COMDAT groups for incremental links.
2382
1706a06f
ILT
23832011-05-24 David Meyer <pdox@google.com>
2384
2385 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
2386 with name parameter. Add found_name parameter.
2387 * fileread.cc (Input_file::find_file): Adjust code accordingly.
2388 * dirsearch.h (class Dirsearch): Update declaration.
2389
a10ae760
ILT
23902011-05-24 Ian Lance Taylor <iant@google.com>
2391
2392 * archive.cc (Library_base::should_include_member): Pull in object
2393 from archive if it defines the entry symbol.
2394 * parameters.cc (Parameters::entry): New function.
2395 * parameters.h (class Parameters): Declare entry.
2396 * output.h (class Output_file_header): Remove entry_ field.
2397 * output.cc (Output_file_header::Output_file_header): Remove entry
2398 parameter. Change all callers.
2399 (Output_file_header::entry): Use parameters->entry.
2400 * gold.cc (queue_middle_tasks): Likewise.
2401 * plugin.cc (Plugin_hook::run): Likewise.
2402
aa92d6ed
CC
24032011-05-24 Cary Coutant <ccoutant@google.com>
2404
2405 * gold.cc (queue_initial_tasks): Pass incremental base filename
2406 to Output_file::open_base_file; don't print error message.
2407 * incremental-dump.cc (main): Adjust call to
2408 Output_file::open_for_modification.
2409 * incremental-dump.cc (main): Likewise.
2410 * incremental.cc (Incremental_inputs::report_command_line):
2411 Ignore --incremental-base option when comparing command lines.
2412 Ignore parameter when given as separate argument.
2413 * options.h (class General_options): Add --incremental-base.
2414 * output.cc (Output_file::Output_file):
2415 (Output_file::open_base_file): Add base_name and writable parameters;
2416 read base file into new file; print error message here.
2417 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2418 callers.
2419 * output.h (Output_file::open_for_modification): Rename to...
2420 (Output_file::open_base_file): ...this; add base_name and
2421 writable parameters; adjust all callers.
2422 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2423 callers.
2424 * testsuite/Makefile.am (incremental_test_4): Test
2425 --incremental-base.
2426 * testsuite/Makefile.in: Regenerate.
2427
2eedd706
CC
24282011-05-24 Cary Coutant <ccoutant@google.com>
2429
2430 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
2431 incremental_test_4.
2432 * testsuite/Makefile.in: Regenerate.
2433 * testsuite/two_file_test_1_v1.cc: New test source file.
2434 * testsuite/two_file_test_1b_v1.cc: New test source file.
2435 * testsuite/two_file_test_2_v1.cc: New test source file.
2436
0f1c85a6
CC
24372011-05-24 Cary Coutant <ccoutant@google.com>
2438
2439 * dynobj.h (Dynobj::do_dynobj): New function.
2440 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
2441 flag and soname for shared objects.
2442 * incremental.cc (Incremental_inputs::report_object): Make
2443 either Incremental_object_entry or Incremental_dynobj_entry; add
2444 soname to string table.
2445 (Incremental_inputs::report_input_section): Add assertion.
2446 (Output_section_incremental_inputs::set_final_data_size): Adjust
2447 type of input file entry for shared libraries; adjust size of
2448 shared library info entry.
2449 (Output_section_incremental_inputs::write_input_files): Write
2450 as_needed flag for shared libraries.
2451 (Output_section_incremental_inputs::write_info_blocks): Adjust type
2452 of input file entry for shared libraries; write soname.
2453 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
2454 soname from incremental info.
2455 * incremental.h (enum Incremental_input_flags): Add
2456 INCREMENTAL_INPUT_AS_NEEDED.
2457 (Incremental_input_entry::Incremental_input_entry): Initialize new
2458 data member.
2459 (Incremental_input_entry::set_as_needed): New function.
2460 (Incremental_input_entry::as_needed): New function.
2461 (Incremental_input_entry::do_dynobj_entry): New function.
2462 (Incremental_input_entry::as_needed_): New data member.
2463 (Incremental_object_entry::Incremental_object_entry): Don't check
2464 for shared library.
2465 (Incremental_object_entry::do_type): Likewise.
2466 (class Incremental_dynobj_entry): New class.
2467 (Incremental_input_entry_reader::as_needed): New function.
2468 (Incremental_input_entry_reader::get_soname): New function.
2469 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
2470 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
2471 size of shared library info entry.
58797674 2472 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
2473 incremental link when adding DT_NEEDED entries.
2474 * object.h (Object::Object): Initialize new data member.
2475 (Object::dynobj): New function.
2476 (Object::set_as_needed): New function.
2477 (Object::as_needed): New function.
2478 (Object::do_dynobj): New function.
2479 (Object::as_needed_): New data member.
2480
6fa2a40b
CC
24812011-05-24 Cary Coutant <ccoutant@google.com>
2482
2483 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
2484 info; adjust display of GOT entries.
2485 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2486 vector of input objects; remove file_status_.
2487 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
2488 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
2489 got_plt reader; call target hooks to reserve GOT entries.
2490 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2491 of input file info header and GOT info entry.
2492 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
2493 relocation info.
2494 (Got_plt_view_info::got_descriptor): Remove.
2495 (Got_plt_view_info::sym_index): New data member.
2496 (Got_plt_view_info::input_index): New data member.
2497 (Local_got_offset_visitor::visit): Write input file index.
2498 (Global_got_offset_visitor::visit): Write 0 for input file index.
2499 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
2500 with sym_index and input_index.
2501 (Output_section_incremental_inputs::write_got_plt): Adjust size of
2502 incremental info GOT entry; replace got_descriptor with input_index.
2503 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
2504 map from input file index to object.
2505 (Sized_relobj_incr::do_layout): Replace direct data member reference
2506 with accessor function.
2507 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
2508 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
2509 Adjust size of input file info header.
2510 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
2511 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
2512 (Incremental_input_entry_reader::get_input_section): Adjust size of
2513 input file info header.
2514 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
2515 of incremental info GOT entry.
2516 (Incremental_got_plt_reader::get_got_desc): Remove.
2517 (Incremental_got_plt_reader::get_got_symndx): New function.
2518 (Incremental_got_plt_reader::get_got_input_index): New function.
2519 (Sized_incremental_binary::Sized_incremental_binary): Remove
2520 file_status_; add input_objects_.
2521 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
2522 (Sized_incremental_binary::set_file_is_unchanged): Remove.
2523 (Sized_incremental_binary::file_is_unchanged): Remove.
2524 (Sized_incremental_binary::set_input_object): New function.
2525 (Sized_incremental_binary::input_object): New function.
2526 (Sized_incremental_binary::file_status_): Remove.
2527 (Sized_incremental_binary::input_objects_): New data member.
2528 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
2529 references.
2530 (Sized_relobj_incr::invalid_address): Move to base class.
2531 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
2532 class.
2533 (Sized_relobj_incr::do_output_section_offset): Likewise.
2534 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
2535 (Sized_relobj_incr::section_offsets_): Likewise.
2536 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
2537 function.
2538 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
2539 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
2540 with accessor function.
2541 (Sized_relobj_file::do_layout): Likewise.
2542 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
2543 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
2544 (Sized_relobj_file::compute_final_local_value): Replace refs to
2545 section_offsets_ with accessor function.
2546 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
2547 * object.h (Relobj::Relobj): Initialize new data members.
2548 (Relobj::add_dyn_reloc): New function.
2549 (Relobj::first_dyn_reloc): New function.
2550 (Relobj::dyn_reloc_count): New function.
2551 (Relobj::first_dyn_reloc_): New data member.
2552 (Relobj::dyn_reloc_count_): New data member.
2553 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
2554 references.
2555 (Sized_relobj::Address): New typedef.
2556 (Sized_relobj::invalid_address): Move here from child class.
2557 (Sized_relobj::Sized_relobj): Initialize new data members.
2558 (Sized_relobj::sized_relobj): New function.
2559 (Sized_relobj::is_output_section_offset_invalid): Move here from
2560 child class.
2561 (Sized_relobj::get_output_section_offset): Likewise.
2562 (Sized_relobj::local_has_got_offset): Likewise.
2563 (Sized_relobj::local_got_offset): Likewise.
2564 (Sized_relobj::set_local_got_offset): Likewise.
2565 (Sized_relobj::do_for_all_local_got_entries): Likewise.
2566 (Sized_relobj::clear_got_offsets): New function.
2567 (Sized_relobj::section_offsets): Move here from child class.
2568 (Sized_relobj::do_output_section_offset): Likewise.
2569 (Sized_relobj::do_set_section_offset): Likewise.
2570 (Sized_relobj::Local_got_offsets): Likewise.
2571 (Sized_relobj::local_got_offsets_): Likewise.
2572 (Sized_relobj::section_offsets_): Likewise.
2573 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
2574 references.
2575 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
2576 class.
2577 (Sized_relobj_file::sized_relobj): New function
2578 (Sized_relobj_file::local_has_got_offset): Move to base class.
2579 (Sized_relobj_file::local_got_offset): Likewise.
2580 (Sized_relobj_file::set_local_got_offset): Likewise.
2581 (Sized_relobj_file::get_output_section_offset): Likewise.
2582 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
2583 (Sized_relobj_file::do_output_section_offset): Likewise.
2584 (Sized_relobj_file::do_set_section_offset): Likewise.
2585 (Sized_relobj_file::Local_got_offsets): Likewise.
2586 (Sized_relobj_file::local_got_offsets_): Likewise.
2587 (Sized_relobj_file::section_offsets_): Likewise.
2588 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
2589 (all constructors).
2590 (set_needs_dynsym_index): Convert relobj to derived class pointer.
2591 (Output_reloc::get_symbol_index): Likewise.
2592 (Output_reloc::local_section_offset): Likewise.
2593 (Output_reloc::get_address): Likewise.
2594 (Output_reloc::symbol_value): Likewise.
2595 (Output_data_got::reserve_slot): Move to class definition.
2596 (Output_data_got::reserve_local): New function.
2597 (Output_data_got::reserve_slot_for_global): Remove.
2598 (Output_data_got::reserve_global): New function.
2599 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
2600 (all constructors, two instantiations).
2601 (Output_reloc::get_relobj): New function (two instantiations).
2602 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
2603 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
2604 (Output_data_reloc::add_global): Adjust type of relobj.
2605 (Output_data_reloc::add_global_relative): Likewise.
2606 (Output_data_reloc::add_symbolless_global_addend): Likewise.
2607 (Output_data_reloc::add_local): Likewise.
2608 (Output_data_reloc::add_local_relative): Likewise.
2609 (Output_data_reloc::add_symbolless_local_addend): Likewise.
2610 (Output_data_reloc::add_local_section): Likewise.
2611 (Output_data_reloc::add_output_section): Likewise.
2612 (Output_data_reloc::add_absolute): Likewise.
2613 (Output_data_reloc::add_target_specific): Likewise.
2614 (Output_data_got::reserve_slot): Move definition here.
2615 (Output_data_got::reserve_local): New function.
2616 (Output_data_got::reserve_global): New function.
2617 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
2618 section_offsets_ with accessor function.
2619 (Sized_relobj_file::write_sections): Likewise.
2620 (Sized_relobj_file::do_relocate_sections): Likewise.
2621 * target.h (Sized_target::reserve_local_got_entry): New function.
2622 (Sized_target::reserve_global_got_entry): New function.
2623 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
2624 (Target_x86_64::reserve_global_got_entry): New function.
2625 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
2626
4829d394
CC
26272011-05-23 Cary Coutant <ccoutant@google.com>
2628
2629 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
2630 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
2631 bit when checking got_type.
2632 * incremental.cc (Sized_incremental_binary::setup_readers):
2633 Store symbol table and string table locations; initialize bit vector
2634 of file status flags.
2635 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
2636 unchanged files.
2637 (Sized_incremental_binary::do_process_got_plt): New function.
2638 (Sized_incremental_binary::get_symtab_view): Use stored locations.
2639 (Output_section_incremental_inputs::set_final_data_size): Record
2640 file index for each input file.
2641 (Output_section_incremental_inputs::write_got_plt): Store file index
2642 instead of input entry offset for each GOT entry.
2643 * incremental.h
2644 (Incremental_input_entry::Incremental_input_entry): Initialize new
2645 data member.
2646 (Incremental_input_entry::set_offset): Store file index.
2647 (Incremental_input_entry::get_file_index): New function.
2648 (Incremental_input_entry::file_index_): New data member.
2649 (Incremental_binary::process_got_plt): New function.
2650 (Incremental_binary::do_process_got_plt): New function.
2651 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2652 data members.
2653 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
2654 (Sized_incremental_binary::set_file_is_unchanged): New function.
2655 (Sized_incremental_binary::file_is_unchanged): New function.
2656 (Sized_incremental_binary::do_process_got_plt): New function.
2657 (Sized_incremental_binary::file_status_): New data member.
2658 (Sized_incremental_binary::main_symtab_loc_): New data member.
2659 (Sized_incremental_binary::main_strtab_loc_): New data member.
2660 * output.cc (Output_data_got::Got_entry::write): Add case
2661 RESERVED_CODE.
2662 (Output_data_got::add_global): Call add_got_entry.
2663 (Output_data_got::add_global_plt): Likewise.
2664 (Output_data_got::add_global_with_rel): Likewise.
2665 (Output_data_got::add_global_with_rela): Likewise.
2666 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
2667 (Output_data_got::add_global_pair_with_rela): Likewise.
2668 (Output_data_got::add_local): Call add_got_entry.
2669 (Output_data_got::add_local_plt): Likewise.
2670 (Output_data_got::add_local_with_rel): Likewise.
2671 (Output_data_got::add_local_with_rela): Likewise.
2672 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
2673 (Output_data_got::add_local_pair_with_rela): Likewise.
2674 (Output_data_got::reserve_slot): New function.
2675 (Output_data_got::reserve_slot_for_global): New function.
2676 (Output_data_got::add_got_entry): New function.
2677 (Output_data_got::add_got_entry_pair): New function.
2678 (Output_section::add_output_section_data): Edit FIXME.
2679 * output.h
2680 (Output_section_data_build::Output_section_data_build): New
2681 constructor with size parameter.
2682 (Output_data_space::Output_data_space): Likewise.
2683 (Output_data_got::Output_data_got): Initialize new data member; new
2684 constructor with size parameter.
2685 (Output_data_got::add_constant): Call add_got_entry.
2686 (Output_data_got::reserve_slot): New function.
2687 (Output_data_got::reserve_slot_for_global): New function.
2688 (class Output_data_got::Got_entry): Add RESERVED_CODE.
2689 (Output_data_got::add_got_entry): New function.
2690 (Output_data_got::add_got_entry_pair): New function.
2691 (Output_data_got::free_list_): New data member.
2692 * target.h (Sized_target::init_got_plt_for_update): New function.
2693 (Sized_target::register_global_plt_entry): New function.
2694 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
2695 Initialize new data member; call init; add constructor with PLT count.
2696 (Output_data_plt_x86_64::init): New function.
2697 (Output_data_plt_x86_64::add_relocation): New function.
2698 (Output_data_plt_x86_64::reserve_slot): New function.
2699 (Output_data_plt_x86_64::free_list_): New data member.
2700 (Target_x86_64::init_got_plt_for_update): New function.
2701 (Target_x86_64::register_global_plt_entry): New function.
2702 (Output_data_plt_x86_64::add_entry): Allocate from free list for
2703 incremental updates.
2704 (Output_data_plt_x86_64::add_relocation): New function.
2705 * testsuite/object_unittest.cc (Object_test): Set default options.
2706
ec69d6da
ILT
27072011-05-16 Ian Lance Taylor <iant@google.com>
2708
2709 * options.h (class General_options): Make -i a synonym for -r.
2710
732e31de
ILT
27112011-05-16 Ian Lance Taylor <iant@google.com>
2712
2713 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
2714
403676b5
CC
27152011-05-10 Cary Coutant <ccoutant@google.com>
2716
2717 * object.cc (Sized_relobj::do_count_local_symbols): Check for
2718 strip_all (-s).
2719
5b7b7d6e
ILT
27202011-05-06 Ian Lance Taylor <iant@google.com>
2721
2722 * layout.cc (Layout::layout): If the output section flags change,
2723 update the ordering.
2724
f0f9babf
CC
27252011-04-25 Cary Coutant <ccoutant@google.com>
2726
2727 * incremental-dump.cc (dump_incremental_inputs): Print local
2728 symbol info for each input file.
2729 * incremental.cc
2730 (Output_section_incremental_inputs::set_final_data_size): Add local
2731 symbol info to input file entries in incremental info.
2732 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2733 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
2734 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
2735 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
2736 implementation.
2737 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
2738 (Sized_incr_relobj::do_relocate): Write the local symbols.
2739 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
2740 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
2741 Adjust size of input file header.
2742 (Incremental_inputs_reader::get_local_symbol_offset): New function.
2743 (Incremental_inputs_reader::get_local_symbol_count): New function.
2744 (Incremental_inputs_reader::get_input_section): Adjust size of input
2745 file header.
2746 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
2747 (Sized_incr_relobj::This): New typedef.
2748 (Sized_incr_relobj::sym_size): New const data member.
2749 (Sized_incr_relobj::Local_symbol): New struct.
2750 (Sized_incr_relobj::do_output_local_symbol_count): New function.
2751 (Sized_incr_relobj::do_local_symbol_offset): New function.
2752 (Sized_incr_relobj::local_symbol_count_): New data member.
2753 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
2754 (Sized_incr_relobj::local_symbol_index_): New data member.
2755 (Sized_incr_relobj::local_symbol_offset_): New data member.
2756 (Sized_incr_relobj::local_dynsym_offset_): New data member.
2757 (Sized_incr_relobj::local_symbols_): New data member.
2758 * object.h (Relobj::output_local_symbol_count): New function.
2759 (Relobj::local_symbol_offset): New function.
2760 (Relobj::do_output_local_symbol_count): New function.
2761 (Relobj::do_local_symbol_offset): New function.
2762 (Sized_relobj::do_output_local_symbol_count): New function.
2763 (Sized_relobj::do_local_symbol_offset): New function.
2764
d0a9ace3
ILT
27652011-04-22 Vladimir Simonov <sv@sw.ru>
2766
2767 * descriptors.cc (set_close_on_exec): New function.
2768 (Descriptors::open): Use set_close_on_exec.
2769 * output.cc (S_ISLNK): Define if not defined.
2770
94a3fc8b
CC
27712011-04-22 Cary Coutant <ccoutant@google.com>
2772
2773 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2774 global symbol map.
2775 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2776 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
2777 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
2778 relocations.
2779 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
2780 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
2781 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
2782 * incremental.h
2783 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
2784 function.
2785 (Incremental_binary::apply_incremental_relocs): New function.
2786 (Incremental_binary::do_apply_incremental_relocs): New function.
2787 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2788 data member.
2789 (Sized_incremental_binary::add_global_symbol): New function.
2790 (Sized_incremental_binary::global_symbol): New function.
2791 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2792 (Sized_incremental_binary::symbol_map_): New data member.
2793 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
2794 * target.h (Sized_target::apply_relocation): New function.
2795 * target-reloc.h (apply_relocation): New function.
2796 * x86_64.cc (Target_x86_64::apply_relocation): New function.
2797
c87e4302
DK
27982011-04-22 Doug Kwan <dougkwan@google.com>
2799
2800 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
2801 flag of a SHT_ARM_EXIDX section.
2e702c99 2802 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
2803 * testsuite/Makefile.in: Regenerate.
2804 * testsuite/arm_exidx_test.s: New file.
2805 * testsuite/arm_exidx_test.sh: Same.
2806
e7782cf6
CC
28072011-04-20 Cary Coutant <ccoutant@google.com>
2808
2809 PR gold/12689
2810 * archive.h (Incremental_archive_entry::Archive_member):
2811 Initialize arg_serial_ (second constructor).
2812
308ecdc7
ILT
28132011-04-17 Ian Lance Taylor <iant@google.com>
2814
2815 * object.cc (Relocate_info::location): Simplify location string.
2816 * errors.cc (Errors::error_at_location): Don't print program
2817 name.
2818 (Errors::warning_at_location): Likewise.
2819 (Errors::undefined_symbol): Likewise.
2820 * testsuite/debug_msg.sh: Update accordingly.
2821
bec5b579
CC
28222011-04-14 Cary Coutant <ccoutant@google.com>
2823
2824 * gold/layout.cc (Layout::symtab_section_offset): New function.
2825 * gold/layout.h (Layout::symtab_section_offset): New function.
2826 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
2827
88597d34
ILT
28282011-04-12 Ian Lance Taylor <iant@google.com>
2829
2830 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
2831 with MREMAP_MAYMOVE.
2832 * output.h (class Output_file): Add map_is_allocated_ field.
2833 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
2834 not available, provide stubs. If mremap is not available, #define
2835 it to gold_mremap.
2836 (MREMAP_MAYMOVE): Define if not defined.
2837 (Output_file::Output_file): Initialize map_is_allocated_.
2838 (Output_file::resize): Check map_is_allocated_.
2839 (Output_file::map_anonymous): If mmap fails, use malloc.
2840 (Output_file::unmap): Don't do anything for an anonymous map.
2841 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
2842 is not available, provide stubs.
2843 (File_read::View::~View): Use free rather than delete[].
2844 (File_read::make_view): Use malloc rather than new[]. If mmap
2845 fails, use malloc.
2846 (File_read::find_or_make_view): Use malloc rather than new[].
2847 * gold.h: Remove HAVE_REMAP code.
2848 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
2849 exists. Rename mremap to gold_mremap. If mmap is not available
2850 don't do anything.
2851 * configure, config.in: Rebuild.
2852
11e361bc
ILT
28532011-04-11 Ian Lance Taylor <iant@google.com>
2854
2855 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
2856 initialize local variable v.
2857
cdc29364
CC
28582011-04-11 Cary Coutant <ccoutant@google.com>
2859
2860 * archive.cc (Archive::include_member): Adjust call to
2861 report_object.
2862 (Add_archive_symbols::run): Track argument serial numbers.
2863 (Lib_group::include_member): Likewise.
2864 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
2865 * archive.h (Incremental_archive_entry::Archive_member):
2866 Initialize arg_serial_.
2867 (Archive_member::arg_serial_): New data member.
2868 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
2869 (Sized_dynobj::do_add_symbols): Track symbols when doing an
2870 incremental link.
2871 (Sized_dynobj::do_for_all_local_got_entries): New function.
2872 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
2873 function.
2874 * fileread.cc (get_mtime): New function.
2875 * fileread.h (get_mtime): New function.
2876 * gold.cc (queue_initial_tasks): Check for incremental update.
2877 (process_incremental_input): New function.
2878 (queue_middle_tasks): Don't force valid target for incremental
2879 update.
2880 * incremental-dump.cc (find_input_containing_global): Adjust
2881 size of symbol info entry.
2882 (dump_incremental_inputs): Dump argument serial number and
2883 in_system_directory flag; bias shndx by 1; print symbol names
2884 when dumping per-file symbol lists; use new symbol info readers.
2885 * incremental.cc
2886 (Output_section_incremental_inputs:update_data_size): New function.
2887 (Sized_incremental_binary::setup_readers): Setup input readers
2888 for each input file; build maps for files added from libraries
2889 and scripts.
2890 (Sized_incremental_binary::check_input_args): New function.
2891 (Sized_incremental_binary::do_check_inputs): Build map of argument
2892 serial numbers to input arguments.
2893 (Sized_incremental_binary::do_file_has_changed): Rename
2894 do_file_is_unchanged to this; compare file modification times.
2895 (Sized_incremental_binary::do_init_layout): New function.
2896 (Sized_incremental_binary::do_reserve_layout): New function.
2897 (Sized_incremental_binary::do_get_input_reader): Remove.
2898 (Sized_incremental_binary::get_symtab_view): New function.
2899 (Incremental_checker::can_incrementally_link_output_file): Remove.
2900 (Incremental_inputs::report_command_line): Exclude --debug options.
2901 (Incremental_inputs::report_archive_begin): Add parameter; track
2902 argument serial numbers; don't put input file entry for archive
2903 before archive members.
2904 (Incremental_inputs::report_archive_end): Put input file entry
2905 for archive after archive members.
2906 (Incremental_inputs::report_object): Add parameter; track argument
2907 serial numbers and in_system_directory flag.
2908 (Incremental_inputs::report_script): Add parameter; track argument
2909 serial numbers.
2910 (Output_section_incremental_inputs::set_final_data_size): Adjust
2911 size of symbol info entry; check for forwarding symbols.
2912 (Output_section_incremental_inputs::write_input_files): Write
2913 in_system_directory flag and argument serial number.
2914 (Output_section_incremental_inputs::write_info_blocks): Map section
2915 indices between incremental info and original input file; store
2916 input section index for each symbol.
2917 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
2918 change operator() to visit().
2919 (class Global_got_offset_visitor): Likewise.
2920 (class Global_symbol_visitor_got_plt):
2921 (Output_section_incremental_inputs::write_got_plt): Use new visitor
2922 classes.
2923 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
2924 (Sized_incr_relobj::do_read_symbols): New function.
2925 (Sized_incr_relobj::do_layout): New function.
2926 (Sized_incr_relobj::do_layout_deferred_sections): New function.
2927 (Sized_incr_relobj::do_add_symbols): New function.
2928 (Sized_incr_relobj::do_should_include_member): New function.
2929 (Sized_incr_relobj::do_for_all_global_symbols): New function.
2930 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
2931 (Sized_incr_relobj::do_section_size): New function.
2932 (Sized_incr_relobj::do_section_name): New function.
2933 (Sized_incr_relobj::do_section_contents): New function.
2934 (Sized_incr_relobj::do_section_flags): New function.
2935 (Sized_incr_relobj::do_section_entsize): New function.
2936 (Sized_incr_relobj::do_section_address): New function.
2937 (Sized_incr_relobj::do_section_type): New function.
2938 (Sized_incr_relobj::do_section_link): New function.
2939 (Sized_incr_relobj::do_section_info): New function.
2940 (Sized_incr_relobj::do_section_addralign): New function.
2941 (Sized_incr_relobj::do_initialize_xindex): New function.
2942 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
2943 (Sized_incr_relobj::do_read_relocs): New function.
2944 (Sized_incr_relobj::do_gc_process_relocs): New function.
2945 (Sized_incr_relobj::do_scan_relocs): New function.
2946 (Sized_incr_relobj::do_count_local_symbols): New function.
2947 (Sized_incr_relobj::do_finalize_local_symbols): New function.
2948 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
2949 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
2950 (Sized_incr_relobj::do_relocate): New function.
2951 (Sized_incr_relobj::do_set_section_offset): New function.
2952 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
2953 (Sized_incr_dynobj::do_read_symbols): New function.
2954 (Sized_incr_dynobj::do_layout): New function.
2955 (Sized_incr_dynobj::do_add_symbols): New function.
2956 (Sized_incr_dynobj::do_should_include_member): New function.
2957 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
2958 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
2959 (Sized_incr_dynobj::do_section_size): New function.
2960 (Sized_incr_dynobj::do_section_name): New function.
2961 (Sized_incr_dynobj::do_section_contents): New function.
2962 (Sized_incr_dynobj::do_section_flags): New function.
2963 (Sized_incr_dynobj::do_section_entsize): New function.
2964 (Sized_incr_dynobj::do_section_address): New function.
2965 (Sized_incr_dynobj::do_section_type): New function.
2966 (Sized_incr_dynobj::do_section_link): New function.
2967 (Sized_incr_dynobj::do_section_info): New function.
2968 (Sized_incr_dynobj::do_section_addralign): New function.
2969 (Sized_incr_dynobj::do_initialize_xindex): New function.
2970 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
2971 (make_sized_incremental_object): New function.
2972 (Incremental_library::copy_unused_symbols): New function.
2973 (Incremental_library::do_for_all_unused_symbols): New function.
2974 * incremental.h (enum Incremental_input_flags): New type.
2975 (class Incremental_checker): Remove.
2976 (Incremental_input_entry::Incremental_input_entry): Add argument
2977 serial number.
2978 (Incremental_input_entry::arg_serial): New function.
2979 (Incremental_input_entry::set_is_in_system_directory): New function.
2980 (Incremental_input_entry::is_in_system_directory): New function.
2981 (Incremental_input_entry::arg_serial_): New data member.
2982 (Incremental_input_entry::is_in_system_directory_): New data member.
2983 (class Script_info): Move here from script.h.
2984 (Script_info::Script_info): Add filename parameter.
2985 (Script_info::filename): New function.
2986 (Script_info::filename_): New data member.
2987 (Incremental_script_entry::Incremental_script_entry): Add argument
2988 serial number.
2989 (Incremental_object_entry::Incremental_object_entry): Likewise.
2990 (Incremental_object_entry::add_input_section): Build list of input
2991 sections with map to original shndx.
2992 (Incremental_object_entry::get_input_section_index): New function.
2993 (Incremental_object_entry::shndx_): New data member.
2994 (Incremental_object_entry::name_key_): Rename; adjust all refs.
2995 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
2996 (Incremental_archive_entry::Incremental_archive_entry): Add argument
2997 serial number.
2998 (Incremental_inputs::report_archive_begin): Likewise.
2999 (Incremental_inputs::report_object): Likewise.
3000 (Incremental_inputs::report_script): Likewise.
3001 (class Incremental_global_symbol_reader): New class.
3002 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
3003 and store flags and input file type.
3004 (Incremental_input_entry_reader::arg_serial): New function.
3005 (Incremental_input_entry_reader::type): Extract type from flags.
3006 (Incremental_input_entry_reader::is_in_system_directory): New function.
3007 (Incremental_input_entry_reader::get_input_section_count): Call
3008 accessor function for type.
3009 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
3010 function for type; adjust size of global symbol entry.
3011 (Incremental_input_entry_reader::get_global_symbol_count): Call
3012 accessor function for type.
3013 (Incremental_input_entry_reader::get_object_count): Likewise.
3014 (Incremental_input_entry_reader::get_object_offset): Likewise.
3015 (Incremental_input_entry_reader::get_member_count): Likewise.
3016 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
3017 (Incremental_input_entry_reader::get_member_offset): Likewise.
3018 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
3019 (Incremental_input_entry_reader::Global_symbol_info): Remove.
3020 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
3021 (Incremental_input_entry_reader::get_global_symbol_reader): New
3022 function.
3023 (Incremental_input_entry_reader::get_output_symbol_index): New
3024 function.
3025 (Incremental_input_entry_reader::type_): Remove.
3026 (Incremental_input_entry_reader::flags_): New data member.
3027 (Incremental_inputs_reader::input_file_offset): New function.
3028 (Incremental_inputs_reader::input_file_index): New function.
3029 (Incremental_inputs_reader::input_file): Call input_file_offset.
3030 (Incremental_inputs_reader::input_file_at_offset): New function.
3031 (Incremental_relocs_reader::get_r_type): Reformat.
3032 (Incremental_relocs_reader::get_r_shndx): Reformat.
3033 (Incremental_relocs_reader::get_r_offset): Reformat.
3034 (Incremental_relocs_reader::data): New function.
3035 (Incremental_binary::Incremental_binary): Initialize new data members.
3036 (Incremental_binary::check_inputs): Add cmdline parameter.
3037 (Incremental_binary::file_is_unchanged): Remove.
3038 (Input_reader::arg_serial): New function.
3039 (Input_reader::get_unused_symbol_count): New function.
3040 (Input_reader::get_unused_symbol): New function.
3041 (Input_reader::do_arg_serial): New function.
3042 (Input_reader::do_get_unused_symbol_count): New function.
3043 (Input_reader::do_get_unused_symbol): New function.
3044 (Incremental_binary::input_file_count): New function.
3045 (Incremental_binary::get_input_reader): Change signature to use
3046 index instead of filename.
3047 (Incremental_binary::file_has_changed): New function.
3048 (Incremental_binary::get_input_argument): New function.
3049 (Incremental_binary::get_library): New function.
3050 (Incremental_binary::get_script_info): New function.
3051 (Incremental_binary::init_layout): New function.
3052 (Incremental_binary::reserve_layout): New function.
3053 (Incremental_binary::output_file): New function.
3054 (Incremental_binary::do_check_inputs): New function.
3055 (Incremental_binary::do_file_is_unchanged): Remove.
3056 (Incremental_binary::do_file_has_changed): New function.
3057 (Incremental_binary::do_init_layout): New function.
3058 (Incremental_binary::do_reserve_layout): New function.
3059 (Incremental_binary::do_input_file_count): New function.
3060 (Incremental_binary::do_get_input_reader): Change signature.
3061 (Incremental_binary::input_args_map_): New data member.
3062 (Incremental_binary::library_map_): New data member.
3063 (Incremental_binary::script_map_): New data member.
3064 (Sized_incremental_binary::Sized_incremental_binary): Initialize
3065 new data members.
3066 (Sized_incremental_binary::output_section): New function.
3067 (Sized_incremental_binary::inputs_reader): Add const.
3068 (Sized_incremental_binary::symtab_reader): Add const.
3069 (Sized_incremental_binary::relocs_reader): Add const.
3070 (Sized_incremental_binary::got_plt_reader): Add const.
3071 (Sized_incremental_binary::get_symtab_view): New function.
3072 (Sized_incremental_binary::Inputs_reader): New typedef.
3073 (Sized_incremental_binary::Input_entry_reader): New typedef.
3074 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
3075 (Sized_incremental_binary::do_file_is_unchanged): Remove.
3076 (Sized_incremental_binary::do_file_has_changed): New function.
3077 (Sized_incremental_binary::do_init_layout): New function.
3078 (Sized_incremental_binary::do_reserve_layout): New function.
3079 (Sized_input_reader::Inputs_reader): Remove.
3080 (Sized_input_reader::Input_entry_reader): Remove.
3081 (Sized_input_reader::do_arg_serial): New function.
3082 (Sized_input_reader::do_get_unused_symbol_count): New function.
3083 (Sized_input_reader::do_get_unused_symbol): New function.
3084 (Sized_incremental_binary::do_input_file_count): New function.
3085 (Sized_incremental_binary::do_get_input_reader): Change signature;
3086 use index instead of filename.
3087 (Sized_incremental_binary::section_map_): New data member.
3088 (Sized_incremental_binary::input_entry_readers_): New data member.
3089 (class Sized_incr_relobj): New class.
3090 (class Sized_incr_dynobj): New class.
3091 (make_sized_incremental_object): New function.
3092 (class Incremental_library): New class.
3093 * layout.cc (Free_list::num_lists): New static data member.
3094 (Free_list::num_nodes): New static data member.
3095 (Free_list::num_removes): New static data member.
3096 (Free_list::num_remove_visits): New static data member.
3097 (Free_list::num_allocates): New static data member.
3098 (Free_list::num_allocate_visits): New static data member.
3099 (Free_list::init): New function.
3100 (Free_list::remove): New function.
3101 (Free_list::allocate): New function.
3102 (Free_list::dump): New function.
3103 (Free_list::print_stats): New function.
3104 (Layout_task_runner::run): Resize output file for incremental updates.
3105 (Layout::Layout): Initialize new data members.
3106 (Layout::set_incremental_base): New function.
3107 (Layout::init_fixed_output_section): New function.
3108 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
3109 incremental updates.
3110 (Layout::create_gold_note): Do not create gold note section for
3111 incremental updates.
3112 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
3113 for incremental updates.
3114 (Layout::set_section_offsets): For incremental updates, allocate space
3115 from free list.
3116 (Layout::create_symtab_sections): Layout with offsets relative to
3117 start of section; for incremental updates, allocate space from free
3118 list.
3119 (Layout::create_shdrs): For incremental updates, allocate space from
3120 free list.
3121 (Layout::finish_dynamic_section): For incremental updates, do not
3122 check --as-needed (fixed in subsequent patch).
3123 * layout.h (class Free_list): New class.
3124 (Layout::set_incremental_base): New function.
3125 (Layout::incremental_base): New function.
3126 (Layout::init_fixed_output_section): New function.
3127 (Layout::allocate): New function.
3128 (Layout::incremental_base_): New data member.
3129 (Layout::free_list_): New data member.
3130 * main.cc (main): Print Free_list statistics.
3131 * object.cc (Relobj::finalize_incremental_relocs): Add
3132 clear_counts parameter; clear counts only when clear_counts is set.
3133 (Sized_relobj::Sized_relobj): Initialize new base class.
3134 (Sized_relobj::do_layout): Don't report special sections.
3135 (Sized_relobj::do_for_all_local_got_entries): New function.
3136 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
3137 symtab_off to all symbol table offsets.
3138 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
3139 * object.h (class Got_offset_list): Move to top of file.
3140 (Object::Object): Allow case where input_file == NULL.
3141 (Object::~Object): Likewise.
3142 (Object::input_file): Assert that input_file != NULL.
3143 (Object::lock): Allow case where input_file == NULL.
3144 (Object::unlock): Likewise.
3145 (Object::is_locked): Likewise.
3146 (Object::token): Likewise.
3147 (Object::release): Likewise.
3148 (Object::is_incremental): New function.
3149 (Object::get_mtime): New function.
3150 (Object::for_all_local_got_entries): New function.
3151 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
3152 (Object::set_is_in_system_directory): New function.
3153 (Object::is_in_system_directory): New function.
3154 (Object::do_is_incremental): New function.
3155 (Object::do_get_mtime): New function.
3156 (Object::do_for_all_local_got_entries): New function.
3157 (Object::is_in_system_directory_): New data member.
3158 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
3159 (class Sized_relobj_base): New class.
3160 (class Sized_relobj): Derive from Sized_relobj_base.
3161 (class Sized_relobj::Symbols): Redeclare from base class.
3162 (class Sized_relobj::local_got_offset_list): Remove.
3163 (class Sized_relobj::Output_sections): Redeclare from base class.
3164 (class Sized_relobj::do_for_all_local_got_entries): New function.
3165 (class Sized_relobj::write_local_symbols): Add offset parameter.
3166 (class Sized_relobj::local_symbol_offset_): Update comment.
3167 (class Sized_relobj::local_dynsym_offset_): Update comment.
3168 * options.cc (Input_arguments::add_file): Remove const.
3169 * options.h (Input_file_argument::Input_file_argument):
3170 Initialize arg_serial_ (all constructors).
3171 (Input_file_argument::set_arg_serial): New function.
3172 (Input_file_argument::arg_serial): New function.
3173 (Input_file_argument::arg_serial_): New data member.
3174 (Input_arguments::Input_arguments): Initialize file_count_.
3175 (Input_arguments::add_file): Remove const.
3176 (Input_arguments::number_of_input_files): New function.
3177 (Input_arguments::file_count_): New data member.
3178 (Command_line::number_of_input_files): Call
3179 Input_arguments::number_of_input_files.
3180 * output.cc (Output_segment_headers::Output_segment_headers):
3181 Set current size.
3182 (Output_section::Input_section::current_data_size): New function.
3183 (Output_section::Output_section): Initialize new data members.
3184 (Output_section::add_input_section): Don't do merge sections for
3185 an incremental link; allocate space from free list for an
3186 incremental update.
3187 (Output_section::add_output_section_data): Allocate space from
3188 free list for an incremental update.
3189 (Output_section::update_data_size): New function.
3190 (Output_section::set_fixed_layout): New function.
3191 (Output_section::reserve): New function.
3192 (Output_segment::set_section_addresses): Remove const.
3193 (Output_segment::set_section_list_addresses): Remove const; allocate
3194 space from free list for an incremental update.
3195 (Output_segment::set_offset): Adjust size of RELRO segment for an
3196 incremental update.
3197 * output.h (Output_data::current_data_size): Move here from
3198 child classes.
3199 (Output_data::pre_finalize_data_size): New function.
3200 (Output_data::update_data_size): New function.
3201 (Output_section_headers::update_data_size): new function.
3202 (Output_section_data_build::current_data_size): Move to Output_data.
3203 (Output_data_strtab::update_data_size): New function.
3204 (Output_section::current_data_size): Move to Output_data.
3205 (Output_section::set_fixed_layout): New function.
3206 (Output_section::has_fixed_layout): New function.
3207 (Output_section::reserve): New function.
3208 (Output_section::update_data_size): New function.
3209 (Output_section::has_fixed_layout_): New data member.
3210 (Output_section::free_list_): New data member.
3211 (Output_segment::set_section_addresses): Remove const.
3212 (Output_segment::set_section_list_addresses): Remove const.
3213 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
3214 New function.
3215 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
3216 New function.
3217 * readsyms.cc (Read_symbols::do_read_symbols): Add library
3218 parameter when calling Add_symbols constructor; store argument
3219 serial number for members of a lib group.
3220 (Add_symbols::locks): Allow case where token == NULL.
3221 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
3222 (Read_member::~Read_member): New function.
3223 (Read_member::is_runnable): New function.
3224 (Read_member::locks): New function.
3225 (Read_member::run): New function.
3226 (Check_script::~Check_script): New function.
3227 (Check_script::is_runnable): New function.
3228 (Check_script::locks): New function.
3229 (Check_script::run): New function.
3230 (Check_library::~Check_library): New function.
3231 (Check_library::is_runnable): New function.
3232 (Check_library::locks): New function.
3233 (Check_library::run): New function.
3234 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
3235 (Add_symbols::library_): New data member.
3236 (class Read_member): New class.
3237 (class Check_script): New class.
3238 (class Check_library): New class.
3239 * reloc.cc (Read_relocs::is_runnable): Allow case where
3240 token == NULL.
3241 (Read_relocs::locks): Likewise.
3242 (Scan_relocs::locks): Likewise.
3243 (Relocate_task::locks): Likewise.
3244 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
3245 to clear counters.
3246 (Sized_relobj::incremental_relocs_scan): Fix comment.
3247 (Sized_relobj::do_relocate): Pass output file offset to
3248 write_local_symbols.
3249 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
3250 from class declaration.
3251 * script.cc (read_input_script): Allocate Script_info; pass
3252 argument serial number to report_script.
3253 * script.h (class Script_info): Move to incremental.h.
3254 * symtab.cc (Symbol_table::add_from_incrobj): New function.
3255 * symtab.h (Symbol_table::add_from_incrobj): New function.
3256 (Symbol_table::set_file_offset): New function.
3257
b961d0d7
CC
32582011-04-05 Cary Coutant <ccoutant@google.com>
3259
3260 * incremental-dump.cc (dump_incremental_inputs): Change signature
3261 to take a Sized_incremental_binary; change caller. Use readers
3262 in Sized_incremental_binary.
3263 * incremental.cc
3264 (Sized_incremental_binary::find_incremental_inputs_sections):
3265 Rename do_find_incremental_inputs_sections to this.
3266 (Sized_incremental_binary::setup_readers): New function.
3267 (Sized_incremental_binary::do_check_inputs): Check
3268 has_incremental_info_ flag; move setup code to setup_readers;
3269 use input readers.
3270 (Sized_incremental_binary::do_file_is_unchanged): New function.
3271 (Sized_incremental_binary::do_get_input_reader): New function.
3272 * incremental.h (class Incremental_binary): Move to end of file.
3273 (Incremental_binary::file_is_unchanged): New function.
3274 (Incremental_binary::do_file_is_unchanged): New function.
3275 (Incremental_binary::Input_reader): New class.
3276 (Incremental_binary::get_input_reader): New function.
3277 (class Sized_incremental_binary): Move to end of file.
3278 (Sized_incremental_binary::Sized_incremental_binary): Setup the
3279 input section reader classes.
3280 (Sized_incremental_binary::has_incremental_info): New function.
3281 (Sized_incremental_binary::inputs_reader): New function.
3282 (Sized_incremental_binary::symtab_reader): New function.
3283 (Sized_incremental_binary::relocs_reader): New function.
3284 (Sized_incremental_binary::got_plt_reader): New function.
3285 (Sized_incremental_binary::do_file_is_unchanged): New function.
3286 (Sized_incremental_binary::Sized_input_reader): New class.
3287 (Sized_incremental_binary::get_input_reader): New function.
3288 (Sized_incremental_binary::find_incremental_inputs_sections):
3289 Rename do_find_incremental_inputs_sections to this.
3290 (Sized_incremental_binary::setup_readers): New function.
3291 (Sized_incremental_binary::has_incremental_info_): New data member.
3292 (Sized_incremental_binary::inputs_reader_): New data member.
3293 (Sized_incremental_binary::symtab_reader_): New data member.
3294 (Sized_incremental_binary::relocs_reader_): New data member.
3295 (Sized_incremental_binary::got_plt_reader_): New data member.
3296 (Sized_incremental_binary::current_input_file_): New data member.
3297
a869183f
PP
32982011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
3299
3300 PR gold/12640
3301 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
3302 violation.
3303
33042011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
3305
3306 * archive.cc (Archive::include_member): Adjust call to report_object.
3307 (Add_archive_symbols::run): Add script_info to call to
3308 report_archive_begin.
3309 (Lib_group::include_member): Adjust call to report_object.
3310 (Add_lib_group_symbols::run): Adjust call to report_object.
3311 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
3312 blocks. Add object count for script input files.
3313 * incremental.cc (Incremental_inputs::report_archive_begin): Add
3314 script_info parameter; change all callers.
3315 (Incremental_inputs::report_object): Add script_info parameter;
3316 change all callers.
3317 (Incremental_inputs::report_script): Store backpointer to
3318 incremental info entry.
3319 (Output_section_incremental_inputs::set_final_data_size): Record
3320 additional information for scripts.
3321 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3322 * incremental.h (Incremental_script_entry::add_object): New function.
3323 (Incremental_script_entry::get_object_count): New function.
3324 (Incremental_script_entry::get_object): New function.
3325 (Incremental_script_entry::objects_): New data member; adjust
3326 constructor.
3327 (Incremental_inputs::report_archive_begin): Add script_info parameter.
3328 (Incremental_inputs::report_object): Add script_info parameter.
3329 (Incremental_inputs_reader::get_object_count): New function.
3330 (Incremental_inputs_reader::get_object_offset): New function.
3331 * options.cc (Input_arguments::add_file): Return reference to
3332 new input argument.
3333 * options.h (Input_argument::set_script_info): New function.
3334 (Input_argument::script_info): New function.
3335 (Input_argument::script_info_): New data member; adjust all
3336 constructors.
3337 (Input_file_group::add_file): Return reference to new input argument.
3338 (Input_file_lib::add_file): Likewise.
3339 (Input_arguments::add_file): Likewise.
3340 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
3341 * script.cc (Parser_closure::Parser_closure): Add script_info
3342 parameter; adjust all callers.
3343 (Parser_closure::script_info): New function.
3344 (Parser_closure::script_info_): New data member.
3345 (read_input_script): Report scripts earlier to incremental info.
3346 (script_add_file): Set script_info in Input_argument.
3347 (script_add_library): Likewise.
3348 * script.h (Script_options::Script_info): Rewrite class.
3349
a869183f 33502011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
3351
3352 * archive.cc (Library_base::should_include_member): Move
3353 method here from class Archive.
3354 (Archive::Archive): Initialize base class.
3355 (Archive::should_include_member): Move to base class.
3356 (Archive::do_for_all_unused_symbols): New function.
3357 (Add_archive_symbols::run): Remove redundant access to
3358 incremental_inputs.
3359 (Lib_group::Lib_group): Initialize base class.
3360 (Lib_group::do_filename): New function.
3361 (Lib_group::include_member): Pass pointer to Lib_group to
3362 report_object.
3363 (Lib_group::do_for_all_unused_symbols): New function.
3364 (Add_lib_group_symbols::run): Report archive information for
3365 incremental links.
3366 * archive.h (class Library_base): New base class.
3367 (class Archive): Derive from Library_base.
3368 (Archive::filename): Move to base class.
3369 (Archive::set_incremental_info): Likewise.
3370 (Archive::incremental_info): Likewise.
3371 (Archive::Should_include): Likewise.
3372 (Archive::should_include_member): Likewise.
3373 (Archive::Armap_entry): Remove.
3374 (Archive::Unused_symbol_iterator): Remove.
3375 (Archive::unused_symbols_begin): Remove.
3376 (Archive::unused_symbols_end): Remove.
3377 (Archive::do_filename): New function.
3378 (Archive::do_get_mtime): New function.
3379 (Archive::do_for_all_unused_symbols): New function.
3380 (Archive::task_): Move to base class.
3381 (Archive::incremental_info_): Likewise.
3382 (class Lib_group): Derive from Library_base.
3383 (Lib_group::do_filename): New function.
3384 (Lib_group::do_get_mtime): New function.
3385 (Lib_group::do_for_all_unused_symbols): New function.
3386 (Lib_group::task_): Move to base class.
3387 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
3388 function.
3389 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
3390 function.
3391 * incremental.cc (Incremental_inputs::report_archive_begin):
3392 Use Library_base; call library's get_mtime; add incremental inputs
3393 entry before members.
3394 (class Unused_symbol_visitor): New class.
3395 (Incremental_inputs::report_archive_end): Use Library_base; use
3396 visitor class to record unused symbols; don't add incremental inputs
3397 entry after members.
3398 (Incremental_inputs::report_object): Use Library_base.
3399 * incremental.h
3400 (Incremental_archive_entry::Incremental_archive_entry): Remove
3401 unused Archive parameter.
3402 (Incremental_inputs::report_archive_begin): Use Library_base.
3403 (Incremental_inputs::report_archive_end): Likewise.
3404 (Incremental_inputs::report_object): Likewise.
3405 * object.cc (Sized_relobj::do_for_all_global_symbols): New
3406 function.
3407 * object.h (Object::for_all_global_symbols): New function.
3408 (Object::do_for_all_global_symbols): New function.
3409 (Sized_relobj::do_for_all_global_symbols): New function.
3410 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
3411 function.
3412 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
3413 function.
3414
61ab3e40
ILT
34152011-03-27 Ian Lance Taylor <iant@google.com>
3416
3417 * archive.cc (Archive::interpret_header): Return -1 if something
3418 goes wrong. Change callers accordingly.
3419
30e1f9e6
CC
34202011-03-25 Cary Coutant <ccoutant@google.com>
3421
3422 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
3423 * testsuite/Makefile.in: Regenerate.
3424
9370ce59 34252011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
3426
3427 * plugin.cc (get_view): New.
3428 (Plugin::load): Pass get_view to the plugin.
3429 (Plugin_manager::get_view): New.
3430
9312bb0a
ILT
34312011-03-21 Ian Lance Taylor <iant@google.com>
3432
3433 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 3434 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 3435
7e12ba9e
ST
34362011-03-21 Sriraman Tallam <tmsriram@google.com>
3437
3438 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
3439 Change == to -eq.
3440 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
3441 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
3442 Change == to -eq.
3443 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
3444 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
3445
fd7a005d
ILT
34462011-03-14 Ian Lance Taylor <iant@google.com>
3447
3448 * script-sections.cc (Sort_output_sections::script_compare):
3449 Rename from is_before, change return type.
3450 (Sort_output_sections::operator()): Adjust accordingly.
3451
ed16fd1b
ILT
34522011-03-11 Jeffrey Yasskin <jyasskin@google.com>
3453
3454 PR gold/12572
3455 * testsuite/odr_violation2.cc: Add comment to make all error line
3456 numbers double digits.
3457 * testsuite/debug_msg.sh: Adjust expected errors.
3458
71ff8986
ILT
34592011-03-09 Jeffrey Yasskin <jyasskin@google.com>
3460
3461 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
3462 but mark earlier ones as non-canonical
3463 (offset_to_iterator): Update search target and example
3464 (do_addr2line): Return extra lines in a vector*
3465 (format_file_lineno): Extract from do_addr2line
3466 (one_addr2line): Add vector* out-param
3467 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
3468 when a lineno entry appeared last for its instruction
3469 (Dwarf_line_info): Add vector* out-param
3470 * object.cc (Relocate_info): Pass NULL for the vector* out-param
3471 * symtab.cc (Odr_violation_compare): Include the lineno in the
3472 comparison again.
3473 (linenos_from_loc): New. Combine the canonical line for an
3474 address with its other lines.
3475 (True_if_intersect): New. Helper functor to make
3476 std::set_intersection a query.
3477 (detect_odr_violations): Compare sets of lines instead of just
3478 one line for each function. This became less deterministic, but
3479 has fewer false positives.
3480 * symtab.h: Declarations.
3481 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
3482 mix an optimized and non-optimized object in the same binary
3483 (odr_violation2.so): Same.
3484 * testsuite/Makefile.in: Regenerate from Makefile.am.
3485 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
3486 * testsuite/debug_msg.sh: Update line numbers and add
3487 assertions.
3488 * testsuite/odr_violation1.cc: Use OdrDerived, in a
3489 non-optimized context.
3490 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
3491 isn't inlined, and use OdrDerived in an optimized context.
3492 * testsuite/odr_header1.h: Defines OdrDerived, where
3493 optimization will change the
3494 first-instruction-in-the-destructor's file and line number.
3495 * testsuite/odr_header2.h: Defines OdrBase.
3496
a19fefdc
ILT
34972011-03-09 Ian Lance Taylor <iant@google.com>
3498
3499 * fileread.cc (File_read::clear_views): Don't delete the whole
3500 file view.
3501
ecb351e9
ILT
35022011-03-08 Ian Lance Taylor <iant@google.com>
3503
3504 PR gold/12525
3505 * fileread.cc: #include <climits>.
3506 (GOLD_IOV_MAX): Define.
3507 (File_read::read_multiple): Limit number of entries by iov_max.
3508 * fileread.h (class File_read): Always set max_readv_entries to
3509 128.
3510
b821d13c
ILT
35112011-03-07 Ian Lance Taylor <iant@google.com>
3512
3513 PR gold/12525
3514 * options.h (class General_options): Add -dy and -dn.
3515
89243142
CC
35162011-03-02 Cary Coutant <ccoutant@google.com>
3517
3518 * testsuite/script_test_9.t: Add TLS segment.
3519
d0773f31
ILT
35202011-03-02 Simon Baldwin <simonb@google.com>
3521
3522 * configure.ac: Add check for gnu_indirect_function support in
3523 the toolchain building binutils.
3524 * configure: Rebuild.
3525
9370ce59 35262011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
3527
3528 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
3529 plugin only symbols.
3530 (Symbol_table::sized_finalize_symbol) Mark symbol only present
3531 in plugin files as not needed in the symbol table.
3532
4cf7a849
ST
35332011-02-11 Sriraman Tallam <tmsriram@google.com>
3534
3535 * output.cc (Output_section::add_input_section): Delay fill
3536 generation for section ordering.
3537
b578bd7d
ILT
35382011-02-09 Ian Lance Taylor <iant@google.com>
3539
3540 PR gold/12316
3541 * object.h (class Sized_relobj): Remove clear_local_symbols.
3542 * reloc.cc (Sized_relobj::do_relocate): Don't call
3543 clear_local_symbols.
3544
9370ce59 35452011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
3546
3547 * plugin.cc (is_visible_from_outside): Return true for symbols
3548 in the -u option.
3549
55382fb7
ILT
35502011-02-04 Jeffrey Yasskin <jyasskin@google.com>
3551
3552 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
3553 filename.
3554
4e271fff
ST
35552011-02-02 Sriraman Tallam <tmsriram@google.com>
3556
3557 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 3558 to std::string.
4e271fff 3559 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 3560 section_name to be std::string.
4e271fff
ST
3561 (is_function_ctor_or_dtor): Change type of parameter to std::string.
3562
d433c3ac
ILT
35632011-01-25 Ian Lance Taylor <iant@google.com>
3564
3565 * script.cc (script_add_extern): Rewrite to use
3566 add_symbol_reference.
3567
880473a6
DK
35682011-01-25 Doug Kwan <dougkwan@google.com>
3569
d433c3ac 3570 * icf.cc (get_section_contents): Always lock section's object.
880473a6 3571
f30f86fa
ILT
35722011-01-24 Ian Lance Taylor <iant@google.com>
3573
3574 * options.h (class General_options): Accept
3575 --no-detect-odr-violations.
3576
8e51a0b9
ILT
35772011-01-24 Ian Lance Taylor <iant@google.com>
3578
3579 * version.cc (version_string): Bump to 1.11.
3580
0f3b89d8
ILT
35812011-01-24 Ian Lance Taylor <iant@google.com>
3582
3583 * plugin.cc (class Plugin_rescan): Define new class.
3584 (Plugin_manager::claim_file): Set any_claimed_.
3585 (Plugin_manager::save_archive): New function.
3586 (Plugin_manager::save_input_group): New function.
3587 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
3588 necessary.
3589 (Plugin_manager::new_undefined_symbol): New function.
3590 (Plugin_manager::rescan): New function.
3591 (Plugin_manager::rescannable_defines): New function.
3592 (Plugin_manager::add_input_file): Set any_added_.
3593 * plugin.h (class Plugin_manager): define new fields rescannable_,
3594 undefined_symbols_, any_claimed_, and any_added_. Declare
3595 Plugin_rescan as friend. Declare new functions.
3596 (Plugin_manager::Rescannable): Define type.
3597 (Plugin_manager::Rescannable_list): Define type.
3598 (Plugin_manager::Undefined_symbol_list): Define type.
3599 (Plugin_manager::Plugin_manager): Initialize new fields.
3600 * archive.cc (Archive::defines_symbol): New function.
3601 (Add_archive_symbols::run): Pass archive to plugins if any.
3602 * archive.h (class Archive): Declare defines_symbol.
3603 * readsyms.cc (Input_group::~Input_group): New function.
3604 (Finish_group::run): Pass input_group to plugins if any.
3605 * readsyms.h (class Input_group): Declare destructor.
3606 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
3607 any.
3608
3bb951e5
ILT
36092011-01-10 Ian Lance Taylor <iant@google.com>
3610
3611 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
3612 section as relro.
3613 (Layout::set_segment_offsets): Reset increase_relro before calling
3614 set_section_addresses a second time.
3615
0aa45fac
CC
36162011-01-04 Cary Coutant <ccoutant@google.com>
3617
3618 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
3619 sections before NOBITS sections.
3620
0db46eb4
L
36212011-01-01 H.J. Lu <hongjiu.lu@intel.com>
3622
3623 * version.cc (print_version): Update copyright to 2011.
3624
829c9745
CC
36252010-12-23 Cary Coutant <ccoutant@google.com>
3626
3627 * output.h (Output_data_reloc::add_output_section): Pass OD instead
3628 of OS to this->add. Add OD parameter to second form of the function.
3629
7500420b
ILT
36302010-12-20 Ian Lance Taylor <iant@google.com>
3631
3632 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
3633 second of two consecutive entries with same offset.
3634
f8e9a930
RW
36352010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3636
3637 * testsuite/Makefile.am (ifuncmain2static_LDADD)
3638 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
3639 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
3640 to avoid unneeded links against $(LDADD).
3641 * testsuite/Makefile.in: Regenerate.
3642
2fbb4320
ILT
36432010-12-15 Ian Lance Taylor <iant@google.com>
3644
3645 PR gold/12324
3646 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
3647 for R_X86_64_32 and R_X86_64_PC32.
3648 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
3649 ver_matching_def_pic.o.
3650 (ver_matching_def_pic.o): New target.
3651
fedb228d
RW
36522010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3653
3654 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
3655 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
3656 Move definition before File_read::View member definitions.
3657 (File_read::View::~View): Initialize and hold lock before
3658 updating current_mapped_bytes.
3659
9b547ce6
RW
36602010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3661
3662 * dwarf_reader.cc: Remove outdated comment.
3663 * gold-threads.cc: Fix typo in error message.
3664 * archive.cc: Fix typos in comments.
3665 * archive.h: Likewise.
3666 * arm-reloc-property.cc: Likewise.
3667 * arm-reloc-property.h: Likewise.
3668 * arm-reloc.def: Likewise.
3669 * arm.cc: Likewise.
3670 * attributes.h: Likewise.
3671 * cref.cc: Likewise.
3672 * ehframe.cc: Likewise.
3673 * fileread.h: Likewise.
3674 * gold.h: Likewise.
3675 * i386.cc: Likewise.
3676 * icf.cc: Likewise.
3677 * incremental.h: Likewise.
3678 * int_encoding.cc: Likewise.
3679 * layout.h: Likewise.
3680 * main.cc: Likewise.
3681 * merge.h: Likewise.
3682 * object.cc: Likewise.
3683 * object.h: Likewise.
3684 * options.cc: Likewise.
3685 * readsyms.cc: Likewise.
3686 * reduced_debug_output.cc: Likewise.
3687 * reloc.cc: Likewise.
3688 * script-sections.cc: Likewise.
3689 * sparc.cc: Likewise.
3690 * symtab.h: Likewise.
3691 * target-reloc.h: Likewise.
3692 * target.cc: Likewise.
3693 * target.h: Likewise.
3694 * timer.cc: Likewise.
3695 * timer.h: Likewise.
3696 * x86_64.cc: Likewise.
3697
83e17bd5
CC
36982010-12-09 Cary Coutant <ccoutant@google.com>
3699
3700 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
3701 stack.
3702 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
3703 parameter; change all callers.
3704 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
3705 * options.h (warn_execstack): New option.
3706
017257f8
DK
37072010-12-07 Doug Kwan <dougkwan@google.com>
3708
3709 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
3710 like function call relocations.
3711
c20cbc06
ILT
37122010-12-07 Ian Lance Taylor <iant@google.com>
3713
3714 * archive.cc (Archive::get_elf_object_for_member): Permit
3715 punconfigured to be NULL.
3716 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
3717 (Archive::include_member): Pass NULL to get_elf_object_for_member
3718 if we searched for the archive and this is the first included
3719 object.
3720
4dbfafcc
ILT
37212010-12-01 Ian Lance Taylor <iant@google.com>
3722
3723 * dwarf_reader.h (class Sized_dwarf_line_info): Add
3724 track_relocs_type_ field.
3725 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3726 Set track_relocs_type_.
3727 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
3728 contents when using RELA relocs.
3729 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
3730 reloc_map_.
3731 * reloc.cc (Track_relocs::next_addend): New function.
3732 * reloc.h (class Track_relocs): Declare next_addend.
3733
e5e19edd
ILT
37342010-12-01 Ian Lance Taylor <iant@google.com>
3735
3736 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
3737 virtual destructor.
3738
9a5ce24c
ILT
37392010-12-01 Ian Lance Taylor <iant@google.com>
3740
3741 * README: Update compilers known to work and fail.
3742
c7791212
NC
37432010-11-23 Matthias Klose <doko@ubuntu.com>
3744
3745 * configure.in: For --enable-gold, handle value `default' instead of
3746 `both*'. Always install ld as ld.bfd, install as ld if gold is
3747 not the default.
3748 * configure: Regenerate.
3749
0ad220c9
DK
37502010-11-18 Doug Kwan <dougkwan@google.com>
3751
3752 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
3753 and right_alignment to be zero. Store result alignment only if it is
3754 greater than existing alignment.
3755
ab8056e0
CC
37562010-11-16 Cary Coutant <ccoutant@google.com>
3757
3758 PR gold/12220
3759 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3760 Check for ".zdebug_line".
3761
fd064a5b
CC
37622010-11-16 Doug Kwan <dougkwan@google.com>
3763 Cary Coutant <ccoutant@google.com>
3764
3765 * output.h (Output_segment::set_section_addresses): Pass increase_relro
3766 by reference; adjust all callers.
3767 * output.cc (Output_segment::set_section_addresses): Adjust references
3768 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
3769 list is empty.
3770 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
3771 end at page boundary.
3772
6fc6ea19
CC
37732010-11-16 Cary Coutant <ccoutant@google.com>
3774
3775 PR gold/12220
3776 * layout.cc (Layout::choose_output_section): Transform names of
3777 compressed sections even when using a script with a SECTIONS clause.
3778 (Layout::output_section_name): Remove code to transform
3779 compressed debug section names.
3780 * output.cc (Output_section::add_input_section): Use uncompressed
3781 section size when tracking input sections.
3782
95a2c8d6
RS
37832010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
3784
3785 * symtab.h (Symbol::NON_PIC_REF): Remove.
3786 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
3787 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
3788 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
3789 (Symbol::use_plt_offset): Take a flags argument and pass it
3790 directly to needs_dynamic_reloc. Restrict check for undefined
3791 weak symbols to function calls.
3792 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
3793 (Target_arm::Scan::global): Use it.
3794 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
3795 (Target_arm::Relocate::relocate): Likewise.
3796 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
3797 parameter with an r_type parameter. Use get_reference_flags
3798 to get the flags.
3799 (Target_arm::Relocate::relocate): Update accordingly.
3800 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
3801 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
3802 (Target_i386::Scan::global): Likewise.
3803 (Target_i386::Relocate::relocate): Likewise.
3804 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
3805 parameter with an r_type parameter. Use get_reference_flags
3806 to get the flags.
3807 (Target_i386::Relocate::relocate): Update accordingly.
3808 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
3809 (Target_powerpc::Scan::global): Use it.
3810 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
3811 (Target_powerpc::Relocate::relocate): Likewise.
3812 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
3813 (Target_sparc::Scan::global): Use it.
3814 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
3815 (Target_sparc::Relocate::relocate): Likewise.
3816 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
3817 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
3818 (Target_x86_64::Scan::global): Likewise.
3819 (Target_x86_64::Relocate::relocate): Likewise.
3820
f625ae50
DK
38212010-11-08 Doug Kwan <dougkwan@google.com>
3822 Cary Coutant <ccoutant@google.com>
3823
3824 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
3825 (Arm_exidx_merge_section::section_contents_): New data member.
3826 (Arm_input_section::Arm_input_section): Initialize original_contents_.
3827 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 3828 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
3829 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
3830 in parameters instead of calling Object::section_contents without
3831 locking.
3832 (Arm_output_section::group_section): New parameter TASK. Pass it
3833 to callees that need locking objects.
3834 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
3835 to lock EXIDX input sections. Fix a formatting issue. Call
3836 Arm_exidx_merged_section::build_contents to create merged section
3837 contents.
3838 (Arm_output_section::create_stub_group): New parameter TASK. Use it
3839 to lock object of stub table owner.
3840 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
3841 TEXT_SIZE to initialize data member TEXT_SIZE_.
3842 (Arm_exidx_input_section::addralign): Fix typo in comment.
3843 (Arm_exidx_input_section::text_size): New method.
3844 (Target_arm::do_relax): New parameter TASK. Pass it to callees
3845 that require locking objects. Lock objects before scanning for stubs
3846 and updating local symbols.
3847 (Arm_input_section<big_endian>::init): Copy contents of original
3848 input section.
2e702c99 3849 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
3850 original input section instead of calling Object::section_contents
3851 without locking.
3852 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
3853 size without calling Object::section_size().
3854 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
3855 for size. Allocate a buffer for merged EXIDX entries.
3856 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 3857 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
3858 building code to Arm_exidx_merged_section::build_contetns. Write
3859 out contetns in buffer instead of building it on the fly.
3860 (Arm_relobj::make_exidx_input_section): Also pass text section size
3861 to Arm_exidx_input_section constructor.
3862 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
3863 (Arm_dynobj::do_read_symbols): Fix memory leak.
3864 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
3865 * target.h: (class Task): Add forward declaration.
3866 (Target::relax): Add new parameter TASK and pass it to
3867 Target::do_relax().
3868 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
3869
5f9bcf58
CC
38702010-11-05 Cary Coutant <ccoutant@google.com>
3871
3872 PR gold/10708
3873 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
3874 object when reading from the file.
3875 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
3876 second layout pass.
3877 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
3878 when reading section contents.
3879 (get_section_contents): Likewise.
3880 (icf::find_identical_sections): Likewise.
3881 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
3882 object when reading from the file.
3883 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
3884 the object when doing deferred section layout.
3885
e597fa08
NC
38862010-11-03 Nick Clifton <nickc@redhat.com>
3887
3888 PR gold/12001
3889 * script.h (class Symbol_assignment: name): New member. Returns
3890 the name of the symbol.
3891 * scrfipt.cc (Script_options::is_pending_assignment): New member.
3892 Returns true if the given symbol name is on the list of
3893 assignments wating to be processed.
3894 * archive.cc (should_incldue_member): If the symbol is undefined,
3895 check to see if it is on the list of symbols pending assignment.
3896
3f9a3278
ILT
38972010-11-03 Ryan Mansfield <rmansfield@qnx.com>
3898
3899 * script-sections.cc (Script_sections::find_memory_region): Check
3900 for a NULL output section pointer.
3901
d06fb4d1
DK
39022010-10-29 Doug Kwan <dougkwan@google.com>
3903
3904 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
3905 Output_section::add_relaxed_input_section.
3906 * output.cc (Output_section::add_relaxed_input_section): Add new
3907 arguments LAYOUT and NAME. Set section order index.
3908 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
3909 Copy section order index.
3910 * output.h (Output_section::add_relaxed_input_section): Add new
3911 arguments LAYOUT and NAME.
3912
90e24de5
ILT
39132010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3914
3915 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 3916 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
3917 * testsuite/Makefile.in: Regenerate.
3918
c9484ea5
DK
39192010-10-20 Doug Kwan <dougkwan@google.com>
3920
3921 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
3922 without SHF_LINK_ORDER flags.
3923 * layout.cc (Layout::choose_output_section): Do not filter
3924 SHF_LINK_ORDER flag in a relocatable link.
3925
5bc2f5be
CC
39262010-10-17 Cary Coutant <ccoutant@google.com>
3927
3928 * output.h (Output_segment::set_section_addresses): Change function
3929 signature. Update all callers.
3930 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
3931 sections.
3932 (Output_segment::set_section_addresses): Align after last TLS
3933 section. Add padding before last relro section instead of after.
3934
0c91cf04
DK
39352010-10-17 Doug Kwan <dougkwan@google.com>
3936
3937 * gold/arm.cc (Target_arm::got_section): Use correct order and set
3938 GOT output section to be writable.
3939
8c21d9d3
CC
39402010-10-14 Cary Coutant <ccoutant@google.com>
3941
3942 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
3943 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
3944 * gold.cc (queue_initial_tasks): Check parameters for incremental link
3945 mode.
3946 * incremental.cc (report_command_line): Ignore all forms of
3947 --incremental.
3948 * layout.cc (Layout::Layout): Check parameters for incremental link
3949 mode.
3950 * options.cc (General_options::parse_incremental): New function.
3951 (General_options::parse_no_incremental): New function.
3952 (General_options::parse_incremental_full): New function.
3953 (General_options::parse_incremental_update): New function.
3954 (General_options::incremental_mode_): New data member.
3955 (General_options::finalize): Check incremental_mode_.
3956 * options.h (General_options): Update help text for --incremental.
3957 Add --no-incremental, --incremental-full, --incremental-update.
3958 (General_options::Incremental_mode): New enum type.
3959 (General_options::incremental_mode): New function.
3960 (General_options::incremental_mode_): New data member.
3961 * parameters.cc (Parameters::incremental_mode_): New data member.
3962 (Parameters::set_options): Set incremental_mode_.
3963 (Parameters::set_incremental_full): New function.
3964 (Parameters::incremental): New function.
3965 (Parameters::incremental_update): New function.
3966 (set_parameters_incremental_full): New function.
3967 * parameters.h (Parameters::set_incremental_full): New function.
3968 (Parameters::incremental): New function.
3969 (Parameters::incremental_update): New function.
3970 (Parameters::incremental_mode_): New data member.
3971 (set_parameters_incremental_full): New function.
3972 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
3973 incremental link mode.
3974 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
3975 (Sized_relobj::do_relocate_sections): Likewise.
3976 * testsuite/Makefile.am (incremental_test): Use --incremental-full
3977 option.
3978 * testsuite/Makefile.in: Regenerate.
3979 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 3980
bb32aa18 39812010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
3982
3983 * script-sections.h (class Script_sections): Make
3984 Sections_elements typedef public.
3985 * script-sections.cc (class Sort_output_sections): Add elements_
3986 field. Add constructor which sets it; change all callers.
3987 (Sort_output_sections::is_before): New function.
3988 (Sort_output_sections::operator()): Call is_before.
3989 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
3990 conditional.
3991 * testsuite/script_test_10.sh: New test. Test script section
3992 order.
3993 * testsuite/script_test_10.t: Likewise.
3994 * testsuite/script_test_10.s: Likewise.
3995 * testsuite/Makefile.am: Wrap the cross linker tests and the
3996 common tests into NATIVE_OR_CROSS_LINKER.
3997 (check_SCRIPTS): Add script_test_10.sh.
3998 (check_DATA): Add script_test_10.stdout.
3999 (script_test_10.o, script_test_10): New targets.
4000 (script_test_10.stdout): New target.
4001 * configure, testsuite/Makefile.in: Regenerate.
4002
3cef7179
ILT
40032010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4004
4005 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
4006 error for the deprecated relocations.
4007 (Target_arm::Scan::global): Likewise.
4008 (Target_arm::Relocate::relocate): Likewise.
4009
7411e9a8
RS
40102010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
4011
4012 * fileread.cc (Input_file::find_file): Initialize *found_name
4013 and *namep when using the fallback search for case 4.
4014
6a9da32a
CC
40152010-10-11 Cary Coutant <ccoutant@google.com>
4016
4017 * options.h (class General_options): Redefine -z lazy as an alias for
4018 the negation of -z now.
4019
ac897c20
ILT
40202010-10-11 Ian Lance Taylor <iant@google.com>
4021
4022 * resolve.cc (symbol_to_bits): Report the value of the unsupported
4023 binding.
4024
ea5cae92
NC
40252010-10-06 Nick Clifton <nickc@redhat.com>
4026
4027 * script-sections.cc(class Memory_region): Remove
4028 current_lma_offset_ field. Rename current_vma_offset_ to
4029 current_offset_. Add last_section_ field.
4030 (Memory_region::get_current_vma_address): Rename to
4031 get_current_address.
4032 (Memory_region::get_current_lma_address): Delete.
4033 (Memory_region::increment_vma_offset): Rename to
4034 increment_offset.
4035 (Memory_region::increment_lma_offset): Delete.
4036 (Memory_region::attributes_compatible): New method. Returns
4037 true if the provided section is compatible with the region.
4038 (Memory_region::get_last_section): New method. Returns the last
4039 section to use the region.
4040 (Memory_region::set_last_section): New method. Stores the last
4041 section to use the region.
4042 (Script_sections::block_in_region): New method. Returns true if
4043 a block of memory is contained within a region.
4044 (Script_sections::find_memory_region): New method. Locates a
4045 memory region to be used to set a VMA or LMA address.
4046 (Output_section_definition::set_section_addresses): Add code to
4047 check for addresses set by memory regions.
4048 (Output_segment::set_section_addresses): Remove memory region
4049 walking code.
4050 (Script_sections::create_segment): Add a warning if a header
4051 segment is created outside of any region.
4052 * script-sections.h (class Script_sections): Add prototypes for
4053 find_memory_region and block_in_region methods.
4054 * testsuite/memory_test.s: Use .long instead of .word.
4055 * testsuite/memory_test.t: Add some more output sections.
4056 * testsuite/memory_test.sh: Update expected output.
4057
a9bfd952
DK
40582010-10-02 Doug Kwan <dougkwan@google.com>
4059
4060 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
4061 defintion to symtab.h
4062 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
4063 declaration to defintion.
4064
bacff3ab
NC
40652010-10-01 Nick Clifton <nickc@redhat.com>
4066
4067 * expression.cc (eval): Replace dummy argument with NULL.
4068 (eval_maybe_dot): Check for a NULL result section pointer.
4069 (Symbol_expression::value): Likewise.
4070 (Dot_expression::value): Likewise.
4071 (BINARY_EXPRESSION): Likewise.
4072 (Max_expression::value): Likewise.
4073 (Min_expression::value): Likewise.
4074 (Absolute_expression::value): Likewise.
4075 (Addr_expression::value_from_output_section): Likewise.
4076 (Loaddddr_expression::value_from_output_section): Likewise.
4077 (Segment_start_expression::value): Likewise.
4078 * script-sections.cc
4079 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
4080 argument with NULL.
4081 (Sections_elememt_dot_assignment::set_section_addresses):
4082 Likewise.
4083 (Output_data_expression::do_write_to_buffer): Likewise.
4084 (Output_section_definition::finalize_symbols): Likewise.
4085 (Output_section_definition::set_section_addresses): Likewise.
4086
f81bc8b5
DK
40872010-09-30 Doug Kwan <dougkwan@google.com>
4088
4089 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
4090
c95e9f27
ST
40912010-09-28 Sriraman Tallam <tmsriram@google.com>
4092
4093 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 4094 function.
c95e9f27
ST
4095 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
4096 virtual function.
4097 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
4098 virtual function.
4099 * icf.cc (get_section_contents): Inline merge sections only when
4100 target allows it.
4101
3cac54d2
RW
41022010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4103
4104 * configure: Regenerate.
4105
2904037a
ILT
41062010-09-17 Ian Lance Taylor <iant@google.com>
4107
4108 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
4109 * testsuite/Makefile.am (memory_test.o): New target.
4110 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
4111 memory_test.t.
4112 * testsuite/Makefile.in: Rebuild.
2904037a 4113
bca7fb63
DK
41142010-09-17 Doug Kwan <dougkwan@google.com>
4115
4116 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
4117 defintion if relocation uses GOT entries of the symbol.
4118 * testsuite/icf_safe_test.sh: Fix test.
4119 * testsuite/icf_safe_so_test.sh: Fix test.
4120
4ef28648
CC
41212010-09-16 Cary Coutant <ccoutant@google.com>
4122
4123 * script_sections.cc (class Memory_region): Remove "NULL" from
4124 vector initializations.
4125
793990de
CC
41262010-09-15 Cary Coutant <ccoutant@google.com>
4127
4128 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
4129 Resolve forwarding symbols.
4130
81e015e2
DK
41312010-09-15 Doug Kwan <dougkwan@google.com>
4132
4133 * gold/testsuite/script_test_3.t: Add ARM special sections.
4134 * gold/testsuite/script_test_4.t: Same.
4135 * gold/testsuite/script_test_5.t: Same.
4136 * gold/testsuite/script_test_6.t: Same.
4137 * gold/testsuite/script_test_7.t: Same.
4138 * gold/testsuite/script_test_7.t: Same.
4139 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
4140
36171d64
CC
41412010-09-14 Cary Coutant <ccoutant@google.com>
4142
4143 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
4144 (Target_x86_64::Relocate::relocate_tls): Replace check for
4145 saw_tls_block_reloc_ with test for executable section.
4146
d89051bd
CC
41472010-09-12 Cary Coutant <ccoutant@google.com>
4148
4149 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
4150 position-independent executables to shared libraries need dynamic
4151 relocations.
4152 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
4153 position-independent executables.
4154 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
4155 * testsuite/Makefile.in: Regenerate.
4156
fca41f0f
NC
41572010-09-10 Nick Clifton <nickc@redhat.com>
4158
4159 PR gold/11997
4160 * testsuite/memory_test.t: Discard any sections that are not
4161 needed.
4162
6695e4b3
L
41632010-09-09 H.J. Lu <hongjiu.lu@intel.com>
4164
4165 PR gold/11996
4166 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
4167 "This::" to work around a bug in gcc 4.2.
4168
4169 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
4170
0f72bf6f
RÁE
41712010-09-09 Rafael Espindola <espindola@google.com>
4172
4173 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
4174 sections with different PF_X flags in the same segment.
4175 (Layout::find_first_load_seg): Search all segments to find the first
4176 one.
4177 * options.h (rosegment): New.
4178
41792010-09-08 Rafael Espindola <espindola@google.com>
a6577478 4180
05a79166 4181 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 4182
aa98ff75
DK
41832010-09-08 Doug Kwan <dougkwan@google.com>
4184
4185 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
4186 (Arm_relobj::do_relocate_sections): Add new parameter for output
4187 file to match the parent.
4188 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
4189 of local symbols instead of input values. Update code to track
4190 changes in gold::relocate_section.
4191 * object.cc (Sized_relobj::compute_final_local_value): New methods.
4192 (Sized_relobj::compute_final_local_value_internal): New methods.
4193 (Sized_relobj::do_finalize_local_symbols): Move code from loop
4194 body into private version of Sized_relobj::compute_final_local_value.
4195 Call the inline method.
4196 * object.h (Symbol_value::Symbol_value): Define destructor. Free
4197 merged symbol value if there is one.
4198 (Symbol_value::has_output_value): New method defintiion.
4199 (Sized_relobj::Compute_final_local_value_status): New enum type.
4200 (Sized_relobj::compute_final_local_value): New methods.
4201 (Sized_relobj::compute_final_local_value_internal): New methods.
4202 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
4203 and arm_cortex_a8.sh.
4204 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
4205 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
4206 New tests.
4207 * Makefile.in: Regenerate.
4208 * testsuite/arm_bl_out_of_range.s: Update test.
4209 * testsuite/thumb_bl_out_of_range.s: Ditto.
4210 * testsuite/thumb_blx_out_of_range.s: Ditto.
4211 * testsuite/arm_branch_out_of_range.sh: New file.
4212 * testsuite/arm_cortex_a8.sh: Ditto.
4213 * testsuite/arm_cortex_a8_b.s: Ditto.
4214 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
4215 * testsuite/arm_cortex_a8_b_local.s: Ditto.
4216 * testsuite/arm_cortex_a8_bl.s: Ditto.
4217 * testsuite/arm_cortex_a8_blx.s: Ditto.
4218 * testsuite/arm_cortex_a8_local.s: Ditto.
4219 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
4220 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
4221
05a79166
L
42222010-09-08 Rafael Espindola <espindola@google.com>
4223
4224 * Makefile.am (memory_test.stdout): Run readelf with -W.
4225 * Makefile.in: Regenerate.
4226 * testsuite/memory_test.sh: Make the regexps accept both 32 and
4227 64 bit output.
4228
33dbc701
RÁE
42292010-09-08 Rafael Espindola <espindola@google.com>
4230
4231 * script-sections.cc (Script_sections::add_memory_region): Convert
4232 field precision to int.
4233 * script.cc (script_set_section_region, script_set_section_region):
4234 Convert field precision to int.
4235
731ca54a
RÁE
42362010-09-08 Rafael Espindola <espindola@google.com>
4237
4238 * arm.cc (do_finalize_sections): Create the __exidx_start and
4239 __exdix_end symbols even when the section is missing.
4240
7f8cd844
NC
42412010-09-08 Nick Clifton <nickc@redhat.com>
4242
4243 * README: Remove claim that MEMORY is not supported.
4244 * expression.cc (script_exp_function_origin)
4245 (script_exp_function_length): Move from here to ...
4246 * script.cc: ... here.
4247 (script_set_section_region, script_add_memory)
4248 (script_parse_memory_attr, script_include_directive): New
4249 functions.
4250 * script-sections.cc
4251 (class Memory_region): New class.
4252 (class Output_section_definition): Add set_memory_region,
4253 set_section_vma, set_section_lma and get_section_name methods.
4254 (class Script_Sections): Add add_memory_region,
4255 find_memory_region, find_memory_region_origin,
4256 find_memory_region_length and set_memory_region methods.
4257 Have set_section_addresses method walk the list of set memory
4258 regions.
4259 Extend the print methos to display memory regions.
4260 * script-sections.h: Add prototypes for new methods.
4261 Add enum for MEMORY region attributes.
4262 * yyscript.y: Add support for parsing MEMORY regions.
4263 * script-c.h: Add prototypes for new functions.
4264 * testsuite/Makefile.am: Add test of MEMORY region functionality.
4265 * testsuite/Makefile.in: Regenerate.
4266 * testsuite/memory_test.sh: New script.
4267 * testsuite/memory_test.s: New assembler source file.
4268 * testsuite/memory_test.t: New linker script.
4269
a4649286
DK
42702010-08-27 Doug Kwan <dougkwan@google.com>
4271
4272 * gold/resolve.cc (Symbol_table::should_override): Let a weak
4273 reference override an existing dynamic weak reference.
4274 * testsuite/Makefile.am: Add new test dyn_weak_ref.
4275 * testsuite/Makefile.in: Regenerate.
4276 * testsuite/dyn_weak_ref.sh: New file.
4277 * testsuite/dyn_weak_ref_1.c: Ditto.
4278 * testsuite/dyn_weak_ref_2.c: Ditto.
4279
b56648ad
ILT
42802010-08-27 Ian Lance Taylor <iant@google.com>
4281
4282 * incremental.h (class Incremental_input_entry): Add virtual
4283 destructor.
4284
809313cb
ILT
42852010-08-27 Ian Lance Taylor <iant@google.com>
4286
4287 * testsuite/start_lib_test_3.c: Mark t3 as used.
4288
11e32464
NC
42892010-08-27 Nick Clifton <nickc@redhat.com>
4290
4291 * options.cc (version_script): Fix small typo in previous
4292 whitespace tidyup.
4293
ca09d69a
NC
42942010-08-25 Nick Clifton <nickc@redhat.com>
4295
4296 * archive.cc: Formatting fixes: Remove whitespace between
4297 typename and following asterisk. Remove whitespace between
4298 function name and opening parenthesis.
4299 * archive.h: Likewise.
4300 * arm.cc: Likewise.
4301 * attributes.cc: Likewise.
4302 * attributes.h: Likewise.
4303 * common.cc: Likewise.
4304 * copy-relocs.cc: Likewise.
4305 * dirsearch.h: Likewise.
4306 * dynobj.cc: Likewise.
4307 * ehframe.cc: Likewise.
4308 * ehframe.h: Likewise.
4309 * expression.cc: Likewise.
4310 * fileread.cc: Likewise.
4311 * fileread.h: Likewise.
4312 * gc.h: Likewise.
4313 * gold-threads.cc: Likewise.
4314 * gold.cc: Likewise.
4315 * i386.cc: Likewise.
4316 * icf.h: Likewise.
4317 * incremental-dump.cc: Likewise.
4318 * incremental.cc: Likewise.
4319 * layout.cc: Likewise.
4320 * layout.h: Likewise.
4321 * main.cc: Likewise.
4322 * merge.cc: Likewise.
4323 * merge.h: Likewise.
4324 * object.cc: Likewise.
4325 * object.h: Likewise.
4326 * options.cc: Likewise.
4327 * options.h: Likewise.
4328 * output.cc: Likewise.
4329 * output.h: Likewise.
4330 * plugin.cc: Likewise.
4331 * plugin.h: Likewise.
4332 * powerpc.cc: Likewise.
4333 * reloc.cc: Likewise.
4334 * script-c.h: Likewise.
4335 * script-sections.cc: Likewise.
4336 * script.cc: Likewise.
4337 * stringpool.cc: Likewise.
4338 * symtab.cc: Likewise.
4339 * symtab.h: Likewise.
4340 * target.cc: Likewise.
4341 * timer.cc: Likewise.
4342 * timer.h: Likewise.
4343 * version.cc: Likewise.
4344 * x86_64.cc: Likewise.
4345
b8fa8750
NC
43462010-08-24 Nick Clifton <nickc@redhat.com>
4347
4348 PR 11899
4349 * layout.cc (segment_precedes): Sort segments by their physical
4350 addresses, if they have been set.
4351
9919d93b
CC
43522010-08-23 Cary Coutant <ccoutant@google.com>
4353
4354 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
4355 symbols data.
4356 (Lib_group::include_member): Unlock object after deleting its
4357 symbols data.
4358 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
4359 the bug fixed here.
4360
97b4be1c
CC
43612010-08-19 Neil Vachharajani <nvachhar@google.com>
4362 Cary Coutant <ccoutant@google.com>
4363
4364 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
4365 constructor, and set_blocker.
4366 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
4367 readsyms_blocker_.
4368 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
4369 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
4370 * testsuite/Makefile.am (start_lib_test): New test case.
4371 * testsuite/Makefile.in: Regenerate.
4372 * testsuite/start_lib_test_main.c: New file.
4373 * testsuite/start_lib_test_1.c: New file.
4374 * testsuite/start_lib_test_2.c: New file.
4375 * testsuite/start_lib_test_3.c: New file.
4376
dd0b1884
ILT
43772010-08-19 Ian Lance Taylor <iant@google.com>
4378
4379 * Makefile.in: Rebuild with automake 1.11.1.
4380 * aclocal.m4: Likewise.
4381 * testsuite/Makefile.in: Likewise.
4382
7223e9ca
ILT
43832010-08-19 Ian Lance Taylor <iant@google.com>
4384
4385 PR 10893
4386 * i386.cc (class Output_data_plt_i386): Update declarations.
4387 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
4388 local_ifuncs_ fields.
4389 (Target_i386::do_plt_section_for_global): New function.
4390 (Target_i386::do_plt_section_for_local): New function.
4391 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
4392 parameter; change all callers. Initialize global_ifuncs_ and
4393 local_ifuncs_. If doing a static link define __rel_iplt_start and
4394 __rel_iplt_end.
4395 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
4396 (Output_data_plt_i386::add_local_ifunc_entry): New function.
4397 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
4398 symbols.
4399 (Target_i386::make_plt_section): New function, broken out of
4400 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
4401 (Target_i386::make_plt_entry): Call make_plt_section.
4402 (Target_i386::make_local_ifunc_plt_entry): New function.
4403 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
4404 (Target_i386::Scan::local): Handle IFUNC symbols. Add
4405 R_386_IRELATIVE to switch.
4406 (Target_i386::Scan::global): Likewise.
4407 (Target_i386::Relocate::relocate): Likewise.
4408 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
4409 switch.
4410 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
4411 (Target_x86_64::do_plt_section_for_global): New function.
4412 (Target_x86_64::do_plt_section_for_local): New function.
4413 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
4414 parameter; change all callers. If doing a static link define
4415 __rela_iplt_start and __rela_iplt_end.
4416 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
4417 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
4418 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
4419 to point to .plt.
4420 (Target_x86_64::make_local_ifunc_plt_entry): New function.
4421 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
4422 switch.
4423 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
4424 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
4425 R_X86_64_IRELATIVE to switch.
4426 (Target_x86_64::Scan::global): Likewise.
4427 (Target_x86_64::Relocate::relocate): Likewise.
4428 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
4429 switch.
4430 * target.h (class Target): Add plt_section_for_global and
4431 plt_section_for_local functions. Add do_plt_section_for_global
4432 and do_plt_section_for_local virtual functions.
4433 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
4434 clarifying comments.
4435 (Symbol::use_plt_offset): Handle IFUNC symbol.
4436 * object.cc (Sized_relobj::Sized_relobj): Initialize
4437 local_plt_offsets_.
4438 (Sized_relobj::local_has_plt_offset): New function.
4439 (Sized_relobj::local_plt_offset): New function.
4440 (Sized_relobj::set_local_plt_offset): New function.
4441 (Sized_relobj::do_count): Handle IFUNC symbol.
4442 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
4443 a bit away from input_shndx_ field. Add set_is_func_symbol and
4444 is_ifunc_symbol functions.
4445 (class Sized_relobj): Update declarations. Remove Tls_got_entry
4446 and Local_tls_got_offsets. Define Local_plt_offsets. Add
4447 local_plt_offsets_ field.
4448 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
4449 * output.h (class Output_section_data): Add non-const
4450 output_section function.
4451 (class Output_data_got): Update declarations.
4452 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
4453 Add use_plt_offset parameter to global and local constructors.
4454 Change all callers. Change local_sym_index_ field to 31 bits.
4455 Change GSYM_CODE and CONSTANT_CODE accordingly.
4456 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
4457 doing a static link don't set sh_link field.
4458 (Output_data_got::Got_entry::write): Use PLT offset if
4459 appropriate.
4460 (Output_data_got::add_global_plt): New function.
4461 (Output_data_got::add_local_plt): New function.
4462 * target-reloc.h (relocate_section): Handle IFUNC symbol.
4463 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
4464 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
4465 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
4466 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
4467 IFUNC conditional.
4468 * testsuite/ifunc-sel.h: New file.
4469 * testsuite/ifuncmain1.c: New file.
4470 * testsuite/ifuncmain1vis.c: New file.
4471 * testsuite/ifuncmod1.c: New file.
4472 * testsuite/ifuncdep2.c: New file.
4473 * testsuite/ifuncmain2.c: New file.
4474 * testsuite/ifuncmain3.c: New file.
4475 * testsuite/ifuncmod3.c: New file.
4476 * testsuite/ifuncmain4.c: New file.
4477 * testsuite/ifuncmain5.c: New file.
4478 * testsuite/ifuncmod5.c: New file.
4479 * testsuite/ifuncmain6pie.c: New file.
4480 * testsuite/ifuncmod6.c: New file.
4481 * testsuite/ifuncmain7.c: New file.
4482 * configure, testsuite/Makefile.in: Rebuild.
4483
56f75c03
ILT
44842010-08-18 Ian Lance Taylor <iant@google.com>
4485
4486 * incremental.cc
4487 (Output_section_incremental_inputs::write_input_files): Add cast
4488 to avoid signed/unsigned comparison warning.
4489 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4490
55455f89
CC
44912010-08-12 Cary Coutant <ccoutant@google.com>
4492
4493 * common.cc (Sort_commons::operator()): Remove unnecessary code.
4494
e2054bcb
ILT
44952010-08-13 Ian Lance Taylor <iant@google.com>
4496
4497 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
4498
74f67560
DK
44992010-08-12 Cary Coutant <ccoutant@google.com>
4500 Doug Kwan <dougkwan@google.com>
4501
4502 * resolve.cc (Symbol_table::should_override): When a weak dynamic
4503 defintion overrides non-weak undef, remember that the original undef
4504 is not weak.
4505 * symtab.cc (Symbol_table::sized_write_global): For undef without
4506 an original weak binding, set binding to global in output.
4507 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
4508 * testsuite/Makefile.in: Regenerate.
4509 * testsuite/strong_ref_weak_def.sh: New file.
4510 * testsuite/strong_ref_weak_def_1.c: Ditto.
4511 * testsuite/strong_ref_weak_def_2.c: Ditto.
4512
d1238d12
CC
45132010-08-12 Cary Coutant <ccoutant@google.com>
4514
4515 * testsuite/incremental_test.sh: Rewrite.
4516 * testsuite/incremental_test_1.c: Rewrite.
4517 * testsuite/incremental_test_2.c: Rewrite.
4518
0e70b911
CC
45192010-08-12 Cary Coutant <ccoutant@google.com>
4520
4521 * arm.cc (Target_arm::got_size): Add const.
4522 (Target_arm::got_entry_count): New function.
4523 (Target_arm::plt_entry_count): New function.
4524 (Target_arm::first_plt_entry_offset): New function.
4525 (Target_arm::plt_entry_size): New function.
4526 (Output_data_plt_arm::entry_count): New function.
4527 (Output_data_plt_arm::first_plt_entry_offset): New function.
4528 (Output_data_plt_arm::get_plt_entry_size): New function.
4529 * i386.cc (Target_i386::got_size): Add const.
4530 (Target_i386::got_entry_count): New function.
4531 (Target_i386::plt_entry_count): New function.
4532 (Target_i386::first_plt_entry_offset): New function.
4533 (Target_i386::plt_entry_size): New function.
4534 (Output_data_plt_i386::entry_count): New function.
4535 (Output_data_plt_i386::first_plt_entry_offset): New function.
4536 (Output_data_plt_i386::get_plt_entry_size): New function.
4537 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
4538 find_incremental_inputs_sections. Dump incremental_got_plt section.
4539 * incremental.cc: Include target.h.
4540 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
4541 parameter. Adjust all callers. Find incremental_got_plt section.
4542 (Incremental_inputs::create_data_sections): Create incremental_got_plt
4543 section.
4544 (Output_section_incremental_inputs::set_final_data_size): Calculate
4545 size of incremental_got_plt section.
4546 (Output_section_incremental_inputs::do_write): Write the
4547 incremental_got_plt section.
4548 (Got_plt_view_info): New struct.
4549 (Local_got_offset_visitor): New class.
4550 (Global_got_offset_visitor): New class.
4551 (Global_symbol_visitor_got_plt): New class.
4552 (Output_section_incremental_inputs::write_got_plt): New function.
4553 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
4554 Add parameter. Adjust all callers.
4555 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4556 (Incremental_inputs::got_plt_section): New function.
4557 (Incremental_inputs::got_plt_section_): New data member.
4558 (Incremental_got_plt_reader): New class.
4559 * layout.cc (Layout::create_incremental_info_sections): Add the
4560 incremental_got_plt section.
4561 * object.h (Got_offset_list::get_list): New function.
4562 (Got offset_list::for_all_got_offsets): New function.
4563 (Sized_relobj::local_got_offset_list): New function.
4564 * powerpc.cc (Target_powerpc::got_size): Add const.
4565 (Target_powerpc::got_entry_count): New function.
4566 (Target_powerpc::plt_entry_count): New function.
4567 (Target_powerpc::first_plt_entry_offset): New function.
4568 (Target_powerpc::plt_entry_size): New function.
4569 (Output_data_plt_powerpc::entry_count): New function.
4570 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
4571 (Output_data_plt_powerpc::get_plt_entry_size): New function.
4572 * sparc.cc (Target_sparc::got_size): Add const.
4573 (Target_sparc::got_entry_count): New function.
4574 (Target_sparc::plt_entry_count): New function.
4575 (Target_sparc::first_plt_entry_offset): New function.
4576 (Target_sparc::plt_entry_size): New function.
4577 (Output_data_plt_sparc::entry_count): New function.
4578 (Output_data_plt_sparc::first_plt_entry_offset): New function.
4579 (Output_data_plt_sparc::get_plt_entry_size): New function.
4580 * symtab.h (Symbol::got_offset_list): New function.
4581 (Symbol_table::for_all_symbols): New function.
4582 * target.h (Sized_target::got_entry_count): New function.
4583 (Sized_target::plt_entry_count): New function.
4584 (Sized_target::plt_entry_size): New function.
4585 * x86_64.cc (Target_x86_64::got_size): Add const.
4586 (Target_x86_64::got_entry_count): New function.
4587 (Target_x86_64::plt_entry_count): New function.
4588 (Target_x86_64::first_plt_entry_offset): New function.
4589 (Target_x86_64::plt_entry_size): New function.
4590 (Output_data_plt_x86_64::entry_count): New function.
4591 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
4592 (Output_data_plt_x86_64::get_plt_entry_size): New function.
4593
09ec0418
CC
45942010-08-12 Cary Coutant <ccoutant@google.com>
4595
4596 * archive.cc: Include incremental.h.
4597 (Archive::Archive): Initialize incremental_info_.
4598 (Archive::include_member): Record archive members in incremental info.
4599 (Add_archive_symbols::run): Record begin and end of an archive in
4600 incremental info.
4601 (Lib_group::include_member): Record objects in incremental info.
4602 * archive.h (Incremental_archive_entry): Forward declaration.
4603 (Archive::set_incremental_info): New member function.
4604 (Archive::incremental_info): New member function.
4605 (Archive::Unused_symbol_iterator): New class.
4606 (Archive::unused_symbols_begin): New member function.
4607 (Archive::unused_symbols_end): New member function.
4608 (Archive::incremental_info_): New data member.
4609 * incremental-dump.cc (find_input_containing_global): New function.
4610 (dump_incremental_inputs): Dump new incremental info sections.
4611 * incremental.cc: Include symtab.h.
4612 (Output_section_incremental_inputs): New class.
4613 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
4614 new incremental info sections.
4615 (Sized_incremental_binary::do_check_inputs): Likewise.
4616 (Incremental_inputs::report_archive): Remove.
4617 (Incremental_inputs::report_archive_begin): New function.
4618 (Incremental_inputs::report_archive_end): New function.
4619 (Incremental_inputs::report_object): New function.
4620 (Incremental_inputs::finalize_inputs): Remove.
4621 (Incremental_inputs::report_input_section): New function.
4622 (Incremental_inputs::report_script): Rewrite.
4623 (Incremental_inputs::finalize): Do nothing but finalize string table.
4624 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
4625 (Incremental_inputs::sized_create_inputs_section_data): Remove.
4626 (Incremental_inputs::create_data_sections): New function.
4627 (Incremental_inputs::relocs_entsize): New function.
4628 (Output_section_incremental_inputs::set_final_data_size): New function.
4629 (Output_section_incremental_inputs::do_write): New function.
4630 (Output_section_incremental_inputs::write_header): New function.
4631 (Output_section_incremental_inputs::write_input_files): New function.
4632 (Output_section_incremental_inputs::write_info_blocks): New function.
4633 (Output_section_incremental_inputs::write_symtab): New function.
4634 * incremental.h (Incremental_script_entry): Forward declaration.
4635 (Incremental_object_entry): Forward declaration.
4636 (Incremental_archive_entry): Forward declaration.
4637 (Incremental_inputs): Forward declaration.
4638 (Incremental_inputs_header_data): Remove.
4639 (Incremental_inputs_header): Remove.
4640 (Incremental_inputs_header_write): Remove.
4641 (Incremental_inputs_entry_data): Remove.
4642 (Incremental_inputs_entry): Remove.
4643 (Incremental_inputs_entry_write): Remove.
4644 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
4645 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
4646 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4647 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
4648 Likewise.
4649 (Incremental_input_entry): New class.
4650 (Incremental_script_entry): New class.
4651 (Incremental_object_entry): New class.
4652 (Incremental_archive_entry): New class.
4653 (Incremental_inputs::Incremental_inputs): Initialize new data members.
4654 (Incremental_inputs::report_inputs): Remove.
4655 (Incremental_inputs::report_archive): Remove.
4656 (Incremental_inputs::report_archive_begin): New function.
4657 (Incremental_inputs::report_archive_end): New function.
4658 (Incremental_inputs::report_object): Change prototype.
4659 (Incremental_inputs::report_input_section): New function.
4660 (Incremental_inputs::report_script): Change prototype.
4661 (Incremental_inputs::get_reloc_count): New function.
4662 (Incremental_inputs::set_reloc_count): New function.
4663 (Incremental_inputs::create_data_sections): New function.
4664 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
4665 (Incremental_inputs::inputs_section): New function.
4666 (Incremental_inputs::symtab_section): New function.
4667 (Incremental_inputs::relocs_section): New function.
4668 (Incremental_inputs::get_stringpool): Add const.
4669 (Incremental_inputs::command_line): Add const.
4670 (Incremental_inputs::inputs): Remove.
4671 (Incremental_inputs::command_line_key): New function.
4672 (Incremental_inputs::input_file_count): New function.
4673 (Incremental_inputs::input_files): New function.
4674 (Incremental_inputs::relocs_entsize): New function.
4675 (Incremental_inputs::sized_create_inputs_section_data): Remove.
4676 (Incremental_inputs::finalize_inputs): Remove.
4677 (Incremental_inputs::Input_info): Remove.
4678 (Incremental_inputs::lock_): Remove.
4679 (Incremental_inputs::inputs_): Change type.
4680 (Incremental_inputs::inputs_map_): Remove.
4681 (Incremental_inputs::current_object_entry_): New data member.
4682 (Incremental_inputs::inputs_section_): New data member.
4683 (Incremental_inputs::symtab_section_): New data member.
4684 (Incremental_inputs::relocs_section_): New data member.
4685 (Incremental_inputs::reloc_count_): New data member.
4686 (Incremental_inputs_reader): New class.
4687 (Incremental_symtab_reader): New class.
4688 (Incremental_relocs_reader): New class.
4689 * layout.cc (Layout::finalize): Move finalization of incremental info
4690 and creation of incremental info sections to follow finalization of
4691 symbol table. Set offsets for postprocessing sections.
4692 (Layout::create_incremental_info_sections): Call
4693 Incremental_inputs::create_data_sections. Add incremental symtab
4694 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
4695 sections to layout after input sections.
4696 * layout.h (struct Timespec): Forward declaration.
4697 (Layout::incremental_inputs): Add const.
4698 (Layout::create_incremental_info_sections): Add parameter.
4699 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
4700 * object.cc: Include incremental.h.
4701 (Relobj::finalize_incremental_relocs): New function.
4702 (Sized_relobj::do_layout): Record input sections in incremental info.
4703 * object.h (Object::output_section): New function.
4704 (Object::output_section_offset): Moved from Relobj.
4705 (Object::get_incremental_reloc_base): New function.
4706 (Object::get_incremental_reloc_count): New function.
4707 (Object::do_output_section): New function.
4708 (Object::do_output_section_offset): Moved from Relobj.
4709 (Object::do_get_incremental_reloc_base): New function.
4710 (Object::do_get_incremental_reloc_count): New function.
4711 (Object::Object): Initialize new data members.
4712 (Relobj::output_section): Renamed do_output_section and moved to
4713 protected.
4714 (Relobj::output_section_offset): Moved to Object.
4715 (Relobj::do_get_incremental_reloc_base): New function.
4716 (Relobj::do_get_incremental_reloc_count): New function.
4717 (Relobj::allocate_incremental_reloc_counts): New function.
4718 (Relobj::count_incremental_reloc): New function.
4719 (Relobj::finalize_incremental_relocs): New function.
4720 (Relobj::next_incremental_reloc_index): New function.
4721 (Relobj::reloc_counts_): New data member.
4722 (Relobj::reloc_bases_): New data member.
4723 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
4724 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
4725 (Sized_relobj::incremental_relocs_scan): New function.
4726 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4727 (Sized_relobj::incremental_relocs_write): New function.
4728 (Sized_relobj::incremental_relocs_write_reltype): New function.
4729 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
4730 incremental link.
4731 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
4732 archives and object files elsewhere.
4733 (Add_symbols::run): Report object files here.
4734 (Finish_group::run): Report end of archive at end of group.
4735 * reloc.cc: Include layout.h, incremental.h.
4736 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
4737 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
4738 (Sized_relobj::incremental_relocs_scan): New function.
4739 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4740 (Sized_relobj::do_relocate_sections): Write incremental relocations.
4741 (Sized_relobj::incremental_relocs_write): New function.
4742 (Sized_relobj::incremental_relocs_write_reltype): New function.
4743 * script.cc (read_input_script): Rewrite test for incremental link.
4744 Change call to Incremental_inputs::report_script.
4745 * symtab.h (Symbol_table::first_global_index): New function.
4746 (Symbol_table::output_count): New function.
4747
ce0d1972
DK
47482010-08-12 Doug Kwan <dougkwan@google.com>
4749
4750 * arm.cc (Target_arm::merge_object_attributes): Check command line
4751 options --no-wchar-size-warning and --no-enum-size-warning.
4752 * options.h (General_options): Add ld-compatible options
4753 --no-enum-size-warning and --no-wchar-size-warning.
4754
6e5710ce
ILT
47552010-08-04 Ian Lance Taylor <iant@google.com>
4756
4757 * x86_64.cc (Target_x86_64::Scan::local): Use
4758 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
4759 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
4760 (Target_x86_64::Scan::global): Likewise.
4761 (Target_x86_64::Relocate::relocate): Likewise.
4762 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
4763 Likewise.
4764
fef830db
CC
47652010-08-03 Cary Coutant <ccoutant@google.com>
4766
4767 * merge.cc (Output_merge_string::do_add_input_section): Count strings
4768 to reserve space in merged_strings vector. Keep total input size
4769 for stats.
4770 (Output_merge_string::do_print_merge_stats): Print total input size.
4771 * merge.h (Output_merge_string): Add input_size_ field.
4772 * stringpool.cc (Stringpool_template::string_length): Move
4773 implementations out of Stringpool_template class and place in
4774 stringpool.h.
4775 * stringpool.h (string_length): Move out of Stringpool_template.
4776
1e3811b0
ILT
47772010-08-03 Ian Lance Taylor <iant@google.com>
4778
4779 PR 11712
4780 * layout.cc (relaxation_loop_body): If address of load segment is
4781 set, adjust address to include headers if possible.
4782
7af0c620
ILT
47832010-08-03 Ian Lance Taylor <iant@google.com>
4784
4785 * version.cc (version_string): Bump to 1.10.
4786
22f0da72
ILT
47872010-08-03 Ian Lance Taylor <iant@google.com>
4788
4789 PR 11805
4790 * layout.h (enum Output_section_order): Define.
4791 (class Layout): Update declarations.
4792 * layout.cc (Layout::get_output_section): Add order parameter.
4793 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
4794 is_first_non_relro parameters. Change all callers.
4795 (Layout::choose_output_section): Likewise.
4796 (Layout::add_output_section_data): Likewise.
4797 (Layout::make_output_section): Likewise. Set order.
4798 (Layout::default_section_order): New function.
4799 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
4800 * output.cc (Output_section::Output_section): Initialize order_.
4801 Don't initialize deleted fields.
4802 (Output_segment::Output_segment): Don't initialize deleted
4803 fields.
4804 (Output_segment::add_output_section_to_load): New function
4805 replacing add_output_section. Change all callers to call this or
4806 add_output_section_to_nonload.
4807 (Output_segment::add_output_section_to_nonload): New function.
4808 (Output_segment::remove_output_section): Rewrite.
4809 (Output_segment::add_initial_output_data): Likewise.
4810 (Output_segment::has_any_data_sections): Likewise.
4811 (Output_segment::is_first_section_relro): Likewise.
4812 (Output_segment::maximum_alignment): Likewise.
4813 (Output_segment::has_dynamic_reloc): New function replacing
4814 dynamic_reloc_count. Change all callers.
4815 (Output_segment::has_dynamic_reloc_list): New function replacing
4816 dynamic_reloc_count_list. Change all callers.
4817 (Output_segment::set_section_addresses): Rewrite.
4818 (Output_segment::set_offset): Rewrite.
4819 (Output_segment::find_first_and_last_list): Remove.
4820 (Output_segment::set_tls_offsets): Rewrite.
4821 (Output_segment::first_section_load_address): Likewise.
4822 (Output_segment::output_section_count): Likewise.
4823 (Output_segment::section_with_lowest_load_address): Likewise.
4824 (Output_segment::write_section_headers): Likewise.
4825 (Output_segment::print_sections_to_map): Likewise.
4826 * output.h (class Output_data): Remove dynamic_reloc_count_
4827 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
4828 (Output_data::add_dynamic_reloc): Rewrite.
4829 (Output_data::has_dynamic_reloc): New function.
4830 (Output_data::dynamic_reloc_count): Remove.
4831 (class Output_section): Add order_ field. Remvoe is_relro_local_,
4832 is_last_relro_, is_first_non_relro_, is_interp_,
4833 is_dynamic_linker_section_ fields. Add order and set_order
4834 functions. Remove is_relro_local, set_is_relro_local,
4835 is_last_relro, set_is_last_relro, is_first_non_relro,
4836 set_is_first_non_relro functions, is_interp, set_is_interp,
4837 is_dynamic_linker_section, and set_is_dynamic_linker_section
4838 functions.
4839 (class Output_segment): Change Output_data_list from std::list to
4840 std:;vector. Add output_lists_ field. Remove output_data_ and
4841 output_bss_ fields. Update declarations.
4842
3ff2ccb0
ILT
48432010-08-02 Ian Lance Taylor <iant@google.com>
4844
4845 * arm.cc (Target_arm::gc_process_relocs): Use typename.
4846 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
4847 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
4848
88a4108b
ILT
48492010-08-02 Ian Lance Taylor <iant@google.com>
4850
4851 PR 11855
4852 * script.cc (Script_options::Script_options): Initialize
4853 symbol_definitions_ and symbol_references_.
4854 (Script_options::add_symbol_assignment): Update
4855 symbol_definitions_ and symbol_references_.
4856 (Script_options::add_symbol_reference): New function.
4857 (script_symbol): New function.
4858 * script.h (class Script_options): Add symbol_definitions_ and
4859 symbol_references_ fields.
4860 (Script_options::referenced_const_iterator): New type.
4861 (Script_options::referenced_begin): New function.
4862 (Script_options::referenced_end): New function.
4863 (Script_options::is_referenced): New function.
4864 (Script_options::any_unreferenced): New function.
4865 * script-c.h (script_symbol): Declare.
4866 * yyscript.y (exp): Call script_symbol.
4867 * symtab.cc: Include "script.h".
4868 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
4869 Change all callers. Check symbols referenced by scripts.
4870 (Symbol_table::add_undefined_symbols_from_command_line): Add
4871 layout parameter. Change all callers.
4872 (Symbol_table::do_add_undefined_symbols_from_command_line):
4873 Likewise. Break out loop body. Check symbols referenced by
4874 scripts.
4875 (Symbol_table::add_undefined_symbol_from_command_line): New
4876 function broken out of
4877 do_add_undefined_symbols_from_command_line.
4878 * symtab.h (class Symbol_table): Update declarations.
4879 * archive.cc: Include "layout.h".
4880 (Archive::should_include_member): Add layout parameter. Change
4881 all callers. Check for symbol mentioned in expression.
4882 * archive.h (class Archive): Update declaration.
4883 * object.cc (Sized_relobj::do_should_include_member): Add layout
4884 parameter.
4885 * object.h (Object::should_include_member): Add layout parameter.
4886 Change all callers.
4887 (Object::do_should_include_member): Add layout parameter.
4888 (class Sized_relobj): Update declaration.
4889 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
4890 parameter.
4891 * dynobj.h (class Sized_dynobj): Update declaration.
4892 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
4893 layout parameter.
4894 * plugin.h (class Sized_pluginobj): Update declaration.
4895
5f1ab67a
ILT
48962010-08-02 Ian Lance Taylor <iant@google.com>
4897
4898 PR 11866
4899 * output.cc (Output_segment::set_offset): Search for the first and
4900 last sections rather than assuming that the list is in order.
4901 (Output_segment::find_first_and_last_list): New function.
4902 * output.h (class Output_segment): Update declarations.
4903 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
4904 (relro_strip_test_SOURCES): New variable.
4905 (relro_strip_test_DEPENDENCIES): New variable.
4906 (relro_strip_test_LDFLAGS): New variable.
4907 (relro_strip_test_LDADD): New variable.
4908 (relro_strip_test.so): New target.
4909
a8df5856
ILT
49102010-08-02 Ian Lance Taylor <iant@google.com>
4911
4912 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
4913 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
4914 (Target_i386::got_tlsdesc_section): New function.
4915 (Target_i386::got_section): Create space for GOT entries for
4916 TLSDESC relocations.
4917 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
4918 R_386_TLS_GOTDESC.
4919 (Target_i386::Scan::global): Likewise.
4920 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
4921 using TLSDESC GOT.
4922 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
4923 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
4924 (Target_x86_64::got_tlsdesc_section): New function.
4925 (Target_x86_64::got_section): Create space for GOT entries for
4926 TLSDESC relocations.
4927 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
4928 R_386_TLS_GOTDESC.
4929 (Target_x86_64::Scan::global): Likewise.
4930 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
4931 using TLSDESC GOT.
4932
0c10a0a6
ILT
49332010-08-02 Ian Lance Taylor <iant@google.com>
4934
4935 * testsuite/final_layout.sh: Use dc to convert from hex to
4936 decimal.
4937
41cbeecc
ST
49382010-07-29 Sriraman Tallam <tmsriram@google.com>
4939
4940 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
4941 paramter to the call to gold::gc_process_relocs.
4942 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
4943 paramter to the call to gold::gc_process_relocs.
4944 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
4945 parameter to the call to gold::gc_process_relocs.
4946 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
4947 template parameter to the call to gold::gc_process_relocs.
4948 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
4949 paramter to the call to gold::gc_process_relocs.
4950 * gc.h (get_embedded_addend_size): New function.
4951 (gc_process_relocs): Save the size of the reloc for use by ICF.
4952 * icf.cc (get_section_contents): Get the addend from the text section
4953 for SHT_REL relocation sections.
4954 * icf.h (Icf::Reloc_addend_size_info): New typedef.
4955 (Icf::Reloc_info): Add new member reloc_addend_size_info.
4956 * int_encoding.h (read_from_pointer): New overloaded function.
4957 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
4958 * testsuite/icf_sht_rel_addend_test.sh: New file.
4959 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
4960 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
4961
6ea55b82
RW
49622010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4963
4964 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
4965 * Makefile.in: Regenerate.
4966 * testsuite/Makefile.in: Regenerate.
4967
9691462b
ILT
49682010-07-27 Jeffrey Yasskin <jyasskin@google.com>
4969
4970 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
4971 * gold/testsuite/debug_msg.cc: Likewise.
4972 * gold/testsuite/odr_violation1.cc
4973 * gold/testsuite/odr_violation2.cc
4974
76897331
CC
49752010-07-21 Cary Coutant <ccoutant@google.com>
4976
4977 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
4978 string, and length fields.
4979 (Output_merge_string::Merged_strings_list): New type.
4980 (Output_merge_string::Merged_strings_lists): New typedef.
4981 (Output_merge_string): Replace merged_strings_ with
4982 merged_strings_lists_.
4983 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
4984 Merged_strings_list per input object and section. Don't store pointer
4985 to the string. Don't store length with each merged string entry.
4986 (Output_merge_string::finalize_merged_data): Loop over list of merged
4987 strings lists. Recompute length of each merged string.
4988
78384e8f
CC
49892010-07-15 Cary Coutant <ccoutant@google.com>
4990
4991 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
4992 here.
4993
783659f9
ILT
49942010-07-14 Ian Lance Taylor <iant@google.com>
4995
4996 * descriptors.cc (Descriptors::open): Report correct name in error
4997 message.
4998
131687b4
DK
49992010-07-13 Doug Kwan <dougkwan@google.com>
5000
5001 * arm.cc (Arm_input_section::Arm_input_section): For a
5002 SHT_ARM_EXIDX section, always keeps the input sections.
5003 (Arm_input_section::set_exidx_section_link): New method.
5004 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
5005 has_errors_ to false.
5006 (Arm_exidx_input_section::has_errors,
5007 Arm_exidx_input_section::set_has_errors): New methods.
5008 (Arm_exidx_input_section::has_errors_): New data member.
5009 (Arm_relobj::get_exidx_shndx_list): New method.
5010 (Arm_output_section::append_text_sections_to_list): Do not skip
5011 section without SHF_EXECINSTR.
5012 (Arm_output_section::fix_exidx_coverage): Skip input sections with
5013 errors.
2e702c99 5014 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
5015 section header. Make error messages more verbose. Check for
5016 a non-executable section linked to an EXIDX section.
5017 (Arm_relobj::do_read_symbols): Remove error checking, which has been
5018 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
5019 check that there is no deferred EXIDX section if we exit early.
5020 Instead of not making an EXIDX section in case of an error, make one
5021 and set the has_errors flag of it.
5022 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
5023 in a relocatable link.
5024 (Target_arm::do_relax): Look for the EXIDX output section instead of
5025 assuming that it is called .ARM.exidx.
2e702c99 5026 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
5027 section list. Do not check for SHF_EXECINSTR section flags but
5028 skip any input section with errors.
5029 * output.cc (Output_section::Output_section): Initialize
5030 always_keeps_input_sections_ to false.
5031 (Output_section::add_input_section): Check for
5032 always_keeps_input_sections_.
5033 * output.h (Output_section::always_keeps_input_sections,
5034 Output_section::set_always_keeps_input_sections): New methods.
5035 (Output_section::always_keeps_input_sections): New data member.
5036
69517287
RÁE
50372010-07-13 Rafael Espindola <espindola@google.com>
5038
5039 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
5040 * fileread.h (Input_file): Add try_extra_search_path and find_file.
5041
82742395
ILT
50422010-07-13 Philip Herron <herron.philip@googlemail.com>
5043 Ian Lance Taylor <iant@google.com>
5044
5045 * output.h (Output_section_lookup_maps::add_merge_section):
5046 Correct check of whether value was inserted.
5047 (Output_section_lookup_maps::add_merge_input_section): Likewise.
5048 (Output_section_lookup_maps::add_relaxed_input_section):
5049 Likewise.
5050 * arm.cc (Target_arm::got_section): Remove used local os.
5051 * i386.cc (Target_i386::got_section): Likewise.
5052 * x86_64.cc (Target_x86_64::got_section): Likewise.
5053 * sparc.cc (Target_sparc::got_section): Likewise.
5054 (Target_sparc::relocate): Remove unused local have_got_offset.
5055 * powerpc.cc (Target_powerpc::relocate): Likewise.
5056
f2d707b5
ILT
50572010-07-13 Ian Lance Taylor <iant@google.com>
5058
241531d6
ILT
5059 * compressed_output.cc (zlib_decompress): Fix signature in
5060 !HAVE_ZLIB_H case.
5061
f2d707b5
ILT
5062 * archive.cc (Archive::include_member): Unlock an external member
5063 of a thin archive. Don't bother to delete an object we know is
5064 NULL.
5065
a2e47362
CC
50662010-07-12 Cary Coutant <ccoutant@google.com>
5067
5068 * compressed_output.cc (zlib_decompress): New function.
5069 (get_uncompressed_size): New function.
5070 (decompress_input_section): New function.
5071 * compressed_output.h (get_uncompressed_size): New function.
5072 (decompress_input_section): New function.
5073 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
5074 Handle compressed debug sections.
5075 * layout.cc (is_compressed_debug_section): New function.
5076 (Layout::output_section_name): Map compressed section names to
5077 canonical names.
5078 * layout.h (is_compressed_debug_section): New function.
5079 (is_debug_info_section): Recognize compressed debug sections.
5080 * merge.cc: Include compressed_output.h.
5081 (Output_merge_data::do_add_input_section): Handle compressed
5082 debug sections.
5083 (Output_merge_string::do_add_input_section): Handle compressed
5084 debug sections.
5085 * object.cc: Include compressed_output.h.
5086 (Sized_relobj::Sized_relobj): Initialize new data members.
5087 (build_compressed_section_map): New function.
5088 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
5089 * object.h (Object::section_is_compressed): New method.
5090 (Object::do_section_is_compressed): New method.
5091 (Sized_relobj::Compressed_section_map): New type.
5092 (Sized_relobj::do_section_is_compressed): New method.
5093 (Sized_relobj::compressed_sections_): New data member.
5094 * output.cc (Output_section::add_input_section): Handle compressed
5095 debug sections.
5096 * reloc.cc: Include compressed_output.h.
5097 (Sized_relobj::write_sections): Handle compressed debug sections.
5098
ce279a62
CC
50992010-07-08 Cary Coutant <ccoutant@google.com>
5100
5101 * resolve.cc (Symbol_table::resolve): Remember whether undef was
5102 weak when resolving to a dynamic def.
5103 (Symbol_table::should_override): Add adjust_dyndef flag; set it
5104 for weak undef/dynamic def cases. Adjust callers.
5105 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
5106 undef_binding_weak_.
5107 (Symbol_table::sized_write_globals): Adjust symbol binding.
5108 (Symbol_table::sized_write_symbol): Add binding parameter.
5109 * symtab.h (Symbol::set_undef_binding): New method.
5110 (Symbol::is_undef_binding_weak): New method.
5111 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
5112 (Symbol_table::should_override): Add new parameter.
5113 (Symbol_table::sized_write_symbol): Add new parameter.
5114
5115 * testsuite/weak_undef_file1.cc: Add new test case.
5116 * testsuite/weak_undef_file2.cc: Fix header comment.
5117 * testsuite/weak_undef_test.cc: Add new test case.
5118
b2286c10
DK
51192010-06-29 Doug Kwan <dougkwan@google.com>
5120
5121 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
5122 Initialize USE_SYMBOL_.
5123 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
5124 definition.
5125 (Arm_reloc_property::uses_symbol_): New data member declaration.
5126 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
5127 uses symbol value and symbol is undefined but not weakly undefined.
5128
4802450a
RÁE
51292010-06-28 Rafael Espindola <espindola@google.com>
5130
5131 * plugin.cc (Plugin::load): Use dlerror.
5132
e5ca47ba
ILT
51332010-06-26 Jeffrey Yaskin <jyasskin@google.com>
5134
5135 * symtab.cc (detect_odr_violations): When reporting an ODR
5136 violation, report an object where the symbol is defined.
5137
8a75a161
DK
51382010-06-25 Doug Kwan <dougkwan@google.com>
5139
5140 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
5141 (Target_arm::section_may_have_icf_unsafe_pointers): New method
5142 definition.
5143 (Target_arm::Scan::local_reloc_may_be_function_pointer,
5144 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
5145 target hook to detect function points.
5146 (Target_arm::Scan::possible_function_pointer_reloc): New method.
5147 * icf.h (Icf::check_section_for_function_pointers): Change type of
5148 parameter SECTION_NAME to const reference to std::string. Use
5149 target hook to determine if section may have unsafe pointers.
5150 * target.h (Target::section_may_have_icf_unsafe_pointers): New
5151 method definition.
5152
42218b9f
RÁE
51532010-06-21 Rafael Espindola <espindola@google.com>
5154
5155 * fileread.cc (Input_file::find_fie): New
5156 (Input_file::open): Use Input_file::find_fie.
5157 * fileread.h (Input_file::find_fie): New
5158 * plugin.cc (set_extra_library_path): New.
5159 (Plugin::load): Add set_extra_library_path to the transfer vector.
5160 (Plugin_manager::set_extra_library_path): New.
5161 (Plugin_manager::add_input_file): Use the extra search path if set.
5162 (set_extra_library_path(): New.
5163 * plugin.h (Plugin_manager): Add set_extra_library_path and
5164 extra_search_path_.
5165
a0506cca
CC
51662010-06-19 Cary Coutant <ccoutant@google.com>
5167
5168 * layout.cc (gdb_sections): Add .debug_types.
5169 (lines_only_debug_sections): Likewise.
5170
6508b958
RÁE
51712010-06-18 Rafael Espindola <espindola@google.com>
5172
5173 * plugin.cc (add_input_file,add_input_library)
5174 (Plugin_manager::add_input_file): Make filename arguments const.
5175 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
5176 const.
5177
3e235302
DK
51782010-06-16 Doug Kwan <dougkwan@google.com>
5179
5180 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
5181 .ARM.attributes section if we have not merged any input
5182 attributes sections.
5183
106e8a6c
DK
51842010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5185
5186 * arm.cc: Allow combining objects with no EABI version
5187 information.
5188
91ff43fe
RÁE
51892010-06-15 Rafael Espindola <espindola@google.com>
5190
5191 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
5192
68ed838c
ILT
51932010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5194
5195 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
5196 (struct iovec): Correct !HAVE_READV definition.
5197
f3a2388f
CC
51982010-06-10 Cary Coutant <ccoutant@google.com>
5199
5200 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
5201 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
5202 reloc sections.
5203 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
5204
5205 PR 11683
5206 * symtab.h (Symbol::is_placeholder): New member function.
5207 * target-reloc.h (relocate_section): Check for placeholder symbols.
5208
5209 * testsuite/Makefile.am (plugin_test_8): New test.
5210 (plugin_test_9): New test.
5211 * testsuite/Makefile.in: Regenerate.
5212
e1df38aa
NC
52132010-06-09 Nick Clifton <nickc@redhat.com>
5214
5215 * yyscript.y (input_list_element): Allow strings prefixed with
5216 the '-' character. Treat these as libraries.
5217 * script.cc (script_add_library): New function. Adds a library
5218 specified by "-l<name>" found in an input script.
5219 * script-c.h: Add prototype for script_add_library.
5220
25bbe950
DK
52212010-06-07 Doug Kwan <dougkwan@google.com>
5222
5223 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
5224 Restrict stub-group size to be within long conditional branch
5225 range when working around cortex-A8 erratum.
5226
0f32ea4c
ILT
52272010-06-07 Damien Diederen <dd@crosstwine.com>
5228
5229 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
5230 #ifdef typo.
5231
8fe2a369
ST
52322010-06-03 Sriraman Tallam <tmsriram@google.com>
5233
5234 PR gold/11658
5235 * output.cc
5236 (Output_section::Input_section_sort_entry::compare_section_ordering):
5237 Change to return non-zero correctly.
5238 (Output_section::Input_section_sort_section_order_index_compare
5239 ::operator()): Change to fix ambiguity in comparisons.
5240
6e9ba2ca
ST
52412010-06-01 Sriraman Tallam <tmsriram@google.com>
5242
5243 * gold.h (is_wildcard_string): New function.
5244 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
5245 (Layout::layout_eh_frame): Ditto.
5246 (Layout::find_section_order_index): New method.
5247 (Layout::read_layout_from_file): New method.
5248 * layout.h (Layout::find_section_order_index): New method.
5249 (Layout::read_layout_from_file): New method.
5250 (Layout::input_section_position_): New private member.
5251 (Layout::input_section_glob_): New private member.
5252 * main.cc (main): Call read_layout_from_file here.
5253 * options.h (--section-ordering-file): New option.
5254 * output.cc (Output_section::input_section_order_specified_): New
5255 member.
5256 (Output_section::Output_section): Initialize new member.
5257 (Output_section::add_input_section): Add new parameter.
5258 Keep input sections when --section-ordering-file is used.
5259 (Output_section::set_final_data_size): Sort input sections when
5260 section ordering file is specified.
5261 (Output_section::Input_section_sort_entry): Add new parameter.
5262 Check sorting type.
5263 (Output_section::Input_section_sort_entry::compare_section_ordering):
5264 New method.
5265 (Output_section::Input_section_sort_compare::operator()): Change to
5266 consider section_order_index.
5267 (Output_section::Input_section_sort_init_fini_compare::operator()):
5268 Change to consider section_order_index.
5269 (Output_section::Input_section_sort_section_order_index_compare
5270 ::operator()): New method.
5271 (Output_section::sort_attached_input_sections): Change to sort
5272 according to section order when specified.
e1df38aa
NC
5273 (Output_section::add_input_section<32, true>): Add new parameter.
5274 (Output_section::add_input_section<64, true>): Add new parameter.
5275 (Output_section::add_input_section<32, false>): Add new parameter.
5276 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
5277 * output.h (Output_section::add_input_section): Add new parameter.
5278 (Output_section::input_section_order_specified): New
5279 method.
5280 (Output_section::set_input_section_order_specified): New method.
5281 (Input_section::Input_section): Initialize section_order_index_.
5282 (Input_section::section_order_index): New method.
5283 (Input_section::set_section_order_index): New method.
5284 (Input_section::section_order_index_): New member.
5285 (Input_section::Input_section_sort_section_order_index_compare): New
5286 struct.
5287 (Output_section::input_section_order_specified_): New member.
5288 * script-sections.cc (is_wildcard_string): Delete and move modified
5289 method to gold.h.
5290 (Output_section_element_input::Output_section_element_input): Modify
5291 call to is_wildcard_string.
5292 (Output_section_element_input::Input_section_pattern
5293 ::Input_section_pattern): Ditto.
5294 (Output_section_element_input::Output_section_element_input): Ditto.
5295 * testsuite/Makefile.am (final_layout): New test case.
5296 * testsuite/Makefile.in: Regenerate.
5297 * testsuite/final_layout.cc: New file.
5298 * testsuite/final_layout.sh: New file.
5299
3537c84b
RÁE
53002010-06-01 Rafael Espindola <espindola@google.com>
5301
5302 * plugin.cc (Plugin::load): Pass the output name to the plugin.
5303
105b6afd
RÁE
53042010-06-01 Rafael Espindola <espindola@google.com>
5305
5306 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
5307 visibility of symbols.
5308
29e11421
DK
53092010-05-27 Doug Kwan <dougkwan@google.com>
5310
5311 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
5312 from start of output section instead of address for a local symbol
5313 in a merged or relaxed section when doing a relocatable link.
5314
5e0f337e
RÁE
53152010-05-26 Rafael Espindola <espindola@google.com>
5316
5317 PR 11604
5318 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
5319 adding sections the garbage collector removed.
5320 * gold/testsuite/Makefile.am: Add test.
5321 * gold/testsuite/Makefile.in: Regenerate.
5322 * gold/testsuite/plugin_test_7.sh: New.
5323 * gold/testsuite/plugin_test_7_1.c: New.
5324 * gold/testsuite/plugin_test_7_2.c: New.
5325
f4187277
RÁE
53262010-05-26 Rafael Espindola <espindola@google.com>
5327
5328 * script-sections.cc (Output_section_definition::set_section_addresses):
5329 Check for --section-start.
5330
5c388529
DK
53312010-05-26 Doug Kwan <dougkwan@google.com>
5332
5333 * arm.cc (Arm_scan_relocatable_relocs): New class.
5334 (Target_arm::relocate_special_relocatable): New method.
5335 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
5336 (Arm_relocate_functions::thumb_branch_common): Same.
5337 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
5338 instead of Default_scan_relocatable_relocs.
5339 * target-reloc.h (relocate_for_relocatable): Let target handle
5340 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
5341 * target.h (Sized_target::relocate_special_relocatable): New method.
5342
bca1c3ae
ILT
53432010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5344
5345 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
5346
0439c796
DK
53472010-05-23 Doug Kwan <dougkwan@google.com>
5348
5349 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
5350 instead of a cast.
5351 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
5352 with a direct branch, not a conditional branch, to a stub.
5353 * merge.cc (Output_merge_base::record_input_section): New method
5354 defintion.
5355 (Output_merge_data::do_add_input_section): Record input section if
5356 keeps-input-sections flag is set.
5357 (Output_merge_string::do_add_input_section): Ditto.
5358 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
5359 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
5360 INPUT_SECTIONS_.
5361 (Output_merge_base::keeps_input_sections,
5362 Output_merge_base::set_keeps_input_sections,
5363 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
5364 method definitions.
5365 (Output_merge_base::Input_sections): New type declaration.
5366 (Output_merge_base::input_sections_begin,
5367 Output_merge_base::input_sections_end,
5368 Output_merge_base::do_set_keeps_input_sections): New method definitions.
5369 (Output_merge_base::bool keeps_input_sections_,
5370 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
5371 Output_merge_base::input_sections_): New data members.
5372 (Output_merge_data::do_set_keeps_input_sections): New method
5373 defintion.
5374 (Output_merge_string::do_set_keeps_input_sections): Ditto.
5375 * output.cc (Output_section::Input_section::relobj): Move method
5376 defintion from class declaration to here and handle merge sections.
5377 (Output_section::Input_section::shndx): Ditto.
5378 (Output_section::Output_section): Remove initializations of removed
5379 data members and initialize new data member LOOKUP_MAPS_.
5380 (Output_section::add_input_section): Set keeps-input-sections flag
5381 for a newly created merge output section as appropriate. Adjust code
5382 to use Output_section_lookup_maps class.
5383 (Output_section::add_relaxed_input_section): Adjst code for lookup
5384 maps code refactoring.
2e702c99 5385 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
5386 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
5387 class. If adding input section to a newly created merge output
5388 section fails, remove the new merge section.
5389 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 5390 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 5391 (Output_section::find_merge_section): Ditto.
0439c796 5392 (Output_section::build_lookup_maps): New method defintion.
2e702c99 5393 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
5394 Output_section_lookup_maps class.
5395 (Output_section::get_input_sections): Export merge sections. Adjust
5396 code to use Output_section_lookup_maps class.
5397 (Output_section:::add_script_input_section): Adjust code to use
5398 Output_section_lookup_maps class. Update lookup maps for merge
5399 sections also.
5400 (Output_section::discard_states): Use Output_section_lookup_maps.
5401 (Output_section::restore_states): Same.
5402 * output.h (Merge_section_properties): Move class defintion out of
5403 Output_section.
5404 (Output_section_lookup_maps): New class.
5405 (Output_section::Input_section::is_merge_section): New method
5406 defintion.
5407 (Output_section::Input_section::relobj): Move defintion out of class
5408 defintion. Declare method only.
5409 (Output_section::Input_section::shndx): Ditto.
5410 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 5411 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
5412 (Output_section::Merge_section_by_properties_map,
5413 Output_section::Output_section_data_by_input_section_map,
5414 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
5415 Remove types.
2e702c99 5416 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
5417 KEEPS_INPUT_SECTIONS.
5418 (Output_section::build_lookup_maps): New method declaration.
5419 (Output_section::merge_section_map_,
5420 Output_section::merge_section_by_properties_map_,
5421 Output_section::relaxed_input_section_map_,
5422 Output_section::is_relaxed_input_section_map_valid_): Remove data
5423 members.
5424 (Output_section::lookup_maps_): New data member.
5425
76295588
L
54262010-05-21 Doug Kwan <dougkwan@google.com>
5427
5428 PR gold/11619
5429 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
5430 avoid a compilation error.
5431
d103a984
RÁE
54322010-05-19 Rafael Espindola <espindola@google.com>
5433
5434 * script-sections.cc (Output_section_definition::allocate_to_segment):
5435 Update the phdrs_list even when the output section is NULL.
5436 * testsuite/Makefile.am: Add test.
5437 * testsuite/Makefile.in: Regenerate.
5438 * testsuite/script_test_9.cc: New.
5439 * testsuite/script_test_9.sh: New.
5440 * testsuite/script_test_9.t: New.
5441
6625d24e
DK
54422010-05-19 Doug Kwan <dougkwan@google.com>
5443
5444 * arm.cc (Arm_input_section::original_size): New method.
5445 (Arm_input_section::do_addralign): Add a cast.
5446 (Arm_input_section::do_output_offset): Remove static cast.
5447 (Arm_input_section::original_addralign,
5448 Arm_input_section::original_size_): Change type to uint32_t.
5449 (Arm_input_section::init): Add safe casts for section alignment
5450 and size.
5451 (Arm_input_section::set_final_data_size): Do not set address and
5452 offset of stub table.
5453 (Arm_output_section::fix_exidx_coverage): Change use of of
5454 Output_section::Simple_input_section to that of
5455 Output_section::Input_section.
5456 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
5457 except for the first pass.
5458 * output.cc (Output_section::get_input_sections): Change type of
5459 input_sections to std::list<Input_section>.
5460 (Output_section::add_script_input_section): Rename from
5461 Output_section::add_simple_input_section. Change type of SIS
5462 parameter from Simple_input_section to Input_section.
5463 * output.h (Output_section::Simple_input_section): Remove class.
5464 (Output_section::Input_section): Change class visibility to public.
5465 (Output_section::Input_section::addralign): Use stored alignments
5466 for special input sections if set.
5467 (Output_section::Input_section::set_addralign): New method.
5468 (Output_section::get_input_sections): Change parameter type from
5469 list of Simple_input_section to list of Input_section.
5470 (Output_section::add_script_input_section): Rename from
5471 Output_section::add_simple_input_section. Change first parameter's
5472 type from Simple_input_section to Input_section and remove the
5473 second and third parameters.
5474 * script-sections.cc (Input_section::Input_section_list): Change
5475 type to list of Output_section::Input_section/
5476 (Input_section_info::Input_section_info): Change parameter type of
5477 INPUT_SECTION to Output_section::Input_section.
5478 (Input_section_info::input_section): Change return type.
5479 (Input_section_info::input_section_): Change type to
5480 Output_section::Input_section.
5481 (Output_section_element_input::set_section_addresses): Adjust code
5482 to use Output_section::Input_section instead of
5483 Output_section::Simple_input_section. Adjust code for renaming
5484 of Output_section::add_simple_input_section.
5485 (Orphan_output_section::set_section_addresses): Ditto.
5486
e1e82ea4
RW
54872010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5488
5489 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
5490 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
5491
91e75c8a
RÁE
54922010-05-18 Rafael Espindola <espindola@google.com>
5493
5494 * options.cc (General_options::finalize): Handle -nostdlib.
5495 * options.h (nostdlib): New option.
5496 * script.cc (script_add_search_dir): Handle -nostdlib.
5497
da59ad79
DK
54982010-05-12 Doug Kwan <dougkwan@google.com>
5499
5500 * arm.cc (Target_arm::do_finalize_sections): Create an empty
5501 attributes section only if there no attributes section after merging.
5502 (Target_arm::merge_object_attributes): Move value of
e1df38aa 5503 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
5504 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
5505 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
5506 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
5507 and arm_attr_merge_7.stdout.
5508 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
5509 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
5510 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
5511 arm_attr_merge_7b.o): New rules.
5512 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
5513 arm_attr_merge_7
5514 * testsuite/Makefile.in: Regenerate.
5515 * testsuite/arm_attr_merge.sh: New file.
5516 * testsuite/arm_attr_merge_[67][ab].s: Same.
5517
3e01a7fd
NC
55182010-05-05 Nick Clifton <nickc@redhat.com>
5519
5520 * po/es.po: Updated Spanish translation.
5521
7ad2014a
L
55222010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5523
5524 * Makefile.am (install-exec-local): Properly install gold as
5525 default cross linker.
5526 * Makefile.in: Regenerated.
5527
4fda8867
NC
55282010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5529 Nick Clifton <nickc@redhat.com>
5530
5531 * configure.ac (install_as_default): Define and set to false
5532 unless --enable-gold or --enable-gold=both/gold has been
5533 specified.
5534 * configure: Regenerate.
5535
5536 * Makefile.am (install-exec-local): Install the executable as
5537 'ld.gold'. If install_as_default is true then also install it as
5538 'ld'.
5539 * Makefile.in: Regenerated.
5540
bd288ea2
ILT
55412010-04-24 Ian Lance Taylor <iant@google.com>
5542
5543 * layout.cc (Layout::layout_reloc): In relocatable link don't
5544 combine reloc sections for grouped sections.
5545
ef38fd8a
ST
55462010-04-23 Sriraman Tallam <tmsriram@google.com>
5547
5548 * gc.h (gc_process_relocs): Pass information on relocs pointing to
5549 sections that are not ordinary to icf.
5550 * icf.cc (get_section_contents): Handle relocation pointing to section
5551 with no object or shndx information.
5552 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
5553 * testsuite/Makefile.in: Regenerate.
5554 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
5555 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
5556
f6973bdc
ILT
55572010-04-22 Ian Lance Taylor <iant@google.com>
5558
5559 * expression.cc (Expression::Expression_eval_info): Add
5560 result_alignment_pointer field.
5561 (Expression::eval_with_dot): Add result_alignment_pointer
5562 parameter. Change all callers.
5563 (Expression::eval_maybe_dot): Likewise.
5564 (class Binary_expression): Add alignment_pointer parameter to
5565 left_value and right_value. Change all callers.
5566 (BINARY_EXPRESSION): Set result alignment.
5567 (class Trinary_expression): Add alignment_pointer parameter to
5568 arg2_value and arg3_value. Change all callers.
5569 (Trinary_cond::value): Set result alignment.
5570 (Max_expression::value, Min_expression::value): Likewise.
5571 (Align_expression::value): Likewise.
5572 * script-sections.cc (class Sections_element): Add dot_alignment
5573 parameter to set_section_addresses virtual function. Update
5574 instantiations.
5575 (class Output_section_element): Likewise.
5576 (Script_sections::create_segments): Add dot_alignment parameter.
5577 Change all callers.
5578 (Script_sections::create_segments_from_phdrs_clause): Likewise.
5579 (Script_sections::set_phdrs_clause_addresses): Likewise.
5580 * script-sections.h: Update declarations.
5581 * script.h: Update declarations.
5582 * output.h (Output_segment::set_minimum_p_align): Don't decrease
5583 min_p_align.
5584 * testsuite/script_test_3.t: Set large alignment.
5585 * testsuite/script_test_3.sh: Make sure that at least one LOAD
5586 segment has expected alignment.
5587
9c9c98a5
NC
55882010-04-22 Nick Clifton <nickc@redhat.com>
5589
5590 * po/gold.pot: Updated by the Translation project.
5591 * po/vi.po: Updated Vietnamese translation.
5592
2253bfba
L
55932010-04-22 H.J. Lu <hongjiu.lu@intel.com>
5594
5595 * testsuite/Makefile.am (check_PROGRAMS): Add
5596 icf_virtual_function_folding_test.
5597 * testsuite/Makefile.in: Regenerated.
5598
85fdf906
AH
55992010-04-15 Andrew Haley <aph@redhat.com>
5600
5601 * options.h (merge_exidx_entries): New option.
5602 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
5603 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
5604 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
5605 (Target_arm::merge_exidx_entries): New function.
5606 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
5607 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
5608 to Arm_exidx_fixup constructor.
5609 Add new arg, merge_exidx_entries.
5610 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
5611 Arm_output_section::fix_exidx_coverage.
5612
ce97fa81
ST
56132010-04-18 Sriraman Tallam <tmsriram@google.com>
5614
5615 * icf.cc (get_section_contents): Check for preemptible functions.
5616 Ignore addend when appropriate.
5617 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
5618 section folded.
5619 (add_from_relobj): Check for section folded.
5620 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
5621 * symtab.h (should_add_dynsym_entry): Add new parameter.
5622 * target-reloc.h (scan_relocs): Check for section folded.
5623 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
5624 Check reloc types for function pointers in shared objects.
5625 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
5626 case.
5627 (icf_preemptible_functions_test): New test case.
5628 (icf_string_merge_test): New test case.
5629 * testsuite.Makefile.in: Regenerate.
5630 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
5631 bar_glob. Refactor code.
5632 * testsuite/icf_preemptible_functions_test.cc: New file.
5633 * testsuite/icf_preemptible_functions_test.sh: New file.
5634 * testsuite/icf_string_merge_test.cc: New file.
5635 * testsuite/icf_string_merge_test.sh: New file.
5636 * testsuite/icf_virtual_function_folding_test.cc: New file.
5637 * testsuite/icf_virtual_function_folding_test.sh: New file.
5638
04ceb17c
DK
56392010-04-14 Doug Kwan <dougkwan@google.com>
5640
5641 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
5642 for local symbol recounting if we remove a section due to ICF.
5643 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
5644 there are no regular objects in input.
5645
153e7da4
DK
56462010-04-13 Doug Kwan <dougkwan@google.com>
5647
5648 * arm.cc (Arm_input_section::set_final_data_size): Compute
5649 accurate final data size instead of using current data size.
5650
4dbd9faf
DK
56512010-04-09 Doug Kwan <dougkwan@google.com>
5652
5653 * layout.cc (Layout::choose_output_section): Handle script section
5654 types.
5655 (Layout::make_output_section_for_script): Add section type parameter.
5656 Handle script section types.
5657 * layout.h (Layout::make_output_section_for_script): Add section
5658 type parameter.
5659 * output.cc (Output_section::Output_section): Initialize data member
5660 is_noload_.
5661 (Output_section::do_reset_address_and_file_offset): Do not set address
5662 to 0 if section is a NOLOAD section.
5663 * output.h (Output_section::is_noload): New method.
5664 (Output_section::set_is_noload): Ditto.
5665 (Output_section::is_noload_): New data member.
5666 * script-c.h (Script_section_type): New enum type.
5667 (struct Parser_output_section_header): Add new file section_type.
5668 * script-sections.cc (Sections_element::output_section_name): Add
5669 parameter for returning script section type.
5670 (Output_section_definition::output_section_name): Ditto.
5671 (Output_section_definition::section_type)P; New method.
5672 (Output_section_definiton::script_section_type_name): Ditto.
5673 (Output_section_definition::script_section_type_): New data member.
5674 (Output_section_definition::Output_section_definition): Initialize
5675 data member Output_section_definition::script_section_type_.
5676 (Output_section_definition::create_sections): Pass script section type
5677 to Layout::make_output_section_for_script.
5678 (Output_section_definition::output_section_name): Return script
5679 section type to caller.
5680 (Output_section_definition::set_section_address): Do not advance
5681 dot value and load address if section type is NOLOAD. Set address
5682 of NOLOAD sections regardless of section flags.
5683 (Output_section_definition::print): Print section type if it is
5684 not SCRIPT_SECTION_TYPE_NONE.
5685 (Output_section_definition::section_type): New method.
5686 (Output_section_definition::script_section_type_name): Ditto.
5687 (Script_sections::output_section_name): Add new parameter
5688 PSECTION_TYPE for returning script section type. Pass it to
5689 section elements. Handle discard sections.
5690 (Sort_output_sections::operator()): Handle NOLOAD sections.
5691 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 5692 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
5693 returning script section type.
5694 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
5695 INFO and NOLOAD.
5696 * yyscript.y (union): Add new field SECTION_TYPE.
5697 (COPY, DSECT, INFO, NOLOAD): New tokens.
5698 (opt_address_and_section_type): Change type to output_section_header.
5699 (section_type): New non-terminal
5700 (section_header): Handle section type.
2253bfba 5701 (opt_address_and_section_type): Return section type value.
4dbd9faf 5702
721ea635
L
57032010-04-09 H.J. Lu <hongjiu.lu@intel.com>
5704
5705 * testsuite/plugin_common_test_1.c (foo): Add prototype.
5706 * testsuite/plugin_common_test_2.c (foo): Likewise.
5707
6bf924b0
DK
57082010-04-08 Doug Kwan <dougkwan@google.com>
5709
5710 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
5711 Output_merge_data.
5712 * output.cc (Output_section::add_merge_input_section): Simplify
5713 code and return status of Output_merge_base::add_input_section.
e1df38aa 5714 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
5715 returns true.
5716
24af6f92
DK
57172010-04-07 Doug Kwan <dougkwan@google.com>
5718
5719 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
5720 if section is marked as containing instructions but has no mapping
5721 symbols.
5722 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
5723 correct section index.
5724 (Arm_relobj::find_linked_text_section): Ditto.
5725
00698fc5
CC
57262010-04-07 Cary Coutant <ccoutant@google.com>
5727
5728 * archive.cc (include_member): Destroy Read_symbols_data object before
5729 releasing file.
5730 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
5731 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
5732 (Read_symbols_data::~Read_symbols_data) New destructor.
5733 (Section_relocs::Section_relocs) New constructor.
5734 (Section_relocs::~Section_relocs) New destructor.
5735 (Read_relocs_data::Read_relocs_data) New constructor.
5736 (Read_relocs_data::~Read_relocs_data) New destructor.
5737 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
5738 pointers to NULL after deleting.
5739
7296d933
DK
57402010-04-07 Doug Kwan <dougkwan@google.com>
5741
5742 * arm.cc: Replace "endianity" with "endianness" in comments.
5743 (Arm_exidx_cantunwind): Ditto.
5744 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
5745 (Arm_relobj::merge_flags_and_attributes): New method.
5746 (Arm_relobj::merge_flags_and_attributes_): New data member.
5747 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
5748 (Arm_relobj::scan_sections_for_stubs): Ditto.
5749 (Arm_relobj::do_read_symbols): Check to see if we really want to
5750 merge processor-specific flags and attributes. Exit early if
5751 an object is empty except for section names and the undefined symbol.
5752 (Target_arm::do_finalize_sections): Move check for ELF format to
5753 Arm_relobj::do_read_symbols. Merge processor specific flags and
5754 attributes from a regular object only when we have determined that
5755 it is aapropriate. Do not create an .ARM.attributes section in
5756 output if there is no regular input object.
5757 (Target_arm::merge_processor_specific_flags): Check
5758 --warn-mismatch before printing any error.
5759 (Target_arm::merge_object_attributes): Ditto.
5760 * gold.cc (queue_middle_tasks): Handle the case in which there is
5761 no regular object in input.
5762 * options.cc (General_options::parse_EB): New method.
5763 (General_options::parse_EL): Same.
5764 (General_options::General_options): Initialize endianness_.
5765 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
5766 New options.
5767 (General_options::Endianness): New enum.
5768 (General_options::endianness): New method.
5769 (General_options::endianness_): New data member.
5770 * parameters.cc (Parameters::set_options): Check target endianness.
5771 (Parameters::set_target_once): Ditto.
5772 (Parameters::check_target_endianness): New method.
5773 (parameters_force_valid_target): If either -EL or -EB is specified,
5774 use it to define endianness of default target.
5775 * parameters.h (Parameters::check_target_endianness): New method
5776 declaration.
5777 * target.h (class Target): Change "endianity" to "endianness"
5778 in comments.
5779
efc8d4f2
RW
57802010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5781
5782 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
5783 * configure: Regenerate.
5784 * Makefile.in: Regenerate.
5785 * testsuite/Makefile.in: Regenerate.
5786
be234d88
CC
57872010-04-06 Cary Coutant <ccoutant@google.com>
5788
5789 gcc PR lto/42757
5790 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
5791 prevailing definitions of common symbols.
5792 * testsuite/plugin_test_6.sh: New test case.
5793 * testsuite/plugin_common_test_1.c: New test case.
5794 * testsuite/plugin_common_test_2.c: New test case.
5795 * testsuite/Makefile.am (plugin_test_6): New test case.
5796 * testsuite/Makefile.in: Regenerate.
5797
bd32c6bd
NC
57982010-04-06 Nick Clifton <nickc@redhat.com>
5799
5800 * po/vi.po: New Vietnamese translation.
5801
323c532f
DK
58022010-03-30 Doug Kwan <dougkwan@google.com>
5803
5804 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
5805
4fcd97eb
DK
58062010-03-25 Doug Kwan <dougkwan@google.com>
5807
5808 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
5809 to avoid a conversion warning on a 32-bit host.
5810
4ebf39db
ILT
58112010-03-24 Ian Lance Taylor <iant@google.com>
5812
5813 * testsuite/script_test_3.t: Add a TLS segment.
5814 * testsuite/Makefile.am (check_PROGRAMS): Add
5815 tls_phdrs_script_test.
5816 (tls_phdrs_script_test_SOURCES): Define.
5817 (tls_phdrs_script_test_DEPENDENCIES): Define.
5818 (tls_phdrs_script_test_LDFLAGS): Define.
5819 (tls_phdrs_script_test_LDADD): Define.
5820 * testsuite/Makefile.in: Rebuild.
5821
4a599bdd
CC
58222010-03-23 Cary Coutant <ccoutant@google.com>
5823
5824 * fileread.cc (find_or_make_view): Fix comment.
5825
6c93b22c
ILT
58262010-03-23 Ian Lance Taylor <iant@google.com>
5827
5828 * script-sections.cc (class Orphan_section_placement): Define
5829 PLACE_TLS and PLACE_TLS_BSS.
5830 (Orphan_section_placement::Orphan_section_placement): Initialize
5831 new places.
5832 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
5833 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
5834 (tls_script_test_SOURCES): Define.
5835 (tls_script_test_DEPENDENCIES): Define.
5836 (tls_script_test_LDFLAGS): Define.
5837 (tls_script_test_LDADD): Define.
5838 * testsuite/Makefile.in: Rebuild.
5839
a2c7281b
DK
58402010-03-22 Doug Kwan <dougkwan@google.com>
5841
5842 * arm.cc (Arm_relocate_functions::abs8,
5843 Arm_relocate_functions::abs16): Use correct check for overflow
5844 specified in the ARM ELF specs.
5845 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
5846 target of a BLX instruction specially.
5847 (Reloc_stub::stub_type_for_reloc): Ditto.
5848 (Relocate::relocate): Use symbolic names instead of numeric relocation
5849 codes to report error.
5850 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
5851 workaround.
5852 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
5853 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
5854 thumb2_blx_out_of_range.stdout
5855 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
5856 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
5857 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
5858 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
5859 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
5860 thumb2_blx_in_range, thumb2_blx_in_range.o,
5861 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
5862 thumb2_blx_out_of_range.o): New rules.
2e702c99 5863 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
5864 thumb2_blx_in_range and thumb2_blx_out_of_range.
5865 * testsuite/Makefile.in: Regenerate.
5866 * arm_branch_in_range.sh: Add tests for THUMB BLX.
5867 * testsuite/thumb_blx_in_range.s: New file.
5868 * testsuite/thumb_blx_out_of_range.s: New file.
5869
b0193076
RÁE
58702010-03-22 Rafael Espindola <espindola@google.com>
5871
5872 * archive.cc (Should_include): Move to archive.h.
5873 (should_include_member): Make it a member of Archive.
5874 (Lib_group): New.
5875 (Add_lib_group_symbols): New.
5876 * archive.h: Include options.h.
5877 (Archive_member): Moved from Archive.
5878 (Should_include): Moved from archive.cc.
5879 (Lib_group): New.
5880 (Add_lib_group_symbols): New.
5881 * dynobj.cc (do_should_include_member): New.
5882 * dynobj.h (do_should_include_member): New.
5883 * gold.cc (queue_initial_tasks): Update call to queue.
5884 * main.cc (main): Print lib group stats.
5885 * object.cc (do_should_include_member): New.
5886 * object.h: Include archive.h.
5887 (Object::should_include_member): New.
5888 (Object::do_should_include_member): New.
5889 (Sized_relobj::do_should_include_member): New.
5890 * options.cc (General_options::parse_start_lib): New.
5891 (General_options::parse_end_lib): New.
5892 (Input_arguments::add_file): Handle lib groups.
5893 (Input_arguments::start_group): Check we are not in a lib.
5894 (Input_arguments::start_lib): New.
5895 (Input_arguments::end_lib): New.
5896 * options.h (General_options): Add start_lib and end_lib.
5897 (Input_argument::lib_): New.
5898 (Input_argument::lib): New.
5899 (Input_argument::is_lib): New.
5900 (Input_file_lib): New.
5901 (Input_arguments::in_lib_): New.
5902 (Input_arguments::in_lib): New.
5903 (Input_arguments::start_lib): New.
5904 (Input_arguments::end_lib_): New.
5905 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
5906 in unused members as preempted.
5907 (Sized_pluginobj::do_should_include_member): New.
5908 * plugin.h (Sized_pluginobj::do_should_include_member): New.
5909 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
5910 return the blocker.
5911 (Read_symbols::do_whole_lib_group): New.
5912 (Read_symbols::do_lib_group): New.
5913 (Read_symbols::do_read_symbols): Handle lib groups.
5914 (Read_symbols::get_name): Handle lib groups.
5915 * readsyms.h (Read_symbols): Add an archive member pointer.
5916 (Read_symbols::do_whole_lib_group): New.
5917 (Read_symbols::do_lib_group): New.
5918 (Read_symbols::member_): New.
5919 * script.cc (read_input_script): Update call to queue_soon.
5920
d099120c
DK
59212010-03-19 Doug Kwan <dougkwan@google.com>
5922
5923 * arm.cc (Stub_table::Stub_table): Initialize new data members
5924 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
5925 (Stub_table::add_reloc_stub): Assign stub offset and update
5926 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
5927 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
5928 New data members.
2e702c99 5929 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
5930 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
5931 instead of going over all reloc stubs.
2e702c99 5932 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
5933 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
5934 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 5935 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
5936 Stringpool_template::offset_.
5937 * stringpool.h (Stringpool_template::set_no_zero_null): Set
5938 Stringpool_template::offset_ to zero.
5939
1aa37384
DK
59402010-03-15 Doug Kwan <dougkwan@google.com>
5941
5942 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
5943 offset_.
5944 (Stringpool_template::new_key_offset): New method.
5945 (Stringpool_template::add_string): Assign offsets when adding new
5946 strings.
5947 (Stringpool_template::set_string_offsets): Do not set string offsets
5948 when not optimizing.
5949 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
5950 member size_.
2e702c99
RM
5951 (Chunked_vector::clear): Clear size_.
5952 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
5953 (Chunked_vector::size): Return size_.
5954 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 5955 (Chunked_vector::size_): New data member.
1aa37384
DK
5956 (Stringpool_template::set_no_zero_null): Assert string set is empty.
5957 (Stringpool_template::new_key_offset): New method declaration.
5958 (Stringpool_template::offset_): New data member.
5959
b672b057
RÁE
59602010-03-15 Rafael Espindola <espindola@google.com>
5961
5962 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
5963 Add_symbols' constructor.
5964 * readsyms.h (Add_symbols): Remove the input_group member.
5965
b6848d3c
ILT
59662010-03-10 Ian Lance Taylor <iant@google.com>
5967
5968 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
5969 target to ask whether a reference to a symbol requires a stack
5970 split.
5971 * target.h (Target::is_call_to_non_split): New function.
5972 (Target::do_is_call_to_non_split): Declare virtual function.
5973 * target.cc: Include "symtab.h".
5974 (Target::do_is_call_to_non_split): New function.
5975 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
5976
a2a5469e
CC
59772010-03-10 Cary Coutant <ccoutant@google.com>
5978
5979 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
5980 (File_read::open[1]): Remove initial mapping of whole_file_view_.
5981 (File_read::open[2]): Add whole_file_view_ to list of views.
5982 (File_read::make_view): Remove test of whole_file_view_.
5983 (File_read::find_or_make_view): Create whole_file_view_ if
5984 necessary.
5985 (File_read::clear_views): Replace bool parameter with enum;
5986 adjust all callers. Don't delete views with permanent data;
5987 do delete cached views and views from archives if
5988 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
5989 if clearing the corresponding view.
5990 * fileread.h (File_read::Clear_views_mode): New enum.
5991 (File_read::View::is_permanent_view): New method.
5992 (File_read::clear_views): Replace bool parameter
5993 with enum; adjust all callers.
5994 * options.h (General_options): Change keep_files_mapped option;
5995 add map_whole_files.
5996 * readsyms.cc (Add_symbols::run): Delete sd_ object before
5997 releasing the file.
5998 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
5999 the file.
6000
8861f32b
DM
60012010-03-10 David S. Miller <davem@davemloft.net>
6002
6003 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
6004
d62d0f5f
ST
60052010-03-09 Sriraman Tallam <tmsriram@google.com>
6006
6007 * icf.cc (get_section_contents): Add '@' marker after processing the
6008 merge reloc.
6009
9177756d
DK
60102010-03-08 Doug Kwan <dougkwan@google.com>
6011
6012 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
6013 due to a conversion warning.
6014 (Arm_relobj::update_output_local_symbol_count): Check for local
6015 symbol with unset output index.
6016
9e9e071b
ILT
60172010-03-05 Ian Lance Taylor <iant@google.com>
6018
6019 * options.h (class General_options): Add --spare-dynamic-tags.
6020 * output.cc (Output_data_dynamic::set_final_data_size): Implement
6021 --spare-dynamic-tags.
6022
a81ee015
ILT
60232010-03-05 Ian Lance Taylor <iant@google.com>
6024
6025 * incremental.cc: Include "libiberty.h".
6026
44ec90b9
RO
60272010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
6028
6029 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
6030 function, is_info_ member.
6031 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
6032 (Versions::Versions): Update caller.
6033 (Versions::define_base_version): Likewise.
6034 (Versions::add_def): Likewise.
6035
0897ed3b
ST
60362010-03-03 Sriraman Tallam <tmsriram@google.com>
6037
6038 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
6039 (Scan::possible_function_pointer_reloc): New function.
6040 (Scan::local_reloc_may_be_function_pointer): Change to call
6041 possible_function_pointer_reloc.
6042 (Scan::global_reloc_may_be_function_pointer): Ditto.
6043 * icf.h (Icf::check_section_for_function_pointers): Change to reject
6044 relocations in ".data.rel.ro._ZTV" section.
6045 * testsuite/icf_safe_so_test.sh: Change to pass i386.
6046 * testsuite/icf_safe_so_test.cc: Ditto.
6047 * testsuite/icf_safe_test.cc: Ditto.
6048 * testsuite/icf_safe_test.sh: Ditto.
6049
d3bbad62
ILT
60502010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6051 Ian Lance Taylor <iant@google.com>
6052
6053 * target-reloc.h (relocate_section): Check the symbol table index
6054 for -1U before setting the local symbol index.
6055 (scan_relocatable_relocs): If copying the relocation, record that
6056 the local symbol is required.
6057 * object.h (Symbol_value::is_output_symtab_index_set): New
6058 function.
6059 (Symbol_value::may_be_discarded_from_output_symtab): New
6060 function.
6061 (Symbol_value::has_output_symtab_entry): New function.
6062 (Symbol_value::needs_output_symtab_entry): Remove.
6063 (Symbol_value::output_symtab_index): Make sure the symbol index is
6064 set.
6065 (Symbol_value::set_output_symtab_index): Make sure the symbol
6066 index is not set. Make sure the new index is valid.
6067 (Symbol_value::set_must_have_output_symtab_entry): New function.
6068 (Symbol_value::has_output_dynsym_entry): New function.
6069 (Symbol_value::set_output_dynsym_index): Make sure the new index
6070 is valid.
6071 (Sized_relobj::set_must_have_output_symtab_entry): New function.
6072 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
6073 local symbol if permitted.
6074 (Sized_relobj::do_finalize_local_symbols): Call
6075 is_output_symtab_index_set rather than needs_output_symtab_entry.
6076 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
6077 rather than needs_output_symtab_entry. Call
6078 has_output_dynsym_entry rather than needs_output_dynsym_entry.
6079 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
6080 is_output_symtab_index_set rather than needs_output_symtab_entry.
6081 * testsuite/discard_locals_relocatable_test.c: New file.
6082 * testsuite/discard_locals_test.sh: Test -r.
6083 * testsuite/Makefile.am (check_DATA): Add
6084 discard_locals_relocatable_test1.syms,
6085 discard_local_relocatable_test2.syms.
6086 (MOSTLYCLEANFILES): Likewise. Also add
6087 discard_locals_relocatable_test1.lout and
6088 discard_locals_relocatable_test2.out.
6089 (discard_locals_relocatable_test1.syms): New target.
6090 (discard_locals_relocatable_test.o): New target.
6091 (discard_locals_relocatable_test1.out): New target.
6092 (discard_locals_relocatable_test2.syms): New target.
6093 (discard_locals_relocatable_test2.out): New target.
6094 (various): Add missing ../ld-new dependencies.
6095 * testsuite/Makefile.in: Rebuild.
6096
7e8ccf26
NC
60972010-03-03 Nick Clifton <nickc@redhat.com>
6098
6099 * po/fi.po: New Finnish translation.
6100
2a0ff005
DK
61012010-03-01 Doug Kwan <dougkwan@google.com>
6102
6103 * layout.cc (Layout::Layout): Force section types of .init_array*,
6104 .preinit_array* and .fini_array* sections.
6105 * output.cc (Output_section::Input_section_sort_entry::has_priority):
6106 Fix check of return value of std::string::find.().
6107 (Output_section::Input_section_sort_compare::operator()): Remove
6108 comment about .init_array.
6109 (Output_section::Input_section_sort_init_fini_compare::operator()):
6110 New method.
6111 (Output_section::sort_attached_input_sections): Handle .init_array
6112 and .fini_array specially.
6113 * output.h (Output_section::Inut_section_sort_compare): Update
6114 comment.
6115 (Output_section::Input_section_sort_init_fini_compare): New struct.
6116
c3e4ae29
DK
61172010-02-26 Doug Kwan <dougkwan@google.com>
6118
6119 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
6120 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
6121 * testsuite/debug_msg.sh: Avoid matching source line number for
6122 use of global variable undef_int.
6123
2fd9ae7a
DK
61242010-02-26 Doug Kwan <dougkwan@google.com>
6125
6126 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
6127 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
6128 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
6129 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
6130 * options.cc (General_options::General_options): Initialize member
6131 fix_v4bx_.
6132 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
6133 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
6134 and rm_no_fix_v4bx.stdout
6135 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
6136 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
6137 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
6138 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
6139 and arm_no_fix_v4bx.
6140 * Makefile.in: Regenerate.
6141 * testsuite/arm_fix_v4bx.s: New file.
6142 * testsuite/arm_fix_v4bx.sh: Ditto.
6143
67ec7d0b
DK
61442010-02-24 Doug Kwan <dougkwan@google.com>
6145
6146 * arm.cc (Target_arm::got_section): Make the .got section the first
6147 non RELRO section in the data segment.
6148 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
6149 suffixes of section names.
6150
10165461
DK
61512010-02-24 Doug Kwan <dougkwan@google.com>
6152
6153 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
6154 flags and attributes merging if an input file is a binary file.
6155 * fileread.cc (Input_file::open): Record format of original file.
6156 * fileread.h (Input_file::Format): New enum type.
2e702c99 6157 (Input_file::Input_file): Initialize data member format_.
10165461
DK
6158 (Input_file::format): New method definition.
6159 (Input_file::format_):: New data member.
6160
4a54abbb
DK
61612010-02-24 Doug Kwan <dougkwan@google.com>
6162
6163 * arm.cc (Arm_output_data_got): New class.
6164 (ARM_TCB_SIZE): New constant
6165 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
6166 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
6167 If user uses a script with a SECTIONS clause, issue only a warning
6168 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 6169 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
6170 garbage collection.
6171 (Target_arm::got_mode_index_entry): Handle static linking.
6172 (Target_arm::Scan::local): Ditto.
6173 (Target_arm::Scan::global): Ditto.
6174 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
6175 all incorrectly implemented relocations.
e1df38aa 6176 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
6177 Arm_output_section::fix_exidx_coverage.
6178 * layout.cc (Layout::section_name_mapping): Remove trailing dots
6179 from ".ARM.exidx." and ".ARM.extab.".
6180
ca419a6f
ILT
61812010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6182
6183 * arm.cc (Target_arm::do_finalize_sections): Create attribute
6184 section if it does not already exist.
6185 * attributes.cc (Attributes_section_data::Attributes_section_data):
6186 Don't crash if size is zero.
6187
135b9c78
ILT
61882010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6189 Ian Lance Taylor <iant@google.com>
6190
6191 * gold.cc (queue_middle_tasks): If no input files were opened,
6192 exit.
6193 * workqueue.h (Task_function::Task_function): Assert that there is
6194 a blocker.
6195
bb0bfe4f
DK
61962010-02-22 Doug Kwan <dougkwan@google.com>
6197
6198 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
6199 * icf.cc (get_section_contents): Cast snprintf arguments to long long
6200 types to avoid warnings due to different uint64_t implementations
6201 on different hosts.
6202
2a2b6d42
DK
62032010-02-21 Doug Kwan <dougkwan@google.com>
6204
6205 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
6206 handling of the maximum backward branch offset.
2e702c99 6207 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
6208 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
6209 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 6210 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
6211 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
6212 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
6213 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
6214 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
6215 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
6216 thumb_bl_out_of_range thumb_bl_out_of_range.o,
6217 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
6218 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
6219 thumb2_bl_out_of_range.o): New rules.
6220 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
6221 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
6222 thumb2_bl_out_of_range
6223 * testsuite/Makefile.in: Regenerate.
6224 * testsuite/arm_bl_in_range.s: New file.
6225 * testsuite/arm_bl_out_of_range.s: Ditto.
6226 * testsuite/arm_branch_in_range.sh: Ditto.
6227 * testsuite/arm_branch_range.t: Ditto.
6228 * testsuite/thumb2_branch_range.t: Ditto.
6229 * testsuite/thumb_bl_in_range.s: Ditto.
6230 * testsuite/thumb_bl_out_of_range.s: Ditto.
6231 * testsuite/thumb_branch_range.t: Ditto.
6232
b487ad64
ST
62332010-02-20 Sriraman Tallam <tmsriram@google.com>
6234
6235 * gc.h (gc_process_relocs): Change vectors to point to the new list.
6236 Add reloc offset information.
6237 * icf.cc (get_section_contents): Change iterators to point to the new
6238 vectors. Add reloc offset information to the contents.
6239 * icf.h (Icf::Sections_reachable_info): New typedef.
6240 (Icf::Sections_reachable_list): New typedef.
6241 (Icf::Offset_info): New typedef.
6242 (Icf::Reloc_info): New struct typedef.
6243 (Icf::Reloc_info_list): New typedef.
6244 (Icf::symbol_reloc_list): Delete method.
6245 (Icf::addend_reloc_list): Delete method.
6246 (Icf::section_reloc_list): Delete method.
6247 (Icf::reloc_info_list): New method.
6248 (Icf::reloc_info_list_): New member.
6249
f96accdf
DK
62502010-02-19 Doug Kwan <dougkwan@google.com>
6251
6252 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
6253 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
6254 * arm.cc (Arm_relocation_functions): New forward declaration.
6255 (Target_arm::Target_arm): Initialize new data members
6256 got_mod_index_offset_ and tls_base_symbol_defined_.
6257 (Target_arm::Relocate::relocate_tls): New method.
6258 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
6259 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
6260 New methods.
2e702c99 6261 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
6262 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
6263 (Target_arm::got_mod_index_offset_,
6264 Target_arm::tls_base_symbol_defined_): New data members.
6265 (Target_arm::Scan::local, Target::Scan::global,
6266 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
6267 relocations.
6268
c8761b9a
DK
62692010-02-18 Doug Kwan <dougkwan@google.com>
6270
6271 * arm.cc (Arm_relobj::find_linked_text_section): New method.
6272 (Arm_relobj::make_exidx_input_section): Pass section index of linked
6273 text section as a parameter becuase some broken tools may not set
6274 the link in section header.
6275 (Target_arm::has_got_section): New method.
6276 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
6277 without any mapping symbol as data only. Remove warning.
6278 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
6279 link in its section header, try to discover the link by inspecting the
6280 REL31 relocation at the beginning of the section.
6281 (Target_arm::Scan::check_non_pic): Report name of offending relocation
6282 in error message.
6283 (Target_arm::Scan::global): Treat any reference to the symbol
6284 _GLOBAL_OFFSET_TABLE_ as a GOT access.
6285
21bb3914
ST
62862010-02-12 Sriraman Tallam <tmsriram@google.com>
6287
6288 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
6289 (Scan::global_reloc_may_be_function_pointer): New function.
6290 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6291 (Scan::global_reloc_may_be_function_pointer): New function.
6292 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6293 (Scan::global_reloc_may_be_function_pointer): New function.
6294 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
6295 (Scan::global_reloc_may_be_function_pointer): New function.
6296 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
6297 (Scan::global_reloc_may_be_function_pointer): New function.
6298 (Scan::possible_function_pointer_reloc): New function.
6299 (Target_x86_64::can_check_for_function_pointers): New function.
6300 * gc.h (gc_process_relocs): Scan relocation types to determine if
6301 function pointers were taken for targets that support it.
6302 * icf.cc (Icf::find_identical_sections): Include functions for
6303 folding in safe ICF whose pointer is not taken.
6304 * icf.h (Secn_fptr_taken_set): New typedef.
6305 (fptr_section_id_): New member.
6306 (section_has_function_pointers): New function.
6307 (set_section_has_function_pointers): New function.
6308 (check_section_for_function_pointers): New function.
6309 * options.h: Fix comment for safe ICF option.
6310 * target.h (can_check_for_function_pointers): New function.
6311 * testsuite/Makefile.am: Add icf_safe_so_test test case.
6312 Modify icf_safe_test for X86-64.
6313 * testsuite/Makefile.in: Regenerate.
6314 * testsuite/icf_safe_so_test.cc: New file.
6315 * testsuite/icf_safe_so_test.sh: New file.
6316 * testsuite/icf_safe_test.cc (kept_func_3): New function.
6317 (main): Change to take pointer to function kept_func_3.
6318 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
6319 folding is done correctly for X86-64.
6320
0da6fa6c
DM
63212010-02-12 David S. Miller <davem@davemloft.net>
6322
6323 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
6324 is_symbolless parameter.
6325 (Output_reloc<SHT_REL>::is_symbolless): New.
6326 (Output_reloc<SHT_REL>::is_symbolless_): New.
6327 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
6328 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
6329 (Output_reloc<SHT_RELA>::is_symbolless): New.
6330 (Output_data_reloc::add_global): Handle is_symbolless.
6331 (Output_data_reloc::add_global_relative): Likewise.
6332 (Output_data_reloc::add_local): Likewise.
6333 (Output_data_reloc::add_local_relative): Likewise.
6334 (Output_data_reloc::add_symbolless_global_addend): New.
6335 (Output_data_reloc::add_symbolless_local_addend): New.
6336 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
6337 is_symbolless.
6338 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
6339 instead of ->is_relative_
6340 (Output_reloc::write): Likewise.
6341 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
6342 (Output_reloc::write_rel): Simplify.
6343
6344 * sparc.cc (Target_sparc::Scan::local): Use
6345 ->add_symbolless_local_addend as needed.
6346 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
6347 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
6348 based upon relocation offset.
6349
e4782e83
DK
63502010-02-11 Doug Kwan <dougkwan@google.com>
6351
6352 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
6353 (Target_arm::Scan::global): Ditto. Also remove a comment before the
6354 beginning of function.
6355 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
6356 and MOVT_ABS relocations. Those are non issued in scanning. Fix
6357 parameter is_32bit in calls to should_apply_static_reloc.
6358 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
6359 (check_DATA): Add arm_abs_global.stdout.
6360 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
6361 arm_abs_global.stdout): New rules.
6362 (MOSTLLYCLEANFILES): Add arm_abs_global
6363 * Makefile.in: Regenerate.
6364 * testsuite/arm_abs_global.s: New file.
6365 * testsuite/arm_abs_global.sh: Ditto.
6366 * testsuite/arm_abs_lib.s: Ditto.
6367
93ceb764
ILT
63682010-02-11 Ian Lance Taylor <iant@google.com>
6369
6370 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
6371 Read_relocs task.
6372 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
6373 Allocate_commons_task first.
6374 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
6375 task, rather than symtab_lock_.
6376 (Gc_process_relocs::~Gc_process_relocs): New function.
6377 (Gc_process_relocs::is_runnable): Check this_blocker_.
6378 (Gc_process_relocs::locks): Use next_blocker_ rather than
6379 blocker_.
6380 (Scan_relocs::~Scan_relocs): New function.
6381 (Scan_relocs::is_runnable): Check this_blocker_ rather than
6382 symtab_lock_.
6383 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
6384 next_blocker_.
6385 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
6386 fields. Add this_blocker_ and next_blocker_ fields. Adjust
6387 constructor accordingly.
6388 (class Gc_process_relocs): Likewise.
6389 (class Scan_relocs): Likewise.
6390 * common.h (class Allocate_commons_task): Remove symtab_lock_
6391 field, and corresponding constructor parameter.
6392 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
6393 symtab_lock_.
6394 (Allocate_commons_task::locks): Likewise.
6395
114dfbe1
ILT
63962010-02-11 Ian Lance Taylor <iant@google.com>
6397
6398 * gold-threads.h (class Once): Define.
6399 (class Initialize_lock): Rewrite as child of Once.
6400 * gold-threads.cc (class Once_initialize): Define.
6401 (once_pointer_control): New static variable.
6402 (once_pointer, once_arg): New static variables.
6403 (c_run_once): New static function.
6404 (Once::Once, Once::run_once, Once::internal_run): New functions.
6405 (class Initialize_lock_once): Remove.
6406 (initialize_lock_control): Remove.
6407 (initialize_lock_pointer): Remove.
6408 (initialize_lock_once): Remove.
6409 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
6410 (Initialize_lock::initialize): Rewrite.
6411 (Initialize_lock::do_run_once): New function.
6412 * archive.cc (Archive::interpret_header): Only clear name if it is
6413 not already empty.
6414 * fileread.cc: Include "gold-threads.h"
6415 (file_counts_lock): New static variable.
6416 (file_counts_initialize_lock): Likewise.
6417 (File_read::release): Only increment counts when using --stats.
6418 Use a lock around the increment.
6419 * parameters.cc (class Set_parameters_target_once): Define.
6420 (set_parameters_target_once): New static variable.
6421 (Parameters::Parameters): Move here from parameters.h.
6422 (Parameters::set_target): Rewrite.
6423 (Parameters::set_target_once): New function.
6424 (Parameters::clear_target): Move here and rewrite.
6425 * parameters.h (class Parameters): Update declarations. Add
6426 set_parameters_target_once_ field.
6427 (Parameters::Parameters): Move to parameters.cc.
6428 (Parameters::clear_target): Likewise.
6429 * readsyms.cc (Read_symbols::do_group): Create a Start_group
6430 task.
6431 (Start_group::~Start_group): New function.
6432 (Start_group::is_runnable): New function.
6433 (Start_group::locks, Start_group::run): New functions.
6434 (Finish_group::run): Change saw_undefined to size_t.
6435 * readsyms.h (class Start_group): Define.
6436 (class Finish_group): Change saw_undefined_ field to size_t.
6437 (Finish_group::Finish_group): Remove saw_undefined and
6438 this_blocker parameters. Change all callers.
6439 (Finish_group::set_saw_undefined): New function.
6440 (Finish_group::set_blocker): New function.
6441 * symtab.h (class Symbol_table): Change saw_undefined to return
6442 size_t. Change saw_undefined_ field to size_t.
6443 * target-select.cc (Set_target_once::do_run_once): New function.
6444 (Target_selector::Target_selector): Initialize set_target_once_
6445 field. Don't initialize lock_ and initialize_lock_ fields.
6446 (Target_selector::instantiate_target): Rewrite.
6447 (Target_selector::set_target): New function.
6448 * target-select.h (class Set_target_once): Define.
6449 (class Target_selector): Update declarations. Make
6450 Set_target_once a friend. Remove lock_ and initialize_lock_
6451 fields. Add set_target_once_ field.
6452
fa17a3f4
ILT
64532010-02-10 Ian Lance Taylor <iant@google.com>
6454
6455 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
6456 queueing any tasks.
6457 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
6458 (queue_middle_tasks): Add all blockers before queueing any tasks.
6459 (queue_final_tasks): Likewise.
6460 * token.h (Task_token::add_blockers): New function.
6461 * object.h (Input_objects::number_of_relobjs): New function.
6462
c7177d31
ILT
64632010-02-10 Ian Lance Taylor <iant@google.com>
6464
5de0e392
ILT
6465 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
6466 shared, not if not position independent.
6467 * x86_64.cc (Relocate::relocate_tls): Likewise.
6468 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
6469 (tls_pie_pic_test): New target.
6470 * testsuite/Makefile.in: Rebuild.
6471
c7177d31
ILT
6472 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
6473 (tls_test_main_pie.o, tls_test_pie.o): New targets.
6474 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
6475 * testsuite/Makefile.in: Rebuild.
6476
684b268a
DM
64772010-02-09 David S. Miller <davem@davemloft.net>
6478
6479 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
6480 R_SPARC_RELATIVE using ->add_local_relative().
6481 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
6482
612a8d3d
DM
6483 * output.h (Output_data_dynamic::add_section_size): New method
6484 that takes two Output_data objects.
6485 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
6486 entry param. Handle it in initializers.
6487 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
6488 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
6489 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
6490 arg.
6491 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
6492 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
6493 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
6494 for dynrel_includes_plt.
6495 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6496 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6497 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
6498 before .rela.plt
6499 (Target_sparc::do_finalize_sections): Update to pass true for
6500 dynrel_includes_plt.
6501 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
6502 output before .rela.plt
6503 (Target_powerpc::do_finalize_sections): Update to pass true for
6504 dynrel_includes_plt when 32-bit.
6505
cb1be87e
DK
65062010-02-08 Doug Kwan <dougkwan@google.com>
6507
6508 * arm.cc (Arm_relobj::simple_input_section_output_address): New
6509 method.
6510 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
6511 Arm_relobj::scan_section_for_cortex_a8_stubs,
6512 Arm_relobj::do_relocation_section): Instead of calling
6513 Output_section::output_address, use faster
6514 Arm_relobj::simple_input_section_output_address.
6515
705b5121
DM
65162010-02-08 David S. Miller <davem@davemloft.net>
6517
6518 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
6519 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
6520 relocation helper function.
6521
024c4466
DM
6522 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
6523 just like R_SPARC_GOT{10,13,22}.
6524 (Target_sparc::Scan::local): Likewise.
6525 (Target_sparc::Relocate:relocate): Likewise.
6526
9109c078
ILT
65272010-02-06 Ian Lance Taylor <iant@google.com>
6528
6529 * configure.ac: Rewrite targetobjs duplicate removal code to use
6530 only shell constructs.
6531 * configure: Rebuild.
6532
cf846138
DK
65332010-02-05 Doug Kwan <dougkwan@google.com>
6534
6535 PR 11247
6536 * arm.cc (Arm_relobj::section_is_scannable): New method.
6537 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
6538 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
6539
6cfaf60b
DK
65402010-02-04 Doug Kwan <dougkwan@google.com>
6541
6542 PR 11247
6543 * arm-reloc-property.cc (cstdio): Include.
6544 * configure.ac (targetobjs): Remove duplicates.
6545 * configure: Regenerate.
6546 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
6547 big and little endian version for a given address size.
6548
5c57f1be
DK
65492010-02-03 Doug Kwan <dougkwan@google.com>
6550
6551 * arm-reloc-property.cc
6552 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6553 definition.
6554 * arm-reloc-property.h
6555 (Arm_reloc_property_table::get_implemented_static_reloc_property):
6556 New method definition.
6557 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6558 declaration.
6559 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
6560 overflow to N.
6561 (GOT_PREL): Change implemented to Y.
6562 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
6563 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
6564 (Arm_relocate_functions::movw_abs_nc): Remove method.
6565 (Arm_relocate_functions::movt_abs): Ditto.
6566 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
6567 (Arm_relocate_functions::thm_movt_abs): Ditto.
6568 (Arm_relocate_functions::movw_rel_nc): Ditto.
6569 (Arm_relocate_functions::movw_rel): Ditto.
6570 (Arm_relocate_functions::movt_rel): Ditto.
6571 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
6572 (Arm_relocate_functions:thm_movw_rel): Ditto.
6573 (Arm_relocate_functions:thm_movt_rel): Ditto.
6574 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
6575 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
6576 New method definitions.
6577 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
6578 (Arm_relocation_functions::arm_grp_ldr): Ditto.
6579 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
6580 (Arm_relocation_functions::arm_grp_ldc): Ditto.
6581 (Target_arm::Relocate::relocate): Check for non-static or
6582 unimplemented relocation code and exit early. Change calls to
6583 Target_arm::reloc_uses_thumb_bit and
6584 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
6585 instead. Refactor code to handle similar relocations to increase
6586 code sharing. Remove check for unsupported relocation code in switch
6587 statement.
6588 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
6589 relocation property table to find out size. Change error message to
6590 print out the name of a relocation code instead of the numeric value.
6591 (Target_arm::scan_reloc_for_stub): Use relocation property table
6592 instead of calling Target_arm::reloc_uses_thumb_bit().
6593
218c5831
DK
65942010-02-02 Doug Kwan <dougkwan@google.com>
6595
6596 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
6597 types of relaxed input section.
6598
0d31c79d
DK
65992010-02-02 Doug Kwan <dougkwan@google.com>
6600
6601 * Makefile.am (HFILES): Add arm-reloc-property.h.
6602 (DEFFILES): New.
2e702c99
RM
6603 (TARGETSOURCES): Add arm-reloc-property.cc
6604 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
6605 (libgold_a_SOURCES): $(DEFFILES)
6606 * Makefile.in: Regenerate.
6607 * arm-reloc-property.cc: New file.
6608 * arm-reloc-property.h: New file.
6609 * arm-reloc.def: New file.
6610 * arm.cc: Update comments.
6611 (arm-reloc-property.h): New included header.
6612 (arm_reloc_property_table): New global variable.
6613 (Target_arm::do_select_as_default_target): New method definition.
6614 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
6615 arm-reloc-property to targ_extra_obj.
6616 * parameters.cc (set_parameters_target): Call
6617 Target::select_as_default_target().
6618 * target.h (Target::select_as_default_target): New method definition.
6619 (Target::do_select_as_default_target): Same.
6620
546c7457
DK
66212010-02-01 Doug Kwan <dougkwan@google.com>
6622
6623 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
6624 first_output_text_section_.
6625 (Arm_exidx_fixup::first_output_text_section): New method definition.
6626 (Arm_exidx_fixup::first_output_text_section_): New data member.
6627 (Arm_exidx_fixup::process_exidx_section): Record the first text
6628 output section seen.
6629 (Arm_output_section::fix_exidx_coverage): Set correct linked section
6630 and entsize in output section header.
6631
11b861d5
DK
66322010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6633
6634 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
6635 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
6636 (Arm_relocate_functions::thm_alu11): New Method.
6637 (Arm_relocate_functions::thm_pc8): New Method.
6638 (Arm_relocate_functions::thm_pc12): New Method.
6639 (Target_arm::Scan::local): Handle the relocations.
6640 (Target_arm::Scan::global): Likewise.
6641 (Target_arm::Relocate::relocate): Likewise.
6642 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6643
c9a2c125
DK
66442010-01-29 Doug Kwan <dougkwan@google.com>
6645
6646 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
6647 of relocation types as ld.
6648
1521477a
DK
66492010-01-29 Doug Kwan <dougkwan@google.com>
6650
6651 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
6652 to public.
6653 (Arm_relocate_functions::thumb_branch_common): Ditto.
6654 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
6655 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
6656 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
6657 Arm_relocate_functions::jump24): Remove.
6658 (Target_arm::Relocate::relocate): Adjust code to call
6659 Arm_relocation_functions::arm_branch_common and
6660 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 6661 wrappers. Merge switch-cases together to reduce source code size.
1521477a 6662
e7eca48c
DK
66632010-01-29 Doug Kwan <dougkwan@google.com>
6664
6665 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
6666 output_local_symbol_count_needs_update_.
6667 (Arm_relobj::output_local_symbol_count_needs_update,
6668 Arm_relobj::set_output_local_symbol_count_needs_update,
6669 Arm_relobj::update_output_local_symbol_count): New methods.
6670 (Arm_relobj::output_local_symbol_count_needs_update_): New data
6671 member.
6672 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
6673 of pointed function as in a R_ARM_PREL31 relocation.
6674 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
6675 for output local symbol count updating.
6676 (Target_arm::do_relax): Update output local symbol counts in objects
6677 if necessary.
6678 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
6679
02961d7e
ILT
66802010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6681
6682 * arm.cc: Added support for the ARM relocations:
6683 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
6684 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
6685 (Arm_relocate_functions::movw_rel_nc): Renamed (was
6686 movw_prel_nc).
6687 (Arm_relocate_functions::movw_rel): New method.
6688 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
6689 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
6690 thm_movw_prel_nc).
6691 (Arm_relocate_functions::thm_movw_rel): New method.
6692 (Arm_relocate_functions::thm_movt_rel): Renamed (was
6693 thm_movt_prel).
6694 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
6695 relocations.
6696 (Target_arm::Scan::global): Likewise.
6697 (Target_arm::Relocate::relocate): Likewise.
6698 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6699 Likewise.
6700
b10d2873
ILT
67012010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6702
6703 * arm.cc: Added support for ARM group relocations.
6704 (Target_arm::reloc_needs_sym_origin): New method.
6705 (Arm_relocate_functions::calc_grp_kn): New method.
6706 (Arm_relocate_functions::calc_grp_residual): New method.
6707 (Arm_relocate_functions::calc_grp_gn): New method.
6708 (Arm_relocate_functions::arm_grp_alu): New Method.
6709 (Arm_relocate_functions::arm_grp_ldr): New Method.
6710 (Arm_relocate_functions::arm_grp_ldrs): New Method.
6711 (Arm_relocate_functions::arm_grp_ldc): New Method.
6712 (Target_arm::Scan::local): Handle the ARM group relocations.
6713 (Target_arm::Scan::global): Likewise.
6714 (Target_arm::Relocate::relocate): Likewise.
6715 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6716 Likewise.
6717
2b328d4e
DK
67182010-01-26 Doug Kwan <dougkwan@google.com>
6719
6720 * arm.cc (set): Include.
6721 (class Arm_exidx_fixup): Change type of last_input_section_ to const
6722 pointer type.
2e702c99 6723 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
6724 (Arm_output_section::append_text_sections_to_list): New method.
6725 (Arm_output_section::fix_exidx_coverage): Ditto.
6726 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 6727 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
6728 Relobj::set_section_offset() instead of
6729 Sized_relobj::invalidate_section_offset().
2e702c99 6730 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
6731 parameter for section headers. Ignore relocation sections for
6732 unallocated sections and EXIDX sections.
6733 (Target_arm::fix_exidx_coverage): New method.
6734 (Target_arm::output_section_address_less_than): New type.
6735 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
6736 linked text section instead of the EXIDX section.
6737 (Arm_output_section::create_stub_group): Add an assertion to check
6738 that this is not an EXIDX output section.
6739 (Arm_output_section::append_text_sections_to_list): New method.
6740 (Arm_output_section::fix_exidx_coverage): Ditto.
6741 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 6742 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
6743 (Target_arm::do_relax): Fix EXIDX output section coverage in the
6744 first pass.
6745 (Target_arm::fix_exidx_coverage): New method.
6746 * object.h (Relobj::set_output_section): New method.
6747 (Sized_relobj::invalidate_section_offset): Remove method.
6748 (Sized_relobj::do_invalidate_section_offset): Remove method.
6749 (Sized_relobj::do_set_section_offset): Handle offset value -1.
6750
c7f3c371
DK
67512010-01-25 Doug Kwan <dougkwan@google.com>
6752
6753 * arm.cc (Arm_exidx_merged_section::do_output_offset):
6754 Fix warning due to signed and unsigned comparison on a 32-bit host.
6755
8923b24c
DK
67562010-01-22 Doug Kwan <dougkwan@google.com>
6757
6758 * arm.cc (Target_arm::do_relax): Record an output section for section
6759 offset adjustment it contains any stub table that has changed.
6760 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
6761 offsets in an output section if necessary.
6762 * output.cc (Output_section::Output_section): Initialize
6763 section_offsets_need_adjustments_.
6764 (Output_section::add_input_section_for_script): Renamed to
6765 Output_section::add_simple_input_section.
6766 (Output_section::save_states): Add a comment.
6767 (Output_section::discard_states): New method defintion.
6768 (Output_section::adjust_section_offsets): Same.
6769 * output.h (Output_section::add_input_section_for_script): Renamed to
6770 Output_section::add_simple_input_section.
6771 (Output_section::discard_states): New method declaration.
6772 (Output_section::adjust_section_offsets): Same.
6773 (Output_section::section_offsets_need_adjustment,
6774 Output_section::set_section_offsets_need_adjustment): New method
6775 definitions.
6776 (Output_section::section_offsets_need_adjustment_): New data member.
6777 * script-sections.cc
6778 (Output_section_element_input::set_section_address): Adjust code for
6779 renaming of Output_section::add_input_section_for_script.
6780 (Orphan_output_section::set_section_address): Same.
6781
9b2fd367
DK
67822010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6783
6784 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
6785 Fix_v4bx enum values .
6786 * gold/options.h (General_options): New option definitions.
6787 (General_options::fix_v4bx): New method.
6788 (General_options::Fix_v4bx): New enum.
6789 * gold/options.cc (General_options::parse_fix_v4bx): New method.
6790 (General_options::parse_fix_v4bx_interworking): New method.
6791
80d0d023
DK
67922010-01-22 Doug Kwan <dougkwan@google.com>
6793
6794 * arm.cc (Arm_exidx_fixup): New class.
6795
af2cdeae
DK
67962010-01-21 Doug Kwan <dougkwan@google.com>
6797
6798 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
6799 classes.
6800 (Arm_exidx_section_offset_map): New type.
6801
993d07c1
DK
68022010-01-21 Doug Kwan <dougkwan@google.com>
6803
6804 * arm.cc (Arm_exidx_input_section): New class.
6805 (Arm_relobj::exidx_input_section_by_link,
6806 Arm_relobj::exidx_input_section_by_shndx,
6807 Arm_relobj::make_exidx_input_section): New methods.
6808 (read_arm_attributes_section): Remove.
6809 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
6810 information about them.
6811 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
6812 to here.
6813
5ac169d4
DK
68142010-01-20 Doug Kwan <dougkwan@google.com>
6815
6816 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
6817 Input_section_specifier to Section_id.
6818 (Target_arm::new_arm_input_section: Adjust code for change of key
6819 type.
6820 (Target_arm::find_arm_input_section): Ditto.
6821 * gc.h (object.h): Include for Section_id nand Section_id_hash.
6822 (Section_id): Remove.
6823 (Garbage_collection::Section_id_hash): Remove.
6824 * icf.h (object.h): Include for Section_id nand Section_id_hash.
6825 (Section_id): Remove.
6826 (Icf::Section_id_hash): Remove.
6827 * object.h (Section_id, Const_section_id, Section_id_hash,
6828 Const_section_id_hash): New type definitions.
6829 * output.cc (Output_section::add_relaxed_input_section): Change to
6830 use Const_section_id instead of Input_section_specifier as key type.
6831 (Output_section::add_merge_input_section): Ditto.
6832 (Output_section::build_relaxation_map): Change to use Section_id
6833 instead of Input_section_specifier as key type.
2e702c99 6834 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
6835 Ditto.
6836 (Output_section::convert_input_sections_to_relaxed_sections): Change
6837 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 6838 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
6839 (Output_section::find_relaxed_input_section): Ditto.
6840 * output.h (Input_section_specifier): Remove class.
6841 (Output_section::Output_section_data_by_input_section_map): Change
6842 key type to Const_section_id.
6843 (Output_section::Output_relaxed_input_section_by_input_section_map):
6844 Ditto.
6845 (Output_section::Relaxation_map): Change key type to Section_id.
6846
a2162063
ILT
68472010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6848
6849 * gold/arm.cc: Added support for R_ARM_V4BX relocation
6850 (class Arm_v4bx_stub): New class.
6851 (DEF_STUBS): Updated definition to support v4_veneer_bx.
6852 (Stub_factory::make_arm_v4bx_stub): New method.
6853 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
6854 (Stub_table::empty): Handle v4bx stubs.
6855 (Stub_table::add_arm_v4bx_stub): New method.
6856 (Stub_table::find_arm_v4bx_stub): New method.
6857 (Arm_relocate_functions::v4bx): New method.
6858 (Target_arm::fix_v4bx): New method.
6859 (Target_arm::Target_arm): Handle R_ARM_V4BX.
6860 (Stub_table::relocate_stubs): Likewise.
6861 (Stub_table::do_write): Likewise.
6862 (Stub_table::update_data_size_and_addralign): Likewise.
6863 (Stub_table::finalize_stubs): Likewise.
6864 (Target_arm::Scan::local): Likewise.
6865 (Target_arm::Scan::global): Likewise.
6866 (Target_arm::do_finalize_sections): Likewise.
6867 (Target_arm::Relocate::relocate): Likewise.
6868 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6869 Likewise.
6870 (Target_arm::scan_reloc_for_stub): Likewise.
6871 (Target_arm::scan_reloc_section_for_stubs): Likewise.
6872
5696ab0b
ILT
68732010-01-19 Ian Lance Taylor <iant@google.com>
6874
6875 * output.cc (Output_section_headers::do_sized_write): Write large
6876 segment count to sh_info field.
6877 (Output_file_header::do_sized_write): For large segment count,
6878 write PN_XNUM to e_phnum field.
6879
800d0f56
ILT
68802010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6881
6882 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
6883 (Arm_relocate_functions::thm_jump8): New function.
6884 (Arm_relocate_functions::thm_jump11): New function.
6885 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
6886 R_ARM_THM_JUMP11.
6887 (Target_arm::Scan::global): Likewise.
6888 (Target_arm::Relocate::relocate): Likewise.
6889 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6890 Likewise.
6891
41263c05
DK
68922010-01-14 Doug Kwan <dougkwan@google.com>
6893
6894 * arm.cc (map, utility): Include headers.
6895 (Target_arm::apply_cortex_a8_workaround): New method.
6896 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
6897 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
6898 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
6899 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
6900 the --[no-]fix-cortex-a8 command line options.
6901 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
6902 (Target_arm::relocate_stub): Use addend in instruction template.
6903 * options.h (DEFINE_bool): Set the user-set flag.
6904 (General_options): Add --[no-]-fix-cortex options.
6905 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 6906 : Update fast look-up map after conversion.
41263c05 6907
459e9b03
ST
69082010-01-14 Sriraman Tallam <tmsriram@google.com>
6909
6910 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
6911 in the first pass of do_layout.
6912
b521dfe4
DK
69132010-01-13 Doug Kwan <dougkwan@google.com>
6914
6915 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
6916 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
6917 apparent compiler problem of not folding static constant integral
6918 data members of elfcpp::Elf_sizes<32>.
6919
44272192
DK
69202010-01-13 Doug Kwan <dougkwan@google.com>
6921
6922 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
6923 Arm_relobj::section_needs_cortex_a8_stub_scanning,
6924 Arm_relobj::scan_section_for_cortex_a8_erratum,
6925 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
6926 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
6927 sections to scan for relocation stubs into a new method
6928 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
6929 relocation and Cortex-A8 stub scanning.
6930 (Target_arm::do_relax): Force stubs to be after stubbed sections
6931 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 6932 the beginning of a new relaxation pass. Update a comment.
44272192
DK
6933 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
6934
44b71ece
ILT
69352010-01-12 Ian Lance Taylor <iant@google.com>
6936
6937 * target-reloc.h (visibility_error): New inline function.
6938 (relocate_section): Call visibility_error.
6939 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
6940 (MOSTLYCLEANFILES): Likewise.
6941 (protected_4_pic.o, protected_3.err): New targets.
6942 * testsuite/protected_4.cc: New file.
6943
a120bc7f
DK
69442010-01-12 Doug Kwan <dougkwan@google.com>
6945
6946 * arm.cc (Cortex_a8_reloc): New class.
6947 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
6948 and cortex_a8_relocs_info_.
6949 (Target_arm::fix_cortex_a8): New method definition.
6950 (Target_arm::Cortex_a8_relocs_info): New type.
6951 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
6952 New data member declarations.
6953 (Target_arm::scan_reloc_for_stub): Record information about
6954 relocations for THUMB branches that might be exempted from the
6955 Cortex-A8 workaround.
6956 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
6957 at the beginning of a relaxation pass.
6958
20138696
DK
69592010-01-12 Doug Kwan <dougkwan@google.com>
6960
6961 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
6962 (Arm_relobj::Mapping_symbol_position,
6963 Arm_reloj::Mapping_symbol_position_less,
6964 Arm_relobj::Mapping_symbols_info): New types.
6965 (Target_arm::is_mapping_symbol_name): New method definition.
6966 (Arm_relobj::do_count_local_symbols): Save information about mapping
6967 symbols.
6968
089d69dc
DK
69692010-01-11 Doug Kwan <dougkwan@google.com>
6970
6971 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
6972 Arm_relocate_functions::thumb32_branch_upper,
6973 Arm_relocate_functions::thumb32_branch_lower,
6974 Arm_relocate_functions::thumb32_cond_branch_offset,
6975 Arm_relocate_functions::thumb32_cond_branch_upper,
6976 Arm_relocate_functions::thumb32_cond_branch_lower,
6977 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
6978 branch offset encoding.
6979 (Arm_relocate_functions::thumb_branch_common): Use new branch
6980 offset encoding methods to avoid code duplication.
6981 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
6982 (Stub_addend_reader::operator()): Use new branch encoding method
6983 to avoid code duplication.
6984
99e5bff2
DK
69852010-01-11 Doug Kwan <dougkwan@google.com>
6986
6987 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
6988 (Target_arm::do_finalize_sections): Define special EXIDX section
6989 symbols only if referenced.
6990 * gc.h (Garbage_collection::add_reference): New method.
6991 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
6992 code duplication.
6993
98e090bd
ILT
69942010-01-11 Ian Lance Taylor <iant@google.com>
6995
d0a91bd8
ILT
6996 * script.cc (Version_script_info::build_expression_list_lookup):
6997 Change complaing about duplicate wildcard match from error to
6998 warning.
6999
98e090bd
ILT
7000 * script.cc (class Lazy_demangler): Recreate--revert part of patch
7001 of 2009-12-30.
7002 (Version_script_info::Version_script_info): Initialize globs_,
7003 default_version_, default_is_global_, and exact_. Don't
7004 initialize globals_ or locals_.
7005 (Version_script_info::build_lookup_tables): Build local symbols
7006 first.
7007 (Version_script_info::unquote): New function.
7008 (Version_script_info::add_exact_match): New function.
7009 (Version_script_info::build_expression_list_lookup): Remove lookup
7010 parameter. Add is_global parameter. Change all callers. Handle
7011 wildcard pattern specially. Unquote pattern. Call
7012 add_exact_match.
7013 (Version_script_info::get_name_to_match): New function.
7014 (Version_script_info::get_symbol_version): New function.
7015 (Version_script_info::get_symbol_version_helper): Remove.
7016 (Version_script_info::check_unmatched_names): Call unquote.
7017 * script.h (class Version_script_info): Change get_symbol_version
7018 to be non-inline and add is_global parameter; change all callers.
7019 Rewrite symbol_is_local. Update declarations. Define struct
7020 Version_tree_match, Exact, Globs. Don't define struct Lookup.
7021 Remove globals_ and locals_ members. Add exact_, globs_,
7022 default_version_, is_global_.
7023 (Version_script_info::Glob): Remove pattern, add expression and
7024 is_global. Update constructor. Change all callers.
7025 * dynobj.cc (Versions::finalize): Mark the version symbol as the
7026 default version.
7027 (Versions::symbol_section_contents): If a symbol is undefined, or
7028 defined in a dynamic object, set the version index to
7029 VER_NDX_LOCAL.
7030 * symtab.cc (Symbol_table::add_from_relobj): Don't call
7031 symbol_is_local.
7032 (Symbol_table::add_from_pluginobj): Likewise.
7033 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
7034
d56962d3
DK
70352010-01-11 Doug Kwan <dougkwan@google.com>
7036
7037 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
7038 (incremental_dump_LDADD): Add linking option for libintl.
7039 * Makefile.in: Regenerate.
7040
94e6ee91
L
70412010-01-11 H.J. Lu <hongjiu.lu@intel.com>
7042
7043 PR gold/11144
7044 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
7045 instead of -Ds.
7046 * testsuite/Makefile.in: Regenerated.
7047
e96c574b
DK
70482010-01-10 Doug Kwan <dougkwan@google.com>
7049
7050 * options.h (DEFINE_var): Use parentheses around argument varname__
7051 in macro body to avoid any unintended subsequent substitutions.
7052
7198066b
ILT
70532010-01-10 Ian Lance Taylor <iant@google.com>
7054
ba4d53bf
ILT
7055 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
7056 candidates before doing symbol resolution.
7057
7198066b
ILT
7058 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
7059 ODR candidates if only one is weak.
7060
a2beed37
ILT
70612010-01-08 Ian Lance Taylor <iant@google.com>
7062
7063 * script.cc (Version_script_info::build_expression_list_lookup):
7064 Don't warn about ambiguous version, just record the ambiguity.
7065 (Version_script_info::get_symbol_version_helper): Give error if
7066 version is ambiguous.
7067
2fb7225c
DK
70682010-01-08 Doug Kwan <dougkwan@google.com>
7069
7070 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
7071 prev_data_size_ and prev_addralign_. Remove initializer for
7072 deleted data member has_been_changed_.
7073 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
7074 to determine if the table is empty.
7075 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
7076 Remove.
7077 (Stub_table::add_reloc_stub): Define method in class definition
7078 instead of just declaring it there.
7079 (Stub_table::add_cortex_a8_stub): New method definition.
7080 (Stub_table::update_data_size_and_addralign): Ditto.
7081 (Stub_table::finalize_stubs): Ditto.
7082 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
7083 (Stub_table::do_addralign_): Return address alignment in the
7084 (Stub_table::do_reset_address_and_file_offset): Define method in
7085 class definition instead of declaring it there. Set current data
7086 size to be the data size of the previous pass.
7087 (Stub_table::set_final_data_size): Use current data size as the
7088 final data size.
7089 (Stub_table::relocate_stub): Change parameter type of stub from
7090 Reloc_stub pointer to Stub pointer.
7091 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
7092 (Stub_table::Cortex_a8_stub_list): New typedef.
7093 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
7094 Stub_table::prev_addralign_): New data member.
7095 (Arm_relobj::Arm_relobj): Initialize data member
7096 section_has_cortex_a8_workaround_.
7097 (Arm_relobj::section_has_cortex_a8_workaround,
7098 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
7099 definitions.
7100 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
7101 declarations.
7102 (Target_arm::relocate_stub): Change parameter type of stub from
7103 Reloc_stub pointer to Stub pointer.
7104 (Insn_template::size, Insn_template::alignment): Handle
7105 THUMB16_SPECIAL_TYPE.
7106 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
7107 Stub_table::update_data_size_and_addralign,
7108 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
7109 definitions.
2e702c99 7110 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
2fb7225c
DK
7111 (Stub_table::do_write): Ditto.
7112 (Target_arm::do_relax): Adjust code for changes in Stub_table.
7113
880cd20d
ILT
71142010-01-08 Ian Lance Taylor <iant@google.com>
7115
7116 PR 11108
7117 * symtab.h (class Symbol): Remove fields is_target_special_ and
7118 has_plt_offset_. Add field is_defined_in_discarded_section_.
7119 (Symbol::is_defined_in_discarded_section): New function.
7120 (Symbol::set_is_defined_in_discarded_section): New function.
7121 (Symbol::has_plt_offset): Rewrite.
7122 (Symbol::set_plt_offset): Verify that new offset is not -1U.
7123 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
7124 Don't initialize is_target_special_ or has_plt_offset_.
7125 Initialize is_defined_in_discarded_section_.
7126 (Symbol_table::add_from_relobj): If appropriate, set
7127 is_defined_in_discarded_section.
7128 * resolve.cc (Symbol::override_base_with_special): Don't test
7129 is_target_special_. Change has_plt_offset_ to has_plt_offset().
7130 * target-reloc.h (relocate_section): Do special handling for
7131 symbols defined in discarded sections for global symbols as well
7132 as local symbols.
7133
2703e3eb
ILT
71342010-01-08 Ian Lance Taylor <iant@google.com>
7135
7136 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
7137 the SHT_SYMTAB case.
7138
339d40a3
ILT
71392010-01-08 Ian Lance Taylor <iant@google.com>
7140
7141 * object.cc (Sized_relobj::do_layout): Don't get confused if
7142 layout_eh_frame returns NULL.
7143
abecea76
ILT
71442010-01-08 Ian Lance Taylor <iant@google.com>
7145
7146 PR 11084
7147 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
7148 dynamic symbol table, use the normal symbol table.
7149 (Sized_dynobj::do_read_symbols): Remove assertion about type of
7150 symbol table.
7151
6b7dd3f3
ILT
71522010-01-08 Ian Lance Taylor <iant@google.com>
7153
7154 PR 11072
7155 * layout.cc (Layout::include_section): Remove .gnu_debuglink
7156 sections.
7157
36c50e63
L
71582010-01-08 H.J. Lu <hongjiu.lu@intel.com>
7159
7160 * version.cc (print_version): Change to "Copyright 2010".
7161
e291e7b9
ILT
71622010-01-08 Ian Lance Taylor <iant@google.com>
7163
7164 PR 10287
7165 PR 11063
7166 * i386.cc (class Target_i386): Change return type of plt_section
7167 to be non-const.
7168 (class Output_data_plt_i386): Add tls_desc_rel_ field.
7169 (Output_data_plt_i386::Output_data_plt_i386): Initialize
7170 tls_desc_rel_ field.
7171 (Output_data_plt_i386::rel_tls_desc): New function.
7172 (Target_i386::rel_tls_desc_section): New function.
7173 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
7174 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
7175 R_386_TLS_DESC reloc in rel_tls_desc_section.
7176 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
7177 Define struct Tlsdesc_info.
7178 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
7179 (Target_x86_64::do_reloc_symbol_index): New function.
7180 (Target_x86_64::add_tlsdesc_info): New function.
7181 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
7182 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
7183 tlsdesc_rel_ field.
7184 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
7185 all callers.
7186 (Output_data_plt_x86_64::rela_tlsdesc): New function.
7187 (Target_x86_64::rela_tlsdesc_section): New function.
7188 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
7189 handling.
7190 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
7191 (Target_x86_64::do_reloc_addend): New function.
7192 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
7193 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
7194 declarations. Define TARGET_CODE. Add arg field to u1_ union.
7195 (Output_reloc::type): New function.
7196 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
7197 (Output_reloc::is_target_specific): New function.
7198 (Output_reloc::target_arg): New function.
7199 (class Output_reloc) [SHT_RELA]: Add four new constructors for
7200 absolute relocs and target specific relocs.
7201 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
7202 add_target_specific.
7203 (class Output_data_reloc) [SHT_RELA]: Likewise.
7204 * output.cc (Output_reloc::Output_reloc): Add four new versions
7205 for absolute relocs and target specific relocs.
7206 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
7207 (Output_reloc::get_symbol_index): Likewise.
7208 (Output_reloc::local_section_offset): Check that local_sym_index_
7209 is not TARGET_CODE or 0.
7210 (Output_reloc::symbol_value): Likewise.
7211 (Output_reloc::write) [SHT_RELA]: Call target for target specific
7212 reloc.
7213 * target.h (class Target): Add reloc_symbol_index and reloc_addend
7214 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
7215 functions.
7216 * layout.cc (add_target_dynamic_tags): Use output section for
7217 DT_PLTRELSZ and DT_JMPREL.
7218
3a44184e
ILT
72192010-01-07 Ian Lance Taylor <iant@google.com>
7220
7221 PR 11061
7222 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
7223 function.
7224 (class Output_data_reloc_generic): Define.
7225 (class Output_data_reloc_base): Change base class to
7226 Output_data_reloc_generic. Change add() method to call
7227 bump_relative_reloc_count for a relative reloc. Remove
7228 sort_relocs_ field.
7229 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
7230 to sort_relocs().
7231 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
7232 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
7233 appropriate.
7234 * layout.h (class Layout): Update declaration.
7235
ea715a34
ILT
72362010-01-07 Ian Lance Taylor <iant@google.com>
7237
7238 * output.h (class Output_data): Add const version of
7239 output_section and do_output_section.
7240 (class Output_section_data): Add const version of
7241 do_output_section.
7242 (class Output_section): Likewise.
7243 * layout.cc (Layout::add_target_dynamic_tags): New function.
7244 * layout.h (class Layout): Update declarations.
7245 * arm.cc (Target_arm::do_finalize_sections): Use
7246 add_target_dynamic_tags.
7247 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7248 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
7249 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
7250 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7251
659948a4
ILT
72522010-01-07 Ian Lance Taylor <iant@google.com>
7253
7254 PR 11042
7255 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
7256 object as needed.
7257
9d3b86f6
ILT
72582010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
7259 Ian Lance Taylor <iant@google.com>
7260
7261 PR 11019
7262 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
7263 Xindex::read_symtab_xindex.
7264
bb0d3eb0
DK
72652010-01-07 Doug Kwan <dougkwan@google.com>
7266
7267 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
7268 (Insn_template::thumb16_bcond_insn): New method declaration.
7269 (Insn_template): Fix spelling.
7270 (Stub::thumb16_special): New method declaration.
7271 (Stub::do_write): Define virtual method which was previously pure
7272 virtual.
7273 (Stub::do_thumb16_special): New method declaration.
7274 (Stub::do_fixed_endian_write): New template member.
7275 (Reloc_stub::do_write): Remove.
7276 (Reloc_stub::do_fixed_endian_write): Remove.
7277 (Cortex_a8_stub): New class definition.
7278 (Stub_factory::make_cortex_a8_stub): New method definition.
7279 (Stub_factory::Stub_factory): Add missing static storage class
7280 qualifier for elf32_arm_stub_a8_veneer_blx.
7281
ffeef7df
ILT
72822010-01-07 Ian Lance Taylor <iant@google.com>
7283
dc3f80fe
ILT
7284 PR 10980
7285 * options.h (class General_options): Add --warn-unresolved-symbols
7286 and --error-unresolved-symbols.
7287 * errors.cc (Errors::undefined_symbol): Implement
7288 --warn-unresolved-symbols.
7289
ffeef7df
ILT
7290 * options.h (class General_options): Add -z text and -z textoff.
7291 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
7292
f1ec9ded
ST
72932010-01-06 Sriraman Tallam <tmsriram@google.com>
7294
7295 * gc.h (Garbage_collection::Cident_section_map): New typedef.
7296 (Garbage_collection::cident_sections): New function.
7297 (Garbage_collection::add_cident_section): New function.
7298 (Garbage_collection::cident_sections_): New member.
7299 (gc_process_relocs): Add references to sections whose names are C
7300 identifiers.
7301 * gold.h (cident_section_start_prefix): New constant.
7302 (cident_section_stop_prefix): New constant.
7303 (is_cident): New function.
7304 * layout.cc (Layout::define_section_symbols): Replace string constants
7305 with the newly defined constants.
7306 * object.cc (Sized_relobj::do_layout): Track sections whose names are
7307 C identifiers.
7308 * testsuite/Makefile.am: Add gc_orphan_section_test.
7309 * testsuite/Makefile.in: Regenerate.
7310 * testsuite/gc_orphan_section_test.cc: New file.
7311 * testsuite/gc_orphan_section_test.sh: New file.
7312
6eda8c29
ILT
73132010-01-06 Ian Lance Taylor <iant@google.com>
7314
b9674e17
ILT
7315 PR 10980
7316 * options.h (class General_options): Add --warn-shared-textrel.
7317 * layout.cc (Layout::finish_dynamic_section): Implement
7318 --warn-shared-textrel.
7319
6eda8c29
ILT
7320 PR 10980
7321 * options.h (class General_options): Add --warn-multiple-gp.
7322
32dcd44e
ILT
73232010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7324
7325 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
7326 $(THREADSLIB) and $(LIBDL).
7327 * Makefile.in: Rebuild.
7328
a192ba05
ILT
73292010-01-06 Ian Lance Taylor <iant@google.com>
7330
7331 PR 10980
7332 * options.cc (General_options::parse_section_start): New function.
7333 (General_options::section_start): New function.
7334 (General_options::General_options): Initialize all members.
7335 * options.h: Include <map>
7336 (class General_options): Add --section-start. Add section_starts_
7337 member.
7338 * layout.cc (Layout::attach_allocated_section_to_segment): If
7339 --section-start was used, set the address of the segment. Remove
7340 local sort_sections.
7341 (Layout::relaxation_loop_body): If the address of the load segment
7342 has been set by --section-start, don't use it.
7343 * output.h (Output_segment::update_flags_for_output_section): New
7344 function.
7345 * output.cc (Output_segment::add_output_section): Call
7346 update_flags_for_output_section.
7347
dde3f402
ILT
73482010-01-05 Ian Lance Taylor <iant@google.com>
7349
62dfdd4d
ILT
7350 PR 10980
7351 * options.h (class General_options): Add --undefined-version.
7352 * script.cc (struct Version_expression): Add was_matched_by_symbol
7353 field.
7354 (Version_script_info::matched_symbol): New function.
7355 (Version_script_info::get_symbol_version_helper): Call
7356 matched_symbol.
7357 (Version_script_info::check_unmatched_names): New function.
7358 * script.h (class Version_script_info): Update declarations.
7359 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
7360
9c4ae156
ILT
7361 * options.h (class General_options): Use DEFINE_bool_alias for
7362 allow_multiple_definition.
7363 * resolve.cc (Symbol_table::should_override): Don't test
7364 allow_multiple_definition.
7365
dde3f402
ILT
7366 PR 10980
7367 * options.h (class General_options): Add --cref.
7368 * main.cc (main): Print cref table if --cref. Don't close mapfile
7369 until after printing cref table.
7370 * cref.cc: Include "symtab.h".
7371 (class Cref_inputs): Define Cref_table_compare and Cref_table.
7372 (Cref_table_compare::operator()): New function.
7373 (Cref_inputs::gather_cref): New function.
7374 (filecol): New static const.
7375 (Cref_inputs::print_cref): New function.
7376 (Cref::print_cref): New function.
7377 * cref.h: Include <cstdio>.
7378 (class Cref): Update declarations.
7379 * mapfile.h (Mapfile::file): New function.
7380 * object.h (class Object): Define Symbols. Declare virtual
7381 do_get_global_symbols.
7382 (Object::get_global_symbols): New function.
7383 * object.cc (Input_objects::add_object): Pass object to cref_ if
7384 --cref.
7385 (Input_objects::archive_start): Likewise.
7386 (Input_objects::archive_stop): Likewise.
7387 (Input_objects::print_cref): New function.
7388 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
7389 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
7390 --cref.
7391 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
7392 function.
7393 * plugin.h (class Sized_pluginobj): Update declarations.
7394
8781f709
ILT
73952010-01-05 Ian Lance Taylor <iant@google.com>
7396
7397 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
7398 to is_default_version. Rename insdef to insdefault.
7399 (Symbol_table::add_from_relobj): Rename def to is_default_version
7400 and local to is_forced_local.
7401 (Symbol_table::add_from_pluginobj): Likewise.
7402 (Symbol_table::add_from_dynobj): Likewise.
7403 (Symbol_table::define_special_symbol): Rename insdef to
7404 insdefault.
7405
fe35d28d
ILT
74062010-01-04 Ian Lance Taylor <iant@google.com>
7407
30bc8c46
ILT
7408 PR 10980
7409 * options.h (class General_options): Add
7410 --allow-multiple-definition and -z muldefs.
7411 * resolve.cc (Symbol_table::should_override): Don't warn about a
7412 multiple symbol definition if --allow-multiple-definition or -z
7413 muldefs.
7414
7eaea549
ILT
7415 PR 10980
7416 * options.h (class General_options): Add --add-needed and
7417 --copy-dt-needed-entries. Tweak --as-needed help entry.
7418 * object.cc (Input_objects::check_dynamic_dependencies): Give an
7419 error if --copy-dt-needed-entries aka --add-needed is used and
7420 would cause a change in behaviour.
7421
fe35d28d
ILT
7422 PR 10980
7423 * options.h (class General_options): Add -G as a short version of
7424 --shared. Add no-op options -assert, -g, and -i.
7425
55a2bb35
ST
74262010-01-04 Sriraman Tallam <tmsriram@google.com>
7427
7428 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
7429 check for .text or .gnu.linkonce.t sections.
7430 * icf.cc (Icf::find_identical_sections): Ditto.
7431 Change the detection for mangled function name within the section
7432 name.
7433 * icf.h (is_section_foldable_candidate): New function.
7434
719328e1
ILT
74352009-12-30 Ian Lance Taylor <iant@google.com>
7436
7437 PR 10980
7438 * options.h (class General_options): Permit two dashes with
7439 --retain-symbols-file.
7440
d7bb5745
ILT
74412009-12-30 Ian Lance Taylor <iant@google.com>
7442
403a15dd
ILT
7443 PR 10979
7444 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
7445 don't put the file header and segment headers in the text
7446 segment.
7447
eda294df
ILT
7448 PR 10979
7449 * common.cc (Sort_commons::operator()): Stabilize sort when both
7450 entries are NULL.
7451 (Symbol_table::do_allocate_commons_list): When allocating common
7452 symbols, skip a symbol which is no longer common.
7453 * symtab.h (Symbol::is_common): Test whether the symbol comes from
7454 an object before checking its type.
7455 * testsuite/common_test_2.c: New file.
7456 * testsuite/common_test_3.c: New file.
7457 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
7458 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
7459 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
7460 (common_test_2_pic.o, common_test_2.so): New targets.
7461 (common_test_3_pic.o, common_test_3.so): New targets.
7462 * testsuite/Makefile.in: Rebuild.
7463
d7bb5745
ILT
7464 PR 10979
7465 * script.cc (read_input_script): If we see a new SECTIONS clause,
7466 and we have added an input section, give an error.
7467 * layout.h (class Layout): Add have_added_input_section function.
7468 Add have_added_input_section_ field.
7469 * layout.cc (Layout::Layout): Initialize
7470 have_added_input_section_.
7471 (Layout::layout): Set have_added_input_section_.
7472 (Layout::layout_eh_frame): Likewise.
7473
fc59c572
ILT
74742009-12-30 Ian Lance Taylor <iant@google.com>
7475
7476 PR 10931
7477 * options.h (class General_options): Add --sort-common option.
7478 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
7479 * common.cc (Sort_common): Add sort_order parameter to
7480 constructor. Add sort_order_ field.
7481 (Sort_commons::operator): Check sort_order_.
7482 (Symbol_table::allocate_commons): Determine the sort order.
7483 (Symbol_table::do_allocate_commons): Add sort_order parameter.
7484 Change all callers.
7485 (Symbol_table::do_allocate_commons_list): Likewise.
7486
1c74fab0
ILT
74872009-12-30 Ian Lance Taylor <iant@google.com>
7488
7489 PR 10916
7490 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
7491 symbols from this object, don't change the visibility of an
7492 undefined symbol.
7493 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
7494
6affe781
ILT
74952009-12-30 Ian Lance Taylor <iant@google.com>
7496
7497 PR 10861
7498 * script.h (class Version_script_info): Define Language enum.
7499 Update declarations. Define Glob, Exact, and Lookup types. Add
7500 new fields globals_, locals_, and is_finalized_.
7501 * script.cc: Various formatting fixes.
7502 (class Parser_closure): Change language_stack_ from a vector of
7503 std::string to one of Version_script_info::Language. Adjust all
7504 uses accordingly.
7505 (class Lazy_demangler): Remove.
7506 (struct Version_expression): Change language from std::string to
7507 Version_script_info::Language.
7508 (Version_script_info::Version_script_info): New function.
7509 (Version_script_info::~Version_script_info): Don't call clear.
7510 (Version_script_info::finalize): New function.
7511 (Version_script_info::build_lookup_tables): New function.
7512 (Version_script_info::build_expression_list_lookup): New
7513 function.
7514 (Version_script_info::get_symbol_version_helper): Rewrite to use
7515 lookup tables.
7516 (Version_script_info::print_expression_list): Adjust to use
7517 Version_script_info::Language.
7518 (script_push_lex_into_version_mode): Check that the version script
7519 has not been finalized.
7520 (version_script_push_lang): Change language string to
7521 Version_script_info::Language.
7522 * options.cc (Command_line::version_script): New function.
7523 * options.h (class General_options): Add finalize_dynamic_list
7524 function. Change version_script from declaration to definition.
7525 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
7526 * testsuite/version_script.map: Remove duplicate def of foo.
7527 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
7528 version_script.map.
7529 * testsuite/Makefile.in: Rebuild.
7530
818bf354
ILT
75312009-12-30 Ian Lance Taylor <iant@google.com>
7532
7533 PR 10843
7534 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
7535 if the input symbol index is 0, make the output symbol index 0.
7536
ebcc8304
ILT
75372009-12-30 Ian Lance Taylor <iant@google.com>
7538
7539 PR 10670
7540 * options.h (class General_options): Add -x/--discard-all.
7541 * object.cc (Sized_relobj::do_count_local_symbols): Handle
7542 --discard-all. If the local symbol needs a dynamic entry, check
7543 that before handling --discard-locals.
7544
176fe33f
ILT
75452009-12-30 Ian Lance Taylor <iant@google.com>
7546
bb321bb1
ILT
7547 PR 10450
7548 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
7549 flags to PF_R.
7550 (Output_segment::add_output_section): Don't change the flags if
7551 the type is PT_TLS.
7552
176fe33f
ILT
7553 PR 10450
7554 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
7555 GNU hash table if they need a dynamic value. Otherwise, don't add
7556 them if they are defined in a dynamic object or are forced local.
7557
e8cd95c7
ILT
75582009-12-29 Ian Lance Taylor <iant@google.com>
7559
1b81fb71
ILT
7560 PR 10450
7561 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
7562 .gnu.hash table for a 32-bit target.
7563
8d6d383d
ILT
7564 PR 10450
7565 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
7566 regular and a dynamic object only needs a dynamic symbol table
7567 entry if it is externally visible.
7568
e785ec03
ILT
7569 PR 10450
7570 * i386.cc (class Target_i386): Initialize global_offset_table_ in
7571 constructor. Add global_offset_table_ field.
7572 (Target_i386::got_section): Set global_offset_table_.
7573 (Target_i386::do_finalize_sections): Set global_offset_table_
7574 size.
7575 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
7576 in constructor. Add global_offset_table_ field.
7577 (Target_x86_64::got_section): Set global_offset_table_.
7578 (Target_x86_64::do_finalize_sections): Set global_offset_table_
7579 size.
7580
1a2dff53
ILT
7581 * layout.cc (Layout::Layout): Initialize increase_relro_.
7582 (Layout::get_output_section): Add is_relro, is_last_relro, and
7583 is_first_non_relro parameters. Change all callers.
7584 (Layout::choose_output_section): Likewise.
7585 (Layout::add_output_section_data): Likewise.
7586 (Layout::make_output_section): Likewise.
7587 (Layout::set_segment_offsets): Clear increase_relro when using a
7588 linker script.
7589 * layout.h (class Layout): Add increase_relro method. Add
7590 increase_relro_ field. Update declarations.
7591 * output.cc (Output_section::Output_section): Initialize
7592 is_last_relro_ and is_first_non_relro_.
7593 (Output_segment::add_output_section): Group relro sections is
7594 do_sort is true. Handle is_last_relro and is_first_non_relro.
7595 (Output_segment::maximum_alignment): Remove relro handling.
7596 (Output_segment::set_section_addresses): Add increase_relro
7597 parameter. Change all callers. Add initial alignment to align
7598 relro sections on separate page. Remove old relro handling.
7599 (Output_segment::set_section_list_addresses): Remove in_relro
7600 parameter. Change all callers.
7601 (Output_segment::set_offset): Add increase parameter. Change all
7602 callers. Remove old relro handling.
7603 * output.h (class Output_section): Add new methods: is_last_relro,
7604 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
7605 Add is_last_relro_ and is_first_non_relro_ fields.
7606 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
7607 Create separate .got.plt section. Call increase_relro.
7608 * x86_64.cc (Target_x86_64::got_section): Likewise.
7609 * testsuite/relro_script_test.t: Add .got.plt.
7610
f0ba79e2
ILT
7611 PR 10450
7612 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
7613 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
7614 (Layout::finalize): Call set_dynamic_symbol_size.
7615 (Layout::set_dynamic_symbol_size): New function.
7616 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
7617 set_dynamic_symbol_size.
7618
e8cd95c7
ILT
7619 PR 10450
7620 * output.h (class Output_section): Add is_entsize_zero_ field.
7621 * output.cc (Output_section::Output_section): Initialize
7622 is_entsize_zero_.
7623 (Output_section::set_entsize): If two different entsizes are
7624 requested, force it to zero.
7625 (Output_section::add_input_section): Set flags for .debug_str
7626 before updating section flags. Set entsize.
7627 (Output_section::update_flags_for_input_section): Set SHF_MERGE
7628 and SHF_STRING if all input sections have those flags.
7629
3e1b9a8a
RÁE
76302009-12-29 Rafael Espindola <espindola@google.com>
7631
7632 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
7633 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
7634 reporting.
3e1b9a8a 7635
3dcad376
ST
76362009-12-29 Sriraman Tallam <tmsriram@google.com>
7637
7638 * options.cc (General_options::parse_version): Allow -v to exit
7639 without an error if there is nothing to link.
7640
084e2665
ILT
76412009-12-29 Ian Lance Taylor <iant@google.com>
7642
7643 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
7644 using a version of gcc before 4.1.
7645 * configure: Rebuild.
7646
250acde3
CD
76472009-12-28 Chris Demetriou <cgd@google.com>
7648
7649 * attributes.cc (Output_attributes_section_data::do_write): Use
7650 std::vector::front rather than std::vector::data.
7651
99fff23b
ILT
76522009-12-28 Ian Lance Taylor <iant@google.com>
7653
7654 * symtab.h (class Symbol_table): Add enum Defined.
7655 * resolve.cc (Symbol_table::should_override): Add defined
7656 parameter. Change all callers. Test whether object is NULL
7657 before calling a method on it.
7658 (Symbol_table::report_resolve_problem): Add defined parameter.
7659 Change all callers.
7660 (Symbol_table::should_override_with_special): Likewise.
7661 * symtab.cc (Symbol_table::define_in_output_data): Add defined
7662 parameter. Change all callers.
7663 (Symbol_table::do_define_in_output_data): Likewise.
7664 (Symbol_table::define_in_output_segment): Likewise.
7665 (Symbol_table::do_define_in_output_segment): Likewise.
7666 (Symbol_table::define_as_constant): Likewise.
7667 (Symbol_table::do_define_as_constant): Likewise.
7668 * script.h (class Symbol_assignment): Add is_defsym parameter to
7669 constructor; change all callers.
7670 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
7671 parameter. Change all callers. Add is_defsym_ field.
7672 (class Parser_closure): Add parsing_defsym parameter to
7673 constructor; change all callers. Add parsing_defsym accessor
7674 function. Add parsing_defsym_ field.
7675
556bd683
ILT
76762009-12-28 Ian Lance Taylor <iant@google.com>
7677
7678 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 7679 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 7680
1782c879
ILT
76812009-12-23 Ian Lance Taylor <iant@google.com>
7682
7683 * i386.cc (Target_i386::do_calls_non_split): Recognize
7684 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
7685 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
7686 -fsplit-stack prologue when using %r11.
1782c879 7687
329ca2b1
ST
76882009-12-21 Sriraman Tallam <tmsriram@google.com>
7689
7690 * options.cc (General_options::parse_version): Make -v continue and do
7691 the link like GNU ld does.
7692
d675ff46
RÁE
76932009-12-17 Rafael Avila de Espindola <espindola@google.com>
7694
7695 * Makefile.am (CCFILES): Add timer.cc.
7696 (HFILES): Add timer.h.
7697 * configure.ac: Check for sysconf and times.
7698 * main.cc: include timer.h.
7699 (main): Use Timer instead of get_run_time.
7700 * timer.cc: New.
7701 * timer.h: New.
7702 * workqueue.cc: include timer.h.
7703 (Workqueue::find_and_run_task):
7704 Report user, sys and wall time.
7705 * Makefile.in: Regenerate.
7706 * config.in: Regenerate.
7707 * configure: Regenerate.
7708
d6344fb5
DK
77092009-12-16 Doug Kwan <dougkwan@google.com>
7710
7711 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
7712 sections.
7713 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
7714 relaxed input sections.
7715 * output.cc (Output_section::find_relaxed_input_section): Change
7716 return type to Output_relaxed_input_section pointer. Adjust code
7717 for new type of relaxed_input_section_map_.
7718 * output.h (Output_section::find_relaxed_input_section): Change
7719 return type to Output_relaxed_input_section pointer.
7720 (Output_section::Output_relaxed_input_section_by_input_section_map):
7721 New type.
7722 (Output_section::relaxed_input_section_map_): Change type to
7723 Output_section::Output_relaxed_input_section_by_input_section_map.
7724 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
7725 input section.
7726
0e0d5469
ILT
77272009-12-15 Ian Lance Taylor <iant@google.com>
7728
7729 * layout.cc (Layout::create_shstrtab): Only write out after input
7730 sections if we are compressing debug sections.
7731
0649a889
ILT
77322009-12-15 Ian Lance Taylor <iant@google.com>
7733
7734 * archive.cc (Archive::add_symbols): Only look up a symbol without
7735 a version if there is, in fact, a version.
7736
2ea97941
ILT
77372009-12-14 Ian Lance Taylor <iant@google.com>
7738
7739 Revert -Wshadow changes, all changes from:
7740 2009-12-11 Doug Kwan <dougkwan@google.com>
7741 2009-12-11 Nick Clifton <nickc@redhat.com>
7742 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
7743
b0eec2cc
DK
77442009-12-11 Doug Kwan <dougkwan@google.com>
7745
7746 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
7747 due to -Wshadow.
7748 * attributes.cc (Object_attribute::size): Ditto.
7749 (Attributes_section_data::size): Ditto.
7750 (Attributes_section_data::Attributes_section_data): Ditto.
7751 (Output_attributes_section_data::do_write): Ditto.
7752 * attributes.h (Object_attribute::set_type): Ditto.
7753 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
7754
91d6fa6a
NC
77552009-12-11 Nick Clifton <nickc@redhat.com>
7756
7757 * archive.cc: Fix shadowed variable warnings.
7758 * arm.cc: Likewise.
7759 * compressed_output.cc: Likewise.
7760 * compressed_output.h: Likewise.
7761 * configure: Likewise.
7762 * dwarf_reader.cc: Likewise.
7763 * dynobj.cc: Likewise.
7764 * dynobj.h: Likewise.
7765 * ehframe.cc: Likewise.
7766 * ehframe.h: Likewise.
7767 * errors.cc: Likewise.
7768 * expression.cc: Likewise.
7769 * fileread.cc: Likewise.
7770 * fileread.h: Likewise.
7771 * freebsd.h: Likewise.
7772 * i386.cc: Likewise.
7773 * icf.cc: Likewise.
7774 * incremental.h: Likewise.
7775 * layout.cc: Likewise.
7776 * layout.h: Likewise.
7777 * mapfile.cc: Likewise.
7778 * merge.cc: Likewise.
7779 * merge.h: Likewise.
7780 * object.cc: Likewise.
7781 * object.h: Likewise.
7782 * options.h: Likewise.
7783 * output.cc: Likewise.
7784 * output.h: Likewise.
7785 * parameters.cc: Likewise.
7786 * plugin.cc: Likewise.
7787 * powerpc.cc: Likewise.
7788 * reduced_debug_output.cc: Likewise.
7789 * reduced_debug_output.h: Likewise.
7790 * reloc.cc: Likewise.
7791 * reloc.h: Likewise.
7792 * resolve.cc: Likewise.
7793 * script-sections.cc: Likewise.
7794 * script.cc: Likewise.
7795 * script.h: Likewise.
7796 * sparc.cc: Likewise.
7797 * symtab.cc: Likewise.
7798 * symtab.h: Likewise.
7799 * target-select.cc: Likewise.
7800 * target-select.h: Likewise.
7801 * token.h: Likewise.
7802 * workqueue.cc: Likewise.
7803 * workqueue.h: Likewise.
7804 * x86_64.cc: Likewise.
7805
a0351a69
DK
78062009-12-10 Doug Kwan <dougkwan@google.com>
7807
7808 * arm.cc (attributes.h): New include.
7809 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
7810 (Arm_relobj::~Arm_relobj): Delete object pointed by
7811 attributes_section_data_.
7812 (Arm_relobj::attributes_section_data): New method definition.
7813 (Arm_relobj::attributes_section_data_): New data member declaration.
7814 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
7815 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
7816 attributes_section_data_.
7817 (Arm_dynobj::attributes_section_data): New method definition.
7818 (Arm_dynobj::attributes_section_data_): New data member declaration.
7819 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
7820 initialization value of may_use_blx_ to false.
2e702c99 7821 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
7822 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
7823 object attributes to compute results instead of hard-coding.
7824 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
7825 Target_arm::get_secondary_compatible_arch,
7826 Target_arm::set_secondary_compatible_arch
7827 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7828 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
7829 New method declarations.
7830 (Target_arm::get_aeabi_object_attribute): New method definition.
7831 (Target_arm::attributes_section_data_): New data member declaration.
7832 (read_arm_attributes_section): New template definition.
7833 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
7834 (Arm_dynobj::do_read_symbols): Ditto.
7835 (Target_arm::do_finalize_sections): Merge attributes sections from
7836 input. Check for BLX use after attributes section merging.
7837 Fix __exidx_start and __exidx_end visibility. Create an
7838 .ARM.attributes section if necessary.
7839 (Target_arm::get_secondary_compatible_arch,
7840 Target_arm::set_secondary_compatible_arch,
7841 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7842 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 7843 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
7844 New method definitions.
7845
b59befec
ILT
78462009-12-09 Ian Lance Taylor <iant@google.com>
7847
7848 * plugin.cc (Plugin::load): Don't cast from void* to a function
7849 pointer.
7850
1276bc89
ILT
78512009-12-09 Ian Lance Taylor <iant@google.com>
7852
7853 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
7854 information fields.
7855
2f2de248
L
78562009-12-09 H.J. Lu <hongjiu.lu@intel.com>
7857
7858 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
7859 Replace two_file_shared_1.so with two_file_shared_2.so.
7860 * testsuite/Makefile.in: Regenerated.
7861
4f787271
DK
78622009-12-08 Doug Kwan <dougkwan@google.com>
7863
7864 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
7865 (HFILES): Add attributes.h and int_encoding.h.
7866 * Makefile.in: Regenerate.
7867 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
7868 function definitions to int_encoding.cc
7869 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
7870 prototypes to int_encoding.h
7871 * reduced_debug_output.cc (int_encoding.h): New include.
7872 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
7873 function definitions to int_encoding.cc
7874 (insert_into_vector, read_from_pointer): Move template definitions to
7875 int_encoding.h
7876 * attributes.cc: New file.
7877 * attributes.h: New file.
7878 * int_encoding.cc: New file.
7879 * int_encoding.h: New file.
7880
20b52f1a
RÁE
78812009-12-07 Rafael Avila de Espindola <espindola@google.com>
7882
7883 PR gold/11055
7884 * incremental-dump.cc (dump_incremental_inputs): New.
7885 (main): Use dump_incremental_inputs.
7886
53d7974c
L
78872009-12-07 H.J. Lu <hongjiu.lu@intel.com>
7888
7889 PR gold/10893
7890 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
7891 checking elfcpp::STT_FUNC.
7892 (Target_i386::Relocate::relocate): Likewise.
7893 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
7894
7895 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
7896 symbols from shared libraries into normal FUNC symbols.
7897
7898 * symtab.h (Symbol): Add is_func and use it.
7899
05a352e6
DK
79002009-12-05 Doug Kwan <dougkwan@google.com>
7901
7902 * arm.cc (Target_arm::arm_info): Initialize new fields
7903 attributes_section and attributes_vendor.
7904 * i386.cc (Target_i386::i386_info): Same.
7905 * object.cc (Sized_relobj::do_layout): Skip attribute section.
7906 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
7907 fields attributes_section and attributes_vendor.
53d7974c 7908 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
7909 * target.h (Target::attributes_section, Target::attributes_vendor,
7910 Target::is_attributes_section, Target::attribute_arg_type,
7911 Target::attributes_order): New method definitions.
7912 (Target::Target_info::attributes_section,
7913 Target::Target_info::attributes_vendor): New fields.
7914 (Target::do_attribute_arg_type, Target::do_attributes_order): New
7915 virtual method definitions.
7916 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
7917 attributes_section and attributes_vendor.
7918 * testsuite/testfile.cc (Target_test::test_target_info): Same.
7919
f4e5969c
DK
79202009-12-05 Doug Kwan <dougkwan@google.com>
7921
7922 * arm.cc: Update comments about interworking and stub generation.
7923 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
7924 considered as non-PIC.
7925 (Arm_relocate_functions::base_abs): Fix formatting.
7926 (Arm_relocate_functions::got_prel): Fix comment. Change interface
7927 of function to use GOT entry address instead of offset.
7928 (Target_arm::Scan::global): Issue an error if a symbol would need a
7929 PLT does not get one because it is untyped. Remove code to create
7930 dynamic symbols for relative branches.
7931 (Target_arm::Relocate::relocate: Use 0 instead of false since function
7932 takes unsigned integer instead of boolean.
7933
1abce4a6
L
79342009-12-05 H.J. Lu <hongjiu.lu@intel.com>
7935
7936 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
7937 (two_file_test_LDADD): Likewise.
7938 (common_test_1_LDADD): Likewise.
7939 (exception_test_LDADD) Likewise.
7940 (weak_test_LDADD): Likewise.
7941 (many_sections_test_LDADD): Likewise.
7942 (initpri1_LDADD): Likewise.
7943 (script_test_1_LDADD): Likewise.
7944 (script_test_2_LDADD): Likewise.
7945 (justsyms_LDADD): Likewise.
7946 (binary_test_LDADD): Likewise.
7947 (large_LDADD): Likewise.
7948 * testsuite/Makefile.in: Regenerated.
7949
adcf2816 79502009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 7951
adcf2816
L
7952 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
7953 (Symbol_table::override_with_special): Likewise.
7954 (Symbol_table::add_from_object): Likewise.
7955
28e67f5d
RÁE
79562009-12-04 Rafael Avila de Espindola <espindola@google.com>
7957
7958 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
7959 Don't set the data_offset twice.
7960
ae10a101
RÁE
79612009-12-04 Rafael Avila de Espindola <espindola@google.com>
7962
7963 * testsuite/Makefile.in: Regenerate.
7964
f59f41f3
DK
79652009-12-03 Doug Kwan <dougkwan@google.com>
7966
7967 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
7968 (Target_arm::do_finalize_sections): Add parameter for symbol table
7969 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
7970 * i386.cc (Target_i386::do_finalize_sections): Add an additional
7971 parameter for symbol table pointer.
7972 * layout.cc (Layout::finalize): Call Target::finalize_sections with
7973 an additional parameter for a pointer to symbol table.
7974 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
7975 parameter for a symbol table pointer.
7976 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
7977 * target.h (Target::finalize_sections, Target::do_finalize_sections):
7978 Ditto.
7979 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
7980 parameter for a symbol table pointer.
7981
ca55d848
RÁE
79822009-12-03 Rafael Avila de Espindola <espindola@google.com>
7983
7984 * incremental.cc (Incremental_inputs_header)
7985 (Incremental_inputs_header_write, Incremental_inputs_entry)
7986 (Incremental_inputs_entry_write): Move ...
7987 * incremental.h (Incremental_inputs_header)
7988 (Incremental_inputs_header_write, Incremental_inputs_entry)
7989 (Incremental_inputs_entry_write): here.
7990
3aec4f9c
RÁE
79912009-12-02 Rafael Avila de Espindola <espindola@google.com>
7992
7993 * incremental.cc (make_sized_incremental_binary): Set the target.
7994 Error if it is incompatible.
7995 * output.h (Output_file): Add filename method.
7996
9c0ae74d
RÁE
79972009-12-02 Rafael Avila de Espindola <espindola@google.com>
7998
7999 * incremental.cc (Incremental_inputs_entry): Remove unused argument
8000 from the get_* methods.
8001
a45500ae
RÁE
80022009-12-02 Rafael Avila de Espindola <espindola@google.com>
8003
8004 * incremental-dump.cc (main): Check that the offeset of a script is 0.
8005 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
8006 Write 0 for the data_offset of scripts.
8007
325e6408
RÁE
80082009-12-02 Rafael Avila de Espindola <espindola@google.com>
8009
8010 * testsuite/Makefile.am: Add the incremental_test.sh test.
8011 * testsuite/incremental_test.sh: New.
8012 * testsuite/incremental_test_1.c: New.
8013 * testsuite/incremental_test_2.c: New.
8014
954c3e2e
RÁE
80152009-12-01 Rafael Avila de Espindola <espindola@google.com>
8016
8017 * incremental-dump.cc (main): Fix typos.
8018
f8086623
RÁE
80192009-11-27 Rafael Avila de Espindola <espindola@google.com>
8020
8021 PR gold/11025
8022 * incremental-dump.cc (main): Use llu to print 64 bit values.
8023
3b0dd6ac
L
80242009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
8025 H.J. Lu <hongjiu.lu@intel.com>
8026
8027 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
8028 $(LIBDL).
8029 (incremental_dump_LDADD): Likewise.
8030 * Makefile.in: Regenerated.
8031
a6d1ef57 80322009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 8033
a6d1ef57
DK
8034 Revert:
8035
8036 2009-11-25 Doug Kwan <dougkwan@google.com>
8037
8038 * arm.cc (Target_arm::Target_arm): Move method definition
8039 outside of class definition. Add code to handle
8040 --target1-rel, --target1-abs and --target2= options.
8041 (Target_arm::get_reloc_reloc_type): Change method to be
8042 non-static and const.
8043 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
8044 New data member declaration.
8045 (Target_arm::Scan::local, Target_arm::Scan::global,
8046 Target_arm::Relocate::relocate,
8047 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8048 Adjust call to Target_arm::get_real_reloc_type.
8049 (Target_arm::get_real_reloc_type): Use command line options
8050 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8051 * options.h (--target1-rel, --target1-abs, --target2): New
8052 ARM-only options.
8053
50aeb7d4
DK
80542009-11-25 Doug Kwan <dougkwan@google.com>
8055
8056 * arm.cc (Target_arm::Target_arm): Move method definition outside of
8057 class definition. Add code to handle --target1-rel, --target1-abs
8058 and --target2= options.
8059 (Target_arm::get_reloc_reloc_type): Change method to be non-static
8060 and const.
8061 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
8062 member declaration.
8063 (Target_arm::Scan::local, Target_arm::Scan::global,
8064 Target_arm::Relocate::relocate,
8065 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
8066 call to Target_arm::get_real_reloc_type.
8067 (Target_arm::get_real_reloc_type): Use command line options to
8068 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8069 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
8070 options.
8071
51938283
DK
80722009-11-25 Doug Kwan <dougkwan@google.com>
8073
8074 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
8075 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
8076 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
8077 formatting.
8078 (Arm_relocate_functions::thm_call): Replace body with a call to
8079 Arm_relocate_functions::thumb_branch_common.
8080 (Arm_relocate_functions::thm_jump24,
8081 Arm_relocate_functions::thm_xpc22): New method definitions.
8082 (Arm_relocate_functions::thumb_branch_common): New method definition.
8083 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
8084 operator.
8085 (Target_arm::Relocate::relocate): Adjust call to thm_call.
8086 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
8087
e2b8f3c4
RÁE
80882009-11-24 Rafael Avila de Espindola <espindola@google.com>
8089
8090 * Makefile.am: Build incremental-dump
8091 * Makefile.in: Regenerate.
8092 * incremental-dump.cc: New.
8093 * incremental.cc (Incremental_inputs_header_data,
8094 Incremental_inputs_entry_data): Move to incremental.h
8095 * incremental.h: (Incremental_inputs_header_data,
8096 Incremental_inputs_entry_data): Move from incremental.cc
8097
bcba9aec
RÁE
80982009-11-24 Rafael Avila de Espindola <espindola@google.com>
8099
8100 * incremental.cc (Incremental_inputs_header,
8101 Incremental_inputs_header_write, Incremental_inputs_entry,
8102 Incremental_inputs_entry_write): Add a typedef with the data type.
8103
7c3afe08
RÁE
81042009-11-24 Rafael Avila de Espindola <espindola@google.com>
8105
8106 * incremental.cc (Incremental_inputs_header,
8107 Incremental_inputs_header_write, Incremental_inputs_entry,
8108 Incremental_inputs_entry_write): Update comment about which
8109 type has the filed descriptions.
8110
d204b6e9
DK
81112009-11-15 Doug Kwan <dougkwan@google.com>
8112
8113 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
8114 (Arm_relocate_functions::arm_branch_common): Change method defintion
8115 in class definition to a method declaration and update list of formal
8116 parameters.
8117 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
8118 Arm_relocation_functions::jump24): Adjust call to
8119 Arm_relocate_functions::arm_branch_common. Update list of formal
8120 parameters.
8121 (Arm_relocate_functions::xpc25): New method definition.
8122 (Arm_relocate_functions::arm_branch_common): Move method defintion
8123 out from class definition. Use stubs for mode-switching and extending
8124 branch ranges.
8125 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
8126 specially. Change code to enable use of stubs in ARM branches.
8127
43d12afe
DK
81282009-11-10 Doug Kwan <dougkwan@google.com>
8129
8130 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
8131 in method declaration.
8132 (Target_arm::relocate_stub): New method declaration.
8133 (Target_arm::default_target): Change to return a pointer instead of
8134 a const reference.
8135 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
8136 Target_arm::default_target.
8137 (Arm_Relobj::do_relocate_sections): Remove options paramater in
8138 method definition.
8139 (Target_arm::relocate_section): Adjust view.
8140 (Target_arm::relocate_stub): New method definition.
8141
ac33a407
DK
81422009-11-10 Doug Kwan <dougkwan@google.com>
8143
8144 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
8145 a format warning.
8146 * incremental.cc (open_incremental_binary): Initialized local
8147 variables to avoid warnings.
8148 * object.cc (make_elf_object): Ditto.
8149 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
8150 a format warning.
e1df38aa 8151
88ee28e9
L
8152009-11-09 H.J. Lu <hongjiu.lu@intel.com>
8153
8154 PR gold/10930
8155 * testsuite/plugin_test.c: Include "config.h".
8156
2daedcd6
DK
81572009-11-09 Doug Kwan <dougkwan@google.com>
8158
8159 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
8160 (arm_symbol_value): Remove.
8161 (Arm_relocate_functions::arm_branch_common,
8162 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
8163 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
8164 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
8165 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
8166 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
8167 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
8168 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
8169 Arm_relocate_functions::thm_mobw_abs_nc,
8170 Arm_relocate_functions::thm_mov_abs,
8171 Arm_relocate_functions::movw_prel_nc,
8172 Arm_relocate_functions::thm_movt_abs,
8173 Arm_relocate_functions::movt_prel,
8174 Arm_relocate_functions::thm_movw_prel_nc,
8175 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
8176 (Target_arm::Relocate::relocate): Only decompose address into two
8177 parts if relocation type uses the thumb-bit and pass the actual
8178 bit instead of a flag indicating that the thumb-bit is used. Adjust
8179 calls to methods in Arm_relocate_functions for this change.
8180
1276bc89 81812009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
8182
8183 PR 10925
8184 * reloc.cc: Instantiate
8185 Sized_relobj::initialize_input_to_output_maps and
8186 Sized_relobj:free_input_to_output_maps.
8187
e53ad1b5
ILT
81882009-11-06 Ian Lance Taylor <iant@google.com>
8189
8190 PR 10876
8191 * defstd.cc (in_segment): Set only_if_ref true for "end".
8192
eb44217c
DK
81932009-11-06 Doug Kwan <dougkwan@google.com>
8194
8195 * arm.cc (class Reloc_stub): Correct a comment.
8196 (Target_arm::Target_arm): Initialize arm_input_section_map_.
8197 (Target_arm::scan_section_for_stubs): New method declaration.
8198 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
8199 Change methods from private to protected.
8200 (Target_arm::do_may_relax): New method definition.
8201 (Target_arm::do_relax, Target_arm::group_sections,
8202 Target_arm::scan_reloc_for_stub,
8203 Target_arm::scan_reloc_section_for_stubs): New method declarations.
8204 (Target_arm::arm_input_section_map_): New data member declaration.
8205 (Target_arm::scan_reloc_for_stub,
8206 Target_arm::scan_reloc_section_for_stubs,
8207 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
8208 Target_arm::do_relax): New method definitions.
8209
5d329b7d
ILT
82102009-11-06 Mikolaj Zalewski <mikolaj@google.com>
8211
8212 * configure.ac: Check for (struct stat)::st_mtim
8213 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
8214 * config.in: Regenerate.
8215 * configure: Regenerate.
8216
96a0d71b
ILT
82172009-11-05 Ian Lance Taylor <iant@google.com>
8218
8219 PR 10910
8220 * output.cc (Output_segment::add_output_section): Add missing
8221 return statement.
8222
594c8e5e
ILT
82232009-11-04 Ian Lance Taylor <iant@google.com>
8224
8225 PR 10880
8226 * object.h (class Object): Add is_needed and set_is_needed
8227 methods. Add is_needed_ field. Make bool fields into bitfields.
8228 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
8229 defined in a dynamic object and referenced by a regular object,
8230 set is_needed for the dynamic object.
8231 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
8232 if the file is marked with as_needed and it is not needed.
8233
22b127cc
ILT
82342009-11-04 Ian Lance Taylor <iant@google.com>
8235
8236 PR 10887
8237 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
8238 tags if data is discarded by linker script.
8239 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8240 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
8241 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
8242 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8243
f5c870d2
ILT
82442009-11-04 Ian Lance Taylor <iant@google.com>
8245
8246 * layout.cc (Layout::get_output_section): Add is_interp and
8247 is_dynamic_linker_section parameters. Change all callers.
8248 (Layout::choose_output_section): Likewise.
8249 (Layout::make_output_section): Likewise.
8250 (Layout::add_output_section_data): Add is_dynamic_linker_section
8251 parameter. Change all callers.
8252 * layout.h (class Layout): Update declarations.
8253 * output.h (class Output_section): Add is_interp, set_is_interp,
8254 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
8255 Add is_interp_, is_dynamic_linker_section_ fields. Change
8256 generate_code_fills_at_write_ to a bitfield.
8257 * output.cc (Output_section::Output_sections): Initialize new
8258 fields.
8259 (Output_segment::add_output_section): Add do_sort parameter.
8260 Change all callers.
8261
1ae4d23b
ILT
82622009-11-03 Ian Lance Taylor <iant@google.com>
8263
8264 PR 10860
8265 * options.h (class General_options): Add --warn-common.
8266 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
8267 merging two common symbols.
8268 (Symbol_table::should_override): Handle --warn-common when merging
8269 a common symbol with a defined symbol. Use report_resolve_problem
8270 for multiple definitions.
8271 (Symbol_table::report_resolve_problem): New function.
8272 * symtab.h (class Symbol_table): Declare report_resolve_problem.
8273
55da9579
DK
82742009-11-03 Doug Kwan <dougkwan@google.com>
8275
8276 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
8277 stub_factory_.
8278 (Target_arm::stub_factory): New method definition.
8279 (Target_arm::new_arm_input_section,
8280 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
8281 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 8282 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
8283 New type definitions.
8284 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
8285 member declarations.
8286 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
8287 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
8288 New method definitions.
8289
37a9ac43
ILT
82902009-11-03 Ian Lance Taylor <iant@google.com>
8291
8292 * options.h (class General_options): Add --warn_constructors.
8293
b3d6a3d4
ILT
82942009-11-03 Ian Lance Taylor <iant@google.com>
8295
8296 PR 10893
8297 * defstd.cc (in_section): Add entries for __rel_iplt_start,
8298 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
8299
934b01dd
ILT
83002009-11-03 Ian Lance Taylor <iant@google.com>
8301
8302 PR 10895
8303 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
8304 --msgid-bugs-address.
8305 (install-pdf): New target.
8306 (install-data_yes): Look up one directory to find mkinstalldirs.
8307
03c1939b
L
83082009-11-03 H.J. Lu <hongjiu.lu@intel.com>
8309
8310 * po/Make-in (.po.gmo): Don't generate .gmo files in source
8311 tree.
8312
ebd95253
DK
83132009-10-30 Doug Kwan <dougkwan@google.com>
8314
8315 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
8316
e9bbb538
DK
83172009-10-30 Doug Kwan <dougkwan@google.com>
8318
8319 * arm.cc (Stub_addend_reader): New struct template definition
8320 and partial specializations.
8321 (Stub_addend_reader::operator()): New method definition for a
8322 partially specialized template.
8323
d5b40221
DK
83242009-10-30 Doug Kwan <dougkwan@google.com>
8325
8326 * arm.cc (Arm_relobj::processor_specific_flags): New method
8327 definition.
8328 (Arm_relobj::do_read_symbols): New method declaration.
8329 (Arm_relobj::processor_specific_flags_): New data member declaration.
8330 (Arm_dynobj): New class definition.
8331 (Target_arm::do_finalize_sections): Add input_objects parameter.
8332 (Target_arm::do_adjust_elf_header): New method declaration.
8333 (Target_arm::are_eabi_versions_compatible,
8334 (Target_arm::merge_processor_specific_flags): New method declaration.
8335 (Target_arm::do_make_elf_object): New overloaded method definitions
8336 and declaration.
8337 (Arm_relobj::do_read_symbols): New method definition.
8338 (Arm_dynobj::do_read_symbols): Ditto.
8339 (Target_arm::do_finalize_sections): Add input_objects parameters.
8340 Merge processor-specific flags from all input objects.
8341 (Target_arm::are_eabi_versions_compatible,
8342 Target_arm::merge_processor_specific_flags,
8343 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
8344 New method definitions.
8345 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
8346 Input_objects pointer type parameter.
8347 * layout.cc (Layout::finalize): Pass input objects to target's.
8348 finalize_sections function.
8349 * output.cc (Output_file_header::do_sized_write): Set ELF file
8350 header's processor-specific flags.
8351 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
8352 Input_objects pointer type parameter.
8353 * sparc.cc (Target_sparc::do_finalize_sections): Same.
8354 * target.h (Input_objects): New forward class declaration.
8355 (Target::processor_specific_flags,
8356 Target::are_processor_specific_flags_sect): New method definitions.
8357 (Target::finalize_sections): Add input_objects parameter.
8358 (Target::Target): Initialize processor_specific_flags_ and
8359 are_processor_specific_flags_set_.
8360 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
8361 parameter.
8362 (Target::set_processor_specific_flags): New method definition.
8363 (Target::processor_specific_flags_,
8364 Target::are_processor_specific_flags_set_): New data member
8365 declarations.
8366 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
8367 Input_objects pointer type parameter.
8368
ebabffbd
DK
83692009-10-30 Doug Kwan <dougkwan@google.com>
8370
8371 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
8372
ad0f2072
ILT
83732009-10-28 Ian Lance Taylor <iant@google.com>
8374
8375 * object.h (class Relobj): Drop options parameter from
8376 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
8377 do_scan_relocs, do_relocate. Change all callers.
8378 (class Sized_relobj): Drop options parameters from
8379 do_gc_process_relocs, do_scan_relocs, do_relocate,
8380 do_relocate_sections, relocate_sections, emit_relocs_scan,
8381 emit_relocs_scan_reltype. Change all callers.
8382 (struct Relocate_info): Remove options field and all references to
8383 it.
8384 * reloc.h (class Read_relocs): Remove options constructor
8385 parameter and options_ field. Change all callers.
8386 (class Gc_process_relocs, class Scan_relocs): Likewise.
8387 (class Relocate_task): Likewise.
8388 * target-reloc.h (scan_relocs): Remove options parameter. Change
8389 all callers.
8390 (scan_relocatable_relocs): Likewise.
8391 * target.h (class Sized_target): Remove options parameter from
8392 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
8393 all callers.
8394 * gc.h (gc_process_relocs): Remove options parameter. Change all
8395 callers.
8396 * arm.cc: Update functions to remove options parameters.
8397 * i386.cc: Likewise.
8398 * powerpc.cc: Likewise.
8399 * sparc.cc: Likewise.
8400 * x86_64.cc: Likewise.
8401 * testsuite/testfile.cc: Likewise.
8402
8ffa3667
DK
84032009-10-28 Doug Kwan <dougkwan@google.com>
8404
8405 * arm.cc (Arm_relobj): New class definition.
e1df38aa 8406 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
8407 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
8408 New method definitions.
8409
40f36857
CC
84102009-10-28 Cary Coutant <ccoutant@google.com>
8411
8412 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
8413 (Plugin::cleanup_done_): New member.
8414 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
8415 (Plugin_manager::cleanup_done_): Remove.
8416 (Plugin_manager::add_input_file): Edit error message.
8417 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
8418 (Plugin_manager::cleanup): Remove use of cleanup_done_.
8419
2c849493
ILT
84202009-10-27 Mikolaj Zalewski <mikolajz@google.com>
8421
8422 * fileread.cc: (File_read::View::~View): Use the new
8423 data_ownership_ filed.
8424 (File_read::~File_read): Dispose the new whole_file_view_.
8425 (File_read::open): Mmap the whole file if needed.
8426 (File_read::open): Use whole_file_view_ instead of contents_.
8427 (File_read::find_view): Use whole_file_view_ if applicable.
8428 (File_read::do_read): Use whole_file_view_ instead of contents_.
8429 (File_read::make_view): Use whole_file_view_ instead of contents_,
8430 update File_read::View::View call.
8431 (File_read::find_or_make_view): Update File_read::View::View
8432 call.
8433 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
8434 remove contents_
8435 (File_read::View::Data_ownership): New enum.
8436 (File_read::View::View): Replace bool mapped_ with Data_ownership
8437 argument.
8438 (File_read::View::mapped_): Remove (replaced by data_ownership_).
8439 (File_read::View::data_ownership_): New field.
8440 (File_read::contents_): Remove (replaced by whole_file_view_).
8441 (File_read::whole_file_view_): New field.
8442 * options.h (class General_options): Add --keep-files-mapped.
8443
24998053
CC
84442009-10-27 Cary Coutant <ccoutant@google.com>
8445
8446 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
8447 * testsuite/Makefile.am (plugin_test_5): New test case.
8448 * testsuite/Makefile.in: Regenerate.
8449
72adc4fa
DK
84502009-10-25 Doug Kwan <dougkwan@google.com>
8451
8452 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
8453 from private to protected to allow access by child class.
8454 (Sized_relobj::do_relocate_sections): New method declaration.
8455 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 8456 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
8457 Sized_relobj::relocate_sections. Instantiate template explicitly
8458 for different target sizes and endianity.
8459
07f508a2
DK
84602009-10-24 Doug Kwan <dougkwan@google.com>
8461
8462 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
8463 (Arm_input_section::as_arm_input_section): New method.
8464 (Arm_output_section): New class definition.
8465 (Arm_output_section::create_stub_group,
8466 Arm_output_section::group_sections): New method definitions.
8467
10ad9fe5
DK
84682009-10-22 Doug Kwan <dougkwan@google.com>
8469
8470 * arm.cc (Arm_input_section): New class definition.
8471 (Arm_input_section::init, Arm_input_section:do_write,
8472 Arm_input_section::set_final_data_size,
8473 Arm_input_section::do_reset_address_and_file_offset): New method
8474 definitions.
8475
56ee5e00
DK
84762009-10-21 Doug Kwan <dougkwan@google.com>
8477
8478 * arm.cc (Stub_table, Arm_input_section): New forward class
8479 declarations.
8480 (Stub_table): New class defintion.
8481 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
8482 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
8483 New method definition.
8484
b569affa
DK
84852009-10-21 Doug Kwan <dougkwan@google.com>
8486
8487 * arm.cc: Update copyright comments.
8488 (Target_arm): New forward class template declaration.
8489 (Arm_address): New type.
8490 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
8491 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
8492 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
8493 constants.
8494 (Insn_template): Same.
8495 (DEF_STUBS): New macro.
8496 (Stub_type): New enum type.
8497 (Stub_template): New class definition.
8498 (Stub): Same.
8499 (Reloc_stub): Same.
8500 (Stub_factory): Same.
8501 (Target_arm::Target_arm): Initialize may_use_blx_ and
8502 should_force_pic_veneer_.
8503 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
8504 Target_arm::should_force_pic_veneer,
8505 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
8506 Target_arm::using_thumb_only, Target_arm:;default_target): New
8507 method defintions.
8508 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
8509 New data member declarations.
8510 (Insn_template::size, Insn_template::alignment): New method defintions.
8511 (Stub_template::Stub_template): New method definition.
8512 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
8513 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
8514 (Stub_factory::Stub_factory): New method definition.
8515 * gold.h (string_hash): New template.
8516 * output.h (Input_section_specifier::hash_value): Use
8517 gold::string_hash.
8518 (Input_section_specifier::string_hash): Remove.
8519 * stringpool.cc (Stringpool_template::string_hash): Use
8520 gold::string_hash.
8521
6c172549
DK
85222009-10-20 Doug Kwan <dougkwan@google.com>
8523
8524 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
8525 symbols of relaxed input sections.
8526 * output.h (Output_section::find_relaxed_input_section): Make
8527 method public.
8528
c5617f2f
DK
85292009-10-16 Doug Kwan <dougkwan@google.com>
8530
8531 * dynobj.cc (Versions::Versions): Initialize version_script_.
8532 Only insert base version symbol definition for a shared object
8533 if version script defines any version versions.
8534 (Versions::define_base_version): New method definition.
8535 (Versions::add_def): Check that base version is not needed.
8536 (Versions::add_need): Define base version lazily.
8537 * dynobj.h (Versions::define_base_version): New method declaration.
8538 (Versions::needs_base_version_): New data member declaration.
8539 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
8540 (check_DATA): Add no_version_test.stdout.
8541 (libno_version_test.so, no_version_test.o no_version_test.stdout):
8542 New make rules.
8543 * testsuite/Makefile.in: Regenerate.
8544 * testsuite/no_version_test.c: New file.
8545 * testsuite/no_version_test.sh: Ditto.
8546
3c12dcdb
DK
85472009-10-16 Doug Kwan <dougkwan@google.com>
8548
8549 * expression.cc (class Segment_start_expression): New class definition.
8550 (Segment_start_expression::value): New method definition.
8551 (script_exp_function_segment_start): Return a new
8552 Segment_start_expression.
8553 * gold/script-c.h (script_saw_segment_start_expression): New function
8554 prototype.
8555 * script-sections.cc (Script_sections::Script_sections): Initialize
8556 SAW_SEGMENT_START_EXPRESSION_ to false.
8557 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
8558 and -Tbbs options to specify section addresses if given in
8559 command line and no SEGMENT_START expression is seen in a script.
8560 * script-sections.h (Script_sections::saw_segment_start_expression,
8561 Script_sections::set_saw_segment_start_expression): New method
8562 definition.
8563 (Script_sections::saw_segment_start_expression_): New data member
8564 declaration.
8565 * script.cc (script_saw_segment_start_expression): New function.
8566 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
8567 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
8568 script_test_7.sh and script_test_8.sh.
8569 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
8570 script_test_8.stdout.
8571 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
8572 (script_test_6, script_test_6.stdout, script_test_7,
8573 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
8574 * Makefile.in: Regenerate.
8575 * testsuite/script_test_6.sh: New file.
8576 * testsuite/script_test_6.t: Same.
8577 * testsuite/script_test_7.sh: Same.
8578 * testsuite/script_test_7.t: Same.
8579 * testsuite/script_test_8.sh: Same.
8580
64b1ae37
DK
85812009-10-16 Doug Kwan <dougkwan@google.com>
8582
8583 * output.cc (Output_segment::set_section_list_address): Cast
8584 expressions to unsigned long long type to avoid format warnings.
8585
661be1e2
ILT
85862009-10-15 Ian Lance Taylor <iant@google.com>
8587
12edd763 8588 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 8589 dot assignment to script_sections_.
12edd763
ILT
8590 * script-sections.cc (Script_sections::add_dot_assignment):
8591 Initialize if necessary.
8592
68b6574b
ILT
8593 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
8594 program headers with no load segment if there is a linker script.
8595
661be1e2
ILT
8596 * layout.cc (Layout::set_segment_offsets): Align the file offset
8597 to the segment aligment for -N or -n with no load segment.
8598 * output.cc (Output_segment::add_output_section): Don't crash if
8599 the first section is a TLS section.
8600 (Output_segment::set_section_list_addresses): Print an error
8601 message if the address moves backward in a linker script.
8602 * script-sections.cc
8603 (Output_section_element_input::set_section_addresses): Don't
8604 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
8605 (Orphan_output_section::set_section_addresses): Likewise.
8606
f15f61a7
DK
86072009-10-15 Doug Kwan <dougkwan@google.com>
8608
8609 * layout.cc (Layout::finish_dynamic_section): Generate tags
8610 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
8611 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
8612 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
8613
82bb573a
ILT
86142009-10-14 Ian Lance Taylor <iant@google.com>
8615
8616 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
8617 fields.
8618 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
8619 data_shdr fields of relinfo.
8620 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
8621 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
8622 R_386_TLS_LDO_32, adjust based on section flags.
8623 (Target_i386::Relocate::fix_up_ldo): Remove.
8624
374ad285
ILT
86252009-10-13 Ian Lance Taylor <iant@google.com>
8626
8627 Add support for -pie.
8628 * options.h (class General_options): Add -pie and
8629 --pic-executable.
8630 (General_options::output_is_position_independent): Test -pie.
8631 (General_options::output_is_executable): Return true if not shared
8632 and not relocatable.
8633 (General_options::output_is_pie): Remove.
8634 * options.cc (General_options::finalize): Reject incompatible uses
8635 of -pie.
8636 * gold.cc (queue_middle_tasks): A -pie link is not static.
8637 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
8638 * symtab.cc (Symbol::final_value_is_known): Return false if
8639 output_is_position_independent.
8640 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
8641 output_is_position_independent.
8642 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
8643 output_is_position_independent.
8644 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
8645 output_is_position_independent.
8646 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
8647 two_file_pie_test.
8648 (basic_pie_test.o, basic_pie_test): New targets.
8649 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
8650 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
8651 (two_file_pie_test): New target.
8652 * testsuite/Makefile.in: Rebuild.
8653 * README: Remove note saying that -pie is not supported.
8654
c6585162
ILT
86552009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
8656
8657 * options.h (class General_options): Add -init and -fini.
8658 * layout.cc (Layout::finish_dynamic_section): Emit
8659 given init and fini functions.
8660
032ce4e9
ST
86612009-10-13 Sriraman Tallam <tmsriram@google.com>
8662
8663 * gc.h (gc_process_relocs): Check if icf is enabled using new
8664 function.
8665 * gold.cc (queue_initial_tasks): Likewise.
8666 (queue_middle_tasks): Likewise.
8667 * object.cc (do_layout): Likewise.
8668 * symtab.cc (is_section_folded): Likewise.
8669 * main.cc (main): Likewise.
8670 * reloc.cc (Read_relocs::run): Likewise.
8671 (Sized_relobj::do_scan_relocs): Likewise.
8672 * icf.cc (is_function_ctor_or_dtor): New function.
8673 (Icf::find_identical_sections): Check if function is ctor or dtor when
8674 safe icf is chosen.
8675 * options.h (General_options::icf): Change option to be an enum.
8676 (Icf_status): New enum.
8677 (icf_enabled): New method.
8678 (icf_safe_folding): New method.
8679 (set_icf_status): New method.
8680 (icf_status_): New variable.
8681 * (options.cc) (General_options::finalize): Set icf_status_.
8682 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
8683 icf_test and icf_keep_unique_test to use the --icf enum flag.
8684 * testsuite/icf_safe_test.sh: New file.
e1df38aa 8685 * testsuite/icf_safe_test.cc: New file.
032ce4e9 8686
f345227a
ST
86872009-10-12 Sriraman Tallam <tmsriram@google.com>
8688
8689 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
8690 includes to gc.h and icf.h.
8691 * arm.cc: Include gc.h.
8692 * gold.cc: Likewise.
8693 * i386.cc: Likewise.
8694 * powerpc.cc: Likewise.
8695 * sparc.cc: Likewise.
8696 * x86_64.cc: Likewise.
8697 * gc.h: Include icf.h.
8698
1c7814ed
ILT
86992009-10-11 Ian Lance Taylor <iant@google.com>
8700
8701 * plugin.cc: Include "gold.h" before other header files.
8702
ae3b5189
CD
87032009-10-10 Chris Demetriou <cgd@google.com>
8704
8705 * options.h (Input_file_argument::Input_file_type): New enum.
8706 (Input_file_argument::is_lib_): Replace with...
8707 (Input_file_argument::type_): New member.
8708 (Input_file_argument::Input_file_argument): Take Input_file_type
8709 'type' rather than boolean 'is_lib' as second argument.
8710 (Input_file_argument::is_lib): Use type_.
8711 (Input_file_argument::is_searched_file): New function.
8712 (Input_file_argument::may_need_search): Handle is_searched_file.
8713 * options.cc (General_options::parse_library): Support -l:filename.
8714 (General_options::parse_just_symbols): Update for Input_file_argument
8715 changes.
8716 (Command_line::process): Likewise.
8717 * archive.cc (Archive::get_file_and_offset): Likewise.
8718 * plugin.cc (Plugin_manager::release_input_file): Likewise.
8719 * script.cc (read_script_file, script_add_file): Likewise.
8720 * fileread.cc (Input_file::Input_file): Likewise.
8721 (Input_file::will_search_for): Handle is_searched_file.
8722 (Input_file::open): Likewise.
8723 * readsyms.cc (Read_symbols::get_name): Likewise.
8724 * testsuite/Makefile.am (searched_file_test): New test.
8725 * testsuite/Makefile.in: Regenerate.
8726 * testsuite/searched_file_test.cc: New file.
8727 * testsuite/searched_file_test_lib.cc: New file.
8728
f3048a1d
ILT
87292009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8730 Ian Lance Taylor <iant@google.com>
8731
8732 * descriptor.cc: Include <cstdio> and "binary-io.h".
8733 (Descriptors::open): Open the files in binary mode always.
8734 * script.cc (Lex::get_token): Treat \r as whitespace.
8735
d4780e57
ILT
87362009-10-09 Ian Lance Taylor <iant@google.com>
8737
8738 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
8739
d9a893b8
ILT
87402009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8741 Ian Lance Taylor <iant@google.com>
8742
8743 * configure.ac: Check for readv function also.
8744 * fileread.cc (readv): Define if not HAVE_READV.
8745 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
8746 does not exist.
8747 * config.in: Regenerate.
8748 * configure: Regenerate.
8749
c0a62865
DK
87502009-10-09 Doug Kwan <dougkwan@google.com>
8751
8752 * layout.cc (Layout::make_output_section): Call target hook to make
8753 ordinary output section.
8754 (Layout::finalize): Adjust parameter list of call the
8755 Target::may_relax().
8756 * layout.h (class Layout::section_list): New method.
8757 * merge.h (Output_merge_base::entsize): Change visibility to public.
8758 (Output_merge_base::is_string, Output_merge_base::do_is_string):
8759 New methods.
8760 (Output_merge_string::do_is_string): New method.
8761 * object.cc (Sized_relobj::do_setup): renamed from
8762 Sized_relobj::set_up.
8763 * object.h (Sized_relobj::adjust_shndx,
8764 Sized_relobj::initializ_input_to_output_maps,
8765 Sized_relobj::free_input_to_output_maps): Change visibilities to
8766 protected.
8767 (Sized_relobj::setup): Virtualize.
8768 (Sized_relobj::do_setup): New method declaration.
8769 (Sized_relobj::invalidate_section_offset,
8770 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
8771 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
8772 * options.cc (parse_int): New function.
8773 * options.h (parse_int): New declaration.
8774 (DEFINE_int): New macro.
8775 (stub_group_size): New option.
8776 * output.cc (Output_section::Output_section): Initialize memebers
8777 merge_section_map_, merge_section_by_properties_map_,
8778 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
8779 (Output_section::add_input_section): Handled deferred code-fill
8780 generation and remove an old comment.
8781 (Output_section::add_relaxed_input_section): New method definition.
8782 (Output_section::add_merge_input_section): Use merge section by
8783 properties map to speed to search. Update merge section maps
8784 as appropriate.
8785 (Output_section::build_relaxation_map): New method definition.
8786 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8787 Same.
8788 (Output_section::relax_input_section): Renamed to
8789 Output_section::convert_input_sections_to_relaxed_sections and change
8790 interface to take a vector of pointers to relaxed sections.
8791 (Output_section::find_merge_section,
8792 Output_section::find_relaxed_input_section): New method definitions.
8793 (Output_section::is_input_address_mapped,
8794 Output_section::output_offset, Output_section::output_address):
8795 Use output section data maps to speed up searching.
8796 (Output_section::find_starting_output_address): Add comments.
8797 (Output_section::do_write,
8798 Output_section::write_to_postprocessing_buffer): Do code-fill
8799 generation as appropriate.
8800 (Output_section::get_input_sections): Invalidate relaxed input section
8801 map.
8802 (Output_section::restore_states): Adjust type of checkpoint .
8803 Invalidate relaxed input section map.
8804 * output.h (Output_merge_base): New class declaration.
8805 (Input_section_specifier): New class defintion.
8806 (class Output_relaxed_input_section) Change base class to
8807 Output_section_data_build.
8808 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
8809 base class initializer.
8810 (Output_section::add_relaxed_input_section): New method declaration.
8811 (Output_section::Input_section): Change visibility to protected.
2e702c99 8812 (Output_section::Input_section::relobj,
c0a62865
DK
8813 Output_section::Input_section::shndx): Handle relaxed input sections.
8814 Output_section::input_sections) Change visibility to protected. Also
8815 define overload to return a non-const pointer.
8816 (Output_section::Merge_section_properties): New class defintion.
8817 (Output_section::Merge_section_by_properties_map,
8818 Output_section::Output_section_data_by_input_section_map,
8819 Output_section::Relaxation_map): New types.
8820 (Output_section::relax_input_section): Rename method to
8821 Output_section::convert_input_sections_to_relaxed_sections and change
8822 interface to take a vector of relaxed section pointers.
8823 (Output_section::find_merge_section,
8824 Output_section::find_relaxed_input_section,
8825 Output_section::build_relaxation_map,
8826 Output_section::convert_input_sections_in_list_to_relaxed_sections):
8827 New method declarations.
8828 (Output_section::merge_section_map_
8829 Output_section::merge_section_by_properties_map_,
8830 Output_section::relaxed_input_section_map_,
8831 Output_section::is_relaxed_input_section_map_valid_,
8832 Output_section::generate_code_fills_at_write_): New data members.
8833 * script-sections.cc
8834 (Output_section_element_input::set_section_addresses): Call
8835 current_data_size and addralign methods of relaxed input sections.
8836 (Orphan_output_section::set_section_addresses): Call current_data_size
8837 and addralign methods of relaxed input sections.
8838 * symtab.cc (Symbol_table::compute_final_value): Extract template
8839 from the body of Symbol_table::sized_finalize_symbol.
8840 (Symbol_table::sized_finalized_symbol): Call
8841 Symbol_table::compute_final_value.
8842 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
8843 (Symbol_table::compute_final_value): New templated method declaration.
8844 * target.cc (Target::do_make_output_section): New method defintion.
8845 * target.h (Target::make_output_section): New method declaration.
8846 (Target::relax): Add more parameters for input objects, symbol table
8847 and layout. Adjust call to do_relax.
8848 (Target::do_make_output_section): New method declaration.
8849 (Target::do_relax): Add parameters for input objects, symbol table
8850 and layout.
8851
d446d6c4
ILT
88522009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8853
8854 * pread.c: Include stdio.h.
8855
bc06c745
ILT
88562009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8857
8858 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
8859 defined.
8860
75aea3d0
ILT
88612009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8862
8863 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8864 Change read_shndx type to unsigned int.
8865 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
8866 int.
8867 (Sized_dwarf_line_info::read_line_mappings): Likewise.
8868 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
8869 Change read_shndx type to unsigned int.
8870 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
8871 int.
8872 (Sized_dwarf_line_info::read_line_mappings): Likewise.
8873 * layout.cc (Layout::create_symtab_sections): Cast the result of
8874 local_symcount * symsize to off_t in the gold_assert.
8875
be8fcb75
ILT
88762009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8877
8878 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
8879 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
8880 R_ARM_BASE_ABS.
8881 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
8882 (Arm_relocate_functions::thm_abs5): New function.
8883 (Arm_relocate_functions::abs12): New function.
8884 (Arm_relocate_functions::abs16): New function.
8885 (Arm_relocate_functions::base_abs): New function.
8886 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
8887 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
8888 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
8889 R_ARM_BASE_ABS.
8890 (Scan::global): Likewise.
8891 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
8892 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
8893 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
8894 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
8895 R_ARM_BASE_ABS.
8896
c2a122b6
ILT
88972009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8898
8899 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
8900 (Arm_relocate_functions::movt_prel): New function.
8901 (Arm_relocate_functions::thm_movw_prel_nc): New function.
8902 (Arm_relocate_functions::thm_movt_prel): New function.
8903 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
8904 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
8905 (Scan::global, Relocate::relocate): Likewise.
8906 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8907
c4aa1e2d
ILT
89082009-10-09 Mikolaj Zalewski <mikolajz@google.com>
8909
8910 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
8911 Incremental_checker.
8912 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
8913 unsigned int.
8914 (class Incremental_inputs_header): New class.
8915 (Incremental_inputs_header_writer): Edit comment.
8916 (Incremental_inputs_entry): New class.
8917 (Incremental_inputs_entry_writer): Edit comment.
8918 (Sized_incremental_binary::do_find_incremental_inputs_section):
8919 Add *strtab_shndx parameter, fill it.
8920 (Sized_incremental_binary::do_check_inputs): New method.
8921 (Incremental_checker::can_incrementally_link_output_file): Use
8922 Sized_incremental_binary::check_inputs.
8923 (Incremental_inputs::report_command_line): Save command line in
8924 command_line_.
8925 * incremental.h:
8926 (Incremental_binary::find_incremental_inputs_section): New
8927 method.
8928 (Incremental_binary::do_find_incremental_inputs_section): Add
8929 strtab_shndx parameter.
8930 (Incremental_binary::do_check_inputs): New pure virtual method.
8931 (Sized_incremental_binary::do_check_inputs): Declare.
8932 (Incremental_checker::Incremental_checker): Add incremental_inputs
8933 parameter, use it to initialize incremental_inputs_.
8934 (Incremental_checker::incremental_inputs_): New field.
8935 (Incremental_checker::command_line): New method.
8936 (Incremental_checker::inputs): New method.
8937 (Incremental_checker::command_line_): New field.
8938
c549a694
ILT
89392009-10-09 Mikolaj Zalewski <mikolajz@google.com>
8940
8941 * incremental.cc: Include <cstdarg> and "target-select.h".
8942 (vexplain_no_incremental): New function.
8943 (explain_no_incremental): New function.
8944 (Incremental_binary::error): New method.
8945 (Sized_incremental_binary::do_find_incremental_inputs_section): New
8946 method.
8947 (make_sized_incremental_binary): New function.
8948 (open_incremental_binary): New function.
8949 (can_incrementally_link_file): Add checks if output is ELF and has
8950 inputs section.
8951 * incremental.h: Include "elfcpp_file.h" and "output.h".
8952 (Incremental_binary): New class.
8953 (Sized_incremental_binary): New class.
8954 (open_incremental_binary): Declare.
8955 * object.cc (is_elf_object): Use
8956 elfcpp::Elf_recognizer::is_elf_file.
8957 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
8958 * output.h (Output_file::filesize): New method.
8959
fd3c5f0b
ILT
89602009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8961
8962 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
8963 New function.
8964 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
8965 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
8966 function.
8967 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
8968 function.
8969 (Arm_relocate_functions::movw_abs_nc): New function.
8970 (Arm_relocate_functions::movt_abs): New function.
8971 (Arm_relocate_functions::thm_movw_abs_nc): New function.
8972 (Arm_relocate_functions::thm_movt_abs): New function.
8973 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
8974 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
8975 (Scan::global): Likewise.
8976 (Relocate::relocate): Likewise.
8977 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8978
7f5309a5
ILT
89792009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8980
8981 * arm.cc (Arm_relocate_functions::got_prel) New function.
8982 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
8983 (Relocate::relocate): Likewise.
8984 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8985
364c7fa5
ILT
89862009-10-06 Ian Lance Taylor <iant@google.com>
8987
8988 * options.h (class General_options): Define
8989 split_stack_adjust_size parameter.
8990 * object.h (class Object): Add uses_split_stack_ and
8991 has_no_split_stack_ fields. Add uses_split_stack and
8992 has_no_split_stack accessor functions. Declare
8993 handle_split_stack_section.
8994 (class Reloc_symbol_changes): Define.
8995 (class Sized_relobj): Define Function_offsets. Declare
8996 split_stack_adjust, split_stack_adjust_reltype, and
8997 find_functions.
8998 * object.cc (Object::handle_split_stack_section): New function.
8999 (Sized_relobj::do_layout): Call handle_split_stack_section.
9000 * dynobj.cc (Sized_dynobj::do_layout): Call
9001 handle_split_stack_section.
9002 * reloc.cc (Sized_relobj::relocate_sections): Call
9003 split_stack_adjust for executable sections in split_stack
9004 objects. Pass reloc_map to relocate_section.
9005 (Sized_relobj::split_stack_adjust): New function.
9006 (Sized_relobj::split_stack_adjust_reltype): New function.
9007 (Sized_relobj::find_functions): New function.
9008 * target-reloc.h: Include "object.h".
9009 (relocate_section): Add reloc_symbol_changes parameter. Change
9010 all callers.
9011 * target.h (class Target): Add calls_non_split method. Declare
9012 do_calls_non_split virtual method. Declare match_view and
9013 set_view_to_nop.
9014 * target.cc: Include "elfcpp.h".
9015 (Target::do_calls_non_split): New function.
9016 (Target::match_view): New function.
9017 (Target::set_view_to_nop): New function.
9018 * gold.cc (queue_middle_tasks): Give an error if mixing
9019 split-stack and non-split-stack objects with -r.
9020 * i386.cc (Target_i386::relocate_section): Add
9021 reloc_symbol_changes parameter.
9022 (Target_i386::do_calls_non_split): New function.
9023 * x86_64.cc (Target_x86_64::relocate_section): Add
9024 reloc_symbol_changes parameter.
9025 (Target_x86_64::do_calls_non_split): New function.
9026 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
9027 parameter.
9028 * powerpc.cc (Target_powerpc::relocate_section): Add
9029 reloc_symbol_changes parameter.
9030 * sparc.cc (Target_sparc::relocate_section): Add
9031 reloc_symbol_changes parameter.
9032 * configure.ac: Call AM_CONDITIONAL for the default target.
9033 * configure: Rebuild.
9034 * testsuite/Makefile.am (TEST_AS): New variable.
9035 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
9036 (check_DATA): Add split_i386 and split_x86_64 files.
9037 (SPLIT_DEFSYMS): Define.
9038 (split_i386_[1234n].o): New targets.
9039 (split_i386_[124]): New targets.
9040 (split_i386_[1234r].stdout): New targets.
9041 (split_x86_64_[1234n].o): New targets.
9042 (split_x86_64_[124]): New targets.
9043 (split_x86_64_[1234r].stdout): New targets.
9044 (MOSTLYCLEANFILES): Add new executables.
9045 * testsuite/split_i386.sh: New file.
9046 * testsuite/split_x86_64.sh: New file.
9047 * testsuite/split_i386_1.s: New file.
9048 * testsuite/split_i386_2.s: New file.
9049 * testsuite/split_i386_3.s: New file.
9050 * testsuite/split_i386_4.s: New file.
9051 * testsuite/split_i386_n.s: New file.
9052 * testsuite/split_x86_64_1.s: New file.
9053 * testsuite/split_x86_64_2.s: New file.
9054 * testsuite/split_x86_64_3.s: New file.
9055 * testsuite/split_x86_64_4.s: New file.
9056 * testsuite/split_x86_64_n.s: New file.
9057 * testsuite/testfile.cc (Target_test): Update relocation_section
9058 function.
9059 * testsuite/Makefile.in: Rebuild.
9060
e8a9fcda
ILT
90612009-10-06 Ian Lance Taylor <iant@google.com>
9062
9063 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
9064 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
9065 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
9066 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
9067 the address on ldo_addrs_.
9068 (Target_i386::Relocate::fix_up_ldo): New function.
9069
e99daf92
ILT
90702009-10-06 Rafael Espindola <espindola@google.com>
9071
9072 * plugin.cc (add_input_library): New.
9073 (Plugin::load): Add add_input_library to tv.
9074 (Plugin_manager::add_input_file): Add the is_lib argument.
9075 (add_input_file): Update call to Plugin_manager::add_input_file.
9076 (add_input_library): New.
9077 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
9078
966d4097
DK
90792009-09-30 Doug Kwan <dougkwan@google.com>
9080
9081 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
9082 symbol and call Symbol::may_need_copy_reloc to determine if
9083 a copy reloc is needed.
9084 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
9085 nocopyreloc is given in command line.
9086 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
9087 given in command line.
9088 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
9089 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
9090 of the removed Target_i386::may_need_copy_reloc.
9091 * options.h (copyreloc): New option with default value false.
9092 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9093 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
9094 instead of the removed Target_powerpc::may_need_copy_reloc.
9095 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9096 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
9097 instead of the removed Target_sparc::may_need_copy_reloc.
9098 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
9099 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
9100 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
9101 instead of the removed Target_x86_64::may_need_copy_reloc.
9102
029ba973
ILT
91032009-09-30 Ian Lance Taylor <iant@google.com>
9104
9105 * object.h (class Object): Remove target_ field, and target,
9106 sized_target, and set_target methods.
9107 (Object::sized_target): Remove.
9108 (class Sized_relobj): Update declarations. Remove sized_target.
9109 * object.cc (Sized_relobj::setup): Remove target parameter.
9110 Change all callers.
9111 (Input_objects::add_object): Don't do anything with the target.
9112 (make_elf_sized_object): Add punconfigured parameter. Change all
9113 callers. Set or test parameter target.
9114 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
9115 Change all callers.
9116 * parameters.cc (Parameters::set_target): Change parameter type to
9117 be non-const.
9118 (Parameters::default_target): Remove.
9119 (set_parameters_target): Change parameter type to be non-const.
9120 (parameters_force_valid_target): New function.
9121 (parameters_clear_target): New function.
9122 * parameters.h (class Parameters): Update declarations. Remove
9123 default_target method. Add sized_target and clear_target
9124 methods. Change target_ to be non-const.
9125 (set_parameters_target): Update declaration.
9126 (parameters_force_valid_target): Declare.
9127 (parameters_clear_target): Declare.
9128 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
9129 as NULL if we aren't searching.
9130 (Add_symbols::run): Don't check for compatible target.
9131 * fileread.cc (Input_file::open_binary): Call
9132 parameters_force_valid_target.
9133 * gold.cc (queue_middle_tasks): Likewise.
9134 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
9135 set_target on object.
9136 * dynobj.h (class Sized_dynobj): Update declarations.
9137 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
9138 make_elf_object returns NULL.
9139 (Archive::include_member): Don't check whether object target is
9140 compatible.
9141 * output.cc (Output_section::add_input_section): Get target from
9142 parameters.
9143 (Output_section::relax_input_section): Likewise.
9144 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
9145 parameters.
9146 (Sized_relobj::do_scan_relocs): Likewise.
9147 (Sized_relobj::relocate_sections): Likewise.
9148 * resolve.cc (Symbol_table::resolve): Likewise.
9149 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
9150 parameter. Change all callers.
9151 (Symbol_table::add_from_object): Get target from parameters.
9152 (Symbol_table::add_from_relobj): Don't check object target.
9153 (Symbol_table::add_from_dynobj): Likewise.
9154 (Symbol_table::define_special_symbol): Get target from
9155 parameters.
9156 * symtab.h (class Symbol_table): Update declaration.
9157 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
9158 parameter. Change all callers. Clear parameter target.
9159 (Binary_test): Test target here.
9160 * testsuite/object_unittest.cc (gold_testsuite): Remove
9161 target_test_pointer parameter. Change all callers.
9162 (Object_test): Test target here.
9163
a6a22b83
ILT
91642009-09-26 Ian Lance Taylor <iant@google.com>
9165
9166 * testsuite/initpri1.c: Don't try to use constructor priorities if
9167 compiling with gcc before 4.3.
9168
6a8f49fe
ILT
91692009-09-22 Mikolaj Zalewski <mikolajz@google.com>
9170
9171 * testsuite/retain_symbols_file_test.sh (check_present): Change
9172 output file name to retain_symbols_file_test.stdout.
9173 (check_absent): Likewise.
9174
8c604651
CS
91752009-09-18 Craig Silverstein <csilvers@google.com>
9176
9177 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
9178 * options.cc: Include <cerrno> and <fstream>.
9179 (General_options::finalize): Parse -retain-symbols-file tag.
9180 * options.h: New flag.
9181 (General_options): New method should_retain_symbol, new
9182 variable symbols_to_retain.
9183 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
9184 should_retain_symbol map.
9185 * testsuite/Makefile.am (retain_symbols_file_test): New test.
9186 * testsuite/Makefile.in: Regenerate.
9187 * testsuite/retain_symbols_file_test.sh: New file.
9188
ca58b19f
NC
91892009-09-18 Nick Clifton <nickc@redhat.com>
9190
9191 * po/es.po: Updated Spanish translation.
9192
20e6d0d6
DK
91932009-09-17 Doug Kwan <dougkwan@google.com>
9194
9195 * debug.h (DEBUG_RELAXATION): New constant.
9196 (DEBUG_ALL): Add DEBUG_RELAXATION.
9197 (debug_string_to_enum): Add relaxation debug option.
9198 * layout.cc
9199 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
9200 Layout::Relaxation_debug_check::read_sections,
9201 Layout::Relaxation_debug_check::read_sections): New method definitions.
9202 (Layout::Layout): Initialize data members
9203 record_output_section_data_from_scrips_,
9204 script_output_section_data_list_ and relaxation_debug_check_.
9205 (Layout::save_segments, Layout::restore_segments,
9206 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9207 Layout::relaxation_loop_body): New method definitions.
9208 (Layout::finalize): Support relaxation. Move section layout code to
9209 Layout::relaxation_loop_body.
9210 (Layout::set_asection_address_from_script): Move code for orphan
9211 section placement out.
9212 (Layout::place_orphan_sections_in_script): New method definition.
9213 * layout.h (Output_segment_headers, Output_file_header):
9214 New forward class declarations.
9215 (Layout::~Layout): Define.
9216 (Layout::new_output_section_data_from_script): New method definition.
9217 (Layout::place_orphan_sections_in_script): New method declaration.
9218 (Layout::Segment_states): New type declaration.
9219 (Layout::save_segments, Layout::restore_segments,
9220 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9221 Layout::relaxation_loop_body): New method declarations.
9222 (Layout::Output_section_data_list): New type declaration.
9223 (Layout::Relaxation_debug_check): New class definition.
9224 (Layout::record_output_section_data_from_script_,
9225 Layout::script_output_section_data_list_, Layout::segment_states_,
9226 Layout::relaxation_debug_check_): New data members.
9227 * output.cc: (Output_section_headers::do_size): New method definition.
9228 (Output_section_headers::Output_section_headers): Move size
9229 computation to Output_section_headers::do_size.
9230 (Output_segment_headers::do_size): New method definition.
e1df38aa 9231 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
9232 Output_file_header::do_size and call it.
9233 (Output_file_header::do_size): New method definition.
9234 (Output_data_group::Output_data_group): Adjust call to
9235 Output_section_data.
9236 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
9237 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 9238 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
9239 RELAXED_INPUT_SECTION_CODE.
9240 (Output_section::Output_section): Initialize data member checkpoint_.
9241 (Output_section::~Output_section): Delete checkpoint object pointed
9242 by checkpoint_.
9243 (Output_section::add_input_section): Always add an Input_section if
9244 relaxing.
9245 (Output_section::add_merge_input_section): Add assert.
9246 (Output_section::relax_input_section): New method definition.
9247 (Output_section::set_final_data_size): Set load address to zero for
9248 an unallocated section.
9249 (Output_section::do_address_and_file_offset_have_reset_values):
9250 New method definition.
9251 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
9252 Handle relaxed input section.
9253 (Output_section::sort_attached_input_sections): Checkpoint input
9254 section list lazily.
9255 (Output_section::get_input_sections): Change type of input_sections to
9256 list of Simple_input_section pointers. Checkpoint input section list
9257 lazily. Also handle relaxed input sections.
9258 (Output_section::add_input_section_for_script): Take a reference to
9259 a Simple_input_section object instead of Relobj pointer and section
9260 index as parameter. Handle relaxed input sections.
9261 (Output_section::save_states, Output_section::restore_states): New
9262 method definitions.
9263 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
9264 (Output_data::is_data_size_fixed): New method definition.
9265 (Output_data::reset_addresss_and_file_offset): Do not reset data size
9266 if it is fixed.
9267 (Output_data::address_and_file_offset_have_reset_values): New method
9268 definition.
9269 (Output_data::do_address_and_file_offset_have_reset_values): New method
9270 definition.
9271 (Output_data::set_data_size): Check that data size is not fixed.
9272 (Output_data::fix_data_size): New method definition.
9273 (Output_data::is_data_size_fixed_): New data member.
9274 (Output_section_headers::set_final_data_size): New method definition.
9275 (Output_section_headers::do_size): New method declaration.
9276 (Output_segment_headers::set_final_data_size): New method definition.
9277 (Output_segment_headers::do_size): New method declaration.
9278 (Output_file_header::set_final_data_size)::New method definition.
9279 (Output_file_header::do_size)::New method declaration.
9280 (Output_section_data::Output_section_data): Add new parameter
9281 is_data_size_fixed and use it to fix data size.
9282 (Output_data_const::Output_data_const): Adjust call to base class
9283 constructor and fix data size.
9284 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
9285 base class constructor and fix data size.
9286 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
9287 base class constructor and fix data size.
9288 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
9289 class constructor and fix data size.
9290 (Output_data_group::set_final_data_size): New method definition.
9291 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
9292 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
9293 class constructor and fix data size.
9294 (Output_relaxed_input_section): New class definition.
9295 (Output_section::Simple_input_section): New class definition.
9296 (Output_section::get_input_sections): Adjust parameter list.
9297 (Output_section::add_input_section_for_script): Same.
9298 (Output_section::save_states, Output_section::restore_states,
9299 Output_section::do_address_and_file_offset_have_reset_values,
9300 (Output_section::Input_section::Input_section): Handle
9301 RELAXED_INPUT_SECTION_CODE. Add new overload for
9302 Output_relaxed_input_section.
9303 (Output_section::Input_section::is_input_section,
9304 Output_section::Input_section::set_output_section): Handle relaxed
9305 input section.
9306 (Output_section::Input_section::is_relaxed_input_section,
9307 Output_section::Input_section::output_section_data,
9308 Output_section::Input_section::relaxed_input_section): New method
9309 definitions.
9310 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
9311 value.
9312 (Output_section::Input_section::u1_): Update comments.
9313 (Output_section::Input_section::u2_): Add new union member poris.
9314 (Output_section::Checkpoint_output_section): New classs definition.
9315 (Output_section::relax_input_section): New method declaration.
9316 (Output_section::checkpoint_): New data member.
9317 (Output_segment): Update comments.
9318 (Output_segment::Output_segment): Un-privatize copy constructor.
9319 (Output_segment::operator=): Un-privatize.
9320 * script-sections.cc (Output_section_element::Input_section_list):
9321 Change element type to Output_section::Simple_input_section.
9322 (Output_section_element_dot_assignment::set_section_addresses):
9323 Register output section data for relaxation clean up.
9324 (Output_data_exression::Output_data_expression): Adjust call to base
9325 constructor to fix data size.
9326 (Output_section_element_data::set_section_addresses): Register
9327 Output_data_expression object for relaxation clean up.
9328 (struct Input_section_info): Replace Relobj pointer and section index
9329 pair with Output_section::Simple_input_section and Convert struct to a
9330 class.
9331 (Input_section_sorter::operator()): Adjust access to
e1df38aa 9332 Input_section_info data member to use accessors.
20e6d0d6
DK
9333 (Output_section_element_input::set_section_addresses): Use layout
9334 parameter. Adjust code to use Output_section::Simple_input_section
9335 and Input_secction_info classes. Register filler for relaxation
9336 clean up.
9337 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
9338 and section index pair with Output_section::Simple_input_section
9339 class. Adjust code accordingly.
9340 (Phdrs_element::release_segment): New method definition.
9341 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
9342 segment list.
9343 (Script_sections::release_segments): New method definition.
9344 * gold/script-sections.h (Script_sections::release_segments): New
9345 method declaration.
9346 * gold/target.h (Target::may_relax, Target::relax,
9347 Target::do_may_relax, Target::do_relax): New method definitions.
9348
5e445df6
ILT
93492009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9350
9351 * arm.cc (has_signed_unsigned_overflow): New function.
9352 (Arm_relocate_functions::abs8): New function.
9353 (Target_arm::Scan::local): Handle R_ARM_ABS8.
9354 (Target_arm::Scan::global): Likewise.
9355 (Target_arm::relocate::relocate): Likewise.
9356 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9357 Likewise.
9358
8c604651 93592009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
9360
9361 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
9362 * testsuite/Makefile.in: Regenerate.
9363
1e9cc1c2
NC
93642009-09-11 Nick Clifton <nickc@redhat.com>
9365
9366 * po/gold.pot: Updated by the Translation project.
9367
6a89f575
CC
93682009-09-08 Cary Coutant <ccoutant@google.com>
9369
9370 * output.cc (Output_file::open): Add execute permission to empty file.
9371 * testsuite/Makefile.am (permission_test): New test.
9372 * testsuite/Makefile.in: Regenerate.
9373
fdcac5af
ILT
93742009-09-02 Ian Lance Taylor <iant@google.com>
9375
9376 * output.cc (Output_file::resize): Call map_no_anonymous rather
9377 than map.
9378
44453f85
ILT
93792009-09-01 Mikolaj Zalewski <mikolajz@google.com>
9380
9381 * gold.cc: Include "incremental.h".
9382 (queue_initial_tasks): Call Incremental_checker methods.
9383 * incremental.cc: Include "output.h".
9384 (Incremental_checker::can_incrementally_link_output_file): New
9385 method.
9386 * incremental.h (Incremental_checker): New class.
9387
9388 * output.cc (Output_file::open_for_modification): New method.
9389 (Output_file::map_anonymous): Changed return type to bool. Record
9390 map in base_ field.
9391 (Output_file::map_no_anonymous): New method, broken out of map.
9392 (Output_file::map): Use map_no_anonymous and map_anonymous.
9393 * output.h (class Output_file): Update declarations.
9394
293c1386
CC
93952009-08-24 Cary Coutant <ccoutant@google.com>
9396
9397 * options.h (Command_line::Pre_options): New class.
9398 (Command_line::pre_options): New member.
9399 * options.cc (gold::options::ready_to_register): New variable.
9400 (One_option::register_option): Do nothing if not registering options.
9401 Assert if same short option registered twice.
9402 (General_options::General_options): Turn off option registration when
9403 done constructing.
9404 (Command_line::Pre_options::Pre_options): New constructor.
9405
f773f3d2
CC
94062009-08-24 Cary Coutant <ccoutant@google.com>
9407
06a73cfe
CC
9408 * options.h (General_options::no_keep_memory): Remove incorrect
9409 short option.
f773f3d2 9410
a15af8e2
RW
94112009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9412
9413 * Makefile.am (am__skiplex, am__skipyacc): New.
9414 * Makefile.in: Regenerate.
9415
c462b41b
RW
94162009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9417
14ec8efd
RW
9418 * Makefile.am (AM_CPPFLAGS): Renamed from ...
9419 (INCLUDES): ... this.
9420 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
9421 (AM_CPPFLAGS): Renamed from ...
9422 (INCLUDE): ... this.
9423 * Makefile.in, testsuite/Makefile.in: Regenerate.
9424
81ecdfbb
RW
9425 * Makefile.in: Regenerate.
9426 * aclocal.m4: Likewise.
9427 * config.in: Likewise.
9428 * configure: Likewise.
9429 * testsuite/Makefile.in: Likewise.
9430
c462b41b
RW
9431 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9432 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9433 * Makefile.in: Regenerate.
9434 * testsuite/Makefile.in: Regenerate.
9435
2da73f13
CC
94362009-08-19 Cary Coutant <ccoutant@google.com>
9437
9438 * resolve.cc (Symbol_table::resolve): Don't complain about defined
9439 symbols in shared libraries overridden by hidden or internal symbols
9440 in the main program.
9441
2db70501
CD
94422009-08-19 Chris Demetriou <cgd@google.com>
9443
9444 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
9445 checking source file names in error messages.
9446
f733487b
DK
94472009-08-18 Doug Kwan <dougkwan@google.com>
9448
9449 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
9450 an elcpp::Ehdr as parameter. Adjust call to set_target.
9451 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
9452 an elfcpp::Ehdr as parameter.
9453 * object.cc (Object::set_target): Remove the version that looks up
9454 a target and sets it.
9455 (Sized_relobj::setup): Take a Target object instead of
9456 an elfcpp::Ehdr as parameter. Adjust call to set_target.
9457 (make_elf_sized_object): Find target and ask target to
9458 make an ELF object.
9459 * object.h: (Object::set_target): Remove the version that looks up
9460 a target and sets it.
9461 (Sized_relobj::setup): Take a Target object instead of
9462 an elfcpp:Ehdr as parameter.
9463 * target.cc: Include dynobj.h.
9464 (Target::do_make_elf_object_implementation): New.
2e702c99 9465 (Target::do_make_elf_object): New.
f733487b
DK
9466 * target.h (Target::make_elf_object): New template declaration.
9467 (Target::do_make_elf_object): New method declarations.
9468 (Target::do_make_elf_object_implementation): New template declaration.
9469
cc70f101
ILT
94702009-08-14 Ian Lance Taylor <iant@google.com>
9471
9472 * gold.h (FUNCTION_NAME): Define.
9473 (gold_unreachable): Use FUNCTION_NAME.
9474
ef5e0cb1
ST
94752009-08-12 Sriraman Tallam <tmsriram@google.com>
9476
9477 * icf.cc (Icf::find_identical_sections): Issue a warning when a
9478 symbol in the --keep-unique list is not found.
9479
48c187ce
ST
94802009-08-12 Sriraman Tallam <tmsriram@google.com>
9481
9482 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
9483 been maked as --keep-unique.
9484 (Icf::unfold_section): New function.
9485 * icf.h (Icf::unfold_section): New function.
9486 * options.h (General_options::keep_unique): New option.
9487 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
9488 * testsuite/Makefile.in: Regenerate.
9489 * testsuite/icf_keep_unique_test.sh: New file.
9490 * testsuite/icf_keep_unique_test.cc: New file.
9491
645afe0c
CC
94922009-08-12 Cary Coutant <ccoutant@google.com>
9493
9494 PR 10471
9495 * resolve.cc (Symbol_table::resolve): Check for references from
9496 dynamic objects to hidden and internal symbols.
9497 * testsuite/Makefile.am (hidden_test.sh): New test.
9498 * testsuite/Makefile.in: Regenerate.
9499 * testsuite/hidden_test.sh: New script.
9500 * testsuite/hidden_test_1.c: New test source.
9501 * testsuite/hidden_test_main.c: New test source.
9502
11af873f
DK
95032009-08-11 Doug Kwan <dougkwan@google.com>
9504
9505 * arm.cc: Update comments.
9506 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
9507 segment to locate the .ARM.exidx section if present.
9508
b9f7d72d
DK
95092009-08-09 Doug Kwan <dougkwan@google.com>
9510
9511 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
9512 patch.
9513
ddd3c53c
ST
95142009-08-07 Sriraman Tallam <tmsriram@google.com>
9515 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
9516 compiler warnings.
9517
27721062
ST
95182009-08-06 Sriraman Tallam <tmsriram@google.com>
9519
9520 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
9521 valid tls_segment only for non-debug-section relocations.
9522 * testsuite/Makefile.am: Add gc_tls_test.
9523 * testsuite/Makefile.in: Regenerate.
9524 * testsuite/gc_tls_test.cc: New file.
9525 * testsuite/gc_tls_test.sh: New file.
9526
ef15dade 95272009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 9528
ef15dade
ST
9529 * icf.cc: New file.
9530 * icf.h: New file.
9531 * Makefile.am (CCFILES): Add icf.cc.
9532 (HFILES): Add icf.h
9533 * Makefile.in: Regenerate.
9534 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
9535 * gc.h (gc_process_relocs): Populate lists used by icf to contain
9536 section, symbol and addend information for the relocs.
9537 * gold.cc (queue_middle_tasks): Call identical code folding.
9538 * gold.h: Add defines for multimap.
9539 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
9540 to the call of finalize_local_symbols.
9541 * main.cc (main): Create object of class Icf.
9542 * object.cc (Sized_relobj::do_layout): Allow this function to be
9543 called twice during icf.
9544 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
9545 to sections marked as identical by icf.
9546 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
9547 when available.
9548 (Sized_relobj::do_section_entsize): New function.
9549 * object.h (Object::section_entsize): New function.
9550 (Object::do_section_entsize): New pure virtual function.
9551 (Relobj::finalize_local_symbols): Add new parameter.
9552 (Relobj::do_section_entsize): New function.
9553 * options.h (General_options::icf): New option.
9554 (General_options::icf_iterations): New option.
9555 (General_options::print_icf_sections): New option.
9556 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
9557 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
9558 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
9559 icf.
9560 * symtab.cc (Symbol_table::is_section_folded): New function.
9561 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
9562 to sections marked as identical by icf.
9563 * symtab.h (Symbol_table::set_icf): New function.
9564 (Symbol_table::icf): New function.
9565 (Symbol_table::is_section_folded): New function.
9566 (Symbol_table::icf_): New data member.
9567 * target-reloc.h (relocate_section): Ignore sections folded by icf.
9568 * testsuite/Makefile.am: Add commands to build icf_test.
9569 * testsuite/Makefile.in: Regenerate.
9570 * testsuite/icf_test.sh: New file.
9571 * testsuite/icf_test.cc: New file.
9572
c3b65ac4
CD
95732009-07-24 Chris Demetriou <cgd@google.com>
9574
9575 * layout.cc (is_compressible_debug_section): Fix incorrect
9576 comment about compressed section names.
9577
1caf2c51
ILT
95782009-07-20 Ian Lance Taylor <ian@airs.com>
9579
9580 PR 10419
9581 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
9582
1ef4d87f
ILT
95832009-07-16 Ian Lance Taylor <iant@google.com>
9584
9585 PR 10400
9586 * layout.h: #include <map>.
9587 (class Kept_section): Change from struct to class. Add accessors
9588 and setters. Add section size to Comdat_group mapping. Change
9589 Comdat_group to std::map. Add is_comdat_ field. Add
9590 linkonce_size field in union.
9591 (class Layout): Update declaration of find_or_add_kept_section.
9592 Don't declare find_kept_object.
9593 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
9594 parameter. Add object, shndx, is_comdat, and is_group_name
9595 parameters. Change all callers. Adjust for new Kept_section.
9596 (Layout::find_kept_object): Remove.
9597 * object.cc (Sized_relobj::include_section_group): Update use of
9598 Kept_section. Rename secnum to shndx. Only record
9599 Kept_comdat_section if sections are the same size.
9600 (Sized_relobj::include_linkonce_section): Update use of
9601 Kept_section. Only record Kept_comdat_section if sections are the
9602 same size. Set size of linkonce section.
9603 (Sized_relobj::map_to_kept_section): Update call to
9604 get_kept_comdat_section.
9605 * object.h (class Sized_relobj): Rename fields in
9606 Kept_comdat_section to drop trailing underscores; change object
9607 field to Relobj*. Change Kept_comdat_section_table to store
9608 struct rather than pointer.
9609 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
9610 Add kept_object and kept_shndx parameters. Change all callers.
9611 (Sized_relobj::get_kept_comdat_section): Change return type to
9612 bool. Add kept_object and kept_shndx parameters. Change all
9613 callers.
9614 * plugin.cc (Pluginobj::include_comdat_group): Update call to
9615 Layout::find_or_add_kept_section.
9616
37c3b7b0
ILT
96172009-07-09 Ian Lance Taylor <iant@google.com>
9618
9619 * merge.cc (Object_merge_map::initialize_input_to_output_map):
9620 Reserve space in the hash table.
9621
98fa85cb
ILT
96222009-07-06 Mikolaj Zalewski <mikolajz@google.com>
9623
9624 * fileread.cc (File_read::get_mtime): New method.
9625 * fileread.h (Timespec): New structure.
9626 (File_read::get_mtime): New method.
9627 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
9628 Renamed from timestamp_nsec.
9629 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
9630 Elf_Xword.
e1df38aa 9631 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 9632 timestamp_nsec.
e1df38aa 9633 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
9634 (Incremental_inputs::report_obejct): Save mtime; style fix.
9635 (Incremental_inputs::report_script): Save mtime; style fix.
9636 (Incremental_inputs::finalize_inputs): Style fix.
9637 (Incremental_inputs::finalize): Style fix.
9638 (Incremental_inputs::create_input_section_data): Store inputs
9639 mtime.
9640 * incremental.h (Incremental_inputs::report_script): Add mtime
9641 argument.
9642 (Incremental_inputs::Input_info::Input_info): Intialize only one
9643 union member.
9644 (Incremental_inputs::Input_info::archive): Move to nameless
9645 union.
9646 (Incremental_inputs::Input_info::obejct): Move to nameless union.
9647 (Incremental_inputs::Input_info::script): Move to nameless union.
9648 (Incremental_inputs::mtime): New field.
9649 * script.cc (read_input_script): Pass file mtime to
9650 Incremental_input.
9651 * script.h (Script_info::inputs): Style fix.
9652
c9d70757
ILT
96532009-07-01 Ian Lance Taylor <ian@airs.com>
9654
9655 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
9656 instead of 32.
9657
9c547ec3
ILT
96582009-06-24 Ian Lance Taylor <iant@google.com>
9659
9660 PR 10156
9661 * layout.cc (Layout::choose_output_section): If we find an
9662 existing section, update the flags.
9663 (Layout::create_notes): New function, broken out of
9664 Layout::finalize.
9665 (Layout::finalize): Don't create note sections.
9666 (Layout::create_note): Don't crash if linker script discards
9667 section.
9668 (Layout::create_gold_note): Likewise.
9669 (Layout::create_build_id): Likewise. Don't set
9670 after_input_sections on the section.
9671 (Layout::create_executable_stack_info): Remove target parameter.
9672 Change caller.
9673 * layout.h (class Layout): Declare create_notes. Update
9674 declaration of create_executable_stack_info.
9675 * gold.cc (queue_middle_tasks): Call create_notes.
9676 * output.cc (Output_section::update_flags_for_input_section): Move
9677 here from output.h. If SHF_ALLOC flag is newly set, mark address
9678 invalid.
9679 * output.h (Output_data::mark_address_invalid): New function.
9680 (class Output_section): Only declare, not define,
9681 update_flags_for_input_section. Remove set_flags.
9682
55458500
ILT
96832009-06-24 Ian Lance Taylor <iant@google.com>
9684
9685 * script-sections.cc (Output_section_definition::
9686 set_section_addresses): Rename shadowing local load_address to
9687 laddr.
9688
1307d6cd
ILT
96892009-06-24 Ian Lance Taylor <iant@google.com>
9690
9691 PR 10244
9692 * reloc.cc (relocate_sections): Skip empty relocation sections.
9693
ec3f783e
ILT
96942009-06-23 Ian Lance Taylor <iant@google.com>
9695
9696 PR 10156
9697 * layout.cc (Layout::create_note): Use choose_output_section
9698 rather than make_output_section.
9699
459c9f1c
ILT
97002009-06-23 Ian Lance Taylor <iant@google.com>
9701
9702 PR 10237
9703 * options.cc (General_options::parse_V): Set printed_version_.
9704 (General_options::General_options): Initialize printed_version_.
9705 * options.h (class General_options): Add printed_version_ field.
9706 * gold.cc (queue_initial_tasks): If there are no input files,
9707 don't give a fatal error if we printed the version information.
9708 (queue_middle_tasks): If using -r with a shared object, give a
9709 fatal error rather than an ordinary error.
9710
1518dc8f
ILT
97112009-06-23 Ian Lance Taylor <iant@google.com>
9712
9713 PR 10219
9714 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
9715 (Layout::make_output_section): Set have_stabstr_section_ if we see
9716 a .stab*str section.
9717 (Layout::finalize): Call link_stabs_sections.
9718 (Layout::link_stabs_sections): New file.
9719 * layout.h (class Layout): Add have_stabstr_section_ field.
9720 Declare link_stabs_sections.
9721
3d857b98
DK
97222009-06-23 Doug Kwan <dougkwan@google.com>
9723
9724 * Makefile.am (libgold_a_LIBADD): New.
9725 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 9726 * Makefile.in: Regenerate.
3d857b98
DK
9727 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
9728 * configure: Regenerate.
9729 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
9730 * fileread.cc: Include sys/state.h
9731 * gold.h: Declare memmem and strndup if found missing.
9732 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
9733
0639a6f6
ILT
97342009-06-23 Ian Lance Taylor <iant@google.com>
9735
9736 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
9737 * configure: Rebuild.
9738
8d63875c
ILT
97392009-06-23 Ian Lance Taylor <iant@google.com>
9740
9741 PR 10147
9742 * object.cc (Object::section_contents): Don't try to get a view if
9743 the section has length zero.
9744 (Object::handle_gnu_warning_section): If the section is empty, use
9745 the name of the section as the warning.
9746
f7c8a183
ILT
97472009-06-23 Ian Lance Taylor <iant@google.com>
9748
9749 PR 10133
9750 * stringpool.h (class Stringpool_template): Add optimize_ field.
9751 (Stringpool_template::set_optimize): New function.
9752 * stringpool.cc (Stringpool_template::Stringpool_template):
9753 Initialize optimize_ field.
9754 (Stringpool_template::set_string_offsets): Test local optimize
9755 fild rather than parameter.
9756 * layout.cc (Layout::Layout): Call set_optimize on the section
9757 name stringpool.
9758
e6a307ba
ILT
97592009-06-22 Ian Lance Taylor <iant@google.com>
9760
9761 PR 10030
9762 * yyscript.y: Parse TARGET.
9763 * script.cc (script_set_target): New function.
9764 * script-c.h (script_set_target): Declare.
9765 * options.cc (General_options::string_to_object_format): Rename
9766 from string_to_object_format in anonymous namespace. Change
9767 callers.
9768 * options.h (class General_options): Declare
9769 string_to_object_format.
9770
3ee173de
ILT
97712009-06-22 Ian Lance Taylor <iant@google.com>
9772
9773 * script-sections.cc (Script_sections::create_segments): Don't put
9774 program headers in a PT_LOAD segment if -n or -N.
9775
97762009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
9777
9778 PR 10141
9779 * options.h (class General_options): Add -z lazy and -z now. Sort
9780 -z options into alphabetical order.
9781 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
9782
cd6739a1 97832009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
9784
9785 * layout.cc (Layout::make_output_section): Call
9786 Target::new_output_section.
9787 (Layout::attach_allocated_section_to_segment): Put large section
9788 sections in a separate load segment with the large segment flag
9789 set.
9790 (Layout::segment_precedes): Sort large data segments after other
9791 load segments.
9792 (align_file_offset): New static function.
9793 (Layout::set_segment_offsets): Use align_file_offset.
9794 * output.h (class Output_section): Add is_small_section_ and
9795 is_large_section_ fields.
9796 (Output_section::is_small_section): New function.
9797 (Output_section::set_is_small_section): New function.
9798 (Output_section::is_large_section): New function.
9799 (Output_section::set_is_large_section): New function.
9800 (Output_section::is_large_data_section): New function.
9801 (class Output_segment): Add is_large_data_segment_ field.
9802 (Output_segment::is_large_data_segment): New function.
9803 (Output_segment::set_is_large_data_segment): New function.
9804 * output.cc (Output_section::Output_section): Initialize new
9805 fields.
9806 (Output_segment::Output_segment): Likewise.
9807 (Output_segment::add_output_section): Add assertion that large
9808 data sections always go in large data segments. Force small data
9809 sections to the end of the list of data sections. Force small BSS
9810 sections to the start of the list of BSS sections. For large BSS
9811 sections to the end of the list of BSS sections.
9812 * symtab.h (class Symbol): Declare is_common_shndx.
9813 (Symbol::is_defined): Check Symbol::is_common_shndx.
9814 (Symbol::is_common): Likewise.
9815 (class Symbol_table): Define enum Commons_section_type. Update
9816 declarations. Add small_commons_ and large_commons_ fields.
9817 * symtab.cc (Symbol::is_common_shndx): New function.
9818 (Symbol_table::Symbol_table): Initialize new fields.
9819 (Symbol_table::add_from_object): Put small and large common
9820 symbols in the right list.
9821 (Symbol_table::sized_finalized_symbol): Check
9822 Symbol::is_common_shndx.
9823 (Symbol_table::sized_write_globals): Likewise.
9824 * common.cc (Symbol_table::do_allocate_commons): Allocate new
9825 common symbol lists. Don't call do_allocate_commons_list if the
9826 list is empty.
9827 (Symbol_table::do_allocate_commons_list): Remove is_tls
9828 parameter. Add comons_section_type parameter. Change all
9829 callers. Handle small and large common symbols.
9830 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
9831 Symbol::is_common_shndx.
9832 * resolve.cc (symbol_to_bits): Likewise.
9833 * target.h (Target::small_common_shndx): New function.
9834 (Target::small_common_section_flags): New function.
9835 (Target::large_common_shndx): New function.
9836 (Target::large_common_section_flags): New function.
9837 (Target::new_output_section): New function.
9838 (Target::Target_info): Add small_common_shndx, large_common_shndx,
9839 small_common_section_flags, and large_common_section_flags
9840 fields.
9841 (Target::do_new_output_section): New virtual function.
9842 * arm.cc (Target_arm::arm_info): Initialize new fields.
9843 * i386.cc (Target_i386::i386_info): Likewise.
9844 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
9845 Likewise.
9846 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
9847 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
9848 (Target_x86_64::do_new_output_section): New function.
9849 * configure.ac: Define conditional MCMODEL_MEDIUM.
9850 * testsuite/Makefile.am (check_PROGRAMS): Add large.
9851 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
9852 (large_LDFLAGS): Define.
9853 * testsuite/large.c: New file.
9854 * testsuite/testfile.cc (Target_test::test_target_info):
9855 Initialize new fields.
9856 * configure, testsuite/Makefile.in: Rebuild.
9857
bb04269c
DK
98582009-06-05 Doug Kwan <dougkwan@google.com>
9859
9860 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 9861 * Makefile.in: Regenerate.
bb04269c
DK
9862 * i386.cc (class Target_i386): Define new virtual method to
9863 override do_is_local_label_name in parent.
9864 * object.cc (Sized_relobj::do_count_local_symbols): Discard
9865 local symbols if --discard-locals or -X is given.
9866 * options.h (class General_options): Declare new options
9867 '--discard-locals' and '-X' for discarding locals.
9868 * target.h (class Target): Define new methods is_local_label_name.
9869 Declare new virtual method do_is_local_label_name.
9870 * target.cc: New file.
9871 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
9872 (check_SCRIPTS): Add discard_locals_test.sh.
9873 (check_DATA): Add discard_local_tests.syms.
9874 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
9875 (discard_local_tests.syms, discard_locals_test.o): New make rules.
9876 * testsuite/Makefile.in: Regenerate.
9877 * testsuite/discard_locals_test.c: New file.
9878 * testsuite/discard_locals_test.sh: Same.
9879
805bb01c
DK
98802009-06-05 Doug Kwan <dougkwan@google.com>
9881
9882 * object.cc (Sized_relobj::Sized_relobj): Initialize
9883 discarded_eh_frame_shndx_ to -1U.
9884 (Sized_relobj::do_layout): Record index of a discard .eh_frame
9885 section.
9886 (Sized_relobj::do_count_local_symbols): Skip local symbols in
9887 a discarded .eh_frame section.
9888 (Sized_relobj::do_finalize_local_symbols): Ditto.
9889 * object.h (class Sized_relobj): Declare new member
9890 discarded_eh_frame_shndx_.
9891 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
9892 (local_labels_test.o, local_labels_test): New rules.
9893 * testsuite/Makefile.in: Regenerate.
9894
1dcd334d
DK
98952009-06-04 Doug Kwan <dougkwan@google.com>
9896
9897 * layout.cc (Layout::section_name_mapping): Add mapping for
9898 special ARM sections.
9899
96d49306
DK
99002009-06-03 Doug Kwan <dougkwan@google.com>
9901
9902 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
9903 (utils::has_overflow): Same.
9904
dff16297
ILT
99052009-06-03 Ian Lance Taylor <iant@google.com>
9906
9907 * layout.cc (Layout::section_name_mapping): New array, replacing
9908 Layout::linkonce_mapping.
9909 (Layout::section_name_mapping_count): New variable, replacing
9910 Layout::linkonce_mapping_count.
9911 (Layout::linkonce_output_name): Remove.
9912 (Layout::output_section_name): Rewrite.
9913 * layout.h (class Layout): Rename Linkonce_mapping to
9914 Section_name_mapping, linkonce_mapping to section_name_mapping,
9915 linkonce_mapping_count to section_name_mapping_count. Don't
9916 declare linkonce_output_name.
9917
c121c671
DK
99182009-06-03 Doug Kwan <dougkwan@google.com>
9919
9920 * gold/arm.cc (namespace utils): New.
9921 (Target_arm::reloc_is_non_pic): Define new method.
9922 (class Arm_relocate_functions): New.
9923 (Target_arm::Relocate::relocate): Handle relocation types used by
9924 Android.
9925
07800fab
ILT
99262009-06-03 Ian Lance Taylor <iant@google.com>
9927
9928 * arm.cc (Target_arm::scan::global): Use || instead of |.
9929
c121c671
DK
99302009-06-02 Doug Kwan <dougkwan@google.com>
9931
9932 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
9933 issued_non_pic_error_.
9934 (class Target_arm::Scan): Declare new method check_non_pic.
9935 Define new method symbol_needs_plt_entry.
9936 Declare new data member issued_non_pic_error_.
9937 (class Target_arm::Relocate): Declare new method
9938 should_apply_static_reloc.
9939 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
9940 (Target_arm::Scan::check_non_pic): Define new method.
9941 (Target_arm::Scan::local): Handle a small subset of reloc types used
9942 by Android.
9943 (Target_arm::Scan::local): Same.
9944 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
9945
b19b0c6d
ILT
99462009-05-31 Mikolaj Zalewski <mikolajz@google.com>
9947
9948 * incremental.cc (Incremental_inputs::report_command_line): Filter
9949 out --incremental-* options.
9950
94cdfcff
DK
99512009-05-29 Doug Kwan <dougkwan@google.com>
9952
9953 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
9954 template class.
9955 (class Target_arm): Update comment.
9956 (Target_arm::Target_arm): Initialize new data members GOT_,
9957 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
9958 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
9959 and Target_arm::rel_dyn_section.
9960 Declare new_enum Target_arm::Got_type.
9961 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
9962 and DYNBSS_.
9963 Update commments for member do_dynsym_value.
9964 (Target_arm::got_size, Target_arm::plt_section,
9965 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
9966 new methods inside class defintion.
9967 (Target_arm::got_section): Define new method.
9968 (Target_arm::rel_dyn_section): Same.
9969 (Output_data_plt_arm): New template class.
9970 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
9971 (Output_data_plt_arm:do_adjust_output_section): Define new method.
9972 (Output_data_plt_arm::add_entry): Same.
9973 (Output_data_plt_arm::first_plt_entry): Define new
9974 static data member for PLT instruction template.
9975 (Output_data_plt_arm::plt_entry): Same.
9976 (Output_data_plt_arm::do_write): Define new method.
9977 (Target_arm::make_plt_entry): Same.
9978 (Target_arm::do_finalize_sections): Same.
9979 (Target_arm::do_dynsym_value): Same.
9980
4a657b0d
DK
99812009-05-28 Doug Kwan <dougkwan@google.com>
9982
9983 * Makefile.am (TARGETSOURCES): Add arm.cc.
9984 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
9985 * Makefile.in: Regenerate.
9986 * arm.cc: New file.
9987 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
9988
e7ae8c36
DK
99892009-05-26 Doug Kwan <dougkwan@google.com>
9990
9991 * options.cc (General_options::parse_exclude_libs). Fix a comment.
9992 (General_options::check_excluded_libs): Strip off directories in
9993 archive name before matching like GNU ld does.
9994 * testsuite/Makefile.am (MOSTLYCLEANFILES,
9995 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
9996 (exclude_libs_test_LDFLAGS): Add linker option
9997 -Wl,--exclude-libs,libexclude_libs_test_3
9998 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
9999 an explicit archive without using -l.
10000 (alt/libexclude_libs_test_3.a): New make rule.
10001 * testsuite/Makefile.in: Regenerate.
10002 * testsuite/exclude_libs_test.c : Declare lib3_default().
10003 (main): Call it.
10004 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
10005 * exclude_libs_test_3.c: New file.
10006
f12e7348
NC
100072009-05-26 Nick Clifton <nickc@redhat.com>
10008
10009 * po/id.po: New Indonesian translation.
10010 * po/gold.pot: Updated template file.
10011
4daadc0d
ST
100122009-05-22 Sriraman Tallam <tmsriram@google.com>
10013
e1df38aa 10014 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
10015 gc_comdat_test files. Add -Wl,--gc-sections to build
10016 gc_comdat_test.
10017 * testsuite/Makefile.in: Regenerate.
10018 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
10019
531813ad
ST
100202009-05-21 Sriraman Tallam <tmsriram@google.com>
10021
10022 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
10023 kept comdat section was garbage collected.
10024 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
10025 * testsuite/Makefile.in: Regenerate.
10026 * testsuite/gc_comdat_test.sh: New file.
10027 * testsuite/gc_comdat_test_1.cc: New file.
10028 * testsuite/gc_comdat_test_2.cc: New file.
10029
65514900
CC
100302009-05-19 Doug Kwan <dougkwan@google.com>
10031
10032 * archive.cc (Archive::Archive): Move constructor from archive.h
10033 to here. Initialize no_export_.
10034 (Archive::get_elf_object_for_member): Set no_export flag of object.
10035 * archive.h (Archive::Archive): Move constructor body to
10036 archive.cc.
10037 (Archive::no_export): New method.
10038 (Archive::no_export_): New field.
10039 * object.h (Object::Object): Initialize no_export_ to false.
10040 (Object::no_export, Object::set_no_export): New methods.
10041 (Object::no_export_): New field.
10042 * options.cc (General_options::parse_exclude_libs): New method.
10043 (General_options::check_excluded_libs) Same.
10044 * options.h (exclude_libs): New option.
10045 (General_options::check_excluded_libs): New method declaration.
10046 (General_options::excluded_libs_): New field.
10047 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
10048 default or protected visibility if an object has no-export flag set.
10049 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
10050 (check_SCRIPTS): Add exclude_libs_test.sh.
10051 (check_DATA): Add exclude_libs_test.syms.
10052 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
10053 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
10054 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
10055 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
10056 (exclude_libs_test.syms, libexclude_libs_test_1.a,
10057 libexclude_libs_test_2.a): New rules.
10058 * testsuite/Makefile.in: Regenerate.
10059 * testsuite/exclude_libs_test.c: New file.
10060 * testsuite/exclude_libs_test.sh: Ditto.
10061 * testsuite/exclude_libs_test_1.c: Ditto.
10062 * testsuite/exclude_libs_test_2.c: Ditto.
10063
1b77ea50
ILT
100642009-05-15 Ian Lance Taylor <iant@google.com>
10065
10066 * configure.ac: Check for declarations for cases where libiberty.h
10067 checks HAVE_DECL_xxx.
10068 * configure, config.in: Rebuild.
10069
072fe7ce
ILT
100702009-05-15 Mikolaj Zalewski <mikolajz@google.com>
10071
10072 * gold.h (Incremental_argument_list): Remove (invalid) forward
10073 declaration.
10074 * incremental.cc (Incremental_inputs::report_achive): New method.
10075 (Incremental_inputs::report_object): New method.
10076 (Incremental_inputs::report_script): New method.
10077 (Incremental_inputs::finalize_inputs): New method.
10078 (Incremental_inputs::finalize): Call finalize_inputs().
10079 (Incremental_inputs::sized_create_incremental_inputs_section_data):
10080 Create inputs entries.
10081 * incremental.h (Incremental_input_type): New enum.
10082 (Incremental_inputs::Incremental_input): Initialize new fields.
10083 (Incremental_inputs::report_inputs): New method.
10084 (Incremental_inputs::report_achive): New method.
10085 (Incremental_inputs::report_object): New method.
10086 (Incremental_inputs::report_script): New method.
10087 (Incremental_inputs::finalize_inputs): New method.
10088 (Incremental_inputs::Input_info): New struct.
10089 (Incremental_inputs::Input_info_map): New typedef.
10090 (Incremental_inputs::lock_): New field.
10091 (Incremental_inputs::Inputs_): New field.
10092 (Incremental_inputs::Inputs_map): New field.
10093 * main.cc (main): Call Incremental_input::report_inputs.
10094 * options.h (Input_argument_list): Typedef moved from
10095 Input_arguments.
10096 (Input_file_group::Files): Remove, use ::Input_argument_list.
10097 (Input_file_group::Input_argument_list): Remove, use
10098 ::Input_argument_list.
10099 * plugin.cc (Plugin_manager::add_input_file): Add error in
10100 incremental build.
10101 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
10102 functions.
10103 * script.cc (read_input_script): Call
10104 Incremental_input::report_script.
10105 * script.h (Script_info): New class.
10106
b0481b0b
ILT
101072009-04-27 Ian Lance Taylor <iant@google.com>
10108
10109 * x86_64.cc (do_adjust_output_section): Set entsize to
10110 plt_entry_size.
10111
b22a5a41 101122009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
10113
10114 * output.cc (Output_file::close): After short writes, continue
10115 writing from the correct offset in the buffer being written.
10116
40fde488
CD
101172009-04-23 Chris Demetriou <cgd@google.com>
10118
10119 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
10120 * configure: Regenerate.
10121 * config.in: Regenerate.
10122 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
10123 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
10124
3ce2c28e
ILT
101252009-04-21 Mikolaj Zalewski <mikolajz@google.com>
10126
10127 * incremental.cc (Incremental_inputs_header_data): Renamed from
10128 Incremental_input_header_data.
10129 (Incremental_inputs_header_data::data_size): New field.
10130 (Incremental_inputs_header_data::put_input_file_count): Renamed
10131 from input_file_count.
10132 (Incremental_inputs_header_data::put_command_line_offset): Renamed
10133 from command_line_offset.
10134 (Incremental_inputs_header_data::put_reserved): Renamed from
10135 put_reserved.
10136 (Incremental_inputs_entry_data): Renamed from
10137 Incremental_input_entry_data.
10138 (Incremental_inputs_entry_data::data_size): New field.
10139 (Incremental_inputs::report_command_line): New method.
10140 (Incremental_inputs::finalize): New method.
10141 (Incremental_inputs::create_incremental_inputs_data): New method.
10142 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
10143 * incremental.h: New file.
10144 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
10145 (Layout::finalize): Create incremental inputs section in
10146 incremental builds.
10147 (Layout::create_incremental_info_sections): New method.
10148 * layout.h (Layout::incremental_inputs): New method.
10149 (Layout::create_incremental_info_sections): New method.
10150 (Layout::incremental_inputs_): New field.
10151 * main.cc (main): Notify Incremental_input of the command line.
10152
e55bde5e
ILT
101532009-04-01 Ian Lance Taylor <iant@google.com>
10154 Mikolaj Zalewski <mikolajz@google.com>
10155
10156 * gold.h (reserve_unordered_map): Define, three versions, one for
10157 each version of Unordered_map.
10158 * layout.cc (Layout::Layout): Remove options parameter. Add
10159 number_of_input_files parameter. Don't initialize options_.
10160 Initialize number_of_input_files_ and resized_signatures_. Move
10161 sections_are_attached_.
10162 (Layout::layout_group): Reserve space for group_signatures_.
10163 (Layout::find_or_add_kept_section): Change name parameter to be a
10164 reference. Resize signatures_ map when it gets large enough.
10165 (Layout::layout_eh_frame): Use parameters->options() instead of
10166 this->options_.
10167 (Layout::make_output_section): Likewise.
10168 (Layout::attach_allocated_section_to_segment): Likewise.
10169 (Layout::finalize, Layout::create_executable_stack): Likewise.
10170 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
10171 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
10172 * layout.h (class Layout): Update declarations. Remove options_
10173 field. Add number_of_input_files_ and resized_signatures_
10174 fields. Move sections_are_attached_ field.
10175 * main.cc (main): Pass number of input files to Layout
10176 constructor. Don't pass options.
10177
154b857c
ILT
101782009-03-30 Ian Lance Taylor <iant@google.com>
10179
10180 * ffsll.c (ffsll): Correct implementation.
10181
2f35ab9b
ILT
101822009-03-27 Ian Lance Taylor <iant@google.com>
10183
fd03461a
ILT
10184 * ffsll.c: New file.
10185 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
10186 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
10187 * ftruncate.c (ftruncate): Declare before definition.
10188 * mremap.c (mremap): Likewise.
10189 * pread.c (pread): Likewise.
10190 * configure, Makefile.in, config.in: Rebuild.
10191
2f35ab9b
ILT
10192 * mremap.c: New file.
10193 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
10194 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
10195 (mremap): Declare if HAVE_MREMAP is not defined.
10196 * configure, Makefile.in, config.in: Rebuild.
10197
33aea2fd
CC
101982009-03-27 Cary Coutant <ccoutant@google.com>
10199
10200 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
10201 position independent.
10202 * sparc.cc (Target_sparc::check_non_pic): Likewise.
10203 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
10204
6d479619
CC
102052009-03-24 Cary Coutant <ccoutant@google.com>
10206
10207 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
10208 an executable.
10209 (needs_dynamic_reloc): Likewise.
10210
afc06bb8
ILT
102112009-03-24 Ian Lance Taylor <iant@google.com>
10212
10213 * yyscript.y (file_cmd): Recognize EXTERN.
10214 (extern_name_list, extern_name_list_body): New nonterminals.
10215 * script.cc (script_add_extern): Define.
10216 * script-c.h (script_add_extern): Declare.
10217
f6060a4d
ILT
102182009-03-24 Rafael Avila de Espindola <espindola@google.com>
10219
10220 * object.cc (is_elf_object): Define.
10221 * object.h (is_elf_object): Declare.
10222 * archive.cc (Archive::get_elf_object_for_member): Call
10223 is_elf_object.
33aea2fd 10224 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 10225
26736d8e
ILT
102262009-03-24 Elliott Hughes <enh@google.com>
10227
10228 * output.cc (Output_file::map_anonymous): Define.
10229 (Output_file::map): Use map_anonymous. If the regular mmap fails,
10230 try an anonymous one. Report the size if the mmap fails.
10231 * output.h (class Output_file): Declare map_anonymous.
10232
22fd9730
ILT
102332009-03-24 Ian Lance Taylor <iant@google.com>
10234
10235 * target-select.cc (instantiate_target): Don't acquire the lock if
10236 the instantiated_target_ field has already been set.
10237
cb010894
ILT
102382009-03-23 Ian Lance Taylor <iant@google.com>
10239
7f055c20
ILT
10240 * gold-threads.h (class Initialize_lock): Define.
10241 * gold-threads.cc (class Initialize_lock_once): Define.
10242 (initialize_lock_control): New static variable.
10243 (initialize_lock_pointer): New static variable.
10244 (initialize_lock_once): New static function.
10245 (Initialize_lock::Initialize_lock): Define.
10246 (Initialize_lock::initialize): Define.
10247 * target-select.h: Include "gold-threads.h".
10248 (class Target_selector): Add lock_ and initialize_lock_ fields.
10249 Don't define instantiate_target, just declare it.
10250 * target-select.cc (Target_selector::Target_selector): Initialize
10251 new fields.
10252 (Target_selector::instantiate_target): Define.
10253 * descriptors.h: Include "gold-threads.h".
10254 (class Descriptors): Add initialize_lock_ field.
10255 * descriptors.cc (Descriptors::Descriptors): Initialize new
10256 field.
10257 (Descriptors::open): Use initialize_lock_ field
10258 * errors.h (class Errors): Add initialize_lock_ field.
10259 * errors.cc (Errors::Errors): Initialize new field.
10260 (Errors::initialize_lock): Use initialize_lock_ field.
10261 * powerpc.cc (class Target_selector_powerpc): Remove
10262 instantiated_target_ field. In do_recognize call
10263 instantiate_target rather than do_instantiate_target. In
10264 do_instantiate_target just allocate a new target.
10265 * sparc.cc (class Target_selector_sparc): Likewise.
10266
36959681
ILT
10267 * freebsd.h: New file.
10268 * i386.cc: Include "freebsd.h".
10269 (Target_i386): Derive from Target_freebsd rather than
10270 Sized_target.
10271 (Target_selector_i386): Derive from Target_selector_freebsd rather
10272 than Target_selector.
10273 * x86_64.cc: Include "freebsd.h".
10274 (Target_x86_64): Derive from Target_freebsd rather than
10275 Sized_target.
10276 (Target_selector_x86_64): Derive from Target_selector_freebsd
10277 rather than Target_selector.
10278 * target.h (class Target): Add adjust_elf_header and
10279 do_adjust_elf_header.
10280 * output.cc (Output_file_header:: do_sized_write): Call target
10281 adjust_elf_header routine.
10282 * configure.tgt: Set targ_osabi.
10283 * configure.ac: Define GOLD_DEFAULT_OSABI.
10284 * parameters.cc (Parameters::default_target): Pass
10285 GOLD_DEFAULT_OSABI to select_target.
10286 * target-select.h (class Target_selector): Make instantiate_target
10287 protected rather than private.
10288 * Makefile.am (HFILES): Add freebsd.h.
10289 * configure, Makefile.in, config.in: Rebuild.
10290
cb010894
ILT
10291 * merge.cc (do_add_input_section): Correct pend value. Change
10292 message about last entry not being null terminated from error to
10293 warning.
10294
0e879927
ILT
102952009-03-20 Mikolaj Zalewski <mikolajz@google.com>
10296
10297 * incremental.cc: New file.
10298 * Makefile.am (CCFILES): Add incremental.cc.
10299 * Makefile.in: Rebuild.
10300
41105937
PP
103012009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
10302
10303 * layout.cc (Layout::output_section_name): Preserve names
10304 of '.note.' sections.
e1df38aa 10305
60439920
ILT
103062009-03-19 Ian Lance Taylor <iant@google.com>
10307
10308 * descriptors.cc (Descriptors::open): Check that the options are
10309 valid before using them.
10310
0d371ad3
ILT
103112009-03-18 Ian Lance Taylor <iant@google.com>
10312
10313 * script-sections.h: Include <list>.
10314 (class Script_sections): Change Sections_elements from std::vector
10315 to std::list. Typedef public Elements_iterator. Add
10316 orphan_section_placement_, data_segment_align_start_, and
10317 saw_data_segment_align_ fields. Remove data_segment_align_index_
10318 field.
10319 * script-sections.cc (class Orphan_section_placement): New class.
10320 (class Sections_element): Add virtual functions is_relro and
10321 orphan_section_init. Remove virtual function place_orphan_here.
10322 (class Output_section_definition): Add is_relro and
10323 orphan_section_init. Remove place_orphan_here.
10324 (class Orphan_output_section): Likewise.
10325 (Script_sections::Script_sections): Update for field changes.
10326 (Script_sections::data_segment_align): Set saw_data_segment_align_
10327 and data_segment_align_start_, not data_segment_align_index.
10328 (Script_sections::data_segment_relro_end): Check
10329 saw_data_segment_align_. Use data_segment_align_start_ rather
10330 than data_segment_align_index_.
10331 (Script_sections::place_orphan): Rewrite to use
10332 Orphan_section_placement.
10333
9201d894
ILT
103342009-03-17 Ian Lance Taylor <iant@google.com>
10335
9c5b8369
ILT
10336 * archive.cc (Archive::add_symbols): Check for a version attached
10337 to the symbol name in the archive map.
10338 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
10339 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
10340 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
10341 (ver_test_11.a): New target.
10342 * testsuite/Makefile.in: Rebuild.
10343
9201d894
ILT
10344 * configure.ac: Check for chsize and posix_fallocate. Replace
10345 ftruncate.
10346 * ftruncate.c: New file, from gnulib.
10347 * output.cc (posix_fallocate): Define dummy version if not
10348 HAVE_POSIX_FALLOCATE.
10349 (Output_file::map): Call posix_fallocate rather than lseek and
10350 write.
10351 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
10352 * configure, Makefile.in, config.in: Rebuild.
10353
ef4ab7a8 103542009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 10355
ef4ab7a8
PP
10356 * layout.h (Layout::create_note): Add section_name parameter.
10357 * layout.cc (Layout::create_note): Likewise.
10358 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 10359
8c500701
ILT
103602009-03-17 Ian Lance Taylor <iant@google.com>
10361
e85b18e1
ILT
10362 * descriptors.cc: Include "options.h".
10363 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
10364 (Descriptors::open): Always use O_CLOEXEC when opening a new
10365 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
10366 then set FD_CLOEXEC.
10367
9efe6174
ILT
10368 * sparc.cc (class Target_sparc): Add has_got_section.
10369 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
10370 make sure we have a GOT section.
10371
10372 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
10373 (Target_sparc::Scan::local): Likewise.
10374 (Target_sparc::Scan::global): Likewise.
10375 (Target_sparc::Relocate::relocate): Likewise.
10376 (Target_sparc::Relocate::relocate_tls): Likewise.
10377
8c500701
ILT
10378 * symtab.cc (Symbol_table::define_default_version): New function,
10379 broken out of add_from_object.
10380 (Symbol_table::add_from_object): Call define_default_version.
10381 (Symbol_table::define_special_symbol): Add resolve_oldsym
10382 parameter. Change all callers. If the version for a symbol comes
10383 from a version script, resolve it with the symbol with the same
10384 name with no version. Also add the symbol without a version if
10385 appropriate.
10386 (do_define_in_output_data): If resolving with oldsym, don't delete
10387 sym.
10388 (do_define_in_output_segment): Likewise.
10389 (do_define_as_constant): Likewise.
10390 * symtab.h (class Symbol_table): Update declarations.
10391
f1ed28fb
ILT
103922009-03-13 Ian Lance Taylor <iant@google.com>
10393
15f8229b
ILT
10394 * readsyms.cc (Read_symbols::incompatible_warning): New function.
10395 (Read_symbols::requeue): New function.
10396 (Read_symbols::do_read_symbols): If make_elf_object fails because
10397 the target type is not configured, and the file was searched for,
10398 issue a warning and retry with the next directory.
10399 (Add_symbols::run): If the file has an incompatible format, and
10400 it was searched for, requeue the Read_symbols task. On error,
10401 release the object.
10402 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
10403 dirindex parameter to constructor. Change all callers. Declare
10404 incompatible_warning and requeue.
10405 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
10406 input_argument_ and input_group_ fields. Add them to
10407 constructor. Change all callers.
10408 (class Read_script): Add dirindex_ field. Add it to constructor.
10409 Change all callers.
10410 * archive.cc (Archive::setup): Remove input_objects parameter.
10411 Change all callers.
10412 (Archive::get_file_and_offset): Likewise.
10413 (Archive::read_all_symbols): Likewise.
10414 (Archive::read_symbols): Likewise.
10415 (Archive::get_elf_object_for_member): Remove input_objects
10416 parameter. Add punconfigured parameter. Change all callers.
10417 (Archive::add_symbols): Change return type to bool. Check return
10418 value of include_member.
10419 (Archive::include_all_members): Likewise.
10420 (Archive::include_member): Change return type to bool. Return
10421 false if first included object has incompatible target. Set
10422 included_member_ field.
10423 (Add_archive_symbols::run): If add_symbols returns false, requeue
10424 Read_symbols task.
10425 * archive.h (class Archive): Add included_member_ field.
10426 Initialize it in constructor. Add input_file and searched_for
10427 methods. Update declarations.
10428 (class Add_archive_symbols): Add dirpath_, dirindex_, and
10429 input_argument_ fields. Add them to constructor. Change all
10430 callers.
10431 * script.cc: Include "target-select.h".
10432 (class Parser_closure): Add skip_on_incompatible_target_ and
10433 found_incompatible_target_ fields. Add
10434 skip_on_incompatible_target parameter to constructor. Change all
10435 callers. Add methods skip_on_incompatible_target,
10436 clear_skip_on_incompatible_target, found_incompatible_target, and
10437 set_found_incompatible_target.
10438 (read_input_script): Add dirindex parameter. Change all callers.
10439 If parser finds an incompatible target, requeue Read_symbols
10440 task.
10441 (script_set_symbol): Clear skip_on_incompatible_target in
10442 closure.
10443 (script_add_assertion, script_parse_option): Likewise.
10444 (script_start_sections, script_add_phdr): Likewise.
10445 (script_check_output_format): New function.
10446 * script.h (read_input_script): Update declaration.
10447 * script-c.h (script_check_output_format): Declare.
10448 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
10449 (ignore_cmd): Remove OUTPUT_FORMAT.
10450 * fileread.cc (Input_file::Input_file): Add explicit this.
10451 (Input_file::will_search_for): New function.
10452 (Input_file::open): Add pindex parameter. Change all callers.
10453 * fileread.h (class Input_file): Add input_file_argument method.
10454 Declare will_search_for. Update declarations.
10455 * object.cc (make_elf_object): Add punconfigured parameter.
10456 Change all callers.
10457 * object.h (class Object): Make input_file public. Add
10458 searched_for method.
10459 (make_elf_object): Update declaration.
10460 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
10461 restart search.
10462 * dirsearch.h (class Dirsearch): Update declaration.
10463 * options.h (class General_options): Add --warn-search-mismatch.
10464 * parameters.cc (Parameters::is_compatible_target): New function.
10465 * parameters.h (class Parameters): Declare is_compatible_target.
10466 * workqueue.cc (Workqueue::add_blocker): New function.
10467 * workqueue.h (class Workqueue): Declare add_blocker.
10468
f1ed28fb
ILT
10469 * fileread.cc (Input_file::open): Remove options parameter.
10470 Change all callers.
10471 (Input_file::open_binary): Likewise.
10472 * script.cc (read_input_script): Likewise.
10473 * readsyms.h (class Read_symbols): Remove options_ field. Remove
10474 options parameter from constructor. Change all callers.
10475 (class Read_script): Likewise.
10476 * fileread.h (class Input_file): Update declarations.
10477 * script.h (read_input_script): Update declaration.
10478
34dd024a
NC
104792009-03-10 Nick Clifton <nickc@redhat.com>
10480
10481 * po/es.po: New Spanish translation.
10482
6d71b17c
CC
104832009-03-06 Cary Coutant <ccoutant@google.com>
10484
10485 * options.cc (parse_short_option): Keep dash_z from registering itself.
10486
031cdbed
ILT
104872009-03-03 Ian Lance Taylor <iant@google.com>
10488
10489 PR 9918
10490 * target-reloc.h (relocate_section): Pass output_section to
10491 relocate.
10492 * i386.cc (Target_i386::should_apply_static_reloc): Add
10493 output_section parameter. Change all callers.
10494 (Target_i386::Relocate::relocate): Add output_section parameter.
10495 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10496 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
10497 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
10498 * testsuite/two_file_shared.sh: New script.
10499 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
10500 (check_DATA): Add two_file_shared.dbg.
10501 (two_file_shared.dbg): New target.
10502 * testsuite/Makefile.in: Rebuild.
10503
15d5fa16
ILT
105042009-03-01 Ian Lance Taylor <iant@google.com>
10505
10506 * configure.ac: Check for byteswap.h.
10507 * configure: Rebuild.
10508 * config.in: Rebuild.
10509
8a4c0b0d
ILT
105102009-03-01 Mikolaj Zalewski <mikolajz@google.com>
10511
10512 * layout.cc (Layout::find_or_add_kept_section): New function.
10513 (Layout::add_comdat): Removed.
10514 * layout.h (struct Kept_section): Move out of class Layout.
10515 Remove trailing underscores from field names. Add group_sections
10516 field. Rename group_ field to is_group. Change all uses.
10517 (class Layout): Declare find_or_add_kept_section, not add_comdat.
10518 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
10519 comdat_groups_ field.
10520 (Sized_relobj::include_section_group): Use
10521 find_or_add_kept_section and Kept_section::group_sections.
10522 (Sized_relobj::include_linkonce_section): Likewise.
10523 * object.cc (class Sized_relobj): Don't define Comdat_group or
10524 Comdat_group_table. Remove find_comdat_group and
10525 add_comdat_group. Remove comdat_groups_ field.
10526 * plugin.cc (include_comdat_group): Use
10527 Layout::find_or_add_kept_section.
10528
b4ecf66b
ILT
105292009-02-28 Ian Lance Taylor <iant@google.com>
10530
14359ca0
ILT
10531 * README: --gc-sections and map files are now supported. Document
10532 some build requirements.
10533
b4ecf66b
ILT
10534 PR 6992
10535 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
10536 relocatable link set the value of the section symbol to zero.
10537 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
10538 relocatable link don't include the section address in the local
10539 symbol value.
10540
0602e05a
ILT
105412009-02-27 Ian Lance Taylor <iant@google.com>
10542
fd9d194f
ILT
10543 PR 6811
10544 * options.h (class Search_directory): Add is_system_directory.
10545 (class General_options): Declare is_in_system_directory.
10546 * options.cc (get_relative_sysroot): Make static.
10547 (get_default_sysroot): Make static.
10548 (General_optoins::is_in_system_directory): New function.
10549 * fileread.cc (Input_file::is_in_system_directory): New function.
10550 * fileread.h (class Input_file): Declare is_in_system_directory.
10551 * object.h (class Object): Add is_in_system_directory.
10552 (class Input_objects): Remove system_library_directory_ field.
10553 * object.cc (Input_objects::add_object): Don't set
10554 system_library_directory_.
10555 (input_objects::found_in_system_library_directory): Remove.
10556 * symtab.cc (Symbol_table::write_globals): Remove input_objects
10557 parameter. Change all callers.
10558 (Symbol_table::sized_write_globals): Likewise.
10559 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
10560 Call Object::is_in_system_directory.
10561 * symtab.h (class Symbol_table): Update declarations.
10562
61edd21f
ILT
10563 PR 5990
10564 * descriptors.h (Open_descriptor): Add is_on_stack field.
10565 * descriptors.cc (Descriptors::open): If the descriptor is on the
10566 top of the stack, remove it. Initialize is_on_stack field.
10567 (Descriptors::release): Only add pod to stack if it is not on the
10568 stack already.
10569 (Descriptors::close_some_descriptor): Clear stack_next and
10570 is_on_stack fields.
10571
e29e076a
ILT
10572 PR 7091
10573 * output.cc (Output_section::find_starting_output_address): Rename
10574 from starting_output_address; add PADDR parameter; change return
10575 type.
10576 * output.h (class Output_section): Declare
10577 find_starting_output_address instead of starting_output_address.
10578 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
10579 section symbol for which we can't find a merge section.
10580
0602e05a
ILT
10581 PR 9836
10582 * symtab.cc (Symbol_table::add_from_object): If the visibility is
10583 hidden or internal, force the symbol to be local.
10584 * resolve.cc (Symbol::override_visibility): Define.
10585 (Symbol::override_base): Use override_visibility.
10586 (Symbol_table::resolve): Likewise.
10587 (Symbol::override_base_with_special): Likewise.
10588 (Symbol_table::override_with_special): If the visibility is hidden
10589 or internal, force the symbol to be local.
10590 * symtab.h (class Symbol): Add set_visibility and
10591 override_visibility.
10592 * testsuite/ver_test_1.sh: New file.
10593 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
10594 (check_DATA): Add ver_test_1.syms.
10595 (ver_test_1.syms): New target.
10596 * testsuite/Makefile.in: Rebuild.
10597
401a9a73
CC
105982009-02-25 Cary Coutant <ccoutant@google.com>
10599
10600 * layout.cc (Layout::choose_output_section): Don't rename sections
10601 when using a linker script that has a SECTIONS clause.
10602 * Makefile.in: Regenerate.
10603
10604 * testsuite/Makefile.am (script_test_5.sh): New test case.
10605 * testsuite/Makefile.in: Regenerate.
10606 * testsuite/script_test_5.cc: New file.
10607 * testsuite/script_test_5.sh: New file.
10608 * testsuite/script_test_5.t: New file.
10609
f488e4b0
CC
106102009-02-13 Rafael Avila de Espindola <espindola@google.com>
10611
10612 * archive.cc (Archive::include_member): Update calls to add_symbols.
10613 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
10614 the Layout argument.
10615 * dynobj.h (do_add_symbols): Add the Layout argument.
10616 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
10617 Layout argument.
10618 * object.h (Object::add_symbols): Add the Layout argument.
10619 (Object::do_add_symbols): Add the Layout argument.
10620 (Sized_relobj::do_add_symbols): Add the Layout argument.
10621 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
10622 Unify the two versions.
10623 (Add_plugin_symbols): Remove.
10624 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
10625 (Sized_pluginobj::do_add_symbols): Unify the two versions.
10626 (Add_plugin_symbols): Remove.
10627 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
10628 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
10629 (Add_symbols::run): Make it work with Pulginobj.
10630
89dd1680
ILT
106312009-02-06 Ian Lance Taylor <iant@google.com>
10632
10633 * object.cc (Sized_relobj::do_layout): Make info message start
10634 with lower case letter.
10635
266d0a74
ILT
106362009-02-06 Mikolaj Zalewski <mikolajz@google.com>
10637
602b464e
ILT
10638 * binary.cc: Fix file comment.
10639
266d0a74
ILT
10640 * options.h (enum Incremental_disposition): Define.
10641 (class General_options): Add new options: --incremental,
10642 --incremental_changed, --incremental_unchanged,
10643 --incremental_unknown. Add incremental_disposition_ and
10644 implicit_incremental_ fields.
10645 (General_options::incremental_disposition): New function.
10646 (class Position_dependent_options): Add incremental_disposition
10647 option.
10648 (Position_dependent_options::copy_from_options): Set incremental
10649 dispositions.
10650 * options.cc (General_options::parse_incremental_changed): New
10651 function.
2e702c99
RM
10652 (General_options::parse_incremental_unchanged): New function.
10653 (General_options::parse_incremental_unknown): New function.
10654 (General_options::General_options): Initialize new fields
266d0a74 10655 incremental_disposition_ and implicit_incremental_.
2e702c99 10656 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
10657 without --incremental.
10658
f073bbf7
CD
106592009-02-06 Chris Demetriou <cgd@google.com>
10660
10661 * gold.h (gold_undefined_symbol): Change to take only a Symbol
10662 pointer and to report location as the file name associated with
10663 the symbol.
10664 (gold_undefined_symbol_at_location): New function to replace the
10665 old gold_undefined_symbol functionality.
10666 * target-reloc.h (relocate_section): Update to use
10667 gold_undefined_symbol_at_location.
10668 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
10669 Call gold_undefined_symbol function rather than gold_error.
10670 * errors.h (Errors::undefined_symbol): Take location as a
10671 string, rather than calculating it from a relocation.
10672 * errors.cc (Errors::fatal): Print "fatal error:" before the
10673 formatted message.
10674 (Errors::error, Errors::error_at_location): Print "error: "
10675 before the formatted message.
10676 (Errors::undefined_symbol): Take location as a string, rather
10677 than calculating it from a relocation.
10678 (gold_undefined_symbol_at_location): New function akin to
10679 old gold_undefined_symbol, calculates location from relocation.
10680 (gold_undefined_symbol): Change to take only a Symbol pointer
10681 and to report location as the file name associated with the symbol.
10682 * testsuite/debug_msg.sh: Update for changed error messages.
10683 * testsuite/undef_symbol.sh: Likewise.
10684
8e94a90c
ILT
106852009-02-04 Duncan Sands <baldrick@free.fr>
10686
10687 PR 9812
10688 * reduced_debug_output.h
10689 (Output_reduced_debug_abbrev_section::failed): Use format for
10690 gold_warning.
10691 (Output_reduced_debug_info_section::faild): Likewise.
10692
88a0e15b
ILT
106932009-01-31 Mikolaj Zalewski <mikolajz@google.com>
10694
10695 * script.cc (Lazy_demangler): New class.
2e702c99 10696 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
10697 symbol only once.
10698
5efc7cd2
CC
106992009-01-29 Cary Coutant <ccoutant@google.com>
10700
10701 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
10702 to __tls_get_addr.
10703 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10704
e0ebcf42
ILT
107052009-01-28 Ian Lance Taylor <iant@google.com>
10706
5efc7cd2 10707 * version.cc (version_string): Bump to 1.9.
75fe7426 10708
e0ebcf42
ILT
10709 * gold.h: Include <cstring> and <stdint.h>.
10710 * version.cc: Include <cstdio>.
10711 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
10712 warning.
10713 * reduced_debug_output.cc (insert_into_vector): Rename from
10714 Insert_into_vector; change all callers. Use Swap_unaligned to
10715 avoid aliasing issue; remove union since it is unnecessary.
10716
8e2813be 107172009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
10718
10719 * Makefile.am (CCFILES): Add gc.cc.
10720 (HFILES): Add gc.h.
10721 * Makefile.in: Regenerate.
10722 * gold.cc (Gc_runner): New class.
10723 (queue_initial_tasks): Call garbage collection related tasks
10724 when corresponding options are invoked.
10725 (queue_middle_gc_tasks): New function.
10726 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
10727 processed early before laying out sections during garbage collection.
10728 * gold.h (queue_middle_gc_tasks): New function.
10729 (is_prefix_of): Move from "layout.cc".
10730 * i386.cc (Target_i386::gc_process_relocs): New function.
10731 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
10732 * main.cc (main): Create object of class "Garbage_collection".
10733 * object.cc (Relobj::copy_symbols_data): New function.
10734 (Relobj::is_section_name_included): New function.
e1df38aa
NC
10735 (Sized_relobj::do_layout): Allow this function to be called twice
10736 during garbage collection and defer layout of section during the
6d03d481
ST
10737 first call.
10738 * object.h (Relobj::get_symbols_data): New function.
10739 (Relobj::is_section_name_included): New function.
10740 (Relobj::copy_symbols_data): New function.
10741 (Relobj::set_symbols_data): New function.
10742 (Relobj::get_relocs_data): New function.
10743 (Relobj::set_relocs_data): New function.
10744 (Relobj::is_output_section_offset_invalid): New pure virtual function.
10745 (Relobj::gc_process_relocs): New function.
10746 (Relobj::do_gc_process_relocs): New pure virtual function.
10747 (Relobj::sd_): New data member.
10748 (Sized_relobj::is_output_section_offset_invalid): New function.
10749 (Sized_relobj::do_gc_process_relocs): New function.
10750 * options.h (General_options::gc_sections): Modify to not be a no-op.
10751 (General_options::print_gc_sections): New option.
10752 * plugin.cc (Plugin_finish::run): Remove function call to
10753 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
10754 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
10755 * reloc.cc (Read_relocs::run): Add task to process relocs and
10756 determine unreferenced sections when doing garbage collection.
10757 (Gc_process_relocs): New class.
10758 (Sized_relobj::do_gc_process_relocs): New function.
10759 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
10760 sections that are garbage collected.
10761 * reloc.h (Gc_process_relocs): New class.
10762 * sparc.cc (Target_sparc::gc_process_relocs): New function.
10763 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
10764 symbols whose corresponding sections are garbage collected.
10765 (Symbol_table::Symbol_table): Add new parameter for the garbage
10766 collection object.
10767 (Symbol_table::gc_mark_undef_symbols): New function.
10768 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10769 (Symbol_table::gc_mark_dyn_syms): New function.
10770 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
10771 as garbage.
10772 (Symbol_table::add_from_object): Likewise.
10773 (Symbol_table::add_from_relobj): When building shared objects, do not
10774 treat externally visible symbols as garbage.
10775 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
10776 table information for static and relocatable links.
10777 * symtab.h (Symbol_table::set_gc): New function.
10778 (Symbol_table::gc): New function.
10779 (Symbol_table::gc_mark_undef_symbols): New function.
10780 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10781 (Symbol_table::gc_mark_dyn_syms): New function.
10782 (Symbol_table::gc_): New data member.
e1df38aa 10783 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
10784 function.
10785 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
10786 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
10787
3b293544
CF
107882009-01-20 Chris Faylor <me.sourceware@sourceware.org>
10789
10790 * options.h (General_options::gc_sections): Define as a no-op for now.
10791 (General_options::no_keep_memory): Ditto.
10792 (General_options::Bshareable): Define.
10793 * options.cc (General_options::finalize): Honor -Bshareable.
10794
83d22aa8
AS
107952009-01-20 Andreas Schwab <schwab@suse.de>
10796
10797 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
10798 read the value in the contents, since we don't use it. Use the
10799 template endianness when writing.
10800 (Relocate::relocate): Use it for R_PPC_REL16_HA.
10801
cd536b21
AS
108022009-01-19 Andreas Schwab <schwab@suse.de>
10803
10804 * configure.tgt (powerpc64-*): Fix targ_obj.
10805
99e9a495
ILT
108062009-01-15 Ian Lance Taylor <iant@google.com>
10807
10808 * object.cc (Sized_relobj::write_local_symbols): Don't write out
10809 local symbols when stripping all symbols.
10810
bbbfea06
CC
108112009-01-14 Cary Coutant <ccoutant@google.com>
10812
99e9a495 10813 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 10814
0f7c0701
CC
108152009-01-14 Cary Coutant <ccoutant@google.com>
10816
10817 * archive.cc (Archive::get_elf_object_for_member): Remove call
10818 to File_read::claim_for_plugin.
10819 * descriptors.cc (Descriptors::open): Remove reference to
10820 is_claimed.
10821 (Descriptors::claim_for_plugin): Remove.
10822 * descriptors.h (Descriptors::claim_for_plugin): Remove.
10823 (Descriptors::is_claimed): Remove.
10824 (claim_descriptor_for_plugin): Remove.
10825 * fileread.cc (File_read::claim_for_plugin): Remove.
10826 * fileread.h (File_read::claim_for_plugin): Remove.
10827 (File_read::descriptor): Reopen descriptor if necessary.
10828 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
10829 (Plugin_manager::all_symbols_read): Add task parameter. Change
10830 all callers.
10831 (Plugin_manager::get_input_file): New function.
10832 (Plugin_manager::release_input_file): New function.
10833 (Pluginobj::Pluginobj): Add filesize parameter and initialize
10834 corresponding data member.
10835 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
10836 and pass to base constructor. Change all callers.
10837 (get_input_file, release_input_file): New functions.
10838 (make_sized_plugin_object): Add filesize parameter. Change all callers.
10839 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
10840 (Plugin_manager::all_symbols_read): Add task parameter.
10841 (Plugin_manager::get_input_file): New function.
10842 (Plugin_manager::release_input_file): New function.
10843 (Plugin_manager::task_): New data member.
10844 (Pluginobj::Pluginobj): Add filesize parameter.
10845 (Pluginobj::filename): New function.
10846 (Pluginobj::descriptor): New function.
10847 (Pluginobj::filesize): New function.
10848 (Pluginobj::filesize_): New data member.
10849 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
10850 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
10851 File_read::claim_for_plugin; use Object::unlock to unlock the file.
10852
10853 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
10854 with archive libraries.
10855 * testsuite/Makefile.in: Regenerate.
10856 * testsuite/plugin_test.c (struct sym_info): New type.
10857 (get_input_file, release_input_file): New static variables.
10858 (onload): Capture new transfer vector entries.
10859 (claim_file_hook): Stop reading at end of file according to filesize.
10860 Factor out parsing of readelf output into separate function.
10861 (all_symbols_read_hook): Exercise get_input_file and release_input_file
10862 APIs and get the source file name from the symbol table. Convert
10863 source file name to corresponding object file name. Print info
10864 message when adding new input files.
10865 (parse_readelf_line): New function.
10866 * testsuite/plugin_test_1.sh: Add checks for new info messages.
10867 * testsuite/plugin_test_2.sh: Likewise.
10868 * testsuite/plugin_test_3.sh: Likewise.
10869 * testsuite/plugin_test_4.sh: New test case.
10870
62a6d109
ILT
108712009-01-07 Ian Lance Taylor <iant@google.com>
10872
10873 * version.cc (version_string): Bump to 1.8.
10874
483620e8
CC
108752008-12-23 Cary Coutant <ccoutant@google.com>
10876
10877 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
10878 * plugin.cc (Plugin_manager::finish): Rename as
10879 layout_deferred_objects. Move cleanup to separate function.
10880 (Plugin_manager::cleanup): New function.
10881 (Plugin_finish::run): Call layout_deferred_objects and cleanup
10882 separately.
10883 * plugin.h (Plugin_manager::finish): Rename as
10884 layout_deferred_objects.
10885 (Plugin_manager::cleanup): New function.
10886 (Plugin_manager::cleanup_done): New field.
10887
d66a9eb3
CC
108882008-12-23 Cary Coutant <ccoutant@google.com>
10889
10890 * plugin.cc (is_visible_from_outside): New function.
10891 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
10892 so we don't return "IR only" status for exported symbols or -r links.
10893
10894 * testsuite/Makefile.am (plugin_test_3): New test case.
10895 * testsuite/Makefile.in: Regenerate.
10896 * testsuite/plugin_test_3.sh: New file.
10897
5995b570
CC
108982008-12-22 Cary Coutant <ccoutant@google.com>
10899
10900 * object.cc (Sized_relobj::layout_section): New function.
10901 (Sized_relobj::do_layout): Defer layout of input sections until after
10902 plugin has provided replacement files.
10903 (Sized_relobj::do_layout_deferred_sections): New function.
10904 * object.h (Relobj::set_section_offset): Remove virtual keyword.
10905 (Relobj::layout_deferred_sections): New function.
10906 (Relobj::do_layout_deferred_sections): New function.
10907 (Sized_relobj::do_layout_deferred_sections): New function.
10908 (Sized_relobj::layout_section): New function.
10909 (Sized_relobj::Deferred_layout): New structure.
10910 (Sized_relobj::deferred_layout_): New field.
10911 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
10912 Change all callers. Layout deferred sections.
10913 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
10914 references.
10915 (Plugin_hook::run): Move code from do_plugin_hook inline.
10916 (Plugin_hook::do_plugin_hook): Remove.
10917 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
10918 (Plugin_manager::finish): Renamed, was cleanup.
10919 (Plugin_manager::should_defer_layout): New function.
10920 (Plugin_manager::add_deferred_layout_object): New function.
10921 (Plugin_manager::Deferred_layout_list): New type.
10922 (Plugin_manager::deferred_layout_objects_): New field.
10923 (Plugin_hook::do_plugin_hook): Remove.
10924
ee769c88
ILT
109252008-12-17 Ian Lance Taylor <iant@google.com>
10926
10927 * options.h (class General_options): Add --no case for
10928 --export-dynamic.
10929
abc8dcba
CC
109302008-12-16 Cary Coutant <ccoutant@google.com>
10931
10932 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
10933 vector.
10934 (Plugin_manager::claim_file): Create plugin object even if
10935 plugin did not call the add_symbols callback.
10936 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
10937 asking for more symbols than were added.
10938 * testsuite/Makefile.am (plugin_test_1): Add test case with
10939 no global symbols.
10940 (empty.syms): New target.
10941 * testsuite/Makefile.in: Regenerate.
10942 * testsuite/plugin_test.c (claim_file_hook): Add new debug
10943 message. Don't call add_symbols if no globals.
10944 (all_symbols_read_hook): Don't provide replacement for empty
10945 claimed file.
10946
b0074644
ILT
109472008-12-12 Ian Lance Taylor <iant@google.com>
10948
68943102
ILT
10949 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
10950 r_type == 0 for a local symbol with r_sym == 0.
10951 (scan_relocatable_relocs): Pass r_sym to
10952 local_non_section_strategy.
10953 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
10954 r_sym parameter.
10955
b0074644
ILT
10956 * configure.ac: Update test for TLS descriptors: they are
10957 supported as of glibc 2.9.
10958 * configure: Rebuild.
10959
c2508178
ILT
109602008-12-11 Ian Lance Taylor <iant@google.com>
10961
10962 PR 7091
10963 * target-reloc.h (Default_scan_relocatable_relocs): For each
10964 function, map r_type == 0 to RELOC_DISCARD.
10965
2756a258
CC
109662008-12-10 Cary Coutant <ccoutant@google.com>
10967
10968 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
10969 object to override a kept COMDAT group from a plugin object.
10970
bb6f53d3
ILT
109712008-12-09 Ian Lance Taylor <iant@google.com>
10972
fbc558e1
ILT
10973 PR 7088
10974 * yyscript.y (file_cmd): Handle INPUT.
10975
bb6f53d3
ILT
10976 * testsuite/initpri1.c: Change all declarations to be full
10977 prototypes by adding void, to avoid compiler warnings.
10978
4674ecfc
CC
109792008-12-05 Rafael Avila de Espindola <espindola@google.com>
10980
10981 * options.cc (General_options::parse_plugin_opt): New.
10982 (General_options::add_plugin): The argument now is just the filename.
10983 (General_options::add_plugin_option): New.
10984 * options.h (plugin_opt): New.
10985 (add_plugin): Change argument name.
10986 (add_plugin_option): New.
10987 * plugin.cc (Plugin::load): Don't parse the plugin option.
10988 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
10989 (Plugin::add_option): New.
10990 (Plugin::args_): Change type.
10991 (Plugin::filename_): New.
10992 (Plugin_manager::add_plugin_option): New.
10993 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
10994 * testsuite/Makefile.in: Regenerate.
10995
fd06b4aa
CC
109962008-12-05 Cary Coutant <ccoutant@google.com>
10997
10998 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
10999 Handle --strip-lto-sections option.
11000 * options.h (strip_lto_sections): New option.
11001
6c52134c
CC
110022008-12-01 Cary Coutant <ccoutant@google.com>
11003
11004 * plugin.cc (ld_plugin_message): Change format parameter to const.
11005 Fix mismatch between new[] and delete.
11006
a45248e0
CC
110072008-11-14 Cary Coutant <ccoutant@google.com>
11008
11009 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
11010 instead of -1U.
11011
c82fbeee
CS
110122008-11-05 Craig Silverstein <csilvers@google.com>
11013
11014 * options.cc (General_options::parse_dynamic_list): New function.
11015 * options.h (General_options): New flags dynamic_list,
11016 dynamic_list_data, dynamic_list_cpp_new, and
11017 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
11018 (General_options::in_dynamic_list): New function.
11019 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
11020 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
11021 (Lex::can_continue_name): Likewise.
11022 (yylex): Likewise.
11023 (read_script_file): New parameter script_options.
11024 (read_dynamic_list): New function.
11025 (Script_options::define_dynamic_list): New function.
11026 (dynamic_list_keyword_parsecodes): New variable.
11027 (dynamic_list_keywords): New variable.
11028 * script.h (Script_options::define_dynamic_list): New function
11029 prototype.
11030 (read_dynamic_list): New function prototype.
11031 * symtab.cc (strprefix): New macro.
11032 (Symbol::should_add_dynsym_entry): Support dynamic_list,
11033 dynamic_list_data, dynamic_list_cpp_new, and
11034 dynamic_list_cpp_typeinfo.
11035 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
11036 (dynamic_list_expr): New rule.
11037 (dynamic_list_nodes): Likewise.
11038 (dynamic_list_node): Likewise.
11039 * testsuite/Makefile.am (dynamic_list): New test.
11040 * testsuite/Makefile.in: Regenerated.
11041 * testsuite/dynamic_list.t: New file.
11042 * testsuite/dynamic_list.sh: New file.
11043
e0bb29a5
CS
110442008-11-05 Craig Silverstein <csilvers@google.com>
11045
11046 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
11047 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
11048 (t11_last): Likewise.
11049 * testsuite/ver_test_6.c (main): Likewise.
11050
4e1e25e0
CC
110512008-10-07 Cary Coutant <ccoutant@google.com>
11052
11053 * options.c (General_options::finalize): Add check for -static and
11054 -shared.
11055 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
11056 is not empty.
11057
92f03fcb
CC
110582008-10-02 Cary Coutant <ccoutant@google.com>
11059
11060 * plugin.cc (make_sized_plugin_object): Fix conditional
11061 compilation to work when not all targets are enabled.
11062
fbd8a257
CC
110632008-09-29 Cary Coutant <ccoutant@google.com>
11064
11065 * archive.cc (Archive::get_file_and_offset): Use filename instead
11066 of name to get library path.
11067 (Archive::include_member): Unlock external member of a thin archive.
11068
11069 * testsuite/Makefile.am (TEST_AR): New variable.
11070 (thin_archive_test_1): New test.
11071 (thin_archive_test_2): New test.
81636b3f
CC
11072 * testsuite/Makefile.in: Regenerate.
11073 * testsuite/thin_archive_main.cc: New file.
11074 * testsuite/thin_archive_test_1.cc: New file.
11075 * testsuite/thin_archive_test_2.cc: New file.
11076 * testsuite/thin_archive_test_3.cc: New file.
11077 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 11078
eff45813
CC
110792008-09-29 Cary Coutant <ccoutant@google.com>
11080
11081 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
11082 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
11083 instead of -1U.
11084 (Sized_relobj::do_finalize_local_symbols): Likewise.
11085 (Sized_relobj::map_to_kept_section): Likewise.
11086 * object.h (Sized_relobj::invalid_address): New constant.
11087 (Sized_relobj::do_output_section_offset): Check for invalid_address
11088 and return -1ULL.
11089 * output.cc (Output_reloc::local_section_offset): Use constant
11090 invalid_address instead of -1U.
11091 (Output_reloc::get_address): Likewise.
11092 (Output_section::output_address): Change -1U to -1ULL.
11093 * output.h (Output_reloc::invalid_address): New constant.
11094 * reloc.cc (Sized_relobj::write_sections): Use constant
11095 invalid_address instead of -1U.
11096 (Sized_relobj::relocate_sections): Likewise.
11097 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
11098 values for merge sections.
11099 * target-reloc.h (relocate_for_relocatable): Use constant
11100 invalid_address instead of -1U.
11101
89fc3421
CC
111022008-09-19 Cary Coutant <ccoutant@google.com>
11103
11104 Add plugin functionality for link-time optimization (LTO).
11105 * configure.ac (plugins): Add --enable-plugins option.
11106 * configure: Regenerate.
11107 * config.in: Regenerate.
11108 * Makefile.am (LIBDL): New variable.
11109 (CCFILES): Add plugin.cc.
11110 (HFILES): Add plugin.h.
11111 (ldadd_var): Add LIBDL.
11112 * Makefile.in: Regenerate.
11113
11114 * archive.cc: Include "plugin.h".
11115 (Archive::setup): Don't preread archive symbols when using a plugin.
11116 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
11117 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
11118 files.
11119 (Archive::include_member): Add symbols from plugin objects.
11120 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
11121 * descriptors.cc (Descriptors::open): Check for file descriptors
11122 abandoned by plugins.
11123 (Descriptors::claim_for_plugin): New function.
11124 * descriptors.h (Descriptors::claim_for_plugin): New function.
11125 (Open_descriptor::is_claimed): New field.
11126 (claim_descriptor_for_plugin): New function.
11127 * fileread.cc (File_read::claim_for_plugin): New function.
11128 * fileread.h (File_read::claim_for_plugin): New function.
11129 (File_read::descriptor): New function.
11130 * gold.cc: Include "plugin.h".
11131 (queue_initial_tasks): Add task to call plugin hooks for generating
11132 new object files.
11133 * main.cc: Include "plugin.h".
11134 (main): Load plugin libraries.
11135 * object.h (Pluginobj): Declare.
11136 (Object::pluginobj): New function.
11137 (Object::do_pluginobj): New function.
11138 (Object::set_target): New function.
11139 * options.cc: Include "plugin.h".
11140 (General_options::parse_plugin): New function.
11141 (General_options::General_options): Initialize plugins_ field.
11142 (General_options::add_plugin): New function.
11143 * options.h (Plugin_manager): Declare.
11144 (General_options): Add --plugin option.
11145 (General_options::has_plugins): New function.
11146 (General_options::plugins): New function.
11147 (General_options::add_plugin): New function.
11148 (General_options::plugins_): New field.
11149 * plugin.cc: New file.
11150 * plugin.h: New file.
11151 * readsyms.cc: Include "plugin.h".
11152 (Read_symbols::do_read_symbols): Check for archive before checking
11153 for ELF file. Call plugin hooks to claim files.
11154 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
11155 from a real object file; force override when processing replacement
11156 files.
11157 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
11158 (Symbol::init_base_object): Likewise.
11159 (Symbol::init_base_output_data): Likewise.
11160 (Symbol::init_base_output_segment): Likewise.
11161 (Symbol::init_base_constant): Likewise.
11162 (Symbol::init_base_undefined): Likewise.
11163 (Symbol::output_section): Assert that object is not a plugin.
11164 (Symbol_table::add_from_pluginobj): New function.
11165 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
11166 undefined.
11167 (Symbol_table::sized_write_globals): Likewise.
11168 (Symbol_table::add_from_pluginobj): Instantiate template.
11169 * symtab.h (Sized_pluginobj): Declare.
11170 (Symbol::in_real_elf): New function.
11171 (Symbol::set_in_real_elf): New function.
11172 (Symbol::in_real_elf_): New field.
11173 (Symbol_table::add_from_pluginobj): New function.
11174
11175 * testsuite/Makefile.am (AM_CFLAGS): New variable.
11176 (LIBDL): New variable.
11177 (LDADD): Add LIBDL.
11178 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
11179 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
11180 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
11181 (MOSTLYCLEANFILES): Likewise.
11182 * testsuite/Makefile.in: Regenerate.
11183 * testsuite/plugin_test.c: New file.
11184 * testsuite/plugin_test_1.sh: New file.
11185 * testsuite/plugin_test_2.sh: New file.
11186
de31bda5
ILT
111872008-09-16 Ian Lance Taylor <iant@google.com>
11188
9c2d0ef9
ILT
11189 * target-reloc.h (relocate_section): Check whether a symbol is
11190 defined by the ABI before reporting an undefined symbol error.
11191 * target.h (Target::is_defined_by_abi): Make parameter const.
11192 (Target::do_is_defined_by_abi): Likewise.
11193 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
11194 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
11195 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
11196 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
11197 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
11198 * testsuite/Makefile.in: Rebuild.
11199
de31bda5
ILT
11200 * fileread.cc (make_view): Add casts to avoid warning.
11201
9fa33bee
AO
112022008-09-16 Alexandre Oliva <aoliva@redhat.com>
11203
11204 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
11205 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11206
183fd0e3
AO
112072008-09-16 Alexandre Oliva <aoliva@redhat.com>
11208
11209 * options.h (General_options::output_is_executable): New.
11210 (General_options::output_is_pie): New.
11211 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
11212 for shared libraries.
11213 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11214
7be8330a
CD
112152008-09-11 Chris Demetriou <cgd@google.com>
11216
11217 * options.h (origin): New -z option.
11218 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
11219 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
11220 in DT_FLAGS_1.
11221
a9caad02
CC
112222008-09-05 Cary Coutant <ccoutant@google.com>
11223
11224 * fileread.cc (File_read::make_view): Add check for attempt to map
11225 beyond end of file.
11226
ae6dce4d
CC
112272008-09-05 Cary Coutant <ccoutant@google.com>
11228
11229 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
11230 explicit instantiations.
11231
d7ab2a47
KVH
112322008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
11233
11234 PR gold/6858
11235 * options.cc (General_options::finalize): Allow undefined symbols
11236 in shlibs if linking -shared.
11237
11238 PR gold/6859
11239 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
11240 symbols as not needing a dynsym entry.
11241
1e52a9c1
CS
112422008-08-20 Craig Silverstein <csilvers@google.com>
11243
11244 * fileread.cc (File_read::open): Do not lock the file unless it
11245 was successfully opened.
11246
d85c80a3
CC
112472008-08-14 Cary Coutant <ccoutant@google.com>
11248
11249 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
11250 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
11251 * testsuite/tls_test.cc (struct int128): 128-bit struct
11252 for testing TLS relocs with non-zero addend.
11253 (v12): New TLS variable.
11254 (t12): New test.
11255 (t_last): Add check for v12.
11256 * testsuite/tls_test.h (t12): New function.
11257 * testsuite/tls_test_main.cc (thread_routine): Call new test.
11258
2d924fd9
ILT
112592008-08-13 Ian Lance Taylor <iant@google.com>
11260
11261 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
11262 set tls_segment_ or relro_segment_.
11263 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
11264 when appropriate.
11265 * output.h (Output_section::clear_is_relro): New function.
11266 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
11267 sections specially even when output_data_ is empty.
11268 (Output_segment::maximum_alignment): When first section is relro,
11269 only force alignment for PT_LOAD segments.
11270 * script.cc (script_data_segment_align): New function.
11271 (script_data_segment_relro_end): New function.
11272 * script-c.h (script_data_segment_align): Declare.
11273 (script_data_segment_relro_end): Declare.
11274 * script-sections.h (class Script_sections): Declare
11275 data_segment_align and data_segment_relro_end. Add fields
11276 segment_align_index_ and saw_relro_end_.
11277 * script-sections.cc (class Sections_element): Add set_is_relro
11278 virtual function. Add new bool* parameter to place_orphan_here.
11279 Add get_output_section virtual function.
11280 (class Output_section_definition): Add set_is_relro. Add new
11281 bool* parameter to place_orphan_here. Add get_output_section.
11282 Add is_relro_ field.
11283 (Output_section_definition::Output_section_definition): Initialize
11284 evaluated_address_, evaluated_load_address, evaluated_addralign_,
11285 and is_relro_ fields.
11286 (Output_section_definition::place_orphan_here): Add is_relro
11287 parameter.
11288 (Output_section_definition::set_section_addresses): Set relro for
11289 output section.
11290 (Output_section_definition::alternate_constraint): Likewise.
11291 (class Orphan_output_section): Add new bool* parameter to
11292 place_orphan_here. Add get_output_section.
11293 (Orphan_output_section::place_orphan_here): Add is_relro
11294 parameter.
11295 (Script_sections::Script_sections): Initialize
11296 data_segment_align_index_ and saw_relro_end_.
11297 (Script_sections::data_segment_align): New function.
11298 (Script_sections::data_segment_relro_end): New function.
11299 (Script_sections::place_orphan): Set or clear is_relro.
11300 (Script_sections::set_section_addresses): Force alignment of first
11301 TLS section.
11302 * yyscript.y (exp): Call script_data_segment_align and
11303 script_data_segment_relro_end.
11304 * testsuite/relro_script_test.t: New file.
11305 * testsuite/relro_test.cc (using_script): Declare.
11306 (t1, t2): Test using_script.
11307 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
11308 (relro_script_test_SOURCES): Define.
11309 (relro_script_test_DEPENDENCIES): Define.
11310 (relro_script_test_LDFLAGS): Define.
11311 (relro_script_test_LDADD): Define.
11312 (relro_script_test.so): New target.
11313 * testsuite/Makefile.in: Rebuild.
11314
f827c9a9
CC
113152008-08-06 Cary Coutant <ccoutant@google.com>
11316
11317 * archive.cc (Archive::total_archives, Archive::total_members)
11318 (Archive::total_members_loaded): New variables.
11319 (Archive::setup): Add parameter. Add option to preread
11320 archive symbols.
11321 (Archive::read_armap): Add counter.
11322 (Archive::get_file_and_offset): New function.
11323 (Archive::get_elf_object_for_member): New function.
11324 (Archive::read_all_symbols): New function.
11325 (Archive::read_symbols): New function.
11326 (Archive::add_symbols): Add counters.
11327 (Archive::include_all_members): Use armap to find members if it's
11328 already built.
11329 (Archive::include_member): Skip reading symbols if already read.
11330 Factored code into Archive::get_file_and_offset and
11331 Archive::get_elf_object_for_member. Changed call to
11332 Mapfile::report_include_archive_member.
11333 (Archive::print_stats): New function.
11334 * archive.h: Declare Object and Read_symbols_data classes.
11335 (Archive::Archive): Add initializers for new members.
11336 (Archive::setup): Add parameter.
11337 (Archive::print_stats): New function.
11338 (Archive::total_archives, Archive::total_members)
11339 (Archive::total_members_loaded): New variables.
11340 (Archive::get_file_and_offset): New function.
11341 (Archive::get_elf_object_for_member): New function.
11342 (Archive::read_all_symbols): New function.
11343 (Archive::read_symbols): New function.
11344 (Archive::Archive_member): New class.
11345 (Archive::members_): New member.
11346 (Archive::num_members_): New member.
11347 * main.cc: Include archive.h.
11348 (main): Call Archive::print_stats.
11349 * mapfile.cc (Mapfile::report_include_archive_member): Delete
11350 archive parameter; member_name is now the fully-decorated name.
11351 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
11352 * options.h: (General_options): Add --preread-archive-symbols option.
11353 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
11354 Archive::setup.
11355
de4c45bd
ILT
113562008-08-04 Ian Lance Taylor <iant@google.com>
11357
11358 * symtab.h (Symbol::use_plt_offset): New function.
11359 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
11360 * powerpc.cc (Relocate::relocate): Likewise.
11361 * sparc.cc (Relocate::relocate): Likewise.
11362 * x86_64.cc (Relocate::relocate): Likewise.
11363 * testsuite/weak_plt.sh: New test.
11364 * testsuite/weak_plt_main.cc: New test.
11365 * testsuite/weak_plt_shared.cc: New test.
11366 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
11367 (check_PROGRAMS): Add weak_plt.
11368 (check_DATA): Add weak_plt_shared.so.
11369 (weak_plt_main_pic.o, weak_plt): New targets.
11370 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
11371 * testsuite/Makefile.in: Rebuild.
11372
11373 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
11374 gcctestdir/ld.
11375 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
11376 * testsuite/Makefile.in: Rebuild.
11377
323ee3f4
AM
113782008-08-04 Alan Modra <amodra@bigpond.net.au>
11379
11380 * Makefile.am (POTFILES.in): Set LC_ALL=C.
11381 * Makefile.in: Regenerate.
11382 * po/POTFILES.in: Regenerate.
11383
7c07ecec
ILT
113842008-07-29 Ian Lance Taylor <iant@google.com>
11385
11386 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
11387 symbols before other symbols.
11388 * testsuite/script_test_2.cc (test_addr): Declare.
11389 (test_addr_alias): Declare.
11390 (main): Check that test_addr and test_addr_alias have the right
cd536b21 11391 values.
7c07ecec
ILT
11392 * testsuite/script_test_2.t: Define test_addr_alias and
11393 test_addr.
11394
5778530e
ILT
113952008-07-24 Ian Lance Taylor <iant@google.com>
11396
2a00e4fb
ILT
11397 PR 5990
11398 * descriptors.cc: New file.
11399 * descriptors.h: New file.
11400 * gold-threads.h (class Hold_optional_lock): New class.
11401 * fileread.cc: Include "descriptors.h".
11402 (File_read::~File_read): Release descriptor rather than closing
11403 it.
11404 (File_read::open) [file]: Call open_descriptor rather than open.
11405 Set is_descriptor_opened_.
11406 (File_read::open) [memory]: Assert that descriptor is not open.
11407 (File_read::reopen_descriptor): New function.
11408 (File_read::release): Release descriptor.
11409 (File_read::do_read): Make non-const. Reopen descriptor.
11410 (File_read::read): Make non-const.
11411 (File_read::make_view): Reopen descriptor.
11412 (File_read::do_readv): Likewise.
11413 * fileread.h (class File_read): Add is_descriptor_opened_ field.
11414 Update declarations.
11415 * layout.cc: Include "descriptors.h".
11416 (Layout::create_build_id): Use open_descriptor rather than open.
11417 * output.cc: Include "descriptors.h".
11418 (Output_file::open): Use open_descriptor rather than open.
11419 * archive.cc (Archive::const_iterator): Change Archive to be
11420 non-const.
11421 (Archive::begin, Archive::end): Make non-const.
11422 (Archive::count_members): Likewise.
11423 * archive.h (class Archive): Update declarations.
11424 * object.h (Object::read): Make non-const.
11425 * Makefile.am (CCFILES): Add descriptors.cc.
11426 (HFILES): Add descriptors.h.
11427 * Makefile.in: Rebuild.
11428
801647d1
ILT
11429 PR 6716
11430 * gold.h: Always include <clocale>. Add Solaris workarounds
11431 following code in binutils/sysdep.h.
11432
5edd166e
ILT
11433 PR 6048
11434 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
11435 this->eh_frame_hdr_ is NULL before using it.
11436
c89ad728
ILT
11437 * dynobj.cc (Versions::Versions): Update comment.
11438
aa86f06b
ILT
11439 * dynobj.cc (Versions::Versions): If there is an soname, use it as
11440 the base version name.
11441
5778530e
ILT
11442 * stringpool.cc (Stringpool_template::add_with_length): Set key to
11443 array size plus one.
11444 (Stringpool_template::set_string_offsets): Subtract one from key
11445 before using it as an array index.
11446 (Stringpool_template::get_offset_with_length): Likewise.
11447 (Stringpool_template::write_to_buffer): Likewise.
11448 * stringpool.h (Stringpool_template::get_offset_from_key):
11449 Likewise.
11450
057ead22
ILT
114512008-07-23 Ian Lance Taylor <iant@google.com>
11452
7f649c59
ILT
11453 PR 6658
11454 * object.h (Merged_symbol_value::value): Do our best to handle a
11455 negative addend.
11456
057ead22
ILT
11457 PR 6647
11458 * script.cc (Version_script_info::get_versions): Don't add empty
11459 version tag to return value.
11460 (Version_script_info::get_symbol_version_helper): Change return
11461 type to bool. Add pversion parameter. Change all callers.
11462 (script_register_vers_node): Don't require a non-NULL tag.
11463 * script.h (class Version_script_info): Update declarations.
11464 (Version_script_info::get_symbol_version): Change return type to
11465 bool. Add version parameter. Change all callers.
11466 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
11467 handling. Handle an empty version from a version script.
11468 (Symbol_table::define_special_symbol): Likewise.
11469 * testsuite/ver_test_10.script: New file.
11470 * testsuite/ver_test_10.sh: New file.
11471 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
11472 (check_DATA): Add ver_test_10.syms.
11473 (ver_test_10.syms, ver_test_10.so): New target.
11474 * testsuite/Makefile.in: Rebuild.
11475
58e54ac2
CD
114762008-07-23 Simon Baldwin <simonb@google.com>
11477
11478 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
11479 to zero for undefined symbols from dynamic libraries.
11480
95d14cd3
ILT
114812008-07-23 Ian Lance Taylor <iant@google.com>
11482
11483 * symtab.cc (Symbol_table::resolve): Remove version parameter.
11484 Change all callers.
11485 * symtab.h (class Symbol_table): Update declaration.
11486 * testsuite/ver_test_9.cc: New file.
11487 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
11488 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
11489 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
11490 (ver_test_9.so, ver_test_9.o): New targets.
11491 * testsuite/Makefile.in: Rebuild.
11492
92de84a6
ILT
114932008-07-22 Ian Lance Taylor <iant@google.com>
11494
34810851
ILT
11495 * options.h (class General_options): Define --check-sections.
11496 * layout.cc (Layout::set_segment_offsets): Handle
11497 --check-sections.
11498
af6156ef
ILT
11499 * options.h (class General_options): Define -n/--nmagic and
11500 -N/--omagic.
11501 * options.cc (General_options::finalize): For -n/--nmagic or
11502 -N/--omagic, set -static.
11503 * layout.cc (Layout::attach_allocated_section_to_segment): If
11504 -N/--omagic, don't put read-only and read-write sections in
11505 different segments.
11506 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
11507 finding a read-only segment.
11508 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
11509 don't set the minimum segment alignment to the common page size,
11510 and don't set the file offset to the address modulo the page size.
11511 * script-sections.cc (Script_sections::create_segments): If
11512 -n/--omagic, don't put read-only and read-write sections in
11513 different segments.
11514
92de84a6
ILT
11515 * cref.cc: New file.
11516 * cref.h: New file.
11517 * options.h (class General_options): Add --print-symbol-counts.
11518 * main.cc (main): Issue defined symbol report if requested.
11519 * archive.cc (Archive::interpret_header): Make into a const member
11520 function.
11521 (Archive::add_symbols): Call Input_objects::archive_start and
11522 archive_stop.
11523 (Archive::const_iterator): Define new class.
11524 (Archive::begin, Archive::end): New functions.
11525 (Archive::include_all_members): Rewrite to use iterator.
11526 (Archive::count_members): New function.
11527 * archive.h (class Archive): Update declarations.
11528 (Archive::filename): New function.
11529 * object.cc: Include "cref.h".
11530 (Sized_relobj::Sized_relobj): Initialize defined_count_.
11531 (Sized_relobj::do_get_global_symbol_counts): New function.
11532 (Input_objects::add_object): Add object to cross-referencer.
11533 (Input_objects::archive_start): New function.
11534 (Input_objects::archive_stop): New function.
11535 (Input_objects::print_symbol_counts): New function.
11536 * object.h: Declare Cref and Archive.
11537 (Object::get_global_symbol_counts): New function.
11538 (Object::do_get_global_symbol_counts): New pure virtual function.
11539 (class Sized_relobj): Add defined_count_ field. Update
11540 declarations.
11541 (class Input_objects): Add cref_ field. Update constructor.
11542 Update declarations.
11543 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
11544 defined_count_.
11545 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
11546 symbol counts.
11547 (Sized_dynobj::do_get_global_symbol_counts): New function.
11548 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
11549 defined_count_. Update declarations. Define Symbols typedef.
11550 * symtab.cc (Symbol_table::add_from_relobj): Add defined
11551 parameter. Change all callers.
11552 (Symbol_table::add_from_dynobj): Add sympointers and defined
11553 parameters. Change all callers.
11554 * symtab.h (class Symbol_table): Update declarations.
11555 * Makefile.am (CCFILES): Add cref.cc.
11556 (HFILES): Add cref.h.
11557 * Makefile.in: Rebuild.
11558
3f7c5e1d
CD
115592008-07-22 Simon Baldwin <simonb@google.com>
11560
11561 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
11562 to zero when writing undefined symbols.
11563
e0b64032
ILT
115642008-07-22 Ian Lance Taylor <iant@google.com>
11565
11566 * output.cc (Output_section::add_input_section): Don't try to
11567 merge empty merge sections.
11568
096b02cf
CS
115692008-07-21 Craig Silverstein <csilvers@google.com>
11570
11571 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
11572 Include symbol version in error message.
cd536b21 11573
1d1f116d
CD
115742008-07-20 Chris Demetriou <cgd@google.com>
11575
cd536b21 11576 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
11577 (RANDOM_SEED_CFLAGS): New substituted variable.
11578 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
11579 * configure: Rebuild.
11580 * Makefile.in: Likewise.
11581 * testsuite/Makefile.in: Likewise.
11582
a18f591e
ILT
115832008-07-18 Ian Lance Taylor <iant@google.com>
11584
11585 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
11586 where we see NAME/NULL and NAME/VERSION as separate symbols.
11587 * testsuite/ver_test_main.cc (main): Call t4.
11588 (t4, t4_2a): Define.
11589 * testsuite/ver_test_2.cc (t4_2): Define.
11590 * testsuite/ver_test_2.script: Put t4_2a in VER2.
11591 * testsuite/ver_test_4.cc (t4_2a): Define.
11592 * testsuite/ver_test_4.script: Put t4_2a in VER2.
11593 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
11594
c6e3f6ed
ILT
115952008-07-17 Ian Lance Taylor <iant@google.com>
11596
11597 * dynobj.cc (Versions::add_def): If we give an error about a
11598 missing version, go ahead and create the version anyhow.
11599
ef9beddf
ILT
116002008-07-10 Ian Lance Taylor <iant@google.com>
11601
11602 Handle output sections with more than 0x7fffffff bytes.
11603 * object.h (class Relobj): Change map_to_output_ to
11604 output_sections_, and just keep a section pointer. Change all
11605 uses. Move comdat group support to Sized_relobj.
11606 (Relobj::is_section_specially_mapped): Remove.
11607 (Relobj::output_section): Remove poff parameter. Change all
11608 callers.
11609 (Relobj::output_section_offset): New function.
11610 (Relobj::set_section_offset): Rewrite.
11611 (Relobj::map_to_output): Remove.
11612 (Relobj::output_sections): New function.
11613 (Relobj::do_output_section_offset): New pure virtual function.
11614 (Relobj::do_set_section_offset): Likewise.
11615 (class Sized_relobj): Add section_offsets_ field. Add comdat
11616 group support from Relobj. Update declarations.
11617 (Sized_relobj::get_output_section_offset): New function.
11618 (Sized_relobj::do_output_section_offset): New function.
11619 (Sized_relobj::do_set_section_offset): New function.
11620 * object.cc (Relobj::output_section_address): Remove.
11621 (Sized_relobj::Sized_relobj): Initialize new fields.
11622 (Sized_relobj::include_section_group): Cast find_kept_object to
11623 Sized_relobj.
11624 (Sized_relobj::include_linkonce_section): Likewise.
11625 (Sized_relobj::do_layout): Use separate arrays for output section
11626 and output offset.
11627 (Sized_relobj::do_count_local_symbols): Change map_to_output to
11628 output_sections.
11629 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
11630 output_sections and section_offsets.
11631 (Sized_relobj::write_local_symbols): Likewise.
11632 (map_to_kept_section): Compute output address directly.
11633 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
11634 output_sections and section_offsets.
11635 (Sized_relobj::write_sections): Likewise.
11636 (Sized_relobj::relocate_sections): Likewise.
11637 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
11638 * output.h (class Output_reloc): Update declarations. Change
11639 u2_.relobj to Sized_relobj*.
11640 (class Output_data_reloc): Change add functions to use
11641 Sized_relobj*.
11642 * output.cc (Output_reloc::Output_reloc): Change relobj to
11643 Sized_relobj*.
11644 (Output_reloc::local_section_offset): Change return type to
11645 Elf_Addr. Use get_output_section_offset.
11646 (Output_reloc::get_address): Likewise.
11647 (Output_section::is_input_address_mapped): Don't call
11648 is_section_specially_mapped.
11649 (Output_section::output_offset): Likewise.
11650 (Output_section::output_address): Likewise.
11651 (Output_section::starting_output_address): Likewise.
11652 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
11653 parameter to Sized_relobj*.
11654 (Copy_relocs::need_copy_reloc): Likewise.
11655 (Copy_relocs::save): Likewise.
11656 * copy-relocs.h (class Copy_relocs): Update declarations.
11657 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
11658 Sized_relobj*. Change relobj_ field to Sized_relobj*.
11659 * target-reloc.h (relocate_for_relocatable): Change
11660 offset_in_output_section type to Elf_Addr. Change code that uses
11661 it as well.
11662 * layout.cc (Layout::layout): Always set *off.
11663 * mapfile.cc (Mapfile::print_input_section): Use
11664 output_section_offset.
11665 * i386.cc (Target_i386::copy_reloc): Change object parameter to
11666 Sized_relobj*.
11667 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
11668 * sparc.cc (Target_sparc::copy_reloc): Likewise.
11669 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
11670
5cb66f97
ILT
116712008-07-03 Ian Lance Taylor <iant@google.com>
11672
11673 * layout.cc (Layout::include_section): Do not discard unrecognized
11674 SHT_STRTAB sections.
11675
afe47622
CS
116762008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
11677
11678 * script.cc (Lex::can_continue_name): Make '?' allowable in
11679 version-script names.
11680 * testsuite/version_script.map: Change glob pattern to use '?'
11681
5adf9721
ILT
116822008-06-30 Manish Singh <yosh@gimp.org>
11683
11684 PR 6585
11685 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
11686 Correct typo.
11687
e6fde208
ILT
116882008-06-30 Ian Lance Taylor <iant@google.com>
11689
11690 PR 6660
11691 PR 6682
11692 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
11693 versions]: Don't try to read the value in the contents, since we
11694 don't use it. Use the template endianness when writing.
11695
3f2e6a2d
CC
116962008-06-25 Cary Coutant <ccoutant@google.com>
11697
11698 * fileread.cc (File_read::make_view): Assert on zero-length view.
11699 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
11700 symbol table when there are no symbols to read.
11701
c43d3a48
CS
117022008-06-23 Craig Silverstein <csilvers@google.com>
11703
11704 * version.cc (version_string): Bump to 1.7
11705
5f494ea0
CS
117062008-06-18 Craig Silverstein <csilvers@google.com>
11707
11708 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
11709 constant 0xFFFF to type Valtype.
11710 (Powerpc_relocate_functions::rel16_ha): Likewise.
11711
c42e122e
ILT
117122008-06-17 Ian Lance Taylor <iant@google.com>
11713
f34787f8
ILT
11714 * output.h (Output_section::Input_section): Initialize p2align_ to
11715 zero for Output_section_data constructors.
11716 (Output_section::Input_section::addralign): If not an input
11717 section, return the alignment of the Output_section_data.
11718 * testsuite/copy_test.cc: New file.
11719 * testsuite/copy_test_1.cc: New file.
11720 * testsuite/copy_test_2.cc: New file.
11721 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
11722 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
11723 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
11724 (copy_test_1_pic.o, copy_test_1.so): New targets.
11725 (copy_test_2_pic.o, copy_test_2.so): New targets.
11726 * testsuite/Makefile.in: Rebuild.
11727
c42e122e
ILT
11728 * script-sections.cc (Script_sections::place_orphan): Initialize
11729 local variable exact.
11730
ce3ac18a
DE
117312008-06-13 David Edelsohn <edelsohn@gnu.org>
11732
11733 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
11734
42cacb20
DE
117352008-06-12 David Edelsohn <edelsohn@gnu.org>
11736 David S. Miller <davem@davemloft.net>
11737
11738 * powerpc.cc: New file.
11739 * Makefile.am (TARGETSOURCES): Add powerpc.cc
11740 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
11741 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
11742 * Makefile.in: Rebuild.
11743
7b308235
ILT
117442008-06-09 Ian Lance Taylor <iant@google.com>
11745
11746 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
11747 <exception>.
11748 (throwing, orig_terminate): New static variables.
11749 (terminate_handler): New static function.
11750 (t2): Set terminate handler.
11751
f0b886e3
ILT
117522008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
11753
11754 PR 6584
cd536b21 11755 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
11756 alignment.
11757
3e90f135
CC
117582008-05-30 Cary Coutant <ccoutant@google.com>
11759
11760 * archive.cc (Archive::include_all_members) Correct to step
11761 over symbol table and extended name table in thin archives.
11762
e09ad04a
ILT
117632008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
11764
11765 PR 6407
11766 * target-reloc.h (relocate_for_relocatable): Fix new_offset
11767 calculation.
11768
62b01cb5
ILT
117692008-05-28 Caleb Howe <cshowe@google.com>
11770
11771 * reduced_debug_output.cc: New file.
11772 * reduced_debug_output.h: New file.
92de84a6 11773 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
11774 * options.cc (General_options::finalize): Add strip_debug_non_line
11775 to the strip heirarchy.
11776 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
11777 fields.
11778 * layout.cc: Include "reduced_debug_output.h".
11779 (Layout::Layout): Initialize new fields.
11780 (line_only_debug_sections): New static array.
11781 (is_lines_only_debug_sections): New static inline function.
11782 (Layout::include_section): Handle --strip-debug-non-line.
11783 (Layout::make_output_section): If --strip-debug-non-line, build
11784 new output sections for .debug_abbrev and .debug_info.
11785 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
11786 gold. Warn about possible overflow.
11787 (read_signed_LEB_128): Likewise.
11788 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
11789 (read_signed_LEB_128): Declare.
11790 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
11791 (HFILES): Add reduced_debug_output.h.
11792 * Makefile.in: Rebuild.
11793
7d9e3d98
ILT
117942008-05-21 Ian Lance Taylor <iant@google.com>
11795
11796 * mapfile.cc: New file.
11797 * mapfile.h: New file.
11798 * options.h (class General_options): Add -M/--print-map and -Map.
11799 * options.cc (General_options::finalize): Make -M equivalent to
11800 -Map -.
11801 * main.cc: Include <cstdio> and "mapfile.h".
11802 (main): Open mapfile if requested.
11803 * gold.cc (class Middle_runner): Add mapfile_ field. Update
11804 constructor. Change caller.
11805 (queue_initial_tasks): Add mapfile parameter. Change caller.
11806 (queue_middle_tasks): Likewise.
11807 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
11808 declarations.
11809 * archive.cc: Include "mapfile.h".
11810 (Archive::add_symbols): Add mapfile parameter. Change all
11811 callers. Pass mapfile, symbol, and reason to include_member.
11812 (Archive::include_all_members): Add mapfile parameter. Change all
11813 callers.
11814 (Archive::include_member): Add mapfile, sym, and why parameters.
11815 Change all callers. Report inclusion to map file.
11816 * archive.h: Include "fileread.h".
11817 (class Archive): Update declarations.
11818 (Archive::file): New const method.
11819 (class Add_archive_symbols): Add mapfile_ field. Update
11820 constructor. Change all callers.
11821 * readsyms.h (class Read_symbols): Likewise.
11822 (class Finish_group): Likewise.
11823 (class Read_script): Likewise.
11824 * common.cc: Include "mapfile.h".
11825 (Symbol_table::allocate_commons): Add mapfile parameter. Change
11826 all callers.
11827 (Symbol_table::do_allocate_commons): Likewise.
11828 (Symbol_table::do_allocate_commons_list): Likewise. Report common
11829 symbol allocation to mapfile.
11830 * common.h (class Allocate_commons_task): Add mapfile_ field.
11831 Update constructor. Change all callers.
11832 * symtab.h (class Symbol_table): Update declarations.
11833 * layout.cc: Include "mapfile.h".
11834 (Layout_task_runner::run): Print information to mapfile.
11835 (Layout::create_gold_note): Change Output_data_fixed_space to
11836 Output_data_zero_fill.
11837 (Layout::create_build_id): Likewise.
11838 (Layout::print_to_mapfile): New function.
11839 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
11840 constructor. Change caller.
11841 (class Layout): Declare print_to_mapfile.
11842 * output.cc (Output_section::Input_section::print_to_mapfile): New
11843 function.
11844 (Output_section::add_input_section): If producing a map, always
11845 add to input_sections_ list.
11846 (Output_section::do_print_to_mapfile): New function.
11847 (Output_segment::print_sections_to_mapfile): New function.
11848 (Output_segment::print_section_list_to_mapfile): New function.
11849 * output.h: Include "mapfile.h".
11850 (Output_data::print_to_mapfile): New function.
11851 (Output_data::do_print_to_mapfile): New virtual function.
11852 (Output_segment_headers::do_print_to_mapfile): New function.
11853 (Output_file_header::do_print_to_mapfile): New function.
11854 (Output_data_const::do_print_to_mapfile): New function.
11855 (class Output_data_const_buffer): Add map_name_ field. Update
11856 constructor. Change all callers. Add do_print_to_mapfile
11857 function.
11858 (class Output_data_fixed_space): Likewise.
11859 (class Output_data_space): Likewise.
11860 (class Output_data_zero_fill): New class.
11861 (Output_data_strtab::do_print_to_mapfile): New function.
11862 (Output_data_reloc_base::do_print_to_mapfile): New function.
11863 (Output_relocatable_relocs::do_print_to_mapfile): New function.
11864 (Output_data_group::do_print_to_mapfile): New function.
11865 (Output_data_got::do_print_to_mapfile): New function.
11866 (Output_data_dynamic::do_print_to_mapfile): New function.
11867 (Output_symtab_xindex::do_print_to_mapfile): New function.
11868 (class Output_section): Declare do_print_to_mapflie. Declare
11869 print_to_mapfile in Input_section.
11870 (class Output_segment): Declare new functions.
11871 * object.h (Sized_relobj::symbol_count): New function.
11872 * script-sections.cc
11873 (Output_section_element_dot_assignment::set_section_addresses):
11874 Change Output_data_fixed_space to Output_data_zero_fill.
11875 (Output_data_expression::do_print_to_mapfile): New function.
11876 * script.cc (read_input_script): Add mapfile parameter. Change
11877 all callers.
11878 * script.h (read_input_script): Update declaration.
11879 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
11880 (Eh_frame::do_print_to_mapfile): New function.
11881 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
11882 (Output_merge_string::do_print_to_mapfile): New function.
11883 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
11884 function.
11885 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
11886 function.
11887 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
11888 function.
11889 * Makefile.am (CCFILES): Add mapfile.cc.
11890 (HFILES): Add mapfile.h.
11891 * Makefile.in: Rebuild.
11892
9f1d377b
ILT
118932008-05-19 Ian Lance Taylor <iant@google.com>
11894
11895 * options.h (class General_options): Add -z relro.
11896 * layout.cc (Layout::Layout): Initialize relro_segment_.
11897 (Layout::add_output_section_data): Return the output section.
11898 (Layout::make_output_section): Rcognize relro sections and mark
11899 them appropriately.
11900 (Layout::attach_allocated_section_to_segment): Put relro sections
11901 in a PT_GNU_RELRO segment.
11902 (Layout::create_initial_dynamic_sections): Mark the .dynamic
11903 section as relro.
11904 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
11905 PT_TLS segments.
11906 (Layout::linkonce_mapping): Map d.rel.ro.local to
11907 .data.rel.ro.local.
11908 (Layout::output_section_name): Us .data.rel.ro.local for any
11909 section which begins with that.
11910 * layout.h (class Layout): Update add_output_section_data
11911 declaration. Add relro_segment_ field.
11912 * output.cc (Output_section::Output_section): Initialize is_relro_
11913 and is_relro_local_ fields.
11914 (Output_segment::add_output_section): Group relro sections.
11915 (Output_segment::is_first_section_relro): New function.
11916 (Output_segment::maximum_alignment): If there is a relro section,
11917 align the segment to the common page size.
11918 (Output_segment::set_section_addresses): Track whether we are
11919 looking at relro sections. If the last section is a relro
11920 section, align to the common page size.
11921 (Output_segment::set_section_list_addresses): Add in_relro
11922 parameter. Change all callers. Align to the page size when
11923 moving from relro to non-relro section.
11924 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
11925 segment.
11926 * output.h (class Output_section): Add is_relro_ and
11927 is_relro_local_ fields.
11928 (Output_section::is_relro): New function.
11929 (Output_section::set_is_relro): New function.
11930 (Output_section::is_relro_local): New function.
11931 (Output_section::set_is_relro_local): New function.
11932 (class Output_segment): Update declarations.
11933 * i386.cc (Target_i386::got_section): Mark .got section as relro.
11934 * sparc.cc (Target_sparc::got_section): Likewise.
11935 * x86_64.cc (Target_x86_64::got_section): Likewise.
11936 * testsuite/relro_test_main.cc: New file.
11937 * testsuite/relro_test.cc: New file.
11938 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
11939 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
11940 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
11941 (relro_test.so, relro_test_pic.o): New targets.
11942 * testsuite/Makefile.in: Rebuild.
11943
a984ee1d
ILT
119442008-05-16 Ian Lance Taylor <iant@google.com>
11945
01676dcd
ILT
11946 * output.cc (Output_segment::add_output_section): Remove front
11947 parameter.
11948 * output.h (class Output_segment): Remove
11949 add_initial_output_section and overloaded add_output_section.
11950 Update declaration of remaining add_output_section.
11951 * layout.cc (Layout::create_interp): Call add_output_section
11952 rather than add_initial_output_section.
11953 (Layout::finish_dynamic_section): Likewise.
11954
497897f9
ILT
11955 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
11956 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
11957 know the dynamic type.
11958 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
11959 field. Initialize it in constructor.
11960 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
11961 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
11962 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
11963 reloc.
11964
a984ee1d
ILT
11965 * output.cc (Output_reloc::get_address): Change return type to
11966 Elf_Addr.
11967 * output.h (class Output_reloc): Update get_address declaration.
11968 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
11969 for section addresses.
11970
55ba0940
ILT
119712008-05-09 Ian Lance Taylor <iant@google.com>
11972
11973 PR 6493
11974 * gold.cc (gold_nomem): Use return value of write.
11975
75517b77
ILT
119762008-05-08 Ian Lance Taylor <iant@google.com>
11977
11978 * symtab.c (Symbol::init_base_output_data): Add version
11979 parameter. Change all callers.
11980 (Symbol::init_base_output_segment): Likewise.
11981 (Symbol::init_base_constant): Likewise.
11982 (Symbol::init_base_undefined): Likewise.
11983 (Sized_symbol::init_output_data): Likewise.
11984 (Sized_symbol::init_output_segment): Likewise.
11985 (Sized_symbol::init_constant): Likewise.
11986 (Sized_symbol::init_undefined): Likewise.
11987 (Symbol_table::do_define_in_output_data): If the new symbol has a
11988 version, mark it as the default.
11989 (Symbol_table::do_define_in_output_segment): Likewise.
11990 (Symbol_table::do_define_as_constant): Likewise.
11991 * symtab.h (class Symbol): Update declarations.
11992 (class Sized_symbol): Likewise.
11993 * resolve.cc (Symbol::override_version): New function.
c42e122e 11994 (Symbol::override_base): Call override_version.
75517b77
ILT
11995 (Symbol::override_base_with_special): Likewise.
11996 * testsuite/ver_script_8.script: New file.
11997 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
11998 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
11999 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
12000 (ver_test_8_1.so, ver_test_8_2.so): New targets.
12001
f1f70eae
ILT
120022008-05-06 Ian Lance Taylor <iant@google.com>
12003
f3e9c5c5
ILT
12004 PR 6049
12005 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
12006 functions.
12007 (class General_options): Remove existing --undefined, and add
12008 --no-undefined instead. Add new --undefined as synonym for -u.
12009 * archive.cc (Archive::add_symbols): Check whether symbol was
12010 named with -u.
12011 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
12012 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
12013 all uses. Add IS_UNDEFINED. Update declarations to split
12014 different versions of init_base. Declare init_base_undefined.
12015 (Symbol::is_defined): Handle IS_UNDEFINED.
12016 (Symbol::is_undefined): Likewise.
12017 (Symbol::is_weak_undefined): Call is_undefined.
12018 (Symbol::is_absolute): Handle IS_CONSTANT.
12019 (class Sized_symbol): Update declarations to split different
12020 versions of init. Declare init_undefined.
12021 (class Symbol_table): Declare new functions.
12022 * symtab.cc (Symbol::init_base_object): Rename from init_base.
12023 Change all callers.
12024 (Symbol::init_base_output_data): Likewise.
12025 (Symbol::init_base_output_segment): Likewise.
12026 (Symbol::init_base_constant): Likewise.
12027 (Symbol::init_base_undefined): New function.
12028 (Sized_symbol::init_object): Rename from init. Change all
12029 callers.
12030 (Sized_symbol::init_output_data): Likewise.
12031 (Sized_symbol::init_output_segment): Likewise.
12032 (Sized_symbol::init_constant): Likewise.
12033 (Sized_symbol::init_undefined): New function.
12034 (Symbol_table::add_undefined_symbols_from_command_line): New
12035 function.
12036 (Symbol_table::do_add_undefined_symbols_from_command_line): New
12037 function.
12038 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
12039 (Symbol::output_section): Likewise.
12040 (Symbol::set_output_section): Likewise.
12041 (Symbol_table::sized_finalize_symbol): Likewise.
12042 (Symbol_table::sized_write_globals): Likewise.
12043 * resolve.cc (Symbol_table::should_override): Likewise.
12044 (Symbol::override_base_with_special): Likewise.
12045
8bdcdf2c
ILT
12046 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
12047 symbol, change it to have default visibility.
12048 * testsuite/protected_1.cc: New file.
12049 * testsuite/protected_2.cc: New file.
12050 * testsuite/protected_3.cc: New file.
12051 * testsuite/protected_main_1.cc: New file.
12052 * testsuite/protected_main_2.cc: New file.
12053 * testsuite/protected_main_3.cc: New file.
12054 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
12055 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
12056 (protected_1_LDFLAGS, protected_1_LDADD): Define.
12057 (protected_1.so): New target.
12058 (protected_1_pic.o, protected_2_pic.o): New targets.
12059 (protected_3_pic.o): New target.
12060 (check_PROGRAMS): Add protected_2.
12061 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
12062 (protected_2_LDFLAGS, protected_2_LDADD): Define.
12063 * testsuite/Makefile.in: Rebuild.
12064
2b706932
ILT
12065 * options.h (DEFINE_var): Add set_user_set_##varname__.
12066 (DEFINE_bool_alias): New macro.
12067 (class General_options): Define -Bstatic using DEFINE_bool_alias
12068 rather than DEFINE_special. Add --undefined as an alias for -z
12069 defs.
12070 * options.cc (General_options::parse_Bstatic): Remove.
12071
d82a5bcc
ILT
12072 * options.h (class General_options): Add --fatal-warnings.
12073 * main.cc (main): Implement --fatal-warnings.
12074 * errors.h (Errors::warning_count): New function.
12075
f1f70eae
ILT
12076 * options.h (class General_options): Add -Bsymbolic-functions.
12077 * symtab.h (Symbol::is_preemptible): Check for
12078 -Bsymbolic-functions.
12079
8825ac63
ILT
120802008-05-05 Ian Lance Taylor <iant@google.com>
12081
d98bc257
ILT
12082 * options.h (DEFINE_bool): For DASH_Z, create the negative option
12083 as noVARNAME rather than no-VARNAME.
12084 (class General_options): Add option -z combreloc.
12085 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
12086 get_address.
12087 (Output_reloc::sort_before) [SHT_REL]: New function.
12088 (Output_reloc::sort_before) [SHT_RELA]: New function.
12089 (class Output_data_reloc_base): Add sort_relocs_ field. Define
12090 Sort_relocs_comparison.
12091 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
12092 parameter. Change all callers.
12093 (Output_data_reloc::Output_data_reloc) [both versions]: Add
12094 sort_relocs parameter. Change all callers.
12095 * output.cc (Output_reloc::get_address): New function, broken out
12096 of write_rel.
12097 (Output_reloc::write_rel): Call it.
12098 (Output_reloc::compare): New function.
12099 (Output_data_reloc_base::do_write): Optionally sort relocs.
12100
60b2b4e7
ILT
12101 * configure.ac: If targ_extra_obj is set, link it in.
12102 * configure.tgt: Initialize all variables.
12103 (x86_64*): Set targ_extra_obj and targ_extra_size.
12104 * configure: Rebuild.
12105
8825ac63
ILT
12106 * object.cc (Sized_relobj::include_section_group): Adjust section
12107 indexes read from group data. Build vector to pass to
12108 layout_group.
12109 * layout.cc (Layout::layout_group): Add flags and shndxes
12110 parameters. Remove contents parameter. Change caller. Update
12111 explicit instantiations.
12112 * layout.h (class Layout): Update layout_group declaration.
12113 * output.cc (Output_data_group::Output_data_group): Add flags and
12114 input_shndxes parameters. Remove contents parameter. Change
12115 caller.
12116 (Output_data_group::do_write): Change input_sections_ to
12117 input_shndxes_.
12118 * output.h (class Output_data_group): Update constructor
12119 declaration. Rename input_sections_ to input_shndxes_.
12120 * testsuite/many_sections_test.cc: Add template.
12121
e94cf127
CC
121222008-04-30 Cary Coutant <ccoutant@google.com>
12123
4418b2d5
CC
12124 * target-reloc.h (relocate_section): Fix dead-pointer bug.
12125
e94cf127
CC
12126 * layout.cc (Layout::include_section): Refactored check for debug
12127 info section.
12128 (Layout::add_comdat): Add new parameters. Change type
12129 of signature parameter. Add object and shndx to signatures table.
12130 (Layout::find_kept_object): New function.
12131 * layout.h: Include <cstring>.
12132 (Layout::is_debug_info_section): New function.
12133 (Layout::add_comdat): Add new parameters.
12134 (Layout::find_kept_object): New function.
12135 (Layout::Kept_section): New struct.
12136 (Layout::Signatures): Change type of map range.
12137 * object.cc (Relobj::output_section_address): New function.
12138 (Sized_relobj::include_section_group): Add new parameters. Change
12139 calls to Layout::add_comdat. Change to build table of kept comdat
12140 groups and table mapping discarded sections to kept sections.
12141 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
12142 (Sized_relobj::do_layout): Change calls to include_section_group and
12143 include_linkonce_section.
12144 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
12145 value to zero when section is discarded.
12146 (Sized_relobj::map_to_kept_section): New function.
12147 * object.h (Relobj::output_section_address): New function.
12148 (Relobj::Comdat_group): New type.
12149 (Relobj::find_comdat_group): New function.
12150 (Relobj::Comdat_group_table): New type.
12151 (Relobj::Kept_comdat_section): New type.
12152 (Relobj::Kept_comdat_section_table): New type.
12153 (Relobj::add_comdat_group): New function.
12154 (Relobj::set_kept_comdat_section): New function.
12155 (Relobj::get_kept_comdat_section): New function.
12156 (Relobj::comdat_groups_): New field.
12157 (Relobj::kept_comdat_sections_): New field.
12158 (Symbol_value::input_value): Update comment.
12159 (Sized_relobj::map_to_kept_section) New function.
12160 (Sized_relobj::include_linkonce_section): Add new parameter.
12161 * target-reloc.h (Comdat_behavior): New type.
12162 (get_comdat_behavior): New function.
12163 (relocate_section): Add code to map a discarded section to the
12164 corresponding kept section when applying a relocation.
12165
e4e5049b
CS
121662008-04-30 Craig Silverstein <csilvers@google.com>
12167
12168 * dwarf_reader.cc (next_generation_count): New static var.
12169 (Addr2line_cache_entry): New struct.
12170 (addr2line_cache): New static var.
12171 (Dwarf_line_info::one_addr2line): Added caching.
12172 (Dwarf_line_info::clear_addr2line_cache): New function.
12173 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
12174 cache-size parameter.
12175 (Dwarf_line_info::one_addr2line_cache): New function.
12176 * symtab.cc (Symbol_table::detect_odr_violations): Pass
12177 new cache-size argument to one_addr2line(), and clear cache.
12178
d09e9154
CC
121792008-04-28 Cary Coutant <ccoutant@google.com>
12180
12181 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
12182 R_386_PC8 relocations.
12183
7ef73768
ILT
121842008-04-23 Ian Lance Taylor <iant@google.com>
12185
55438702
ILT
12186 * object.cc (Sized_relobj::include_section_group): Check for
12187 invalid section group.
12188
c165fb93
ILT
12189 * object.cc (make_elf_object): Correct test for 64-bit ELF file
12190 header size.
12191
7ef73768
ILT
12192 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
12193 than read for file header.
12194 * archive.cc (Archive::include_member): Likewise.
12195
6194aaab
L
121962008-04-23 Paolo Bonzini <bonzini@gnu.org>
12197
12198 * aclocal.m4: Regenerate.
12199 * configure: Regenerate.
12200
d491d34e
ILT
122012008-04-19 Ian Lance Taylor <iant@google.com>
12202
5ea2bac6
ILT
12203 * version.cc (version_string): Bump to 1.6.
12204
7bc3e21a
ILT
12205 * testsuite/Makefile.am (many_sections_r_test): New target.
12206 (many_sections_r_test_SOURCES): Remove.
12207 (many_sections_r_test_DEPENDENCIES): Remove.
12208 (many_sections_r_test_LDFLAGS): Remove.
12209 (many_sections_r_test_LDADD): Remove.
12210
7fcd3aa9
ILT
12211 * object.cc (Sized_relobj::do_add_symbols): Always pass
12212 local_symbol_count_ to add_from_relobj.
12213
4c94d6ae
ILT
12214 * testsuite/Makefile.am (many_sections_check.h): Only check one in
12215 every thousand variables.
12216 * testsuite/Makefile.in: Rebuild.
12217
d491d34e
ILT
12218 * object.cc (Xindex::initialize_symtab_xindex): New function.
12219 (Xindex::read_symtab_xindex): New function.
12220 (Xindex::sym_xindex_to_shndx): New function.
12221 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
12222 available.
12223 (Sized_relobj::do_initialize_xindex): New function.
12224 (Sized_relobj::do_read_symbols): Adjust section links.
12225 (Sized_relobj::symbol_section_and_value): Add is_ordinary
12226 parameter. Change all callers.
12227 (Sized_relobj::include_section_group): Adjust section links and
12228 symbol section indexes.
12229 (Sized_relobj::do_layout): Adjust section links.
12230 (Sized_relobj::do_count_local_symbols): Adjust section links and
12231 symbol section indexes.
12232 (Sized_relobj::do_finalize_local_symbols): Distinguish between
12233 ordinary and special symbols.
12234 (Sized_relobj::write_local_symbols): Add symtab_xindex and
12235 dynsym_xindex parameters. Change all callers. Adjust section
12236 links. Use SHN_XINDEX when needed.
12237 (Sized_relobj::get_symbol_location_info): Adjust section links.
12238 Don't get fooled by special symbols.
12239 * object.h (class Xindex): Define.
12240 (class Object): Add xindex_ parameter. Declare virtual functoin
12241 do_initialize_xindex.
12242 (Object::adjust_sym_shndx): New function.
12243 (Object::set_xindex): New protected function.
12244 (class Symbol_value): Add is_ordinary_shndx_ field.
12245 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
12246 (Symbol_value::value): Assert ordinary section.
12247 (Symbol_value::initialize_input_to_output_map): Likewise.
12248 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
12249 Change all callers.
12250 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
12251 all callers.
12252 (class Sized_relobj): Update declarations.
12253 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
12254 parameter. Change all callers.
12255 (Sized_relobj::adjust_shndx): New function.
12256 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
12257 field.
12258 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
12259 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
12260 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
12261 (Sized_dynobj::read_dynsym_section): Adjust section links.
12262 (Sized_dynobj::read_dynamic): Likewise.
12263 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
12264 section links.
12265 (Sized_dynobj::do_initialize_xindex): New function.
12266 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
12267 do_initialize_xindex.
12268 (Sized_dynobj::adjust_shndx): New function.
12269 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
12270 dynsym_xindex_ fields.
12271 (Layout::finalize): Add a call to set_section_indexes before
12272 creating the symtab sections.
12273 (Layout::set_section_indexes): Don't do anything if the section
12274 already has a section index.
12275 (Layout::create_symtab_sections): Add shnum parameter. Change
12276 caller. Create .symtab_shndx section if needed.
12277 (Layout::create_shdrs): Add shstrtab_section parameter. Change
12278 caller.
12279 (Layout::allocated_output_section_count): New function.
12280 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
12281 needed.
12282 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
12283 fields. Update declarations.
12284 (Layout::symtab_xindex): New function.
12285 (Layout::dynsym_xindex): New function.
12286 (class Write_symbols_task): Add layout_ field.
12287 (Write_symbols_task::Write_symbols_task): Add layout parameter.
12288 Change caller.
12289 * output.cc (Output_section_headers::Output_section_headers): Add
12290 shstrtab_section parameter. Change all callers.
12291 (Output_section_headers::do_sized_write): Store overflow values
12292 for section count and section string table section index in
12293 section header zero.
12294 (Output_file_header::do_sized_write): Check for overflow of
12295 section count and section string table section index.
12296 (Output_symtab_xindex::do_write): New function.
12297 (Output_symtab_xindex::endian_do_write): New function.
12298 * output.h (class Output_section_headers): Add shstrtab_section_.
12299 Update declarations.
12300 (class Output_symtab_xindex): Define.
12301 (Output_section::has_out_shndx): New function.
12302 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
12303 field.
12304 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
12305 Change all callers.
12306 (Sized_symbol::init): Likewise.
12307 (Symbol::output_section): Check for ordinary symbol.
12308 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
12309 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
12310 callers.
12311 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
12312 Change all callers. Simplify handling of symbols from sections
12313 not included in the link.
12314 (Symbol_table::add_from_dynobj): Handle ordinary symbol
12315 distinction.
12316 (Weak_alias_sorter::operator()): Assert that symbols are
12317 ordinary.
12318 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
12319 distinction.
12320 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
12321 parameters. Change all callers.
12322 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
12323 symbol distinction. Use SHN_XINDEX when needed.
12324 (Symbol_table::write_section_symbol): Add symtab_xindex
12325 parameter. Change all callers.
12326 (Symbol_table::sized_write_section_symbol): Likewise. Use
12327 SHN_XINDEX when needed.
12328 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
12329 declarations.
12330 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
12331 (Symbol::is_defined): Check is_ordinary.
12332 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
12333 (Symbol::is_absolute, Symbol::is_common): Likewise.
12334 (class Sized_symbol): Update declarations.
12335 (class Symbol_table): Update declarations.
12336 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
12337 parameters. Change all callers.
12338 (Sized_symbol::override): Likewise.
12339 (Symbol_table::override): Likewise.
12340 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
12341 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
12342 is_ordinary, and orig_st_shndx parameters. Change all callers.
12343 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
12344 to be in an ordinary section.
12345 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
12346 object and is_ordinary parameters. Change all callers.
12347 (Sized_dwarf_line_info::read_relocs): Add object parameter.
12348 Change all callers. Don't add undefined or non-ordinary symbols
12349 to reloc_map_.
12350 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
12351 Change all callers.
12352 * dwarf_reader.h (class Sized_dwarf_line_info): Update
12353 declarations.
12354 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
12355 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
12356 (Sized_relobj::relocate_sections): Likewise.
12357 * target-reloc.h (scan_relocs): Adjust section symbol index.
12358 (scan_relocatable_relocs): Likewise.
12359 * i386.cc (Scan::local): Check for ordinary symbols.
12360 * sparc.cc (Scan::local): Likewise.
12361 * x86_64.cc (Scan::local): Likewise.
12362 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
12363 to symbol_section_and_value.
12364 * testsuite/many_sections_test.cc: New file.
12365 * testsuite/Makefile.am (BUILT_SOURCES): Define.
12366 (check_PROGRAMS): Add many_sections_test.
12367 (many_sections_test_SOURCES): Define.
12368 (many_sections_test_DEPENDENCIES): Define.
12369 (many_sections_test_LDFLAGS): Define.
12370 (BUILT_SOURCES): Add many_sections_define.h.
12371 (many_sections_define.h): New target.
12372 (BUILT_SOURCES): Add many_sections_check.h.
12373 (many_sections_check.h): New target.
12374 (check_PROGRAMS): Add many_sections_r_test.
12375 (many_sections_r_test_SOURCES): Define.
12376 (many_sections_r_test_DEPENDENCIES): Define.
12377 (many_sections_r_test_LDFLAGS): Define.
12378 (many_sections_r_test_LDADD): Define.
12379 (many_sections_r_test.o): New target.
12380 * testsuite/Makefile.in: Rebuild.
12381
c5818ff1
CC
123822008-04-17 Cary Coutant <ccoutant@google.com>
12383
12384 * errors.cc (Errors::info): New function.
12385 (gold_info): New function.
12386 * errors.h (Errors::info): New function.
12387 * gold.h (gold_info): New function.
12388 * object.cc (Input_objects::add_object): Print trace output.
12389 * options.cc (options::parse_set): New function.
12390 (General_options::parse_wrap): Deleted.
12391 (General_options::General_options): Deleted initializer.
12392 * options.h (options::String_set): New typedef.
12393 (options::parse_set): New function.
12394 (DEFINE_set): New macro.
12395 (General_options::wrap): Changed to use DEFINE_set. Changed
12396 callers of any_wrap_symbols and is_wrap_symbol.
12397 (General_options::trace, General_options::trace_symbol):
12398 New options.
12399 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
12400 (General_options::wrap_symbols_): Deleted.
12401 * symtab.cc (Symbol_table::add_from_object): Print trace output.
12402
b5be4a7c
DM
124032008-04-17 David S. Miller <davem@davemloft.net>
12404
12405 * options.cc (General_options::parse_V): New function.
12406 * options.h: Add entries for -V and -Qy.
12407
155a0dd7
ILT
124082008-04-17 Ian Lance Taylor <iant@google.com>
12409
12410 * common.cc (Symbol_table::allocate_commons): Remove options
12411 parameter. Change caller.
12412 (Symbol_table::do_allocate_commons): Remove options parameter.
12413 Change caller. Just call do_allocate_commons_list twice.
12414 (Symbol_table::do_allocate_commons_list): New function, broken out
12415 of do_allocate_commons.
12416 * common.h (class Allocate_commons_task): Remove options_ field.
12417 Update constructor.
12418 * symtab.cc (Symbol_table::Symbol_table): Initialize
12419 tls_commons_.
12420 (Symbol_table::add_from_object): Put TLS common symbols on
12421 tls_commons_ list.
12422 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
12423 which are IN_OUTPUT_DATA.
12424 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
12425 allocate_commons and do_allocate_commons declarations. Declare
12426 do_allocate_commons_list.
12427 * gold.cc (queue_middle_tasks): Update creation of
12428 Allocate_commons_task to not pass options.
12429 * testsuite/Makefile.am (INCLUDES): Add -I.. .
12430 (TLS_TEST_C_FLAGS): New variable.
12431 (tls_test_c_pic.o): New target.
12432 (tls_test_shared.so): Link in tls_test_c_pic.o.
12433 (tls_test_c_pic_ie.o): New target.
12434 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
12435 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
12436 (tls_test_c.o): New target.
12437 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
12438 (tls_pic_test_LDADD): Likewise.
12439 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
12440 (tls_shared_gd_to_ie_test_LDADD): Likewise.
12441 (tls_test_c_gnu2.o): New target.
12442 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
12443 tls_test_c_gnu2.o.
12444 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
12445 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
12446 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
12447 * testsuite/tls_test.cc: Include "config.h".
12448 (t_last): Call t11_last.
12449 * testsuite/tls_test.h (t11, t11_last): Declare.
12450 * testsuite/tls_test_c.c: New file.
12451 * testsuite/tls_test_main.cc (thread_routine): Call t11.
12452 * configure.ac: Check for OpenMP support.
12453 * configure, config.in, Makefile.in: Rebuild.
12454 * testsuite/Makefile.in: Rebuild.
12455
edfbb029
CC
124562008-04-16 Cary Coutant <ccoutant@google.com>
12457
12458 * i386.cc (Target_i386::define_tls_base_symbol): New function.
12459 (Target_i386::tls_base_symbol_defined_): New field.
12460 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12461 (Target_i386::Scan::global): Likewise.
12462 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
12463 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
12464 (Target_x86_64::tls_base_symbol_defined_): New field.
12465 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12466 (Target_x86_64::Scan::global): Likewise.
12467
f3c69fca
CC
124682008-04-16 Cary Coutant <ccoutant@google.com>
12469
12470 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
12471 (Symbol::needs_plt_entry): Allow weak undefined symbols.
12472 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
12473 building shared libraries.
12474 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
12475 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
12476 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
12477 * testsuite/Makefile.in: Rebuild.
12478 * testsuite/weak_undef.h: New file.
12479 * testsuite/weak_undef_file1.cc: Add extra test cases.
12480 * testsuite/weak_undef_file2.cc: Likewise.
12481 * testsuite/weak_undef_test.cc: Likewise.
12482
7c414435
DM
124832008-04-16 David S. Miller <davem@davemloft.net>
12484
32b769e1
DM
12485 * sparc.cc (Target_sparc::Scan): Change from struct to class.
12486 Add issued_non_pic_error_ field. Declare check_non_pic.
12487 (Target_sparc::Scan::check_non_pic): New function.
12488 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
12489 (Target_sparc::Scan::global): Likewise.
12490
11936fb1
DM
12491 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
12492 * configure: Rebuild.
12493
7c414435
DM
12494 * options.h (DEFINE_enable): New macro.
12495 (new_dtags): New enable option.
12496 (initfirst, interpose, loadfltr, nodefaultlib,
12497 nodelete, nodlopen, nodump): New -z options.
12498 * layout.cc (Layout:finish_dynamic_section): If new
12499 dtags enabled, emit DT_RUNPATH. Also, emit a
12500 DT_FLAGS_1 containing any specified -z flags.
12501
85c7bf8b
ILT
125022008-04-16 Ian Lance Taylor <iant@google.com>
12503
12c0daef
ILT
12504 * copy-relocs.cc: New file.
12505 * copy-relocs.h: New file.
12506 * reloc.cc: Remove Copy_relocs code.
12507 * reloc.h: Likewise.
12508 * reloc-types.h (struct Reloc_types) [both versions]: Add
12509 get_reloc_addend_noerror.
12510 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
12511 variants of add_global which take an addend which must be zero.
12512 * i386.cc: Include "copy-relocs.h".
12513 (class Target_i386): Change type of copy_relocs_ to variable,
12514 update initializer.
12515 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
12516 Change all callers.
12517 (Target_i386::do_finalize_sections): Change handling of
12518 copy_relocs_.
12519 * sparc.cc: Include "copy-relocs.h".
12520 (class Target_sparc): Change type of copy_relocs_ to variable,
12521 update initializer.
12522 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
12523 Change all callers.
12524 (Target_sparc::do_finalize_sections): Change handling of
12525 copy_relocs_.
12526 * x86_64.cc: Include "copy-relocs.h".
12527 (class Target_x86_64): Change type of copy_relocs_ to variable,
12528 update initializer.
12529 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
12530 class. Change all callers.
12531 (Target_x86_64::do_finalize_sections): Change handling of
12532 copy_relocs_.
12533 * Makefile.am (CCFILES): Add copy-relocs.cc.
12534 (HFILES): Add copy-relocs.h.
12535
4f4995b6
ILT
12536 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
12537
85c7bf8b
ILT
12538 * testsuite/script_test_4.sh: Permit leading zeroes.
12539
4f2a9edd
ILT
125402008-04-15 Ian Lance Taylor <iant@google.com>
12541
e6188289
ILT
12542 * script-sections.cc (Script_sections::create_segments): Use
12543 header_size_adjustment even when there is enough room for the
12544 headers.
12545 * testsuite/script_test_4.sh: New file.
12546 * testsuite/script_test_4.t: New file.
12547 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
12548 (check_DATA): Add script_test_4.stdout.
12549 (MOSTLYCLEANFILES): Likewise.
12550 (script_test_4): New target.
12551 (script_test_4.stdout): New target.
12552 * testsuite/Makefile.in: Rebuild.
12553
4f2a9edd
ILT
12554 * sparc.cc: Add definitions for Output_data_plt_sparc class
12555 constants.
12556
f5314dd5
DM
125572008-04-14 David S. Miller <davem@davemloft.net>
12558
12559 * sparc.cc: New file.
12560 * Makefile.am (TARGETSOURCES): Add sparc.cc
12561 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
12562 * configure.tgt: Document targ_extra_size and
12563 targ_extra_big_endian. Add entries for sparc-* and
12564 sparc64-*.
12565 * configure.ac: Handle targ_extra_size and
12566 targ_extra_big_endian.
12567 * Makefile.in: Rebuild.
12568 * configure: Likewise.
12569 * po/POTFILES.in: Likewise.
12570 * po/gold.pot: Likewise.
12571
154e0e9a
ILT
125722008-04-14 Ian Lance Taylor <iant@google.com>
12573
12574 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
12575 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
12576 in the name/type/flags to section mapping. Don't call
12577 allocate_output_section.
12578 (Layout::choose_output_section): Change parameter from adjust_name
12579 to is_input_section. Don't permit input sections after sections
12580 are attached to segments. Don't call allocate_output_section.
12581 (Layout::layout_eh_frame): Call update_flags_for_input_section,
12582 not write_enable_output_section.
12583 (Layout::make_output_section): Don't push to
12584 unattached_section_list_ nor call attach_to_segment. Call
12585 attach_section_to_segment if sections are attached.
12586 (Layout::attach_sections_to_segments): New function.
12587 (Layout::attach_section_to_segment): New function.
12588 (Layout::attach_allocated_section_to_segment): Rename from
12589 attach_to_segment. Remove flags parameter.
12590 (Layout::allocate_output_section): Remove function.
12591 (Layout::write_enable_output_section): Remove function.
12592 * layout.h (class Layout): Update for above changes. Add new
12593 field sections_are_attached_.
12594 * output.h (Output_section::update_flags_for_input_section): New
12595 function.
12596 * output.cc (Output_section::add_input_section): Call
12597 update_flags_for_input_section.
12598 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
12599
009a67a2
CC
126002008-04-11 Cary Coutant <ccoutant@google.com>
12601
12602 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
12603 thought unnecessary.
12604 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
12605
759b1a24
ILT
126062008-04-11 Ian Lance Taylor <iant@google.com>
12607
12608 * output.h (class Output_section_data): Remove inline definition
12609 of set_addralign.
12610 * output.cc (Output_section_data::set_addralign): New function.
12611
c2b45e22
CC
126122008-04-11 Cary Coutant <ccoutant@google.com>
12613
12614 Add support for TLS descriptors for i386 and x86_64.
12615 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
12616 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
12617 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
12618 GOT_TYPE_TLS_DESC.
12619 (Target_i386::got_mod_index_entry): Remove unnecessary code.
12620 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
12621 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
12622 relocations.
12623 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
12624 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
12625 Fix problem with initial-exec relocations.
12626 (Target_i386::Relocate::relocate_tls): Likewise.
12627 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
12628 relaxation.
12629 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
12630 support for section-plus-offset dynamic table entries.
12631 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
12632 (Output_data_dynamic::Dynamic_entry): Add support for
12633 section-plus-offset dynamic table entries.
12634 (Output_data_dynamic::Classification): Likewise.
12635 (Output_data_dynamic::classification_): Renamed offset_.
12636 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
12637 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
12638 (Target_x86_64::make_plt_section): New function.
12639 (Target_x86_64::reserve_tlsdesc_entries): New function.
12640 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
12641 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
12642 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
12643 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
12644 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
12645 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
12646 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
12647 add extra PLT entry for TLS descriptors.
12648 (Output_data_plt_x86_64::got_): New field.
12649 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
12650 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
12651 fields.
12652 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
12653 descriptors.
12654 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
12655 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
12656 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
12657 R_386_TLS_DESC_CALL relocations.
12658 (Target_x86_64::Scan::global): Likewise.
12659 (Target_x86_64::do_finalize_sections): Add dynamic table entries
12660 for TLS descriptors.
12661 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
12662 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
12663 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
12664 GD-to-IE relaxation.
12665 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
12666 and TLS_DESCRIPTORS.
12667 * Makefile.in: Rebuild.
12668 * configure: Rebuild.
12669 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
12670 (tls_test_shared2.so): New target.
12671 (tls_shared_gd_to_ie_test_SOURCES): New variable.
12672 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
12673 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
12674 (tls_shared_gd_to_ie_test_LDADD): New variable.
12675 (tls_shared_gnu2_gd_to_ie_test): New target.
12676 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
12677 New targets.
12678 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
12679 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
12680 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
12681 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
12682 (tls_shared_gnu2_test): New target.
12683 (tls_test_gnu2_shared.so): New target.
12684 (tls_shared_gnu2_test_SOURCES): New variable.
12685 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
12686 (tls_shared_gnu2_test_LDFLAGS): New variable.
12687 (tls_shared_gnu2_test_LDADD): New variable.
12688 * testsuite/Makefile.in: Rebuild.
12689 * testsuite/Makefile.
12690
83bfb6b7
ILT
126912008-04-11 Ian Lance Taylor <iant@google.com>
12692
12693 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
12694 justsyms.t.
12695 * testsuite/Makefile.in: Rebuild.
12696
12697 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
12698 long.
12699 * testsuite/script_test_2.cc (main): Adjust test.
12700
706e1f5e
ILT
127012008-04-11 David S. Miller <davem@davemloft.net>
12702 Ian Lance Taylor <iant@google.com>
12703
12704 * options.h (General_options): Add entries for '-Y' and
12705 '-relax'.
12706 * options.cc (General_options:finalize): If -Y was used, add those
12707 entries to the library path instead of the default "/lib" and
12708 "/usr/lib".
12709
7c98e6bb
DM
127102008-04-11 David S. Miller <davem@davemloft.net>
12711
12712 * testsuite/justsyms.t: Start at 0x100.
12713 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
12714 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
12715 long.
12716 * testsuite/script_test_2.cc: Adjust string and section length
12717 checks.
7c98e6bb 12718
99a37bfd
ILT
127192008-04-09 Ian Lance Taylor <iant@google.com>
12720
2cefc357
ILT
12721 PR gold/5996
12722 * script-sections.cc (Sections_element::allocate_to_segment): Add
12723 orphan parameter.
12724 (Output_section_definition::allocate_to_segment): Likewise.
12725 (Orphan_output_section::allocate_to_segment): Likewise.
12726 (Script_sections::attach_sections_using_phdrs_clause): Don't
12727 propagate non-PT_LOAD segments to orphan sections.
12728 * testsuite/Makefile.am (script_test_3.stdout): Generate using
12729 readelf rather than objdump.
12730 * testsuite/script_test_3.sh: Adjust accordingly. Test that
12731 .interp section and PT_INTERP segment are the same size.
12732 * testsuite/Makefile.in: Rebuild.
12733
99a37bfd
ILT
12734 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
12735 aliases for symbols defined in the same object.
12736 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
12737 (weak_alias_test_SOURCES): New variable.
12738 (weak_alias_test_DEPENDENCIES): New variable.
12739 (weak_alias_test_LDFLAGS): New variable.
12740 (weak_alias_test_LDADD): New variable.
12741 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
12742 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
12743 (weak_alias_test_3.o): New target.
12744 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
12745 * testsuite/weak_alias_test_main.cc: New file.
12746 * testsuite/weak_alias_test_1.cc: New file.
12747 * testsuite/weak_alias_test_2.cc: New file.
12748 * testsuite/weak_alias_test_3.cc: New file.
12749
780e49c5
ILT
127502008-04-08 Ian Lance Taylor <iant@google.com>
12751
cdb0b8f5
ILT
12752 * options.h (class General_options): Add --noinhibit-exec option.
12753 * main.cc (main): Check --noinhibit-exec.
12754
0864d551
ILT
12755 * options.h (class General_options): Define --wrap as a special
12756 option. Add wrap_symbols_ field.
12757 (General_options::any_wrap_symbols): New function.
12758 (General_options::is_wrap_symbol): New function.
12759 * options.cc (General_options::parse_wrap): New function.
12760 (General_options::General_options): Initialize wrap_symbols_.
12761 * symtab.cc (Symbol_table::wrap_symbol): New function.
12762 (Symbol_table::add_from_object): Handle --wrap.
12763 * symtab.h (class Symbol_table): Declare wrap_symbol.
12764 * target.h (Target::wrap_char): New function.
12765 (Target::Target_info): Add wrap_char field.
12766 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
12767 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12768 * testsuite/testfile.cc (Target_test::test_target_info):
12769 Likewise.
12770
789aa6de
ILT
12771 * errors.cc (Errors::undefined_symbol): Mention symbol version if
12772 there is one.
12773
2c38906f
ILT
12774 * layout.h (class Layout): Add added_eh_frame_data_ field.
12775 * layout.cc (Layout::Layout): Initialize new field.
12776 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
12777 output section until we find a section we merged successfully.
12778 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
12779 that the size be non-zero.
12780
780e49c5
ILT
12781 * merge.cc (Object_merge_map::get_output_offset): Remove inline
12782 qualifier.
12783
7fcd0256
ILT
127842008-04-08 Craig Silverstein <csilvers@google.com>
12785
12786 * configure.ac: Export new conditional variable HAVE_ZLIB.
12787 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
12788 on HAVE_ZLIB.
12789 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
12790 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12791
6835af53
ILT
127922008-04-07 Ian Lance Taylor <iant@google.com>
12793
e24f324c
ILT
12794 * version.cc (version_string): Set to "1.5".
12795
a036edd8
ILT
12796 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
12797 Add issued_non_pic_error_ field. Declare check_non_pic.
12798 (Target_x86_64::Scan::check_non_pic): New function.
12799 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
12800 (Target_x86_64::Scan::global): Likewise.
12801
624f8810
ILT
12802 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
12803 addend parameter. Change caller. Handle merge sections.
12804 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
12805 Address to Addend. Don't add in the result of
12806 local_section_offset, pass down the addend and use the returned
12807 value.
12808 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
12809 Update declarations of local_section_offset and symbol_value.
12810 * testsuite/two_file_test_1.cc (t18): New function.
12811 * testsuite/two_file_test_2.cc (f18): New function.
12812 * testsuite/two_file_test_main.cc (main): Call t18.
12813 * testsuite/two_file_test.h (t18, f18): Declare.
12814
6835af53
ILT
12815 * configure.ac: Don't test for objdump, c++filt, or readelf.
12816 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
12817 conditionals.
12818 (TEST_READELF): New variable.
12819 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
12820 (check_PROGRAMS): Add two_file_strip_test.
12821 (two_file_strip_test): New target.
12822 (check_PROGRAMS): Add two_file_same_shared_strip_test.
12823 (two_file_same_shared_strip_test_SOURCES): New variable.
12824 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
12825 (two_file_same_shared_strip_test_LDFLAGS): New variable.
12826 (two_file_same_shared_strip_test_LDADD): New variable.
12827 (two_file_shared_strip.so): New target.
12828 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
12829 (ver_test_5.syms, ver_test_7.syms): Likewise.
12830 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
12831 (strip_test_3.stdout): Use TEST_OBJDUMP.
12832 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12833
86925eef
CC
128342008-04-04 Cary Coutant <ccoutant@google.com>
12835
12836 * symtab.h (Symbol::is_weak_undefined): New function.
12837 (Symbol::is_strong_undefined): New function.
12838 (Symbol::is_absolute): New function.
12839 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
12840 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
12841 absolute symbols.
12842 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
12843 (weak_undef_test): New target.
12844 * testsuite/Makefile.in: Rebuild.
12845 * testsuite/weak_undef_file1.cc: New file.
12846 * testsuite/weak_undef_file2.cc: New file.
12847 * testsuite/weak_undef_test.cc: New file.
12848
126f3ece
ILT
128492008-04-03 Craig Silverstein <csilvers@google.com>
12850
12851 * compressed_output.h (class Output_compressed_section): Use
12852 unsigned buffer.
12853 * compressed_output.cc (zlib_compress): Use unsigned buffers,
12854 add zlib header.
12855 (zlib_compressed_suffix): Removed.
12856 (Output_compressed_section::set_final_data_size): Use unsigned
12857 buffers.
12858 * testsuite/Makefile.am (flagstest_compress_debug_sections):
12859 Fix linker invocation.
12860 (flagstest_o_specialfile_and_compress_debug_sections):
12861 Likewise.
12862 * testsuite/Makefile.in: Regenerated.
12863
deae2a14
DM
128642008-04-02 David S. Miller <davem@davemloft.net>
12865
12866 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
12867 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
12868
70752818
ILT
128692008-04-02 Craig Silverstein <csilvers@google.com>
12870
12871 * TODO: New file.
12872
39d0cb0e
ILT
128732008-04-02 Ian Lance Taylor <iant@google.com>
12874
12875 * fileread.cc (File_read::find_view): Add byteshift and vshifted
12876 parameters. Update for new key type to views_. Change all
12877 callers.
12878 (File_read::read): Adjust for byteshift in returned view.
12879 (File_read::add_view): New function, broken out of
12880 find_and_make_view.
12881 (File_read::make_view): New function, broken out of
12882 find_and_make_view.
12883 (File_read::find_or_make_view): Add offset and aligned
12884 parameters. Rewrite accordingly. Change all callers.
12885 (File_read::get_view): Add offset and aligned parameters. Adjust
12886 for byteshift in return value.
12887 (File_read::get_lasting_view): Likewise.
12888 * fileread.h (class File_read): Update declarations.
12889 (class File_read::View): Add byteshift_ field. Add byteshift to
12890 constructor. Add byteshift method.
12891 * archive.h (Archive::clear_uncached_views): New function.
12892 (Archive::get_view): Add aligned parameter. Change all callers.
12893 * object.h (Object::get_view): Add aligned parameter. Change all
12894 callers.
12895 (Object::get_lasting_view): Likewise.
12896
12897 * fileread.cc (File_read::release): Don't call clear_views if
12898 there are multiple objects.
12899 * fileread.h (File_read::clear_uncached_views): New function.
12900 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
12901 on the archive.
12902
a1207466
CC
129032008-03-31 Cary Coutant <ccoutant@google.com>
12904
12905 Add thin archive support.
12906 * archive.cc (Archive::armagt): New const.
12907 (Archive::setup): Remove task parameter and calls to unlock.
12908 (Archive::unlock_nested_archives): New function.
12909 (Archive::read_header): Add nested_off parameter. Change
12910 all callers.
12911 (Archive::interpret_header): Likewise.
12912 (Archive::include_all_members): Change to handle thin
12913 archives.
12914 (Archive::include_member): Likewise.
12915 * archive.h (Archive::Archive): Add new parameters and
12916 initializers.
12917 (Archive::armagt): New const.
12918 (Archive::setup): Remove task parameter.
12919 (Archive::unlock_nested_archives): New function.
12920 (Archive::read_header): Add nested_off parameter.
12921 (Archive::interpret_header): Likewise.
12922 (Archive::Nested_archive_table): New typedef.
12923 (Archive::is_thin_archive_): New field.
12924 (Archive::nested_archives_): New field.
12925 (Archive::options_): New field.
12926 (Archive::dirpath_): New field.
12927 (Archive::task_): New field.
12928 * readsyms.cc (Read_symbols::do_read_symbols): Add check
12929 for thin archives. Pass additional parameters to
12930 Archive::Archive. Unlock the archive file after calling
12931 Archive::setup.
cd536b21 12932
479f6503
ILT
129332008-03-29 Ian Lance Taylor <iant@google.com>
12934
686c8caf
ILT
12935 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
12936 version symbol to be local.
12937 * testsuite/ver_test_4.sh: New file.
12938 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
12939 (check_DATA): Add ver_test_4.syms.
12940 (ver_test_4.syms): New target.
12941 * testsuite/Makefile.in: Rebuild.
12942
ab794b6b
ILT
12943 * output.cc
12944 (Output_section::Input_section_sort_entry::has_priority): New
12945 function.
12946 (Output_section::Input_section_sort_entry::match_file_name): New
12947 function.
12948 (Output_section::Input_section_sort_entry::match_section_name):
12949 Remove.
12950 (Output_section::Input_section_sort_entry::match_section_name_prefix):
12951 Remove.
12952 (Output_section::Input_section_sort_entry::match_section_file):
12953 Remove.
12954 (Output_section::Input_section_sort_compare::operator()): Rewrite
12955 using new Input_section_sort_entry functions. Sort crtbegin and
12956 crtend first. Sort sections with no priority before sections with
12957 a priority.
12958 * testsuite/initpri1.c (d3): Check j != 4.
12959 (cd5): New constructor/destructor function.
12960 (main): Check j != 2.
12961
479f6503
ILT
12962 * symtab.cc (Symbol_table::add_from_object): If we don't use the
12963 new symbol when resolving, don't call set_is_default.
12964 * testsuite/ver_test_7.cc: New file.
12965 * testsuite/ver_test_7.sh: New file.
12966 * testsuite/Makefile.am (ver_test_7.so): New target.
12967 (ver_test_7.o): New target.
12968 (check_SCRIPTS): Add ver_test_7.sh.
12969 (check_DATA): Add ver_test_7.syms.
12970 (ver_test_7.syms): New target.
12971
2fd32231
ILT
129722008-03-28 Ian Lance Taylor <iant@google.com>
12973
12974 * layout.cc (Layout::layout): If we see an input section with a
12975 name that needs sorting, set the must_sort flag for the output
12976 section.
12977 (Layout::make_output_section): If the name of the output section
12978 indicates that it might require sorting, set the may_sort flag.
12979 * output.h (Output_section::may_sort_attached_input_sections): New
12980 function.
12981 (Output_section::set_may_sort_attached_input_sections): New
12982 function.
12983 (Output_section::must_sort_attached_input_sections): New
12984 function.
12985 (Output_section::set_must_sort_attached_input_sections): New
12986 function.
12987 (class Output_section): Declare Input_section_sort_entry. Define
12988 Input_section_sort_compare. Declare
12989 sort_attached_input_sections. Add new fields:
12990 may_sort_attached_input_sections_,
12991 must_sort_attached_input_sections_,
12992 attached_input_sections_are_sorted_.
12993 * output.cc (Output_section::Output_section): Initialize new
12994 fields.
12995 (Output_section::add_input_section): Add an entry to
12996 input_sections_ if may_sort or must_sort are true.
12997 (Output_section::set_final_data_size): Call
12998 sort_attached_input_sections if necessary.
12999 (Output_section::Input_section_sort_entry): Define new class.
13000 (Output_section::Input_section_sort_compare::operator()): New
13001 function.
13002 (Output_section::sort_attached_input_sections): New function.
13003 * configure.ac: Check whether the compiler supports constructor
13004 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
13005 * testsuite/initpri1.c: New file.
13006 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
13007 CONSTRUCTOR_PRIORITY.
13008 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
13009 (initpri1_LDFLAGS): New variable.
13010 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13011
18e6b24e
ILT
130122008-03-27 Ian Lance Taylor <iant@google.com>
13013
49bdd526
ILT
13014 * common.cc (Sort_commons::operator): Correct sorting algorithm.
13015 * testsuite/common_test_1.c: New file.
13016 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
13017 (common_test_1_SOURCES): New variable.
13018 (common_test_1_DEPENDENCIES): New variable.
13019 (common_test_1_LDFLAGS): New variable.
13020
18e6b24e
ILT
13021 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
13022 and commons_ correctly when NAME/VERSION does not override
13023 NAME/NULL.
13024 * testsuite/ver_test_6.c: New file.
13025 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
13026 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
13027 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
13028
04bf7072
ILT
130292008-03-26 Ian Lance Taylor <iant@google.com>
13030
5871526f
ILT
13031 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
13032 of an undefined symbol from a version script.
13033 * testsuite/Makefile.am (ver_test_5.so): New target.
13034 (ver_test_5.o): New target.
13035 (check_SCRIPTS): Add ver_test_5.sh.
13036 (check_DATA): Add ver_test_5.syms.
13037 (ver_test_5.syms): New target.
13038 * testsuite/ver_test_5.cc: New file.
13039 * testsuite/ver_test_5.script: New file.
13040 * testsuite/ver_test_5.sh: New file.
13041 * Makefile.in, testsuite/Makefile.in: Rebuild.
13042
04bf7072
ILT
13043 PR gold/5986
13044 Fix problems building gold with gcc 4.3.0.
13045 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
13046 (gold_error_at_location, gold_warning_at_location): Use it.
13047 * configure.ac: Check whether we can compile and use a template
13048 function with a printf attribute.
13049 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
13050 when jumping over bytes.
13051 * object.cc: Instantiate Object::read_section_data.
13052 * debug.h: Include <cstring>
13053 * dwarf_reader.cc: Include <algorithm>
13054 * main.cc: Include <cstring>.
13055 * options.cc: Include <cstring>.
13056 * output.cc: Include <cstring>.
13057 * script.cc: Include <cstring>.
13058 * script.h: Include <string>.
13059 * symtab.cc: Include <cstring> and <algorithm>.
13060 * target-select.cc: Include <cstring>.
13061 * version.cc: Include <string>.
13062 * testsuite/testmain.cc: Include <cstdlib>.
13063 * configure, config.in: Rebuild.
13064
874c5b28
ILT
130652008-03-25 Ian Lance Taylor <iant@google.com>
13066
819d6c3a
ILT
13067 * options.cc: Include "../bfd/bfdver.h".
13068 (options::help): Print bug reporting address.
13069
f4b2c6f5
ILT
13070 * version.cc (print_version): Adjust output for current value of
13071 BFD_VERSION_STRING.
13072
13073 * NEWS: New file.
13074
e96caa79
ILT
13075 * options.cc (options::help): Print list of supported targets.
13076 * target-select.h: Include <vector>.
13077 (class Target_selector): Make machine_, size_, and is_big_endian_
13078 fields const. Add bfd_name_ and instantiated_target_ fields.
13079 (Target_selector::Target_selector): Add bfd_name parameter.
13080 (Target_selector::recognize): Make non-virtual, call
13081 do_recognize.
13082 (Target_selector::recognize_by_name): Make non-virtual, call
13083 do_recognize_by_name.
13084 (Target_selector::supported_names): New function.
13085 (Target_selector::bfd_name): New function.
13086 (Target_selector::do_instantiate_target): New pure virtual
13087 function.
13088 (Target_selector::do_recognize): New virtual function.
13089 (Target_selector::do_recognize_by_name): New virtual function.
13090 (Target_selector::instantiate_target): New private function.
13091 (supported_target_names): Declare.
13092 * target-select.cc (Target_selector::Target_selector): Update for
13093 new parameter and fields.
13094 (select_target_by_name): Check that the name matches before
13095 calling recognize_by_name.
13096 (supported_target_names): New function.
13097 * i386.cc (class Target_selector_i386): Update Target_selector
13098 constructor call. Remove recognize and recognize_by_name. Add
13099 do_instantiate_target.
13100 * x86_64.cc (class Target_selector_x86_64): Likewise.
13101 * testsuite/testfile.cc (class Target_selector_test): Update for
13102 changes to Target_selector.
13103
874c5b28
ILT
13104 * README: Rewrite, with some notes on unsupported features.
13105
0a65a3a7
CC
131062008-03-24 Cary Coutant <ccoutant@google.com>
13107
13108 * i386.cc (Target_i386::Got_type): New enum declaration.
13109 (Target_i386::Scan::local): Updated callers of Output_data_got
13110 member functions.
13111 (Target_i386::Scan::global): Likewise.
13112 (Target_i386::Relocate::relocate): Likewise.
13113 (Target_i386::Relocate::relocate_tls): Likewise.
13114 * object.h (Got_offset_list): New class.
13115 (Sized_relobj::local_has_got_offset): Added got_type parameter.
13116 (Sized_relobj::local_got_offset): Likewise.
13117 (Sized_relobj::set_local_got_offset): Likewise.
13118 (Sized_relobj::local_has_tls_got_offset): Removed.
13119 (Sized_relobj::local_tls_got_offset): Removed.
13120 (Sized_relobj::set_local_tls_got_offset): Removed.
13121 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
13122 * output.cc (Output_data_got::add_global): Added got_type parameter.
13123 (Output_data_got::add_global_with_rel): Likewise.
13124 (Output_data_got::add_global_with_rela): Likewise.
13125 (Output_data_got::add_global_pair_with_rel): New function.
13126 (Output_data_got::add_global_pair_with_rela): New function.
13127 (Output_data_got::add_local): Added got_type parameter.
13128 (Output_data_got::add_local_with_rel): Likewise.
13129 (Output_data_got::add_local_with_rela): Likewise.
13130 (Output_data_got::add_local_pair_with_rel): New function.
13131 (Output_data_got::add_local_pair_with_rela): New function.
13132 (Output_data_got::add_global_tls): Removed.
13133 (Output_data_got::add_global_tls_with_rel): Removed.
13134 (Output_data_got::add_global_tls_with_rela): Removed.
13135 (Output_data_got::add_local_tls): Removed.
13136 (Output_data_got::add_local_tls_with_rel): Removed.
13137 (Output_data_got::add_local_tls_with_rela): Removed.
13138 * output.h (Output_data_got::add_global): Added got_type parameter.
13139 (Output_data_got::add_global_with_rel): Likewise.
13140 (Output_data_got::add_global_with_rela): Likewise.
13141 (Output_data_got::add_global_pair_with_rel): New function.
13142 (Output_data_got::add_global_pair_with_rela): New function.
13143 (Output_data_got::add_local): Added got_type parameter.
13144 (Output_data_got::add_local_with_rel): Likewise.
13145 (Output_data_got::add_local_with_rela): Likewise.
13146 (Output_data_got::add_local_pair_with_rel): New function.
13147 (Output_data_got::add_local_pair_with_rela): New function.
13148 (Output_data_got::add_global_tls): Removed.
13149 (Output_data_got::add_global_tls_with_rel): Removed.
13150 (Output_data_got::add_global_tls_with_rela): Removed.
13151 (Output_data_got::add_local_tls): Removed.
13152 (Output_data_got::add_local_tls_with_rel): Removed.
13153 (Output_data_got::add_local_tls_with_rela): Removed.
13154 * resolve.cc (Symbol::override_base_with_special): Removed
13155 reference to has_got_offset_ field.
13156 * symtab.cc (Symbol::init_fields): Replaced initialization
13157 of got_offset_ with got_offsets_. Removed initialization
13158 of has_got_offset_
53fcba31 13159 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
13160 (Symbol::got_offset): Likewise.
13161 (Symbol::set_got_offset): Likewise.
13162 (Symbol::has_tls_got_offset): Removed.
13163 (Symbol::tls_got_offset): Removed.
13164 (Symbol::set_tls_got_offset): Removed.
13165 (Symbol::got_offset_): Removed.
13166 (Symbol::tls_mod_got_offset_): Removed.
13167 (Symbol::tls_pair_got_offset_): Removed.
13168 (Symbol::got_offsets_): New field.
13169 (Symbol::has_got_offset): Removed.
13170 (Symbol::has_tls_mod_got_offset): Removed.
13171 (Symbol::has_tls_pair_got_offset): Removed.
13172 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
13173 (Target_x86_64::Scan::local): Updated callers of Output_data_got
13174 member functions.
13175 (Target_x86_64::Scan::global): Likewise.
13176 (Target_x86_64::Relocate::relocate): Likewise.
13177 (Target_x86_64::Relocate::relocate_tls): Likewise.
13178
bd52eafb
BE
131792008-03-25 Ben Elliston <bje@au.ibm.com>
13180
13181 * yyscript.y: Fix spelling error in comment.
13182
8b105e34
ILT
131832008-03-24 Ian Lance Taylor <iant@google.com>
13184
8ed814a9
ILT
13185 * options.h (class General_options): Define build_id option.
13186 * layout.h (class Layout): Declare write_build_id, create_note,
13187 create_build_id. Add build_id_note_ member.
13188 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
13189 "libiberty.h", "md5.h", "sha1.h".
13190 (Layout::Layout): Initialize eh_frame_data_,
13191 eh_frame_hdr_section_, and build_id_note_.
13192 (Layout::finalize): Call create_build_id.
13193 (Layout::create_note): New function, broken out of
13194 Layout::create_gold_note.
13195 (Layout::create_gold_note): Call create_note.
13196 (Layout::create_build_id): New function.
13197 (Layout::write_build_id): New function.
13198 (Close_task_runner::run): Call write_build_id.
13199
8b105e34
ILT
13200 * x86_64.cc: Correct license to GPLv3.
13201
086a1841
ILT
132022008-03-23 Ian Lance Taylor <iant@google.com>
13203
13204 * options.cc: Include "demangle.h".
13205 (parse_optional_string): New function.
13206 (parse_long_option): Handle takes_optional_argument.
13207 (parse_short_option): Update dash_z initializer. Handle
13208 takes_optional_argument.
13209 (General_options::General_options): Initialize do_demangle_.
13210 (General_options::finalize): Set do_demangle_. Handle demangling
13211 style.
13212 * options.h (parse_optional_string): Declare.
13213 (struct One_option): Add optional_arg field. Update constructor.
13214 Update call constructor calls. Add takes_optional_argument
13215 function.
13216 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
13217 (DEFINE_optional_string): Define.
13218 (General_options::demangle): Change from DEFINE_bool to
13219 DEFINE_optional_string.
13220 (General_options::no_demangle): New function.
13221 (General_options::do_demangle): New function.
13222 (General_options::set_do_demangle): New function.
13223 (General_options::execstack_status_): Move definition to end of
13224 class definition.
13225 (General_options::static_): Likewise.
13226 (General_options::do_demangle_): New field.
13227 * object.cc (big_endian>::get_symbol_location_info): Call
13228 Options::do_demangle, not Options::demangle.
13229 * symtab.cc (demangle): Likewise.
13230
cbb93e63
ILT
132312008-03-22 Ian Lance Taylor <iant@google.com>
13232
13233 * gold.h: Include <cstddef> and <sys/types.h>
13234 * options.h: Include <cstring>.
13235
ec531623
ILT
132362008-03-21 Ian Lance Taylor <iant@google.com>
13237
13238 * Added source code to GNU binutils.
This page took 0.795058 seconds and 4 git commands to generate.