]> Git Repo - binutils.git/blame - gold/ChangeLog
2012-06-12 Rafael Ávila de Espíndola <[email protected]>
[binutils.git] / gold / ChangeLog
CommitLineData
fb1b895d
CC
12012-06-06 Cary Coutant <[email protected]>
2
3 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
4 add .debug_macro.
5 (lines_only_debug_sections): Likewise.
6 (gdb_fast_lookup_sections): New static array.
7 (is_gdb_debug_section): Rename formal parameter.
8 (is_lines_only_debug_section): Likewise.
9 (is_gdb_fast_lookup_section): New function.
10 (Layout::include_section): Check for ".zdebug_" prefix; pass
11 section name suffix to is_gdb_debug_section, et al.; check for
12 fast-lookup sections when building .gdb_index.
13 * options.h (--strip-debug-gdb): Update GDB version number.
14
7c0640fa
CC
152012-06-06 Cary Coutant <[email protected]>
16
17 * configure.ac: Add check for fallocate.
18 * configure: Regenerate.
19 * config.in: Regenerate.
20
21 * options.h (class General_options): Add --mmap-output-file and
22 --posix-fallocate options.
23 * output.cc: (posix_fallocate): Remove; replace with...
24 (gold_fallocate): New function.
25 (Output_file::map_no_anonymous): Call gold_fallocate.
26 (Output_file::map): Check --mmap-output-file option.
27
2a49eb69
DK
282012-06-05 Jing Yu <[email protected]>
29
30 * gold.h (textdomain): Add do {} to empty while(0).
31 (bindtextdomain): Likewise.
32
fad072ac
CC
332012-06-04 Cary Coutant <[email protected]>
34
35 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
36 has_dynsym_index.
37
8cc69fb6
ST
382012-05-25 Sriraman Tallam <[email protected]>
39
40 * symtab.cc (Symbol_table::define_special_symbol):
41 Initialize *poldsym to prevent uninitialized variable errors.
42
1be75daa
CC
432012-05-23 Cary Coutant <[email protected]>
44
45 * layout.cc (Layout::section_name_mapping): Add rules to handle
46 exact match on .data.rel.ro.local or .data.rel.ro.
47 (Layout::output_section_name): Check for exact matches.
48
9b689de0
CC
492012-05-23 Cary Coutant <[email protected]>
50
51 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
52 more carefully.
53
b24fdbf5
CC
542012-05-22 Cary Coutant <[email protected]>
55
56 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
57 object before exporting symbol.
58
e550e1a2
L
592012-05-21 H.J. Lu <[email protected]>
60
61 * testsuite/tls_test.cc: Include "config.h" first.
62 * testsuite/tls_test_c.c: Likewise.
63
df7b86aa
NC
642012-05-17 Daniel Richard G. <[email protected]>
65 Nick Clifton <[email protected]>
66
67 PR 14072
68 * configure.in: Add check that sysdep.h has been included before
69 any system header files.
70 * configure: Regenerate.
71 * config.in: Regenerate.
72
1007b503
CC
732012-05-14 Cary Coutant <[email protected]>
74
75 * layout.cc (Layout::make_output_section): Mark .tdata section
76 as RELRO.
77 * testsuite/relro_test.cc: Add a TLS variable.
78
fd885f3a
L
792012-05-10 H.J. Lu <[email protected]>
80
81 PR gold/14091
82 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
83 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
84 R_X86_64_64.
85
80f5885c
CC
862012-05-08 Cary Coutant <[email protected]>
87
88 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
89 (lines_only_debug_sections): Likewise.
90
2e702c99
RM
912012-05-02 Roland McGrath <[email protected]>
92
93 * nacl.cc: New file.
94 * nacl.h: New file.
95 * Makefile.am (CCFILES, HFILES): Add them.
96 * Makefile.in: Regenerate.
97 * i386.cc (Output_data_plt_i386_nacl): New class.
98 (Output_data_plt_i386_nacl_exec): New class.
99 (Output_data_plt_i386_nacl_dyn): New class.
100 (Target_i386_nacl): New class.
101 (Target_selector_i386_nacl): New class.
102 (target_selector_i386): Use it instead of Target_selector_i386.
103 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
104 (Target_x86_64_nacl): New class.
105 (Target_selector_x86_64_nacl): New class.
106 (target_selector_x86_64, target_selector_x32): Use it instead of
107 Target_selector_x86_64.
108 * arm.cc (Output_data_plt_arm_nacl): New class.
109 (Target_arm_nacl): New class.
110 (Target_selector_arm_nacl): New class.
111 (target_selector_arm, target_selector_armbe): Use it instead of
112 Target_selector_arm.
113
114 * target-select.cc (select_target): Take new Input_file* and off_t
115 arguments, pass them on to recognize method of selector.
116 * object.cc (make_elf_sized_object): Update caller.
117 * parameters.cc (parameters_force_valid_target): Likewise.
118 * incremental.cc (make_sized_incremental_binary): Likewise.
119 * target-select.h: Update decl.
120 (Target_selector::recognize): Take new Input_file* argument,
121 pass it on to do_recognize.
122 (Target_selector::do_recognize): Take new Input_file* argument.
123 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
124 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
125 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
126 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
127
128 * target.h (Target::Target_info): New members isolate_execinstr
129 and rosegment_gap.
130 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
131 * arm.cc (Target_arm::arm_info): Update initializer.
132 * i386.cc (Target_i386::i386_info): Likewise.
133 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
134 * sparc.cc (Target_sparc::sparc_info): Likewise.
135 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
136 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
137 * layout.cc (Layout::attach_allocated_section_to_segment):
138 Take new const Target* argument. If target->isolate_execinstr(), act
139 like --rosegment.
140 (Layout::find_first_load_seg): Take new const Target* argument;
141 if target->isolate_execinstr(), reject PF_X segments.
142 (Layout::relaxation_loop_body): Update caller.
143 (Layout::set_segment_offsets): If target->isolate_execinstr(),
144 reset file offset to zero when we hit LOAD_SEG, and then do a second
145 loop over the segments before LOAD_SEG to reassign offsets after
146 addresses have been determined. Handle target->rosegment_gap().
147 (Layout::attach_section_to_segment): Take new const Target* argument;
148 pass it to attach_allocated_section_to_segment.
149 (Layout::make_output_section): Update caller.
150 (Layout::attach_sections_to_segments): Take new const Target* argument;
151 pass it to attach_section_to_segment.
152 * gold.cc (queue_middle_tasks): Update caller.
153 * layout.h (Layout): Update method decls with new arguments.
154
155 * arm.cc (Target_arm::Target_arm): Take optional argument for the
156 Target_info pointer to use.
157 (Target_arm::do_make_data_plt): New virtual method.
158 (Target_arm::make_data_plt): New method that calls it.
159 (Target_arm::make_plt_entry): Use it.
160 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
161 for the section alignment.
162 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
163 method.
164 (Output_data_plt_arm::first_plt_entry_offset): Call it.
165 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
166 method.
167 (Output_data_plt_arm::get_plt_entry_size): Call it.
168 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
169 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
170 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
171 method.
172 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
173 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
174 method instead of sizeof(plt_entry).
175 (Output_data_plt_arm::add_entry): Likewise.
176 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
177 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
178 than static method.
179 (Target_arm::plt_entry_size): Likewise.
180 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
181 Move to ...
182 (Output_data_plt_arm_standard): ... here, new class.
183 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
184 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
185 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
186
187 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
188 Take additional argument for the PLT entry size.
189 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
190 Use get_plt_entry_size method rather than plt_entry_size variable.
191 (Output_data_plt_x86_64::reserve_slot): Likewise.
192 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
193 (Output_data_plt_x86_64::add_entry): Likewise.
194 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
195 (Output_data_plt_x86_64::address_for_global): Likewise.
196 (Output_data_plt_x86_64::address_for_local): Likewise.
197 (Output_data_plt_x86_64::set_final_data_size): Likewise.
198 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
199 Make method non-static.
200 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
201 method.
202 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
203 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
204 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
205 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
206 virtual method.
207 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
208 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
209 virtual method.
210 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
211 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
212 virtual method.
213 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
214 (Output_data_plt_x86_64::plt_entry_size)
215 (Output_data_plt_x86_64::first_plt_entry)
216 (Output_data_plt_x86_64::plt_entry)
217 (Output_data_plt_x86_64::tlsdesc_plt_entry)
218 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
219 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
220 (Output_data_plt_x86_64_standard): ... here, new class.
221 (Target_x86_64::Target_x86_64): Take optional argument for the
222 Target_info pointer to use.
223 (Target_x86_64::do_make_data_plt): New virtual method.
224 (Target_x86_64::make_data_plt): New method to call it.
225 (Target_x86_64::init_got_plt_for_update): Use that.
226 Call this->plt_->add_eh_frame method here.
227 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
228 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
229 rather than static method.
230 (Target_x86_64::plt_entry_size): Likewise.
231 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
232 rather than plt_entry_size variable. Move guts of PLT filling to...
233 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
234 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
235 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
236
237 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
238 additional argument for the section alignment.
239 Don't do add_eh_frame_for_plt here.
240 (Output_data_plt_i386::first_plt_entry_offset): Make the method
241 non-static. Use get_plt_entry_size method rather than plt_entry_size
242 variable.
243 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
244 method.
245 (Output_data_plt_i386::get_plt_entry_size): Call it.
246 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
247 (Output_data_plt_i386::add_eh_frame): New method to call it.
248 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
249 method.
250 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
251 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
252 method.
253 (Output_data_plt_i386::fill_plt_entry): New method to call it.
254 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
255 method instead of plt_entry_size.
256 (Output_data_plt_i386::plt_entry_size)
257 (Output_data_plt_i386::plt_eh_frame_fde_size)
258 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
259 (Output_data_plt_i386_standard): ... here, new class.
260 (Output_data_plt_i386_exec): New class.
261 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
262 (Output_data_plt_i386_exec::first_plt_entry): ... here.
263 (Output_data_plt_i386::exec_plt_entry): Move to ...
264 (Output_data_plt_i386_exec::plt_entry): ... here.
265 (Output_data_plt_i386_dyn): New class.
266 (Output_data_plt_i386::first_plt_entry): Move to ...
267 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
268 (Output_data_plt_i386::dyn_plt_entry): Move to ...
269 (Output_data_plt_i386_dyn::plt_entry): ... here.
270 (Target_i386::Target_i386): Take optional argument for the Target_info
271 pointer to use.
272 (Target_i386::do_make_data_plt): New virtual method.
273 (Target_i386::make_data_plt): New method to call it.
274 (Target_i386::make_plt_section): Use that.
275 Call this->plt_->add_eh_frame method here.
276 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
277 rather than plt_entry_size variable.
278 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
279 (Output_data_plt_i386::address_for_local): Likewise.
280 (Output_data_plt_i386::do_write): Likewise.
281 Move guts of PLT filling to...
282 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
283 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
284 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
285 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
286
b9b9f2ee
CC
2872012-05-01 Cary Coutant <[email protected]>
288
289 * dwarf_reader.cc (Dwarf_die::read_attributes)
290 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
291 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
292 * reduced_debug_output.cc
293 (Output_reduced_debug_info_section::get_die_end): Remove
294 DW_FORM_GNU_ref_index. Add default case.
295
57923f48
MW
2962012-04-26 Mark Wielaard <[email protected]>
297
298 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
299 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
300 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
301 DW_AT_high_pc as offset from DW_AT_low_pc.
302
303 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
304 * testsuite/Makefile.in: Regenerate.
305 * testsuite/gdb_index_test_3.c: New test source file.
306 * testsuite/gdb_index_test_3.sh: New test source file.
307
2c54b4f4
ILT
3082012-04-25 Ian Lance Taylor <[email protected]>
309
310 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
311 pointer.
312 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
313 as a class, not a struct.
314 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
315 (Target_arm::apply_cortex_a8_workaround): Likewise.
316 * gc.h: Declare Reloc_types as a struct, not a class.
317 * object.h: Declare Symbols_data as a struct.
318 * reloc.h: Declare Read_relocs_data as a struct.
319 * target.h: Declare Relocate_info as a struct.
320
a5a5f7a3
DM
3212012-04-24 David S. Miller <[email protected]>
322
323 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
324 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
325 and R_SPARC_WPLT30.
326
f038d496
CC
3272012-04-24 Cary Coutant <[email protected]>
328
329 * incremental-dump.cc (find_input_containing_global): Replace
330 magic number with symbolic constant.
331 (dump_incremental_inputs): Update version number.
332 * incremental.cc (Output_section_incremental_inputs): Update version
333 number; import symbolic constants from Incremental_inputs_reader.
334 (Incremental_inputs::create_data_sections): Align relocations
335 section correctly for 64-bit targets.
336 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
337 constants; add padding.
338 (Output_section_incremental_inputs::write_header): Add assert for
339 header_size.
340 (Output_section_incremental_inputs::write_input_files): Add assert
341 for input_entry_size.
342 (Output_section_incremental_inputs::write_info_blocks): Add padding;
343 add assert for object_info_size, input_section_entry_size,
344 global_sym_entry_size.
345 * incremental.h (Incremental_inputs_reader): Add symbolic constants
346 for data structure sizes; use them.
347 (Incremental_input_entry_reader): Import symbolic constants from
348 Incremental_inputs_reader; use them.
349
a4d85145
DM
3502012-04-23 David S. Miller <[email protected]>
351
352 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
353 and elf_flags_set_.
354 (Target_sparc::Target_sparc): Initialize new fields.
355 (Target_sparc::do_make_elf_object): New function.
356 (Target_sparc::do_adjust_elf_header): New function.
357
1d509098
CC
3582012-04-23 Cary Coutant <[email protected]>
359
360 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
361 CU range table of gdb index.
362
7ebeff7f
DM
3632012-04-20 David S. Miller <[email protected]>
364
365 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
366 instead of false.
367
13cf9988
DM
3682012-04-16 David S. Miller <[email protected]>
369
2a1079e8
DM
370 * sparc.cc (Target_sparc::got_address): New function.
371 (Sparc_relocate_functions::gdop_hix22): New function.
372 (Sparc_relocate_functions::gdop_lox10): New function.
373 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
374 relocs.
375 (Target_sparc::Scan::local): Likewise if the global symbol is not
376 preemptible and is not IFUNC.
377 (Target_sparc::Relocate::relocate): Perform GOTDATA code
378 transformations for local and non-preemptible non-IFUNC global
379 symbols.
380
0bc964fc
DM
381 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
382 writing out 64-bit part of ranges.
383
661d7a80
DM
384 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
385 -fpic and -fpie respectively.
386 * Makefile.in: Regenerate.
387
8c2bf391
DM
388 * sparc.cc (class Target_sparc): Add rela_ifunc_.
389 (Target_sparc::Target_sparc): Initialize new field.
390 (Target_sparc::do_plt_section_for_global): New function.
391 (Target_sparc::do_plt_section_for_local): New function.
392 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
393 (Target_sparc::make_plt_section): New function, broken out of
394 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
395 (Target_sparc::make_plt_entry): Call make_plt_section.
396 (Target_sparc::make_local_ifunc_plt_entry): New function.
397 (Target_sparc::rela_ifunc_section): New function.
398 (Target_sparc::plt_section): Remove const.
399 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
400 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
401 and ifunc_count_ fields.
402 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
403 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
404 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
405 (Output_data_plt_sparc::rela_ifunc): New function.
406 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
407 (Output_data_plt_sparc::has_ifunc_section): New function.
408 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
409 (Output_data_plt_sparc::address_for_global): New function.
410 (Output_data_plt_sparc::address_for_local): New function.
411 (Output_data_plt_sparc::plt_index_to_offset): New function.
412 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
413 and entry_count.
414 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
415 entry_count.
416 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
417 R_SPARC_JMP_IREL to switch.
418 (Target_sparc::Scan::check_non_pic): Likewise.
419 (Target_sparc::Scan::local): Handle IFUNC symbols.
420 (Target_sparc::Scan::local): Likewise.
421 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
422 and plt_address_for_local.
423 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
424 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
425
13cf9988
DM
426 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
427 (class Output_data_reloc): Adjust calls to Output_reloc_type.
428 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
429 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
430 global relocs too.
431 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
432 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
433 calls.
434 * sparc.cc (Target_sparc::Scan::global): Likewise.
435 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
436
31821be0
CC
4372012-04-16 Cary Coutant <[email protected]>
438
439 * archive.cc (Library_base::should_include_member): Check for
440 --export-dynamic-symbol.
441 * options.h (class General_options): Add --export-dynamic-symbol.
442 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
443 --export-dynamic-symbol.
444 (Symbol_table::gc_mark_undef_symbols): Likewise.
445 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
446
2615994e
DM
4472012-04-12 David S. Miller <[email protected]>
448
449 * sparc.cc (Reloc::wdisp10): New relocation method.
450 (Reloc::h34): Likewise.
451 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
452 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
453 R_SPARC_WDISP10.
454 (Target_sparc::Scan::local): Likewise.
455 (Target_sparc::Scan::global): Likewise.
456 (Target_sparc::Relocate::relocate): Likewise.
457
6782735d
CC
4582012-04-09 Cary Coutant <[email protected]>
459
460 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
461 low_pc == 0.
462
8c7a0b00
ILT
4632012-04-06 Ian Lance Taylor <[email protected]>
464
465 * timer.cc: #include <unistd.h>.
466
58797674
RM
4672012-04-06 Roland McGrath <[email protected]>
468
469 * configure.in (AC_CHECK_HEADERS): Add locale.h.
470 * config.in: Regenerate.
471 * configure: Regenerate.
472
44350750
NC
4732012-04-05 Nick Clifton <[email protected]>
474
475 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
476 (AM_LC_MESSAGES): Add.
477 * aclocal.m4: Regenerate.
478 * config.in: Regenerate.
479 * configure: Regenerate.
480
c1027032
CC
4812012-03-21 Cary Coutant <[email protected]>
482
483 * Makefile.am: Add gdb-index.cc, gdb-index.h.
484 * Makefile.in: Regenerate.
485 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
486 (Sized_elf_reloc_mapper::symbol_section): New function.
487 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
488 (make_elf_reloc_mapper): New function.
489 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
490 (Dwarf_abbrev_table::do_read_abbrevs): New function.
491 (Dwarf_abbrev_table::do_get_abbrev): New function.
492 (Dwarf_ranges_table::read_ranges_table): New function.
493 (Dwarf_ranges_table::read_range_list): New function.
494 (Dwarf_pubnames_table::read_section): New function.
495 (Dwarf_pubnames_table::read_header): New function.
496 (Dwarf_pubnames_table::next_name): New function.
497 (Dwarf_die::Dwarf_die): New function.
498 (Dwarf_die::read_attributes): New function.
499 (Dwarf_die::skip_attributes): New function.
500 (Dwarf_die::set_name): New function.
501 (Dwarf_die::set_linkage_name): New function.
502 (Dwarf_die::attribute): New function.
503 (Dwarf_die::string_attribute): New function.
504 (Dwarf_die::int_attribute): New function.
505 (Dwarf_die::uint_attribute): New function.
506 (Dwarf_die::ref_attribute): New function.
507 (Dwarf_die::child_offset): New function.
508 (Dwarf_die::sibling_offset): New function.
509 (Dwarf_info_reader::check_buffer): New function.
510 (Dwarf_info_reader::parse): New function.
511 (Dwarf_info_reader::do_parse): New function.
512 (Dwarf_info_reader::do_read_string_table): New function.
513 (Dwarf_info_reader::lookup_reloc): New function.
514 (Dwarf_info_reader::get_string): New function.
515 (Dwarf_info_reader::visit_compilation_unit): New function.
516 (Dwarf_info_reader::visit_type_unit): New function.
517 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
518 Sized_elf_reloc_mapper.
519 (Sized_dwarf_line_info::symbol_section): Remove function.
520 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
521 (Sized_dwarf_line_info::read_line_mappings): Remove object
522 parameter, adjust callers.
523 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
524 * dwarf_reader.h: Include <sys/types.h>.
525 (class Track_relocs): Remove forward declaration.
526 (class Elf_reloc_mapper): New class.
527 (class Sized_elf_reloc_mapper): New class.
528 (class Dwarf_abbrev_table): New class.
529 (class Dwarf_range_list): New class.
530 (class Dwarf_ranges_table): New class.
531 (class Dwarf_pubnames_table): New class.
532 (class Dwarf_die): New class.
533 (class Dwarf_info_reader): New class.
534 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
535 (Sized_dwarf_line_info::symbol_section): Remove member function.
536 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
537 base class.
538 * gdb-index.cc: New source file.
539 * gdb-index.h: New source file.
540 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
541 and .debug_types sections, call Layout::add_to_gdb_index.
542 (Sized_relobj_incr::do_section_name): Implement.
543 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
544 return type; Implement.
545 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
546 return type.
547 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
548 parameter list and return type.
549 (Sized_incr_dynobj::do_section_contents): Likewise.
550 * layout.cc: Include gdb-index.h.
551 (Layout::Layout): Initialize gdb_index_data_.
552 (Layout::init_fixed_output_section): Check for .gdb_index section.
553 (Layout::add_to_gdb_index): New function. Instantiate.
554 * layout.h: Add forward declaration for class Gdb_index.
555 (Layout::add_to_gdb_index): New member function.
556 (Layout::gdb_index_data_): New data member.
557 * main.cc: Include gdb-index.h.
558 (main): Print statistics for gdb index.
559 * object.cc (Object::section_contents): Move code into
560 do_section_contents.
561 (need_decompressed_section): Check for sections needed when building
562 gdb index.
563 (build_compressed_section_map): Likewise.
564 (Sized_relobj_file::do_read_symbols): Need local symbols when building
565 gdb index.
566 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
567 sections; call Layout::add_to_gdb_index.
568 (Sized_relobj_file::do_decompressed_section_contents): Call
569 do_section_contents directly.
570 * object.h (Object::do_section_contents): Adjust parameter list and
571 return type.
572 (Object::do_decompressed_section_contents): Call do_section_contents
573 directly.
574 (Sized_relobj_file::do_section_contents): Adjust parameter list and
575 return type.
576 * options.h (class General_options): Add --gdb-index option.
577 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
578 list and return type.
579 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
580 * reloc.h (Track_relocs::checkpoint): New function.
581 (Track_relocs::reset): New function.
582
583 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
584 New test cases.
585 * testsuite/Makefile.in: Regenerate.
586 * testsuite/gdb_index_test.cc: New test source file.
587 * testsuite/gdb_index_test_1.sh: New test source file.
588 * testsuite/gdb_index_test_2.sh: New test source file.
589
647f1574
DK
5902012-03-19 Doug Kwan <[email protected]>
591
592 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 593 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
594 __exidx_start and __exidx_end. Make symbol table parameter
595 anonymous as it is not used.
596 * gold.cc (queue_middle_tasks): Call target hook to define any
597 target-specific symbols.
598 * target.h (Target::define_standard_symbols): New method.
599 (Target::do_define_standard_symbols): Same.
600 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
601 * testsuite/Makefile.in: Regenerate.
602 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
603 and __exidx_end.
604 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
605 relocations are generated for __exidx_start and __exidx_end.
606
7c6109da
DK
6072012-03-16 Doug Kwan <[email protected]>
608
609 * testsuite/Makefile.am: Disable test initpri3b.
610 * testsuite/Makefile.in: Regenerate.
611
7b8957f8
DK
6122012-03-15 Doug Kwan <[email protected]>
613
614 * arm.cc (Target_arm::got_section): Make .got section read-only
615 if -z now is given.
616
14dc9ef7
ILT
6172012-03-15 Ian Lance Taylor <[email protected]>
618
619 PR gold/13850
620 * layout.cc (Layout::make_output_section): Correctly mark
621 SHT_INIT_ARRAY, et. al., as relro.
622
fa40b62a
DK
6232012-03-14 Doug Kwan <[email protected]>
624
625 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
626 dynamic relocations for protected symbols in shared objects.
627
fd325007
ILT
6282012-03-13 Ian Lance Taylor <[email protected]>
629
630 * resolve.cc (Symbol_table::resolve): When merging common symbols,
631 keep the larger alignment.
632
e8dd54e1
CC
6332012-03-12 Cary Coutant <[email protected]>
634
635 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
636 handling of DW_LNE_define_file.
637
feb5f3b0
CC
6382012-03-12 Cary Coutant <[email protected]>
639
640 * reduced_debug_output.cc
641 (Output_reduced_debug_info_section::get_die_end): Add new FORM
642 codes to switch.
643
a1fb4256
CC
6442012-02-29 Cary Coutant <[email protected]>
645
646 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
647
5dd8762a
CC
6482012-02-29 Cary Coutant <[email protected]>
649
650 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
651 Call Object::decompressed_section_contents.
652 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
653 New dtor.
654 (Sized_dwarf_line_info::buffer_start_): New data member.
655 * merge.cc (Output_merge_data::do_add_input_section): Call
656 Object::decompressed_section_contents.
657 (Output_merge_string::do_add_input_section): Likewise.
658 * object.cc (need_decompressed_section): New function.
659 (build_compressed_section_map): Decompress sections needed later.
660 (Sized_relobj_file::do_decompressed_section_contents): New function.
661 (Sized_relobj_file::do_discard_decompressed_sections): New function.
662 * object.h (Object::decompressed_section_contents): New function.
663 (Object::discard_decompressed_sections): New function.
664 (Object::do_decompressed_section_contents): New function.
665 (Object::do_discard_decompressed_sections): New function.
666 (Compressed_section_info): New type.
667 (Compressed_section_map): Include decompressed section contents.
668 (Sized_relobj_file::do_decompressed_section_contents): New function.
669 (Sized_relobj_file::do_discard_decompressed_sections): New function.
670
7b5de7ee
CC
6712012-02-16 Cary Coutant <[email protected]>
672
673 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
674 * testsuite/Makefile.in: Regenerate.
675
f9fa4a63
CC
6762012-02-14 Cary Coutant <[email protected]>
677
678 * options.cc (General_options::finalize): Disallow -pie and -static.
679
2c175ebc
DK
6802012-02-03 Doug Kwan <[email protected]>
681
682 * arm.cc (Arm_relocate_functions::abs8,
683 Arm_relocate_functions::abs16): Use
684 Bits::has_signed_unsigned_overflow32.
685 (Arm_relocate_functions::thm_abs8): Correct range of
686 overflow check.
687 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
688 in assertions.
689
90cff06f
DK
6902012-02-02 Doug Kwan <[email protected]>
691
692 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
693 position independent outputs, not just shared objects.
694
63887f3d
L
6952012-01-30 H.J. Lu <[email protected]>
696
697 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
698 * configure: Regenerated.
699
bef2b434
ILT
7002012-01-27 Ian Lance Taylor <[email protected]>
701
702 * reloc.h (Bits): New class with static functions, copied from
703 namespace utils in arm.cc.
704 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
705 instead.
706
c335b55d
L
7072012-01-27 H.J. Lu <[email protected]>
708
709 * incremental.cc (write_info_blocks): Correct relocation offset.
710
41194d9f
L
7112012-01-27 H.J. Lu <[email protected]>
712
713 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
714 (Relocate::tls_gd_to_le): Likewise.
715
1bae613c
L
7162012-01-27 H.J. Lu <[email protected]>
717
718 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
719
24482ca0
L
7202012-01-27 H.J. Lu <[email protected]>
721
722 * configure.ac: Check if -mcmodel=medium works.
723 * configure: Regenerated.
724
c2c7840a
CC
7252012-01-24 Cary Coutant <[email protected]>
726
727 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
728 definition and ...
729 (read_unsigned_LEB_128_x): ... this new function.
730 (read_signed_LEB_128): Replaced with inline definition and ...
731 (read_signed_LEB_128_x): ... this new function.
732 * int_encoding.h (read_unsigned_LEB_128_x): New function.
733 (read_unsigned_LEB_128): Add inline definition.
734 (read_signed_LEB_128_x): New function.
735 (read_signed_LEB_128): Add inline definition.
736 * testsuite/Makefile.am (leb128_unittest): New unit test.
737 * testsuite/Makefile.in: Regenerate.
738 * testsuite/leb128_unittest.cc: New unit test.
739
833de760 7402012-01-23 Ian Lance Taylor <[email protected]>
9dee3b3c
ILT
741
742 PR gold/13617
743 * i386.cc (Target_i386::do_code_fill): When using a jmp
744 instruction, pad with nop instructions.
745 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
746
618d6666
L
7472012-01-22 H.J. Lu <[email protected]>
748
749 * x86_64.cc (gc_process_relocs): Add typename on types used in
750 template.
751 (scan_relocs): Likewise.
752 (relocate_section): Likewise.
753 (apply_relocation): Likewise.
754
3660ff06
L
7552012-01-10 H.J. Lu <[email protected]>
756
757 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
758 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
759 under x32.
760
fc51264f
L
7612012-01-09 H.J. Lu <[email protected]>
762
763 * x86_64.cc: Initial support for x32.
764
dd74ae06
CC
7652012-01-03 Cary Coutant <[email protected]>
766
767 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
768 Use abstract base class for GOT.
769 * gold/output.h (class Output_data_got_base): New abstract base class.
770 (class Output_data_got): Derive from new base class, adjust ctors.
771 (Output_data_got::reserve_slot): Make virtual; rename to
772 do_reserve_slot; Adjust callers.
773 * gold/target.h (Sized_target::init_got_plt_for_update): Return
774 pointer to abstract base class.
775 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
776
83896202
ILT
7772011-12-18 Ian Lance Taylor <[email protected]>
778
779 * object.h (Relobj::local_symbol_value): New function.
780 (Relobj::local_plt_offset): New function.
781 (Relobj::local_has_got_offset): New function.
782 (Relobj::local_got_offset): New function.
783 (Relobj::set_local_got_offset): New function.
784 (Relobj::do_local_symbol_value): New pure virtual function.
785 (Relobj::do_local_plt_offset): Likewise.
786 (Relobj::do_local_has_got_offset): Likewise.
787 (Relobj::do_local_got_offset): Likewise.
788 (Relobj::do_set_local_got_offset): Likewise.
789 (Sized_relobj::do_local_has_got_offset): Rename from
790 local_has_got_offset.
791 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
792 (Sized_relobj::do_set_local_got_offset): Rename from
793 set_local_got_offset.
794 (Sized_relobj_file::do_local_plt_offset): Rename from
795 local_plt_offset.
796 (Sized_relobj_file::do_local_symbol_value): New function.
797 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
798 local_plt_offset.
799 * output.cc (Output_data_got::Got_entry::write): Change object to
800 Relobj. Use local_symbol_value.
801 (Output_data_got::add_global_with_rel): Change rel_dyn to
802 Output_data_reloc_generic*. Use add_global_generic.
803 (Output_data_got::add_global_with_rela): Remove. Change all
804 callers to use add_global_with_rel.
805 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
806 Output_data_reloc_generic*. Use add_global_generic.
807 (Output_data_got::add_global_pair_with_rela): Remove. Change all
808 callers to use add_global_pair_with_rel.
809 (Output_data_got::add_local): Change object to Relobj*.
810 (Output_data_got::add_local_plt): Likewise.
811 (Output_data_got::add_local_with_rel): Change object to Relobj*,
812 change rel_dyn to Output_data_reloc_generic*. Use
813 add_local_generic.
814 (Output_data_got::add_local_with_rela): Remove. Change all
815 callers to use all_local_with_rel.
816 (Output_data_got::add_local_pair_with_rel): Change object to
817 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
818 add_output_section_generic.
819 (Output_data_got::add_local_pair_with_rela): Remove. Change all
820 callers to use add_local_pair_with_rel.
821 (Output_data_got::reserve_local): Change object to Relobj*.
822 * output.h: (class Output_data_reloc_generic): Add pure virtual
823 declarations for add_global_generic, add_local_generic,
824 add_output_section_generic.
825 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
826 functions for Output_data_reloc_generic. Update declarations for
827 changes listed in output.cc.
828 (class Output_data_got): Change template parameter to got_size.
829 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
830 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
831 function.
832 (Sized_relobj_incr::do_local_plt_offset): New function.
833 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
834 add_global_generic.
835
76677ad0
CC
8362011-12-17 Cary Coutant <[email protected]>
837
838 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
839 * resolve.cc (Symbol_table::resolve): Likewise.
840 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
841 arrays.
842 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
843
8b8dd8d5
ILT
8442011-12-16 Ian Lance Taylor <[email protected]>
845
846 * output.h (Output_data_reloc_generic::add): Only call
847 add_dynamic_reloc if this is a dynamic reloc section.
848
d55525b9
L
8492011-12-15 H.J. Lu <[email protected]>
850
851 PR gold/13505
852 * target-reloc.h (apply_relocation): Replace <64, false> with
853 <size, big_endian>.
854
ff81c7c1
NC
8552011-11-25 Nick Clifton <[email protected]>
856
857 * po/it.po: New Italian translation.
858
628f39be
SA
8592011-11-17 Sterling Augustine <[email protected]>
860
861 * script.cc (script_include_directive): Implement.
862 (read_script_file): New local variables name and search_path. Update
863 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
864 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
865 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
866
98ef3ea4
SA
8672011-11-11 Sterling Augustine <[email protected]>
868
869 * yyscript.y (section_cmd): Add support for INCLUDE directive.
870 (file_or_sections_cmd): Likewise.
871
f4a8b6d7
DK
8722011-11-11 Doug Kwan <[email protected]>
873
874 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
875 if --just-symbols is given.
876
29ab395d
DK
8772011-11-10 Doug Kwan <[email protected]>
878
879 PR gold/13362
880 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
881 when processing data relocs.
882 * reloc.h (Relocate_functions::rel_unaligned): New method.
883 (Relocate_functions::pcrel_unaligned): Ditto.
884 (Relocate_functions::rel32_unaligned): Ditto.
885 (Relocate_functions::pcrel32_unaligned): Ditto.
886
2c339f71
DK
8872011-11-09 Doug Kwan <[email protected]>
888
889 PR gold/13362
890 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
891 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
892 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
893 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
894 (Relocate_functions::rel_unaligned): New.
895 (Relocate_functions::rel32_unaligned): New.
896 * target-reloc.h (relocate_for_relocatable): Add code to handle
897 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
898 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
899 arm_unaligned_reloc_r): New targets.
900 * testsuite/Makefile.in: Regenerate.
901 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
902 linking.
903
3f3cddf1
ILT
9042011-11-02 Ian Lance Taylor <[email protected]>
905
906 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
907 NATIVE_LINKER.
908 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
909 * options.cc (General_options::finalize): Use library search path
910 from configure script if specified. If not native and no sysroot,
911 only search TOOLLIBDIR.
912 * options.h (Search_directory::Search_directory): Change name to
913 const std::string&.
914 (General_options::add_to_library_path_with_sysroot): Change arg to
915 const std::string&.
916 * configure, Makefile.in, config.in: Rebuild.
917
a8e2273b
ILT
9182011-11-02 Matthew Gretton-Dann <[email protected]>
919
920 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
921 we are working around the ARM1176 Erratum.
922 * options.h (General_options::fix_arm1176): Add option.
923 * testsuite/Makefile.am: Add testcases, and keep current ones
924 working.
925 * testsuite/Makefile.in: Regenerate.
926 * testsuite/arm_fix_1176.s: New file.
927 * testsuite/arm_fix_1176.sh: Likewise.
928
cd6eab1c
ILT
9292011-11-02 Matthew Gretton-Dann <[email protected]>
930
931 * arm.cc (Target_arm::Target_arm): Remove initialisation of
932 may_use_blx_.
933 (Target_arm::may_use_blx): Remove method.
934 (Target_arm::set_may_use_blx): Likewise.
935 (Target_arm::may_use_v4t_interworking): New method.
936 (Target_arm::may_use_v5t_interworking): Likewise.
937 (Target_arm::may_use_blx_): Remove member variable.
938 (Arm_relocate_functions::arm_branch_common): Check for v5T
939 interworking.
940 (Arm_relocate_functions::thumb_branch_common): Likewise.
941 (Reloc_stub::stub_type_for_reloc): Likewise.
942 (Target_arm::do_finalize_sections): Correct interworking checks.
943 * testsuite/Makefile.am: Add new tests.
944 * testsuite/Makefile.in: Regenerate.
945 * testsuite/arm_farcall_arm_arm.s: New test.
946 * testsuite/arm_farcall_arm_arm.sh: Likewise.
947 * testsuite/arm_farcall_arm_thumb.s: Likewise.
948 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
949 * testsuite/arm_farcall_thumb_arm.s: Likewise.
950 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
951 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
952 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
953
286adcf4
CC
9542011-10-31 Cary Coutant <[email protected]>
955
956 PR gold/13023
957 * expression.cc (Expression::eval_with_dot): Add
958 is_section_dot_assignment parameter.
959 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
960 absolute and assigning to dot within a section.
961 * script-sections.cc
962 (Output_section_element_assignment::set_section_addresses): Pass
963 dot_section to set_if_absolute.
964 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
965 as is_section_dot_assignment flag to eval_with_dot.
966 (Output_section_element_dot_assignment::set_section_addresses):
967 Likewise.
968 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
969 parameter. Also set value if relative to dot_section; set the
970 symbol's output_section.
971 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
972 parameter. Adjust all callers.
973 (Expression::eval_maybe_dot): Likewise.
974 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
975 Adjust all callers.
976 * testsuite/script_test_2.t: Test assignment of an absolute value
977 to dot within an output section element.
978
9634ed06
CC
9792011-10-31 Cary Coutant <[email protected]>
980
981 * options.h (class General_options): Add --[no-]gnu-unique options.
982 * symtab.cc (Symbol_table::sized_write_globals): Convert
983 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
984
de4101c7
CC
9852011-10-31 Cary Coutant <[email protected]>
986
987 PR gold/13359
988 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
989 unnecessary assertion.
990 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
991
7257cc92
ST
9922011-10-31 Sriraman Tallam <[email protected]>
993
994 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
995 gc_mark_symbol.
996 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
997 gc_mark_symbol.
998 Change to just keep the section associated with symbol.
999 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
1000 they are externally visible and --export-dynamic is turned on.
1001 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
1002
bfc34b3f
ILT
10032011-10-19 Ian Lance Taylor <[email protected]>
1004
1005 PR gold/13163
1006 * script-sections.cc
1007 (Output_section_element_dot_assignment::needs_output_section): New
1008 function.
1009
ea0d8c47
ILT
10102011-10-19 Ian Lance Taylor <[email protected]>
1011
1012 PR gold/13204
1013 * layout.cc (Layout::segment_precedes): Don't assert failure if a
1014 --section-start option was seen.
1015 * options.h (General_options::any_section_start): New function.
1016
abd242a9
DM
10172011-10-18 David S. Miller <[email protected]>
1018
1019 PR binutils/13301
1020 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
1021 member to track relocation locations that have moved during TLS
1022 reloc optimizations.
1023 (Target_sparc::Relocate::Relocate): Initialize to NULL.
1024 (Target_sparc::Relocate::relocate): Adjust view down by 4
1025 bytes if it matches reloc_adjust_addr_.
1026 (Target_sparc::Relocate::relocate_tls): Always move the
1027 __tls_get_addr call delay slot instruction forward 4 bytes when
1028 performing relaxation.
1029
bab9090f
CC
10302011-10-18 Cary Coutant <[email protected]>
1031
1032 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
1033 (Output_file::map_no_anonymous): Check for non-zero
1034 return code from posix_fallocate.
1035
f7c5b166
CC
10362011-10-17 Cary Coutant <[email protected]>
1037
1038 PR gold/13245
1039 * plugin.cc (is_visible_from_outside): Check for symbols
1040 referenced from dynamic objects.
1041 * resolve.cc (Symbol_table::resolve): Don't count references
1042 from dynamic objects as references from real ELF files.
1043 * testsuite/plugin_test_2.sh: Adjust expected result.
1044
b490c0bb
CC
10452011-10-17 Cary Coutant <[email protected]>
1046
1047 * gold.cc: Include timer.h.
1048 (queue_middle_tasks): Stamp time.
1049 (queue_final_tasks): Likewise.
1050 * main.cc (main): Store timer in parameters. Print timers
1051 for each pass.
1052 * parameters.cc (Parameters::Parameters): Initialize timer_.
1053 (Parameters::set_timer): New function.
1054 (set_parameters_timer): New function.
1055 * parameters.h (Parameters::set_timer): New function.
1056 (Parameters::timer): New function.
1057 (Parameters::timer_): New data member.
1058 (set_parameters_timer): New function.
1059 * timer.cc (Timer::stamp): New function.
1060 (Timer::get_pass_time): New function.
1061 * timer.h (Timer::stamp): New function.
1062 (Timer::get_pass_time): New function.
1063 (Timer::pass_times_): New data member.
1064
f475cf7b
CC
10652011-10-17 Cary Coutant <[email protected]>
1066
1067 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
1068 task for members of lib groups.
1069
cdd7e244
CC
10702011-10-17 Cary Coutant <[email protected]>
1071
1072 PR gold/13288
4f95c8b4 1073 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
1074 (File_read::make_view): Move bounds check (replace with assert)...
1075 (File_read::find_or_make_view): ... to here.
1076
dfb45471
CC
10772011-10-12 Cary Coutant <[email protected]>
1078
4f95c8b4 1079 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
1080 ::read returns less than requested size.
1081
53bbcc1b
CC
10822011-10-10 Cary Coutant <[email protected]>
1083
4f95c8b4 1084 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
1085 Initialize defined_count_.
1086 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
1087 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
1088 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
1089 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
1090 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 1091 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
1092 member.
1093 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 1094 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
1095 Return zeroes instead of internal error.
1096
397b129b
CC
10972011-10-10 Cary Coutant <[email protected]>
1098
1099 PR gold/13249
4f95c8b4 1100 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 1101 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 1102 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
1103 (Output_reloc::type_): Adjust size of bit field.
1104 (Output_reloc::use_plt_offset_): New bit field.
1105 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
1106 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
1107 flag. Adjust all callers.
4f95c8b4 1108 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
1109 creating RELATIVE relocations.
1110
d5698657
NC
11112011-10-10 Nick Clifton <[email protected]>
1112
1113 * po/es.po: Updated Spanish translation.
1114 * po/fi.po: Updated Finnish translation.
1115
6a59a5c2
DN
11162011-10-03 Diego Novillo <[email protected]>
1117
1118 * options.cc (parse_uint): Fix dereference of RETVAL.
1119
f0558624
ST
11202011-09-29 Sriraman Tallam <[email protected]>
1121
1122 * layout.h (section_order_map_): New member.
1123 (get_section_order_map): New member function.
1124 * output.cc (Output_section::add_input_section): Check for patterns
1125 only when --section-ordering-file is specified.
1126 * gold.cc (queue_middle_tasks): Delay updating order of sections till
1127 output_sections have been formed.
1128 * layout.cc (Layout_Layout): Initialize section_order_map_.
1129 * plugin.cc (update_section_order): Store order in order_map. Do not
1130 update the order.
1131 * testsuite/Makefile.am: Add test case for plugin_final_layout.
1132 * testsuite/Makefile.in: Regenerate.
1133 * testsuite/plugin_section_order.c: New file.
1134 * testsuite/plugin_final_layout.cc: New file.
1135 * testsuite/plugin_final_layout.sh: New file.
1136
a7dac153
CC
11372011-09-29 Cary Coutant <[email protected]>
1138
4f95c8b4 1139 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 1140 Check for NULL.
4f95c8b4 1141 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
1142 symbols during incremental update.
1143 (Symbol_table::add_from_dynobj): Likewise.
1144
eebd87a5
ILT
11452011-09-27 Viktor Kutuzov <[email protected]>
1146 Ian Lance Taylor <[email protected]>
1147
1148 * symtab.cc (Symbol_table::define_special_symbol): Always
1149 canonicalize version string.
1150
403a3331
CC
11512011-09-26 Cary Coutant <[email protected]>
1152
4f95c8b4
CC
1153 * gold.cc (queue_initial_tasks): Move option checks ...
1154 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
1155 some options; make others fatal.
1156
235061c2
CC
11572011-09-26 Cary Coutant <[email protected]>
1158
1159 gcc PR lto/47247
1160 * plugin.cc (get_symbols_v2): New function.
1161 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
1162 (is_referenced_from_outside): New function.
1163 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
1164 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
1165 (get_symbols): Pass version parameter.
1166 (get_symbols_v2): New function.
1167 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
1168 parameter.
1169 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
1170 (onload): Add LDPT_GET_SYMBOLS_V2.
1171 (all_symbols_read_hook): Use get_symbols_v2; check for
1172 LDPR_PREVAILING_DEF_IRONLY_EXP.
1173 * testsuite/plugin_test_3.sh: Update expected results.
1174
dc87f620
ILT
11752011-09-23 Simon Baldwin <[email protected]>
1176
1177 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
1178 configuration options.
1179 * configure: Regenerate.
1180 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
1181 * Makefile.in: Regenerate.
1182 * testsuite/Makefile.in: Regenerate.
1183
a8279f82
ST
11842011-09-19 Sriraman Tallam <[email protected]>
1185
1186 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
1187
0c9350c8
CC
11882011-09-19 Cary Coutant <[email protected]>
1189
1190 * incremental.cc (can_incremental_update): Fix typo in comment.
1191 * incremental.h (can_incremental_update): Likewise.
1192
aa06ae28
CC
11932011-09-18 Cary Coutant <[email protected]>
1194
1195 * incremental.cc (can_incremental_update): New function.
1196 * incremental.h (can_incremental_update): New function.
1197 * layout.cc (Layout::init_fixed_output_section): Call it.
1198 (Layout::make_output_section): Don't allow patch space in .eh_frame.
1199 * object.cc (Sized_relobj_file::do_layout): Call
1200 can_incremental_update.
1201
ebb300b2
CC
12022011-09-13 Cary Coutant <[email protected]>
1203
1204 * configure.ac: Check for glibc support for gnu_indirect_function
1205 support with static linking, setting automake conditional
1206 IFUNC_STATIC.
1207 * Makefile.in: Regenerate.
1208 * configure: Regenerate.
1209
1210 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
1211 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
1212 for IFUNC_STATIC.
1213 * testsuite/Makefile.in: Regenerate.
1214
1206d0d5
CC
12152011-09-13 Cary Coutant <[email protected]>
1216
1217 * incremental.cc (Sized_relobj_incr::do_layout): Call
1218 report_comdat_group for kept comdat sections.
1219 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
1220 * testsuite/Makefile.in: Regenerate.
1221 * testsuite/incr_comdat_test_1.cc: New source file.
1222 * testsuite/incr_comdat_test_2_v1.cc: New source file.
1223 * testsuite/incr_comdat_test_2_v2.cc: New source file.
1224 * testsuite/incr_comdat_test_2_v3.cc: New source file.
1225
40b29874
ILT
12262011-09-13 Ian Lance Taylor <[email protected]>
1227
1228 * object.cc (Sized_relobj_file::do_layout): Remove unused local
1229 variable external_symbols_offset.
1230
1b045aac
ILT
12312011-09-12 Ian Lance Taylor <[email protected]>
1232
1233 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
1234 triggered if object has no symbols.
1235
24c6c55a
DM
12362011-09-09 David S. Miller <[email protected]>
1237
1238 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
1239 (Output_fill_debug_line::do_write): Likewise.
1240
66570254
CC
12412011-08-29 Cary Coutant <[email protected]>
1242
1243 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
1244 casts to match formatting specs.
1245 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
1246
8ea8cd50
CC
12472011-08-26 Cary Coutant <[email protected]>
1248
1249 * layout.cc (Free_list::allocate): Provide guarantee of minimum
1250 remaining hole size when allocating.
1251 (Layout::make_output_section): Set fill methods for debug sections.
1252 * layout.h (Free_list::Free_list_node): Move from private to
1253 public.
1254 (Free_list::set_min_hole_size): New function.
1255 (Free_list::begin, Free_list::end): New functions.
1256 (Free_list::min_hole_): New data member.
1257 * output.cc: Include dwarf.h.
1258 (Output_fill_debug_info::do_minimum_hole_size): New function.
1259 (Output_fill_debug_info::do_write): New function.
1260 (Output_fill_debug_line::do_minimum_hole_size): New function.
1261 (Output_fill_debug_line::do_write): New function.
1262 (Output_section::Output_section): Initialize new data member.
1263 (Output_section::set_final_data_size): Ensure patch space is larger
1264 than minimum hole size.
1265 (Output_section::do_write): Fill holes in debug sections.
1266 * output.h (Output_fill): New class.
1267 (Output_fill_debug_info): New class.
1268 (Output_fill_debug_line): New class.
1269 (Output_section::set_free_space_fill): New function.
1270 (Output_section::free_space_fill_): New data member.
1271 * testsuite/Makefile.am (incremental_test_3): Add
1272 --incremental-patch option.
1273 (incremental_test_4): Likewise.
1274 (incremental_test_5): Likewise.
1275 (incremental_test_6): Likewise.
1276 (incremental_copy_test): Likewise.
1277 (incremental_common_test_1): Likewise.
1278 * testsuite/Makefile.in: Regenerate.
1279
7cf80422
NC
12802011-08-26 Nick Clifton <[email protected]>
1281
1282 * po/es.po: Updated Spanish translation.
1283
c3f7b0e5
CC
12842011-08-01 Cary Coutant <[email protected]>
1285
1286 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
1287 * gold/testsuite/Makefile.in: Regenerate.
1288 * gold/testsuite/justsyms_exec.c: New source file.
1289 * gold/testsuite/justsyms_lib.c: New source file.
1290
9590bf25
CC
12912011-08-01 Cary Coutant <[email protected]>
1292
1293 * layout.cc (Layout::set_segment_offsets): Don't realign text
1294 segment if -Ttext was specified.
1295 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
1296 file type.
1297 * object.h (Sized_relobj_file::e_type): New function.
1298 (Sized_relobj_file::e_type_): New data member.
1299 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
1300 base address for ET_EXEC files.
1301 * target.cc (Target::do_make_elf_object_implementation): Allow
1302 ET_EXEC files with --just-symbols option.
1303
dcd8d12e
CC
13042011-07-28 Cary Coutant <[email protected]>
1305
1306 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
1307 Add thread_number parameter.
1308 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
1309 * workqueue-threads.cc
1310 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
1311 current thread if its thread number is greater than desired thread
1312 count.
1313 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
1314 Add thread_number parameter.
1315 (Workqueue::should_cancel_thread): Likewise.
1316 (Workqueue::find_runnable_or_wait): Pass thread_number to
1317 should_cancel_thread.
1318 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
1319 parameter.
1320
804eb480
ST
13212011-07-22 Sriraman Tallam <[email protected]>
1322
1323 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
1324 only after checking if it cannot be forced local.
1325 * symtab.h (is_externally_visible): Check if the symbol is not forced
1326 local.
1327
f1ddb600
ILT
13282011-07-15 Ian Lance Taylor <[email protected]>
1329
1330 * options.h (class General_options): Add --print-output-format.
1331 Move -EL next to -EB, for better --help output.
1332 * target-select.cc: Include <cstdio>, "options.h", and
1333 "parameters.h".
1334 (Target_selector::do_target_bfd_name): New function.
1335 (print_output_format): New function.
1336 * target-select.h (class Target_selector): Update declarations.
1337 (Target_selector::target_bfd_name): New function.
1338 (print_output_format): Declare.
1339 * main.cc: Include "target-select.h".
1340 (main): Handle --print-output-format.
1341 * gold.cc: Include "target-select.h".
1342 (queue_initial_tasks): Handle --print-output-format when there are
1343 no input files.
1344 * parameters.cc (parameters_force_valid_target): Give a better
1345 error message if -EB/-EL does not match target.
1346 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
1347 function.
1348
7d172687
ILT
13492011-07-15 Ian Lance Taylor <[email protected]>
1350
1351 * i386.cc (class Output_data_plt_i386): Add layout_ field.
1352 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
1353 (Output_data_plt_i386::do_write): Write address of .dynamic
1354 section to first entry in .got.plt section.
1355 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
1356 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1357 Initialize layout_.
1358 (Output_data_plt_x86_64::do_write): Write address of .dynamic
1359 section to first entry in .got.plt section.
1360 * layout.h (Layout::dynamic_section): New function.
1361
e9552f7e
ST
13622011-07-13 Sriraman Tallam <[email protected]>
1363
1364 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
1365 to claim_file call.
1366 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
1367 input_section_position_, and input_section_glob_.
1368 (read_layout_from_file): Call function section_ordering_specified.
1369 * layout.h (is_section_ordering_specified): New function.
1370 (section_ordering_specified): New function.
1371 (section_ordering_specified_): New boolean member.
1372 * main.cc(main): Call load_plugins after layout object is defined.
1373 * output.cc (Output_section::add_input_section): Use
1374 function section_ordering_specified to check if section ordering is
1375 needed.
1376 * output.cc (Output_section::add_relaxed_input_section): Use
1377 function section_ordering_specified to check if section ordering is
1378 needed.
1379 (Output_section::update_section_layout): New function.
1380 (Output_section::sort_attached_input_sections): Check if input section
1381 must be reordered.
1382 * output.h (Output_section::update_section_layout): New function.
1383 * plugin.cc (get_section_count): New function.
1384 (get_section_type): New function.
1385 (get_section_name): New function.
1386 (get_section_contents): New function.
1387 (update_section_order): New function.
58797674 1388 (allow_section_ordering): New function.
e9552f7e
ST
1389 (Plugin::load): Add the new interfaces to the transfer vector.
1390 (Plugin_manager::load_plugins): New parameter.
1391 (Plugin_manager::all_symbols_read): New parameter.
1392 (Plugin_manager::claim_file): New parameter. Save the elf object for
1393 unclaimed objects.
1394 (Plugin_manager::get_elf_object): New function.
1395 (Plugin_manager::get_view): Change to directly use the bool to check
1396 if get_view is called from claim_file_hook.
1397 * plugin.h (input_objects): New function
1398 (Plugin__manager::load_plugins): New parameter.
1399 (Plugin_manager::claim_file): New parameter.
1400 (Plugin_manager::get_elf_object): New function.
1401 (Plugin_manager::in_claim_file_handler): New function.
1402 (Plugin_manager::in_claim_file_handler_): New member.
1403 (layout): New function.
1404 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
1405 handler with an extra parameter. Make the elf object before calling
1406 claim_file handler.
1407 * testsuite/plugin_test.c (get_section_count): New function pointer.
1408 (get_section_type): New function pointer.
1409 (get_section_name): New function pointer.
1410 (get_section_contents): New function pointer.
1411 (update_section_order): New function pointer.
1412 (allow_section_ordering): New function pointer.
1413 (onload): Check if the new interfaces exist.
1414
9446efde
ILT
14152011-07-13 Ian Lance Taylor <[email protected]>
1416
1417 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
1418 relro section.
1419 * x86_64.cc (Target_x86_64::got_section): Likewise.
1420 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
1421 (relro_now_test_SOURCES): New variable.
1422 (relro_now_test_DEPENDENCIES): New variable.
1423 (relro_now_test_LDFLAGS): New variable.
1424 (relro_now_test_LDADD): New variable.
1425 (relro_now_test.so): New target.
1426 * testsuite/Makefile.in: Rebuild.
1427
07aa62f2
ILT
14282011-07-12 Ian Lance Taylor <[email protected]>
1429
1430 PR gold/12980
1431 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
1432 GLOB_DAT relocation rather than a RELATIVE relocation for a
1433 protected symbol when creating a shared library.
1434 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
1435 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
1436 * testsuite/protected_main_1.cc (main): Test that protected
1437 function has same address.
1438
e2153196
ILT
14392011-07-11 Ian Lance Taylor <[email protected]>
1440
1441 PR gold/12979
1442 * options.h (class General_options): Add -Bgroup.
1443 * options.cc (General_options::finalize): If -Bgroup is set,
1444 default to --unresolved-symbols=report-all.
1445 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
1446 * target-reloc.h (issue_undefined_symbol_error): Handle
1447 --unresolved-symbols=report-all.
1448
6daf5215
ILT
14492011-07-08 Ian Lance Taylor <[email protected]>
1450
1451 PR gold/11985
1452 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
1453 if linker script discards key sections.
1454 (Layout::create_dynamic_symtab): Likewise.
1455 (Layout::assign_local_dynsym_offsets): Likewise.
1456 (Layout::sized_create_version_sections): Likewise.
1457 (Layout::create_interp): Likewise.
1458 (Layout::finish_dynamic_section): Likewise.
1459 (Layout::set_dynamic_symbol_size): Likewise.
1460
beabb2c6
ILT
14612011-07-08 Ian Lance Taylor <[email protected]>
1462
1463 PR gold/12386
1464 * options.h (class General_options): Add --unresolved-symbols.
1465 * target-reloc.h (issue_undefined_symbol_error): Check
1466 --unresolved-symbols. Add comments.
1467
9c16daf1
ILT
14682011-07-08 Ian Lance Taylor <[email protected]>
1469
1470 * testsuite/odr_violation2.cc (Ordering::operator()): Make
1471 expression more complex.
1472
191f1a2d
ILT
14732011-07-08 Ian Lance Taylor <[email protected]>
1474
1475 PR gold/11317
1476 * target-reloc.h (issue_undefined_symbol_error): New inline
1477 function, broken out of relocate_section.
1478 (relocate_section): Call issue_undefined_symbol_error.
1479 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1480 there is no TLS segment if we are about to issue an undefined
1481 symbol error.
1482 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1483
62855347
ILT
14842011-07-08 Ian Lance Taylor <[email protected]>
1485
1486 PR gold/12279
1487 * resolve.cc (Symbol_table::should_override): Add fromtype
1488 parameter. Change all callers. Give error when linking together
1489 TLS and non-TLS symbol.
1490 (Symbol_table::should_override_with_special): Add fromtype
1491 parameter. Change all callers.
1492 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1493 there is no TLS segment if we have reported some errors.
1494 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1495
67181c72
ILT
14962011-07-08 Ian Lance Taylor <[email protected]>
1497
1498 PR gold/12372
1499 * target.h (Target::plt_address_for_global): New function.
1500 (Target::plt_address_for_local): New function.
1501 (Target::plt_section_for_global): Remove.
1502 (Target::plt_section_for_local): Remove.
1503 (Target::do_plt_address_for_global): New virtual function.
1504 (Target::do_plt_address_for_local): New virtual function.
1505 (Target::do_plt_section_for_global): Remove.
1506 (Target::do_plt_section_for_local): Remove.
1507 (Target::register_global_plt_entry): Add Symbol_table and Layout
1508 parameters.
1509 * output.cc (Output_data_got::Got_entry::write): Use
1510 plt_address_for_global and plt_address_for_local.
1511 * layout.cc (Layout::add_target_dynamic_tags): Use size and
1512 address of output section.
1513 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
1514 got_irelative_, and irelative_count_ fields. Update
1515 declarations.
1516 (Output_data_plt_i386::has_irelative_section): New function.
1517 (Output_data_plt_i386::entry_count): Add irelative_count_.
1518 (Output_data_plt_i386::set_final_data_size): Likewise.
1519 (class Target_i386): Add got_irelative_ and rel_irelative_
1520 fields. Update declarations.
1521 (Target_i386::Target_i386): Initialize new fields.
1522 (Target_i386::do_plt_address_for_global): New function replacing
1523 do_plt_section_for_global.
1524 (Target_i386::do_plt_address_for_local): New function replacing
1525 do_plt_section_for_local.
1526 (Target_i386::got_section): Create got_irelative_.
1527 (Target_i386::rel_irelative_section): New function.
1528 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
1529 fields. Don't define __rel_iplt_{start,end}.
1530 (Output_data_plt_i386::add_entry): Add symtab and layout
1531 parameters. Change all callers. Use different PLT and GOT for
1532 IFUNC symbols.
1533 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
1534 layout parameters. Change all callers. Use different PLT and
1535 GOT.
1536 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
1537 (Output_data_plt_i386::rel_irelative): New function.
1538 (Output_data_plt_i386::address_for_global): New function.
1539 (Output_data_plt_i386::address_for_local): New function.
1540 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
1541 IRELATIVE GOT when changing IFUNC GOT entries.
1542 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
1543 reloc.
1544 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
1545 if we didn't create an IRELATIVE GOT.
1546 (Target_i386::Relocate::relocate): Use plt_address_for_global and
1547 plt_address_for_local.
1548 (Target_i386::do_dynsym_value): Use plt_address_for_global.
1549 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
1550 got_irelative_, and irelative_count_ fields. Update
1551 declarations.
1552 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1553 Initialize new fields. Remove symtab parameter. Change all
1554 callers.
1555 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
1556 irelative_count_.
1557 (Output_data_plt_x86_64::has_irelative_section): New function.
1558 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
1559 (class Target_x86_64): Add got_irelative_ and rel_irelative_
1560 fields. Update declarations.
1561 (Target_x86_64::Target_x86_64): Initialize new fields.
1562 (Target_x86_64::do_plt_address_for_global): New function replacing
1563 do_plt_section_for_global.
1564 (Target_x86_64::do_plt_address_for_local): New function replacing
1565 do_plt_section_for_local.
1566 (Target_x86_64::got_section): Create got_irelative_.
1567 (Target_x86_64::rela_irelative_section): New function.
1568 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
1569 all callers. Don't create __rel_iplt_{start,end}.
1570 (Output_data_plt_x86_64::add_entry): Add symtab and layout
1571 parameters. Change all callers. Use different PLT and GOT for
1572 IFUNC symbols.
1573 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
1574 layout parameters. Change all callers. Use different PLT and
1575 GOT.
1576 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
1577 parameters. Change all callers. Use different PLT and GOT for
1578 IFUNC symbols.
1579 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
1580 (Output_data_plt_x86_64::rela_irelative): New function.
1581 (Output_data_plt_x86_64::address_for_global): New function.
1582 (Output_data_plt_x86_64::address_for_local): New function.
1583 (Output_data_plt_x86_64::set_final_data_size): Likewise.
1584 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
1585 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
1586 (Target_x86_64::register_global_plt_entry): Add symtab and layout
1587 parameters.
1588 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
1589 reloc.
1590 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
1591 symbols if we didn't create an IRELATIVE GOT.
1592 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
1593 plt_address_for_local.
1594 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
1595 * testsuite/ifuncvar1.c: New test file.
1596 * testsuite/ifuncvar2.c: New test file.
1597 * testsuite/ifuncvar3.c: New test file.
1598 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
1599 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
1600 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
1601 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
1602 * testsuite/Makefile.in: Rebuild.
1603
33c15b45
CC
16042011-07-07 Cary Coutant <[email protected]>
1605
1606 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
1607 (two_file_test_1_ndebug.o): Likewise.
1608 (two_file_test_1b_ndebug.o): Likewise.
1609 (two_file_test_2_ndebug.o): Likewise.
1610 (two_file_test_main_ndebug.o): Likewise.
1611 (incremental_test_2): Link with no-debug versions.
1612
f48b5fb7
CC
16132011-07-06 Cary Coutant <[email protected]>
1614
1615 * gold/incremental.cc
1616 (Output_section_incremental_inputs::write_info_blocks): Check for
1617 hidden and internal symbols.
1618
221597a5
CC
16192011-07-06 Cary Coutant <[email protected]>
1620
1621 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
1622 Check disposition for startup file.
1623 (Incremental_inputs::report_command_line): Ignore
1624 --incremental-startup-unchanged option.
1625 * options.cc (General_options::parse_incremental_startup_unchanged):
1626 New function.
1627 (General_options::General_options): Initialize new data member.
1628 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
1629 (General_options): Add --incremental-startup-unchanged option.
1630 (General_options::incremental_startup_disposition): New function.
1631 (General_options::incremental_startup_disposition_): New data member.
1632
e24719f6
CC
16332011-07-06 Cary Coutant <[email protected]>
1634
1635 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
1636 input file index to Script_info ctor.
1637 (Sized_incremental_binary::do_file_has_changed): Find the
1638 command-line argument for files named in scripts.
1639 * incremental.h (Script_info::Script_info): New ctor
1640 with input file index.
1641 (Script_info::input_file_index): New function.
1642 (Script_info::input_file_index_): New data member.
1643 (Incremental_binary::get_library): Add const.
1644 (Incremental_binary::get_script_info): Add const.
1645 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
1646 * testsuite/Makefile.am (incremental_test_5): New test case.
1647 (incremental_test_6): New test case.
1648 * testsuite/Makefile.in: Regenerate.
1649
8f7c81e8
CC
16502011-07-06 Cary Coutant <[email protected]>
1651
1652 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
1653 debug output when command lines differ.
1654
9fbd3822
CC
16552011-07-06 Cary Coutant <[email protected]>
1656
1657 * incremental.cc (Incremental_inputs::report_command_line): Ignore
1658 --incremental-patch option.
1659 * layout.cc (Free_list::allocate): Extend allocation beyond original
1660 end if enabled.
1661 (Layout::make_output_section): Mark sections that should get
1662 patch space.
1663 * options.cc (parse_percent): New function.
1664 * options.h (parse_percent): New function.
1665 (DEFINE_percent): New macro.
1666 (General_options): Add --incremental-patch option.
1667 * output.cc (Output_section::Output_section): Initialize new data
1668 members.
1669 (Output_section::add_input_section): Print section name when out
1670 of patch space.
1671 (Output_section::add_output_section_data): Likewise.
1672 (Output_section::set_final_data_size): Add patch space when
1673 doing --incremental-full.
1674 (Output_section::do_reset_address_and_file_offset): Remove patch
1675 space.
1676 (Output_segment::set_section_list_addresses): Print debug output
1677 only if --incremental-update.
1678 * output.h (Output_section::set_is_patch_space_allowed): New function.
1679 (Output_section::is_patch_space_allowed_): New data member.
1680 (Output_section::patch_space_): New data member.
1681 * parameters.cc (Parameters::incremental_full): New function.
1682 * parameters.h (Parameters::incremental_full): New function
1683 * testsuite/Makefile.am (incremental_test_2): Add test for
1684 --incremental-patch option.
1685 * testsuite/Makefile.in: Regenerate.
1686 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
1687 (t18): Remove function body.
1688
f6cccc2c
DK
16892011-07-05 Doug Kwan <[email protected]>
1690
1691 PR gold/12771
1692 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
1693 Arm_Address type for relocation result.
1694 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
1695 overflow check.
1696 (Arm_relocate_functions::abs32): Use unaligned access.
1697 (Arm_relocate_functions::rel32): Ditto.
1698 (Arm_relocate_functions::prel31): Ditto.
1699 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
1700 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
1701 static data relocations.
1702 * testsuite/Makefile.in: Regnerate.
1703 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
1704
28a13fec
ILT
17052011-07-05 Ian Lance Taylor <[email protected]>
1706
1707 PR gold/12392
1708 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
1709 symbols if necessary.
1710 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
1711
24d47b34
ILT
17122011-07-05 Ian Lance Taylor <[email protected]>
1713
1714 PR gold/12952
1715 * resolve.cc (Symbol::override_base_with_special): Simply override
1716 version with special symbol version, ignoring previous version.
1717
41f9cbbe
ILT
17182011-07-05 Ian Lance Taylor <[email protected]>
1719
1720 * object.cc (Sized_relobj_file::include_section_group): Add
1721 information to comment about signature location.
1722
886288f1
ILT
17232011-07-02 Ian Lance Taylor <[email protected]>
1724
1725 PR gold/12957
1726 * options.h (class General_options): Add -f and -F.
1727 * options.cc (General_options::finalize): Fatal error if -f/-F
1728 are used without -shared.
1729 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
1730
ae3a6d4f
ILT
17312011-07-02 Ian Lance Taylor <[email protected]>
1732
1733 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
1734
21131061
ILT
17352011-07-01 Ian Lance Taylor <[email protected]>
1736
1737 PR gold/12525
1738 PR gold/12952
1739 * resolve.cc (Symbol::override_base_with_special): Don't override
1740 the version if the overriding symbol has a different name.
1741 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
1742 all callers. If we give an error about an undefined version,
1743 define the base version if necessary.
1744 * dynobj.h (class Versions): Update declaration.
1745 * testsuite/weak_alias_test_5.cc: New file.
1746 * testsuite/weak_alias_test.script: New file.
1747 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
1748 and versioned_alias have the right value, and call t2.
1749 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
1750 weak_alias_test_5.so.
1751 (weak_alias_test_LDADD): Likewise.
1752 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
1753 * testsuite/Makefile.in: Rebuild.
1754
611062c0
ILT
17552011-07-01 Ian Lance Taylor <[email protected]>
1756
1757 PR gold/12525
1758 * options.h (class General_options): Support -z notext.
1759 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
1760 -Wl,-z,notext.
1761 (two_file_shared_nonpic.so): Likewise.
1762 (two_file_shared_mixed.so): Likewise.
1763 (two_file_shared_mixed_1.so): Likewise.
1764 (weak_undef_lib_nonpic.so): Likewise.
1765 (alt/weak_undef_lib_nonpic.so): Likewise.
1766 (tls_test_shared_nonpic.so): Likewise.
1767 * testsuite/Makefile.in: Rebuild.
1768
328c7c2f
ILT
17692011-07-01 Ian Lance Taylor <[email protected]>
1770
1771 PR gold/12525
1772 * configure.ac: Test whether static linking works, setting
1773 the automake conditional HAVE_STATIC.
1774 * testsuite/Makefile.am: Disable tests using -static if
1775 HAVE_STATIC is not true.
1776 * configure, testsuite/Makefile.in: Rebuild.
1777
02d7cd44
ILT
17782011-07-01 Ian Lance Taylor <[email protected]>
1779
1780 PR gold/12525
1781 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
1782 Assert if we see DW_EH_PE_indirect.
1783 * target.h (Target::ehframe_datarel_base): New function.
1784 (Target::do_ehframe_datarel_base): New target function.
1785 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
1786 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
1787 function.
1788
07a60597
ILT
17892011-07-01 Ian Lance Taylor <[email protected]>
1790
1791 PR gold/12571
1792 * options.h (class General_options): Add
1793 --ld-generated-unwind-info.
1794 * ehframe.cc (Fde::write): Add address parameter. Change all
1795 callers. If associated with PLT, fill in address and size.
1796 (Cie::set_output_offset): Only add merge mapping if there is an
1797 object.
1798 (Cie::write): Add address parameter. Change all callers.
1799 (Eh_frame::add_ehframe_for_plt): New function.
1800 * ehframe.h (class Fde): Update declarations. Move shndx_ and
1801 input_offset_ fields into union u_, with new plt field.
1802 (Fde::Fde): Adjust for new union field.
1803 (Fde::Fde) [Output_data version]: New constructor.
1804 (Fde::add_mapping): Only add merge mapping if there is an object.
1805 (class Cie): Update declarations.
1806 (class Eh_frame): Declare add_ehframe_for_plt.
1807 * layout.cc (Layout::layout_eh_frame): Break out code into
1808 make_eh_frame_section, and call it.
1809 (Layout::make_eh_frame_section): New function.
1810 (Layout::add_eh_frame_for_plt): New function.
1811 * layout.h (class Layout): Update declarations.
1812 * merge.cc (Merge_map::add_mapping): Add assertion.
1813 * i386.cc: Include "dwarf.h".
1814 (class Output_data_plt_i386): Make first_plt_entry,
1815 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
1816 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1817 and plt_eh_frame_fde.
1818 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
1819 boundary. Call add_eh_frame_for_plt if appropriate.
1820 * x86_64.cc: Include "dwarf.h".
1821 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
1822 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
1823 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1824 and plt_eh_frame_fde.
1825 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
1826 appropriate.
1827
14788a3f
ILT
18282011-06-29 Ian Lance Taylor <[email protected]>
1829
1830 PR gold/12629
1831 * object.cc (Sized_relobj_file::layout_section): Change shdr
1832 parameter to be const.
1833 (Sized_relobj_file::layout_eh_frame_section): New function, broken
1834 out of do_layout.
1835 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
1836 appropriate. Call layout_eh_frame_section.
1837 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
1838 sections.
1839 * object.h (class Sized_relobj_file): Update declarations.
1840
6c21fce1
ILT
18412011-06-29 Ian Lance Taylor <[email protected]>
1842
37e41b03 1843 PR gold/12652
6c21fce1
ILT
1844 * script.cc (Token::integer_value): Accept trailing M/m/K/k
1845 modifier.
1846 (Lex::gather_token): Accept trailing M/m/K/k for integers.
1847
4d5e4e62
ILT
18482011-06-29 Ian Lance Taylor <[email protected]>
1849
1850 PR gold/12675
1851 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
1852 SHT_X86_64_UNWIND.
1853 * layout.cc (Layout::layout_eh_frame): Likewise.
1854
886f533a
ILT
18552011-06-29 Ian Lance Taylor <[email protected]>
1856
1857 PR gold/12695
1858 * layout.cc (Layout::symtab_section_shndx): New function.
1859 * layout.h (class Layout): Declare symtab_section_shndx.
1860 * output.cc (Output_section::write_header): Call it.
1861
f3ae1b28
ILT
18622011-06-29 Ian Lance Taylor <[email protected]>
1863
1864 PR gold/12818
1865 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
1866 symbols which are not used in a relocation.
1867
aecf301f
ILT
18682011-06-28 Ian Lance Taylor <[email protected]>
1869
1870 PR gold/12898
1871 * layout.cc (Layout::segment_precedes): Don't crash if a linker
1872 script create indistinguishable segments.
1873 (Layout::set_segment_offsets): Use stable_sort when sorting
1874 segments. Pass this to Compare_segments constructor.
1875 * layout.h (class Layout): Make segment_precedes non-static.
1876 (class Compare_segments): Change from struct to class. Add
1877 layout_ field. Add constructor.
1878 * script-sections.cc
1879 (Script_sections::attach_sections_using_phdrs_clause): Rename
1880 local orphan to is_orphan. Don't report failure to put empty
1881 section in segment. On attachment failure, report name of
1882 section, and attach to first PT_LOAD segment.
1883
03ef7571
ILT
18842011-06-28 Ian Lance Taylor <[email protected]>
1885
1886 PR gold/12934
1887 * target-select.cc (Target_selector::Target_selector): Add
1888 emulation parameter. Change all callers.
1889 (select_target_by_bfd_name): Rename from select_target_by_name.
1890 Change all callers.
1891 (select_target_by_emulation): New function.
1892 (supported_emulation_names): New function.
1893 * target-select.h (class Target_selector): Add emulation_ field.
1894 Update declarations.
1895 (Target_selector::recognize_by_bfd_name): Rename from
1896 recognize_by_name. Change all callers.
1897 (Target_selector::supported_bfd_names): Rename from
1898 supported_names. Change all callers.
1899 (Target_selector::recognize_by_emulation): New function.
1900 (Target_selector::supported_emulations): New function.
1901 (Target_selector::emulation): New function.
1902 (Target_selector::do_recognize_by_bfd_name): Rename from
1903 do_recognize_by_name. Change all callers.
1904 (Target_selector::do_supported_bfd_names): Rename from
1905 do_supported_names. Change all callers.
1906 (Target_selector::do_recognize_by_emulation): New function.
1907 (Target_selector::do_supported_emulations): New function.
1908 (select_target_by_bfd_name): Change name in declaration.
1909 (select_target_by_emulation): Declare.
1910 (supported_emulation_names): Declare.
1911 * parameters.cc (parameters_force_valid_target): Try to find
1912 target based on emulation from -m option.
1913 * options.h (class General_options): Change doc string for -m.
1914 * options.cc (help): Print emulations.
1915 (General_options::parse_V): Likewise.
1916 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
1917 Add emulation parameter. Change all callers.
1918
200b2bb9
ILT
19192011-06-28 Ian Lance Taylor <[email protected]>
1920
1921 * target.h (class Target): Add osabi_ field.
1922 (Target::osabi): New function.
1923 (Target::set_osabi): New function.
1924 (Target::Target): Initialize osabi_.
1925 (Target::do_adjust_elf_header): Make pure virtual.
1926 (Sized_target::do_adjust_elf_header): Declare.
1927 * target.cc (Sized_target::do_adjust_elf_header): New function.
1928 (class Sized_target): Instantiate all versions.
1929 * freebsd.h (class Target_freebsd): Remove.
1930 (Target_selector_freebsd::do_recognize): Call set_osabi on
1931 Target.
1932 (Target_selector_freebsd::do_recognize_by_name): Likewise.
1933 (Target_selector_freebsd::set_osabi): Remove.
1934 * i386.cc (class Target_i386): Inherit from Sized_target rather
1935 than Target_freebsd.
1936 * x86_64.cc (class Target_x86_64): Likewise.
1937
b3ce541e
ILT
19382011-06-28 Ian Lance Taylor <[email protected]>
1939
1940 * target.h (Target::can_check_for_function_pointers): Rewrite.
1941 Make non-virtual.
1942 (Target::can_icf_inline_merge_sections): Likewise.
1943 (Target::section_may_have_icf_unsafe_poineters): Likewise.
1944 (Target::Target_info): Add can_icf_inline_merge_sections field.
1945 (Target::do_can_check_for_function_pointers): New virtual
1946 function.
1947 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
1948 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
1949 from can_check_for_function_pointers, move in file.
1950 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
1951 section_may_have_icf_unsafe_poineters, move in file.
1952 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
1953 * i386.cc (Target_i386::do_can_check_for_function_pointers):
1954 Rename from can_check_for_function_pointers, move in file.
1955 (Target_i386::can_icf_inline_merge_sections): Remove.
1956 (Target_i386::i386_info): Initialize
1957 can_icf_inline_merge_sections.
1958 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
1959 Initialize can_icf_inline_merge_sections.
1960 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
1961 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
1962 Rename from can_check_for_function_pointers, move in file.
1963 (Target_x86_64::can_icf_inline_merge_sections): Remove.
1964 (Target_x86_64::x86_64_info): Initialize
1965 can_icf_inline_merge_sections.
1966 * testsuite/testfile.cc (Target_test::test_target_info):
1967 Likewise.
1968 * icf.cc (get_section_contents): Correct formatting.
1969
6d1c4efb
ILT
19702011-06-27 Ian Lance Taylor <[email protected]>
1971
1972 * symtab.cc (Symbol::versioned_name): New function.
1973 (Symbol_table::add_to_final_symtab): Use versioned_name when
1974 appropriate.
1975 (Symbol_table::sized_write_symbol): Likewise.
1976 * symtab.h (class Symbol): Declare versioned_name.
1977 * stringpool.h (class Stringpool_template): Add variant of add
1978 which takes a std::basic_string.
1979 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
1980 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
1981 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
1982 (ver_test_12.o): New target.
1983 * testsuite/Makefile.in: Rebuild.
1984
57eb9b50
DK
19852011-06-27 Doug Kwan <[email protected]>
1986
1987 * arm.cc (Arm_relocate_functions::thm_jump8,
1988 Arm_relocate_functions::thm_jump11): Use a wider signed
1989 type to compute offset.
1990 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
1991 arm_thm_jump8.
1992 * testsuite/Makefile.in: Regenerate.
1993 * testsuite/arm_branch_in_range.sh: Check test results of
1994 arm_thm_jump11 and arm_thm_jump8.
1995 * testsuite/arm_thm_jump11.s: New test source file.
1996 * testsuite/arm_thm_jump11.t: New linker script.
1997 * testsuite/arm_thm_jump8.s: New test source file.
1998 * testsuite/arm_thm_jump8.t: New linker script.
1999
487b39df
ILT
20002011-06-24 Ian Lance Taylor <[email protected]>
2001
2002 * layout.cc: Include "object.h".
2003 (ctors_sections_in_init_array): New static variable.
2004 (Layout::is_ctors_in_init_array): New function.
2005 (Layout::layout): Add entry to ctors_sections_in_init_array if
2006 appropriate.
2007 * layout.h (class Layout): Declare is_ctors_in_init_array.
2008 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
2009 is_ctors_reverse_view is set.
2010 (Sized_relobj_file::write_sections): Add layout parameter. Change
2011 all callers. Set is_ctors_reverse_view field of View_size.
2012 (Sized_relobj_file::reverse_words): New function.
2013 * object.h (Sized_relobj_file::View_size): Add
2014 is_ctors_reverse_view field.
2015 (class Sized_relobj_file): Update declarations.
2016 * testsuite/initpri3.c: New test.
2017 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
2018 initpri3b.
2019 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
2020 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
2021 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
2022 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
2023 * testsuite/Makefile.in: Rebuild.
2024
472076e4
CC
20252011-06-24 Cary Coutant <[email protected]>
2026
2027 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
2028 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
2029 (debug_msg_cdebug.err): New targets.
2030 * testsuite/Makefile.in: Regenerate.
2031 * testsuite/debug_msg.sh: Check output of link with compressed debug.
2032 Fix checks for link with shared library.
2033
a60af0db
DK
20342011-06-24 Doug Kwan <[email protected]>
2035
2036 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
2037 skip empty text sections.
2038 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
2039
5393d741
ILT
20402011-06-22 Ian Lance Taylor <[email protected]>
2041
2042 PR gold/12910
2043 * options.h (class General_options): Add --ctors-in-init-array.
2044 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
2045 friends as SHT_PROGBITS for merging sections.
2046 (Layout::layout): Remove special handling of .init_array and
2047 friends. Don't sort if doing relocatable link. Sort for .ctors
2048 and .dtors if ctors_in_init_array.
2049 (Layout::make_output_section): Force correct section types for
2050 .init_array and friends. Don't sort if doing relocatable link,
2051 Don't sort .ctors and .dtors if ctors_in_init_array.
2052 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
2053 (Layout::output_section_name): Add relobj parameter. Change all
2054 callers. Handle .ctors. and .dtors. in code rather than table.
2055 Handle .ctors and .dtors if ctors_in_init_array.
2056 (Layout::match_file_name): New function, moved from output.cc.
2057 * layout.h (class Layout): Update declarations.
2058 * output.cc: Include "layout.h".
2059 (Input_section_sort_entry::get_priority): New function.
2060 (Input_section_sort_entry::match_file_name): Just call
2061 Layout::match_file_name.
2062 (Output_section::Input_section_sort_init_fini_compare::operator()):
2063 Handle .ctors and .dtors. Sort by explicit priority rather than
2064 by name.
2065 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
2066 * testsuite/initpri2.c: New test.
2067 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
2068 (check_PROGRAMS): Add initpri2.
2069 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
2070 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
2071 * configure, testsuite/Makefile.in: Rebuild.
2072
e1f74f98
ILT
20732011-06-19 Ian Lance Taylor <[email protected]>
2074
2075 PR gold/12880
2076 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
2077 .interp section to a PT_INTERP segment even if we have seen a
2078 --dynamic-linker option. Don't do it if we have seen a PHDRS
2079 clause in a linker script.
2080 (Layout::finalize): Don't create a .interp section if we've
2081 already create a PT_INTERP segment.
2082 (Layout::create_interp): Always call choose_output_section (revert
2083 patch of 2011-06-17). Don't create PT_INTERP segment.
2084 * script-sections.cc
2085 (Script_sections::create_note_and_tls_segments): Add a .interp
2086 section to a PT_INTERP segment even if we have seen a
2087 --dynamic-linker option.
2088
766f91bb
ILT
20892011-06-18 Ian Lance Taylor <[email protected]>
2090
2091 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
2092 merely because a non-PT_LOAD segment has a dynamic reloc.
2093
0d212c3a
ILT
20942011-06-18 Ian Lance Taylor <[email protected]>
2095
2096 * layout.cc (Layout::finish_dynamic_section): Don't create
2097 DT_FLAGS entry if not needed.
2098
911a5072
ILT
20992011-06-18 Ian Lance Taylor <[email protected]>
2100
2101 PR gold/12745
2102 * layout.cc (Layout::layout_eh_frame): Correct handling of
2103 writable .eh_frame section.
2104
534b4e5f
ILT
21052011-06-17 Ian Lance Taylor <[email protected]>
2106
2107 PR gold/12893
2108 * resolve.cc (Symbol_table::resolve): Don't give an error if a
2109 symbol is redefined with the exact same object and value.
2110
10b4f102
ILT
21112011-06-17 Ian Lance Taylor <[email protected]>
2112
2113 PR gold/12880
2114 * layout.h (class Layout): Add interp_segment_ field.
2115 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
2116 (Layout::attach_allocated_section_to_segment): If making shared
2117 library, put .interp section in PT_INTERP segment.
2118 (Layout::finalize): Also call create_interp if -dynamic-linker
2119 option was used.
2120 (Layout::create_interp): Assert that there is no PT_INTERP
2121 segment. If not using a SECTIONS clause, use make_output_section.
2122 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
2123 * script-sections.cc
2124 (Script_sections::create_note_and_tls_segments): If making shared
2125 library, put .interp section in PT_INTERP segment.
2126
a29b0dad
ILT
21272011-06-17 Ian Lance Taylor <[email protected]>
2128
e588ea8d
ILT
2129 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
2130 when making a shared library.
2131
21322011-06-17 Ian Lance Taylor <[email protected]>
2133
2134 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
2135 parameter. Change all callers. Don't issue warning about PC32
2136 against locally defined symbol.
a29b0dad 2137
9d3b0698
ILT
21382011-06-16 Ian Lance Taylor <[email protected]>
2139
2140 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
2141 occurs in same object.
2142
85b0f90c
AM
21432011-06-14 Alan Modra <[email protected]>
2144
2145 * po/POTFILES.in: Regenerate.
2146
a94907d9
ILT
21472011-06-09 Ian Lance Taylor <[email protected]>
2148
2149 * script-sections.cc
2150 (Orphan_output_section::set_section_addresses): For a relocatable
2151 link set address to 0.
2152
4fb3a1c3
CC
21532011-06-09 Cary Coutant <[email protected]>
2154
2155 PR gold/12804
2156 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
2157 used with --compress-debug-sections.
2158 * gold/object.cc (Sized_relobj_file::do_layout): Report
2159 uncompressed size of compressed input sections.
2160
61220854
CC
21612011-06-08 Cary Coutant <[email protected]>
2162
2163 PR gold/12804
2164 * testsuite/two_file_test_2_v1.cc: Change initialization of
2165 v2 to keep it in .data.
2166
e6455dfb
CC
21672011-06-07 Cary Coutant <[email protected]>
2168
2169 * common.cc (Symbol_table::do_allocate_commons_list): Call
2170 gold_fallback.
2171 * errors.cc (Errors::fatal): Adjust call to gold_exit.
2172 (Errors::fallback): New function.
2173 (gold_fallback): New function.
2174 * errors.h (Errors::fallback): New function.
2175 * gold.cc (gold_exit): Change status parameter to enum; adjust
2176 all callers.
2177 (queue_initial_tasks): Call gold_fallback.
2178 * gold.h: Include cstdlib.
2179 (Exit_status): New enum type.
2180 (gold_exit): Change status parameter to enum.
2181 (gold_fallback): New function.
2182 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
2183 (Layout::create_symtab_sections): Likewise.
2184 (Layout::create_shdrs): Likewise.
2185 * main.cc (main): Adjust call to gold_exit.
2186 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
2187 (Output_data_got::add_got_entry_pair): Likewise.
2188 (Output_section::add_input_section): Likewise.
2189 (Output_section::add_output_section_data): Likewise.
2190 (Output_segment::set_section_list_addresses): Likewise.
2191 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
2192
fb0e076f
CC
21932011-06-07 Cary Coutant <[email protected]>
2194
2195 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
2196 for incremental links.
2197 * output.cc (Output_segment::set_section_list_addresses): Remove
2198 FIXME and test for TLS or BSS.
2199
a5ee4d5d
CC
22002011-06-07 Cary Coutant <[email protected]>
2201
2202 * testsuite/Makefile.am: Add incremental_copy_test,
2203 incremental_common_test_1.
2204 * testsuite/Makefile.in: Regenerate.
2205 * testsuite/common_test_1_v1.c: New source file.
2206 * testsuite/common_test_1_v2.c: New source file.
2207 * testsuite/copy_test_v1.cc: New source file.
2208
5146f448
CC
22092011-06-07 Cary Coutant <[email protected]>
2210
2211 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
2212 update, allocate common from bss section's free list.
2213 * incremental-dump.cc (dump_incremental_inputs): Print flag for
2214 linker-defined symbols.
2215 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
2216 Skip GOT and PLT entries that are no longer referenced.
2217 (Output_section_incremental_inputs::write_info_blocks): Mark
2218 linker-defined symbols.
2219 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
2220 * output.cc (Output_section::allocate): New function.
2221 * output.h (Output_section::allocate): New function.
2222 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
2223 linker-defined symbols.
2224 (Symbol::override_base_with_special): Copy is_predefined_ flag.
2225 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
2226 (Symbol::init_base_output_data): Likewise.
2227 (Symbol::init_base_output_segment): Likewise.
2228 (Symbol::init_base_constant): Likewise.
2229 (Sized_symbol::init_output_data): Likewise.
2230 (Sized_symbol::init_output_segment): Likewise.
2231 (Sized_symbol::init_constant): Likewise.
2232 (Symbol_table::do_define_in_output_data): Likewise.
2233 (Symbol_table::do_define_in_output_segment): Likewise.
2234 (Symbol_table::do_define_as_constant): Likewise.
2235 * symtab.h (Symbol::is_predefined): New function.
2236 (Symbol::init_base_output_data): Add is_predefined parameter.
2237 (Symbol::init_base_output_segment): Likewise.
2238 (Symbol::init_base_constant): Likewise.
2239 (Symbol::is_predefined_): New data member.
2240 (Sized_symbol::init_output_data): Add is_predefined parameter.
2241 (Sized_symbol::init_output_segment): Likewise.
2242 (Sized_symbol::init_constant): Likewise.
2243 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
2244
26d3c67d
CC
22452011-06-07 Cary Coutant <[email protected]>
2246
2247 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
2248 instead of emit_copy_reloc.
2249 (Copy_relocs::emit_copy_reloc): Refactor.
2250 (Copy_relocs::make_copy_reloc): New function.
2251 (Copy_relocs::add_copy_reloc): Remove.
2252 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
2253 section.
2254 (Copy_relocs::make_copy_reloc): New function.
2255 (Copy_relocs::add_copy_reloc): Remove.
2256 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
2257 unchanged input files.
2258 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
2259 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
2260 Reserve BSS space for COPY relocations.
2261 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2262 (Output_section_incremental_inputs::write_info_blocks): Record
2263 whether a symbol is copied from a shared object.
2264 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
2265 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
2266 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
2267 (Incremental_input_entry_reader::get_output_symbol_index): Add
2268 is_copy parameter.
2269 (Incremental_binary::emit_copy_relocs): New function.
2270 (Incremental_binary::do_emit_copy_relocs): New function.
2271 (Sized_incremental_binary::Sized_incremental_binary): Initialize
2272 new data member.
2273 (Sized_incremental_binary::add_copy_reloc): New function.
2274 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2275 (Sized_incremental_binary::Copy_reloc): New struct.
2276 (Sized_incremental_binary::Copy_relocs): New typedef.
2277 (Sized_incremental_binary::copy_relocs_): New data member.
2278 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
2279 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
2280 * target.h (Sized_target::emit_copy_reloc): New function.
2281 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
2282
7cdb37d9
CC
22832011-06-02 Cary Coutant <[email protected]>
2284
2285 PR gold/12163
2286 * gold/archive.cc (Archive::Archive): Initialize new data member.
2287 (Archive::include_all_members): Return if archive has already been
2288 included.
2289 * gold/archive.h (Archive::include_all_members_): New data member.
2290
cc643b88
NC
22912011-06-02 Nick Clifton <[email protected]>
2292
2293 * dynobj.h: Fix spelling mistake in comment.
2294 * output.cc: Likewise.
2295
f62a3ca7 22962011-05-31 Doug Kwan <[email protected]>
2e702c99 2297 Asier Llano
f62a3ca7
DK
2298
2299 PR gold/12826
cc643b88 2300 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
2301 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
2302 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
2303 redundant arm_exidx_test.so.
2304 * testsuite/Makefile.in: Regenerate.
2305 (check_SCRIPTS): Add pr12826.sh
2306 (check_DATA): Add pr12826.stdout
2307 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
2308 * testsuite/pr12826.sh: New file.
2309 * testsuite/pr12826_1.s: Ditto.
2310 * testsuite/pr12826_1.s: Ditto.
2311
8dbe1edc
ILT
23122011-05-30 Ian Lance Taylor <[email protected]>
2313
2314 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
2315 sections.
2316
c49875be
ILT
23172011-05-29 Ian Lance Taylor <[email protected]>
2318
2319 PR gold/12804
2320 * testsuite/Makefile.am: Use different file name for two_file_test
2321 temporary file for each incremental test.
2322 * testsuite/Makefile.in: Rebuild.
2323
69d53f7a
ILT
23242011-05-29 Ian Lance Taylor <[email protected]>
2325
2326 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
2327 binary input file is empty.
2328
41d0ab5f
ILT
23292011-05-27 Ian Lance Taylor <[email protected]>
2330
2331 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
2332 (ver_test_9.so): Likewise.
2333 * testsuite/Makefile.in: Rebuild.
2334
89d8a36b
CC
23352011-05-26 Cary Coutant <[email protected]>
2336
2337 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
2338 * incremental.cc (Incremental_inputs::report_input_section): Fix
2339 comment, indentation.
2340 (Incremental_inputs::report_comdat_group): New function.
2341 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2342 of data for incremental input file entry.
2343 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
2344 group count, COMDAT group signatures.
2345 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
2346 an unchanged input file.
2347 * incremental.h (Incremental_object_entry::Incremental_object_entry):
2348 Initialize new data member.
2349 (Incremental_object_entry::add_comdat_group): New function.
2350 (Incremental_object_entry::get_comdat_group_count): New function.
2351 (Incremental_object_entry::get_comdat_signature_key): New function.
2352 (Incremental_object_entry::groups_): New data member.
2353 (Incremental_inputs::report_comdat_group): New function.
2354 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
2355 data for incremental input file entry.
2356 (Incremental_input_entry_reader::get_comdat_group_count): New function.
2357 (Incremental_input_entry_reader::get_input_section): Adjust size of
2358 data for incremental input file entry.
2359 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
2360 (Incremental_input_entry_reader::get_comdat_group_signature): New
2361 function.
2362 * object.cc (Sized_relobj::include_section_group): Report kept
2363 COMDAT groups for incremental links.
2364
1706a06f
ILT
23652011-05-24 David Meyer <[email protected]>
2366
2367 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
2368 with name parameter. Add found_name parameter.
2369 * fileread.cc (Input_file::find_file): Adjust code accordingly.
2370 * dirsearch.h (class Dirsearch): Update declaration.
2371
a10ae760
ILT
23722011-05-24 Ian Lance Taylor <[email protected]>
2373
2374 * archive.cc (Library_base::should_include_member): Pull in object
2375 from archive if it defines the entry symbol.
2376 * parameters.cc (Parameters::entry): New function.
2377 * parameters.h (class Parameters): Declare entry.
2378 * output.h (class Output_file_header): Remove entry_ field.
2379 * output.cc (Output_file_header::Output_file_header): Remove entry
2380 parameter. Change all callers.
2381 (Output_file_header::entry): Use parameters->entry.
2382 * gold.cc (queue_middle_tasks): Likewise.
2383 * plugin.cc (Plugin_hook::run): Likewise.
2384
aa92d6ed
CC
23852011-05-24 Cary Coutant <[email protected]>
2386
2387 * gold.cc (queue_initial_tasks): Pass incremental base filename
2388 to Output_file::open_base_file; don't print error message.
2389 * incremental-dump.cc (main): Adjust call to
2390 Output_file::open_for_modification.
2391 * incremental-dump.cc (main): Likewise.
2392 * incremental.cc (Incremental_inputs::report_command_line):
2393 Ignore --incremental-base option when comparing command lines.
2394 Ignore parameter when given as separate argument.
2395 * options.h (class General_options): Add --incremental-base.
2396 * output.cc (Output_file::Output_file):
2397 (Output_file::open_base_file): Add base_name and writable parameters;
2398 read base file into new file; print error message here.
2399 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2400 callers.
2401 * output.h (Output_file::open_for_modification): Rename to...
2402 (Output_file::open_base_file): ...this; add base_name and
2403 writable parameters; adjust all callers.
2404 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2405 callers.
2406 * testsuite/Makefile.am (incremental_test_4): Test
2407 --incremental-base.
2408 * testsuite/Makefile.in: Regenerate.
2409
2eedd706
CC
24102011-05-24 Cary Coutant <[email protected]>
2411
2412 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
2413 incremental_test_4.
2414 * testsuite/Makefile.in: Regenerate.
2415 * testsuite/two_file_test_1_v1.cc: New test source file.
2416 * testsuite/two_file_test_1b_v1.cc: New test source file.
2417 * testsuite/two_file_test_2_v1.cc: New test source file.
2418
0f1c85a6
CC
24192011-05-24 Cary Coutant <[email protected]>
2420
2421 * dynobj.h (Dynobj::do_dynobj): New function.
2422 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
2423 flag and soname for shared objects.
2424 * incremental.cc (Incremental_inputs::report_object): Make
2425 either Incremental_object_entry or Incremental_dynobj_entry; add
2426 soname to string table.
2427 (Incremental_inputs::report_input_section): Add assertion.
2428 (Output_section_incremental_inputs::set_final_data_size): Adjust
2429 type of input file entry for shared libraries; adjust size of
2430 shared library info entry.
2431 (Output_section_incremental_inputs::write_input_files): Write
2432 as_needed flag for shared libraries.
2433 (Output_section_incremental_inputs::write_info_blocks): Adjust type
2434 of input file entry for shared libraries; write soname.
2435 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
2436 soname from incremental info.
2437 * incremental.h (enum Incremental_input_flags): Add
2438 INCREMENTAL_INPUT_AS_NEEDED.
2439 (Incremental_input_entry::Incremental_input_entry): Initialize new
2440 data member.
2441 (Incremental_input_entry::set_as_needed): New function.
2442 (Incremental_input_entry::as_needed): New function.
2443 (Incremental_input_entry::do_dynobj_entry): New function.
2444 (Incremental_input_entry::as_needed_): New data member.
2445 (Incremental_object_entry::Incremental_object_entry): Don't check
2446 for shared library.
2447 (Incremental_object_entry::do_type): Likewise.
2448 (class Incremental_dynobj_entry): New class.
2449 (Incremental_input_entry_reader::as_needed): New function.
2450 (Incremental_input_entry_reader::get_soname): New function.
2451 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
2452 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
2453 size of shared library info entry.
58797674 2454 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
2455 incremental link when adding DT_NEEDED entries.
2456 * object.h (Object::Object): Initialize new data member.
2457 (Object::dynobj): New function.
2458 (Object::set_as_needed): New function.
2459 (Object::as_needed): New function.
2460 (Object::do_dynobj): New function.
2461 (Object::as_needed_): New data member.
2462
6fa2a40b
CC
24632011-05-24 Cary Coutant <[email protected]>
2464
2465 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
2466 info; adjust display of GOT entries.
2467 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2468 vector of input objects; remove file_status_.
2469 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
2470 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
2471 got_plt reader; call target hooks to reserve GOT entries.
2472 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2473 of input file info header and GOT info entry.
2474 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
2475 relocation info.
2476 (Got_plt_view_info::got_descriptor): Remove.
2477 (Got_plt_view_info::sym_index): New data member.
2478 (Got_plt_view_info::input_index): New data member.
2479 (Local_got_offset_visitor::visit): Write input file index.
2480 (Global_got_offset_visitor::visit): Write 0 for input file index.
2481 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
2482 with sym_index and input_index.
2483 (Output_section_incremental_inputs::write_got_plt): Adjust size of
2484 incremental info GOT entry; replace got_descriptor with input_index.
2485 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
2486 map from input file index to object.
2487 (Sized_relobj_incr::do_layout): Replace direct data member reference
2488 with accessor function.
2489 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
2490 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
2491 Adjust size of input file info header.
2492 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
2493 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
2494 (Incremental_input_entry_reader::get_input_section): Adjust size of
2495 input file info header.
2496 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
2497 of incremental info GOT entry.
2498 (Incremental_got_plt_reader::get_got_desc): Remove.
2499 (Incremental_got_plt_reader::get_got_symndx): New function.
2500 (Incremental_got_plt_reader::get_got_input_index): New function.
2501 (Sized_incremental_binary::Sized_incremental_binary): Remove
2502 file_status_; add input_objects_.
2503 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
2504 (Sized_incremental_binary::set_file_is_unchanged): Remove.
2505 (Sized_incremental_binary::file_is_unchanged): Remove.
2506 (Sized_incremental_binary::set_input_object): New function.
2507 (Sized_incremental_binary::input_object): New function.
2508 (Sized_incremental_binary::file_status_): Remove.
2509 (Sized_incremental_binary::input_objects_): New data member.
2510 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
2511 references.
2512 (Sized_relobj_incr::invalid_address): Move to base class.
2513 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
2514 class.
2515 (Sized_relobj_incr::do_output_section_offset): Likewise.
2516 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
2517 (Sized_relobj_incr::section_offsets_): Likewise.
2518 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
2519 function.
2520 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
2521 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
2522 with accessor function.
2523 (Sized_relobj_file::do_layout): Likewise.
2524 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
2525 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
2526 (Sized_relobj_file::compute_final_local_value): Replace refs to
2527 section_offsets_ with accessor function.
2528 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
2529 * object.h (Relobj::Relobj): Initialize new data members.
2530 (Relobj::add_dyn_reloc): New function.
2531 (Relobj::first_dyn_reloc): New function.
2532 (Relobj::dyn_reloc_count): New function.
2533 (Relobj::first_dyn_reloc_): New data member.
2534 (Relobj::dyn_reloc_count_): New data member.
2535 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
2536 references.
2537 (Sized_relobj::Address): New typedef.
2538 (Sized_relobj::invalid_address): Move here from child class.
2539 (Sized_relobj::Sized_relobj): Initialize new data members.
2540 (Sized_relobj::sized_relobj): New function.
2541 (Sized_relobj::is_output_section_offset_invalid): Move here from
2542 child class.
2543 (Sized_relobj::get_output_section_offset): Likewise.
2544 (Sized_relobj::local_has_got_offset): Likewise.
2545 (Sized_relobj::local_got_offset): Likewise.
2546 (Sized_relobj::set_local_got_offset): Likewise.
2547 (Sized_relobj::do_for_all_local_got_entries): Likewise.
2548 (Sized_relobj::clear_got_offsets): New function.
2549 (Sized_relobj::section_offsets): Move here from child class.
2550 (Sized_relobj::do_output_section_offset): Likewise.
2551 (Sized_relobj::do_set_section_offset): Likewise.
2552 (Sized_relobj::Local_got_offsets): Likewise.
2553 (Sized_relobj::local_got_offsets_): Likewise.
2554 (Sized_relobj::section_offsets_): Likewise.
2555 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
2556 references.
2557 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
2558 class.
2559 (Sized_relobj_file::sized_relobj): New function
2560 (Sized_relobj_file::local_has_got_offset): Move to base class.
2561 (Sized_relobj_file::local_got_offset): Likewise.
2562 (Sized_relobj_file::set_local_got_offset): Likewise.
2563 (Sized_relobj_file::get_output_section_offset): Likewise.
2564 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
2565 (Sized_relobj_file::do_output_section_offset): Likewise.
2566 (Sized_relobj_file::do_set_section_offset): Likewise.
2567 (Sized_relobj_file::Local_got_offsets): Likewise.
2568 (Sized_relobj_file::local_got_offsets_): Likewise.
2569 (Sized_relobj_file::section_offsets_): Likewise.
2570 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
2571 (all constructors).
2572 (set_needs_dynsym_index): Convert relobj to derived class pointer.
2573 (Output_reloc::get_symbol_index): Likewise.
2574 (Output_reloc::local_section_offset): Likewise.
2575 (Output_reloc::get_address): Likewise.
2576 (Output_reloc::symbol_value): Likewise.
2577 (Output_data_got::reserve_slot): Move to class definition.
2578 (Output_data_got::reserve_local): New function.
2579 (Output_data_got::reserve_slot_for_global): Remove.
2580 (Output_data_got::reserve_global): New function.
2581 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
2582 (all constructors, two instantiations).
2583 (Output_reloc::get_relobj): New function (two instantiations).
2584 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
2585 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
2586 (Output_data_reloc::add_global): Adjust type of relobj.
2587 (Output_data_reloc::add_global_relative): Likewise.
2588 (Output_data_reloc::add_symbolless_global_addend): Likewise.
2589 (Output_data_reloc::add_local): Likewise.
2590 (Output_data_reloc::add_local_relative): Likewise.
2591 (Output_data_reloc::add_symbolless_local_addend): Likewise.
2592 (Output_data_reloc::add_local_section): Likewise.
2593 (Output_data_reloc::add_output_section): Likewise.
2594 (Output_data_reloc::add_absolute): Likewise.
2595 (Output_data_reloc::add_target_specific): Likewise.
2596 (Output_data_got::reserve_slot): Move definition here.
2597 (Output_data_got::reserve_local): New function.
2598 (Output_data_got::reserve_global): New function.
2599 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
2600 section_offsets_ with accessor function.
2601 (Sized_relobj_file::write_sections): Likewise.
2602 (Sized_relobj_file::do_relocate_sections): Likewise.
2603 * target.h (Sized_target::reserve_local_got_entry): New function.
2604 (Sized_target::reserve_global_got_entry): New function.
2605 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
2606 (Target_x86_64::reserve_global_got_entry): New function.
2607 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
2608
4829d394
CC
26092011-05-23 Cary Coutant <[email protected]>
2610
2611 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
2612 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
2613 bit when checking got_type.
2614 * incremental.cc (Sized_incremental_binary::setup_readers):
2615 Store symbol table and string table locations; initialize bit vector
2616 of file status flags.
2617 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
2618 unchanged files.
2619 (Sized_incremental_binary::do_process_got_plt): New function.
2620 (Sized_incremental_binary::get_symtab_view): Use stored locations.
2621 (Output_section_incremental_inputs::set_final_data_size): Record
2622 file index for each input file.
2623 (Output_section_incremental_inputs::write_got_plt): Store file index
2624 instead of input entry offset for each GOT entry.
2625 * incremental.h
2626 (Incremental_input_entry::Incremental_input_entry): Initialize new
2627 data member.
2628 (Incremental_input_entry::set_offset): Store file index.
2629 (Incremental_input_entry::get_file_index): New function.
2630 (Incremental_input_entry::file_index_): New data member.
2631 (Incremental_binary::process_got_plt): New function.
2632 (Incremental_binary::do_process_got_plt): New function.
2633 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2634 data members.
2635 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
2636 (Sized_incremental_binary::set_file_is_unchanged): New function.
2637 (Sized_incremental_binary::file_is_unchanged): New function.
2638 (Sized_incremental_binary::do_process_got_plt): New function.
2639 (Sized_incremental_binary::file_status_): New data member.
2640 (Sized_incremental_binary::main_symtab_loc_): New data member.
2641 (Sized_incremental_binary::main_strtab_loc_): New data member.
2642 * output.cc (Output_data_got::Got_entry::write): Add case
2643 RESERVED_CODE.
2644 (Output_data_got::add_global): Call add_got_entry.
2645 (Output_data_got::add_global_plt): Likewise.
2646 (Output_data_got::add_global_with_rel): Likewise.
2647 (Output_data_got::add_global_with_rela): Likewise.
2648 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
2649 (Output_data_got::add_global_pair_with_rela): Likewise.
2650 (Output_data_got::add_local): Call add_got_entry.
2651 (Output_data_got::add_local_plt): Likewise.
2652 (Output_data_got::add_local_with_rel): Likewise.
2653 (Output_data_got::add_local_with_rela): Likewise.
2654 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
2655 (Output_data_got::add_local_pair_with_rela): Likewise.
2656 (Output_data_got::reserve_slot): New function.
2657 (Output_data_got::reserve_slot_for_global): New function.
2658 (Output_data_got::add_got_entry): New function.
2659 (Output_data_got::add_got_entry_pair): New function.
2660 (Output_section::add_output_section_data): Edit FIXME.
2661 * output.h
2662 (Output_section_data_build::Output_section_data_build): New
2663 constructor with size parameter.
2664 (Output_data_space::Output_data_space): Likewise.
2665 (Output_data_got::Output_data_got): Initialize new data member; new
2666 constructor with size parameter.
2667 (Output_data_got::add_constant): Call add_got_entry.
2668 (Output_data_got::reserve_slot): New function.
2669 (Output_data_got::reserve_slot_for_global): New function.
2670 (class Output_data_got::Got_entry): Add RESERVED_CODE.
2671 (Output_data_got::add_got_entry): New function.
2672 (Output_data_got::add_got_entry_pair): New function.
2673 (Output_data_got::free_list_): New data member.
2674 * target.h (Sized_target::init_got_plt_for_update): New function.
2675 (Sized_target::register_global_plt_entry): New function.
2676 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
2677 Initialize new data member; call init; add constructor with PLT count.
2678 (Output_data_plt_x86_64::init): New function.
2679 (Output_data_plt_x86_64::add_relocation): New function.
2680 (Output_data_plt_x86_64::reserve_slot): New function.
2681 (Output_data_plt_x86_64::free_list_): New data member.
2682 (Target_x86_64::init_got_plt_for_update): New function.
2683 (Target_x86_64::register_global_plt_entry): New function.
2684 (Output_data_plt_x86_64::add_entry): Allocate from free list for
2685 incremental updates.
2686 (Output_data_plt_x86_64::add_relocation): New function.
2687 * testsuite/object_unittest.cc (Object_test): Set default options.
2688
ec69d6da
ILT
26892011-05-16 Ian Lance Taylor <[email protected]>
2690
2691 * options.h (class General_options): Make -i a synonym for -r.
2692
732e31de
ILT
26932011-05-16 Ian Lance Taylor <[email protected]>
2694
2695 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
2696
403676b5
CC
26972011-05-10 Cary Coutant <[email protected]>
2698
2699 * object.cc (Sized_relobj::do_count_local_symbols): Check for
2700 strip_all (-s).
2701
5b7b7d6e
ILT
27022011-05-06 Ian Lance Taylor <[email protected]>
2703
2704 * layout.cc (Layout::layout): If the output section flags change,
2705 update the ordering.
2706
f0f9babf
CC
27072011-04-25 Cary Coutant <[email protected]>
2708
2709 * incremental-dump.cc (dump_incremental_inputs): Print local
2710 symbol info for each input file.
2711 * incremental.cc
2712 (Output_section_incremental_inputs::set_final_data_size): Add local
2713 symbol info to input file entries in incremental info.
2714 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2715 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
2716 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
2717 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
2718 implementation.
2719 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
2720 (Sized_incr_relobj::do_relocate): Write the local symbols.
2721 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
2722 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
2723 Adjust size of input file header.
2724 (Incremental_inputs_reader::get_local_symbol_offset): New function.
2725 (Incremental_inputs_reader::get_local_symbol_count): New function.
2726 (Incremental_inputs_reader::get_input_section): Adjust size of input
2727 file header.
2728 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
2729 (Sized_incr_relobj::This): New typedef.
2730 (Sized_incr_relobj::sym_size): New const data member.
2731 (Sized_incr_relobj::Local_symbol): New struct.
2732 (Sized_incr_relobj::do_output_local_symbol_count): New function.
2733 (Sized_incr_relobj::do_local_symbol_offset): New function.
2734 (Sized_incr_relobj::local_symbol_count_): New data member.
2735 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
2736 (Sized_incr_relobj::local_symbol_index_): New data member.
2737 (Sized_incr_relobj::local_symbol_offset_): New data member.
2738 (Sized_incr_relobj::local_dynsym_offset_): New data member.
2739 (Sized_incr_relobj::local_symbols_): New data member.
2740 * object.h (Relobj::output_local_symbol_count): New function.
2741 (Relobj::local_symbol_offset): New function.
2742 (Relobj::do_output_local_symbol_count): New function.
2743 (Relobj::do_local_symbol_offset): New function.
2744 (Sized_relobj::do_output_local_symbol_count): New function.
2745 (Sized_relobj::do_local_symbol_offset): New function.
2746
d0a9ace3
ILT
27472011-04-22 Vladimir Simonov <[email protected]>
2748
2749 * descriptors.cc (set_close_on_exec): New function.
2750 (Descriptors::open): Use set_close_on_exec.
2751 * output.cc (S_ISLNK): Define if not defined.
2752
94a3fc8b
CC
27532011-04-22 Cary Coutant <[email protected]>
2754
2755 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2756 global symbol map.
2757 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2758 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
2759 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
2760 relocations.
2761 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
2762 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
2763 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
2764 * incremental.h
2765 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
2766 function.
2767 (Incremental_binary::apply_incremental_relocs): New function.
2768 (Incremental_binary::do_apply_incremental_relocs): New function.
2769 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2770 data member.
2771 (Sized_incremental_binary::add_global_symbol): New function.
2772 (Sized_incremental_binary::global_symbol): New function.
2773 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2774 (Sized_incremental_binary::symbol_map_): New data member.
2775 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
2776 * target.h (Sized_target::apply_relocation): New function.
2777 * target-reloc.h (apply_relocation): New function.
2778 * x86_64.cc (Target_x86_64::apply_relocation): New function.
2779
c87e4302
DK
27802011-04-22 Doug Kwan <[email protected]>
2781
2782 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
2783 flag of a SHT_ARM_EXIDX section.
2e702c99 2784 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
2785 * testsuite/Makefile.in: Regenerate.
2786 * testsuite/arm_exidx_test.s: New file.
2787 * testsuite/arm_exidx_test.sh: Same.
2788
e7782cf6
CC
27892011-04-20 Cary Coutant <[email protected]>
2790
2791 PR gold/12689
2792 * archive.h (Incremental_archive_entry::Archive_member):
2793 Initialize arg_serial_ (second constructor).
2794
308ecdc7
ILT
27952011-04-17 Ian Lance Taylor <[email protected]>
2796
2797 * object.cc (Relocate_info::location): Simplify location string.
2798 * errors.cc (Errors::error_at_location): Don't print program
2799 name.
2800 (Errors::warning_at_location): Likewise.
2801 (Errors::undefined_symbol): Likewise.
2802 * testsuite/debug_msg.sh: Update accordingly.
2803
bec5b579
CC
28042011-04-14 Cary Coutant <[email protected]>
2805
2806 * gold/layout.cc (Layout::symtab_section_offset): New function.
2807 * gold/layout.h (Layout::symtab_section_offset): New function.
2808 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
2809
88597d34
ILT
28102011-04-12 Ian Lance Taylor <[email protected]>
2811
2812 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
2813 with MREMAP_MAYMOVE.
2814 * output.h (class Output_file): Add map_is_allocated_ field.
2815 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
2816 not available, provide stubs. If mremap is not available, #define
2817 it to gold_mremap.
2818 (MREMAP_MAYMOVE): Define if not defined.
2819 (Output_file::Output_file): Initialize map_is_allocated_.
2820 (Output_file::resize): Check map_is_allocated_.
2821 (Output_file::map_anonymous): If mmap fails, use malloc.
2822 (Output_file::unmap): Don't do anything for an anonymous map.
2823 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
2824 is not available, provide stubs.
2825 (File_read::View::~View): Use free rather than delete[].
2826 (File_read::make_view): Use malloc rather than new[]. If mmap
2827 fails, use malloc.
2828 (File_read::find_or_make_view): Use malloc rather than new[].
2829 * gold.h: Remove HAVE_REMAP code.
2830 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
2831 exists. Rename mremap to gold_mremap. If mmap is not available
2832 don't do anything.
2833 * configure, config.in: Rebuild.
2834
11e361bc
ILT
28352011-04-11 Ian Lance Taylor <[email protected]>
2836
2837 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
2838 initialize local variable v.
2839
cdc29364
CC
28402011-04-11 Cary Coutant <[email protected]>
2841
2842 * archive.cc (Archive::include_member): Adjust call to
2843 report_object.
2844 (Add_archive_symbols::run): Track argument serial numbers.
2845 (Lib_group::include_member): Likewise.
2846 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
2847 * archive.h (Incremental_archive_entry::Archive_member):
2848 Initialize arg_serial_.
2849 (Archive_member::arg_serial_): New data member.
2850 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
2851 (Sized_dynobj::do_add_symbols): Track symbols when doing an
2852 incremental link.
2853 (Sized_dynobj::do_for_all_local_got_entries): New function.
2854 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
2855 function.
2856 * fileread.cc (get_mtime): New function.
2857 * fileread.h (get_mtime): New function.
2858 * gold.cc (queue_initial_tasks): Check for incremental update.
2859 (process_incremental_input): New function.
2860 (queue_middle_tasks): Don't force valid target for incremental
2861 update.
2862 * incremental-dump.cc (find_input_containing_global): Adjust
2863 size of symbol info entry.
2864 (dump_incremental_inputs): Dump argument serial number and
2865 in_system_directory flag; bias shndx by 1; print symbol names
2866 when dumping per-file symbol lists; use new symbol info readers.
2867 * incremental.cc
2868 (Output_section_incremental_inputs:update_data_size): New function.
2869 (Sized_incremental_binary::setup_readers): Setup input readers
2870 for each input file; build maps for files added from libraries
2871 and scripts.
2872 (Sized_incremental_binary::check_input_args): New function.
2873 (Sized_incremental_binary::do_check_inputs): Build map of argument
2874 serial numbers to input arguments.
2875 (Sized_incremental_binary::do_file_has_changed): Rename
2876 do_file_is_unchanged to this; compare file modification times.
2877 (Sized_incremental_binary::do_init_layout): New function.
2878 (Sized_incremental_binary::do_reserve_layout): New function.
2879 (Sized_incremental_binary::do_get_input_reader): Remove.
2880 (Sized_incremental_binary::get_symtab_view): New function.
2881 (Incremental_checker::can_incrementally_link_output_file): Remove.
2882 (Incremental_inputs::report_command_line): Exclude --debug options.
2883 (Incremental_inputs::report_archive_begin): Add parameter; track
2884 argument serial numbers; don't put input file entry for archive
2885 before archive members.
2886 (Incremental_inputs::report_archive_end): Put input file entry
2887 for archive after archive members.
2888 (Incremental_inputs::report_object): Add parameter; track argument
2889 serial numbers and in_system_directory flag.
2890 (Incremental_inputs::report_script): Add parameter; track argument
2891 serial numbers.
2892 (Output_section_incremental_inputs::set_final_data_size): Adjust
2893 size of symbol info entry; check for forwarding symbols.
2894 (Output_section_incremental_inputs::write_input_files): Write
2895 in_system_directory flag and argument serial number.
2896 (Output_section_incremental_inputs::write_info_blocks): Map section
2897 indices between incremental info and original input file; store
2898 input section index for each symbol.
2899 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
2900 change operator() to visit().
2901 (class Global_got_offset_visitor): Likewise.
2902 (class Global_symbol_visitor_got_plt):
2903 (Output_section_incremental_inputs::write_got_plt): Use new visitor
2904 classes.
2905 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
2906 (Sized_incr_relobj::do_read_symbols): New function.
2907 (Sized_incr_relobj::do_layout): New function.
2908 (Sized_incr_relobj::do_layout_deferred_sections): New function.
2909 (Sized_incr_relobj::do_add_symbols): New function.
2910 (Sized_incr_relobj::do_should_include_member): New function.
2911 (Sized_incr_relobj::do_for_all_global_symbols): New function.
2912 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
2913 (Sized_incr_relobj::do_section_size): New function.
2914 (Sized_incr_relobj::do_section_name): New function.
2915 (Sized_incr_relobj::do_section_contents): New function.
2916 (Sized_incr_relobj::do_section_flags): New function.
2917 (Sized_incr_relobj::do_section_entsize): New function.
2918 (Sized_incr_relobj::do_section_address): New function.
2919 (Sized_incr_relobj::do_section_type): New function.
2920 (Sized_incr_relobj::do_section_link): New function.
2921 (Sized_incr_relobj::do_section_info): New function.
2922 (Sized_incr_relobj::do_section_addralign): New function.
2923 (Sized_incr_relobj::do_initialize_xindex): New function.
2924 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
2925 (Sized_incr_relobj::do_read_relocs): New function.
2926 (Sized_incr_relobj::do_gc_process_relocs): New function.
2927 (Sized_incr_relobj::do_scan_relocs): New function.
2928 (Sized_incr_relobj::do_count_local_symbols): New function.
2929 (Sized_incr_relobj::do_finalize_local_symbols): New function.
2930 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
2931 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
2932 (Sized_incr_relobj::do_relocate): New function.
2933 (Sized_incr_relobj::do_set_section_offset): New function.
2934 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
2935 (Sized_incr_dynobj::do_read_symbols): New function.
2936 (Sized_incr_dynobj::do_layout): New function.
2937 (Sized_incr_dynobj::do_add_symbols): New function.
2938 (Sized_incr_dynobj::do_should_include_member): New function.
2939 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
2940 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
2941 (Sized_incr_dynobj::do_section_size): New function.
2942 (Sized_incr_dynobj::do_section_name): New function.
2943 (Sized_incr_dynobj::do_section_contents): New function.
2944 (Sized_incr_dynobj::do_section_flags): New function.
2945 (Sized_incr_dynobj::do_section_entsize): New function.
2946 (Sized_incr_dynobj::do_section_address): New function.
2947 (Sized_incr_dynobj::do_section_type): New function.
2948 (Sized_incr_dynobj::do_section_link): New function.
2949 (Sized_incr_dynobj::do_section_info): New function.
2950 (Sized_incr_dynobj::do_section_addralign): New function.
2951 (Sized_incr_dynobj::do_initialize_xindex): New function.
2952 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
2953 (make_sized_incremental_object): New function.
2954 (Incremental_library::copy_unused_symbols): New function.
2955 (Incremental_library::do_for_all_unused_symbols): New function.
2956 * incremental.h (enum Incremental_input_flags): New type.
2957 (class Incremental_checker): Remove.
2958 (Incremental_input_entry::Incremental_input_entry): Add argument
2959 serial number.
2960 (Incremental_input_entry::arg_serial): New function.
2961 (Incremental_input_entry::set_is_in_system_directory): New function.
2962 (Incremental_input_entry::is_in_system_directory): New function.
2963 (Incremental_input_entry::arg_serial_): New data member.
2964 (Incremental_input_entry::is_in_system_directory_): New data member.
2965 (class Script_info): Move here from script.h.
2966 (Script_info::Script_info): Add filename parameter.
2967 (Script_info::filename): New function.
2968 (Script_info::filename_): New data member.
2969 (Incremental_script_entry::Incremental_script_entry): Add argument
2970 serial number.
2971 (Incremental_object_entry::Incremental_object_entry): Likewise.
2972 (Incremental_object_entry::add_input_section): Build list of input
2973 sections with map to original shndx.
2974 (Incremental_object_entry::get_input_section_index): New function.
2975 (Incremental_object_entry::shndx_): New data member.
2976 (Incremental_object_entry::name_key_): Rename; adjust all refs.
2977 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
2978 (Incremental_archive_entry::Incremental_archive_entry): Add argument
2979 serial number.
2980 (Incremental_inputs::report_archive_begin): Likewise.
2981 (Incremental_inputs::report_object): Likewise.
2982 (Incremental_inputs::report_script): Likewise.
2983 (class Incremental_global_symbol_reader): New class.
2984 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
2985 and store flags and input file type.
2986 (Incremental_input_entry_reader::arg_serial): New function.
2987 (Incremental_input_entry_reader::type): Extract type from flags.
2988 (Incremental_input_entry_reader::is_in_system_directory): New function.
2989 (Incremental_input_entry_reader::get_input_section_count): Call
2990 accessor function for type.
2991 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
2992 function for type; adjust size of global symbol entry.
2993 (Incremental_input_entry_reader::get_global_symbol_count): Call
2994 accessor function for type.
2995 (Incremental_input_entry_reader::get_object_count): Likewise.
2996 (Incremental_input_entry_reader::get_object_offset): Likewise.
2997 (Incremental_input_entry_reader::get_member_count): Likewise.
2998 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
2999 (Incremental_input_entry_reader::get_member_offset): Likewise.
3000 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
3001 (Incremental_input_entry_reader::Global_symbol_info): Remove.
3002 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
3003 (Incremental_input_entry_reader::get_global_symbol_reader): New
3004 function.
3005 (Incremental_input_entry_reader::get_output_symbol_index): New
3006 function.
3007 (Incremental_input_entry_reader::type_): Remove.
3008 (Incremental_input_entry_reader::flags_): New data member.
3009 (Incremental_inputs_reader::input_file_offset): New function.
3010 (Incremental_inputs_reader::input_file_index): New function.
3011 (Incremental_inputs_reader::input_file): Call input_file_offset.
3012 (Incremental_inputs_reader::input_file_at_offset): New function.
3013 (Incremental_relocs_reader::get_r_type): Reformat.
3014 (Incremental_relocs_reader::get_r_shndx): Reformat.
3015 (Incremental_relocs_reader::get_r_offset): Reformat.
3016 (Incremental_relocs_reader::data): New function.
3017 (Incremental_binary::Incremental_binary): Initialize new data members.
3018 (Incremental_binary::check_inputs): Add cmdline parameter.
3019 (Incremental_binary::file_is_unchanged): Remove.
3020 (Input_reader::arg_serial): New function.
3021 (Input_reader::get_unused_symbol_count): New function.
3022 (Input_reader::get_unused_symbol): New function.
3023 (Input_reader::do_arg_serial): New function.
3024 (Input_reader::do_get_unused_symbol_count): New function.
3025 (Input_reader::do_get_unused_symbol): New function.
3026 (Incremental_binary::input_file_count): New function.
3027 (Incremental_binary::get_input_reader): Change signature to use
3028 index instead of filename.
3029 (Incremental_binary::file_has_changed): New function.
3030 (Incremental_binary::get_input_argument): New function.
3031 (Incremental_binary::get_library): New function.
3032 (Incremental_binary::get_script_info): New function.
3033 (Incremental_binary::init_layout): New function.
3034 (Incremental_binary::reserve_layout): New function.
3035 (Incremental_binary::output_file): New function.
3036 (Incremental_binary::do_check_inputs): New function.
3037 (Incremental_binary::do_file_is_unchanged): Remove.
3038 (Incremental_binary::do_file_has_changed): New function.
3039 (Incremental_binary::do_init_layout): New function.
3040 (Incremental_binary::do_reserve_layout): New function.
3041 (Incremental_binary::do_input_file_count): New function.
3042 (Incremental_binary::do_get_input_reader): Change signature.
3043 (Incremental_binary::input_args_map_): New data member.
3044 (Incremental_binary::library_map_): New data member.
3045 (Incremental_binary::script_map_): New data member.
3046 (Sized_incremental_binary::Sized_incremental_binary): Initialize
3047 new data members.
3048 (Sized_incremental_binary::output_section): New function.
3049 (Sized_incremental_binary::inputs_reader): Add const.
3050 (Sized_incremental_binary::symtab_reader): Add const.
3051 (Sized_incremental_binary::relocs_reader): Add const.
3052 (Sized_incremental_binary::got_plt_reader): Add const.
3053 (Sized_incremental_binary::get_symtab_view): New function.
3054 (Sized_incremental_binary::Inputs_reader): New typedef.
3055 (Sized_incremental_binary::Input_entry_reader): New typedef.
3056 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
3057 (Sized_incremental_binary::do_file_is_unchanged): Remove.
3058 (Sized_incremental_binary::do_file_has_changed): New function.
3059 (Sized_incremental_binary::do_init_layout): New function.
3060 (Sized_incremental_binary::do_reserve_layout): New function.
3061 (Sized_input_reader::Inputs_reader): Remove.
3062 (Sized_input_reader::Input_entry_reader): Remove.
3063 (Sized_input_reader::do_arg_serial): New function.
3064 (Sized_input_reader::do_get_unused_symbol_count): New function.
3065 (Sized_input_reader::do_get_unused_symbol): New function.
3066 (Sized_incremental_binary::do_input_file_count): New function.
3067 (Sized_incremental_binary::do_get_input_reader): Change signature;
3068 use index instead of filename.
3069 (Sized_incremental_binary::section_map_): New data member.
3070 (Sized_incremental_binary::input_entry_readers_): New data member.
3071 (class Sized_incr_relobj): New class.
3072 (class Sized_incr_dynobj): New class.
3073 (make_sized_incremental_object): New function.
3074 (class Incremental_library): New class.
3075 * layout.cc (Free_list::num_lists): New static data member.
3076 (Free_list::num_nodes): New static data member.
3077 (Free_list::num_removes): New static data member.
3078 (Free_list::num_remove_visits): New static data member.
3079 (Free_list::num_allocates): New static data member.
3080 (Free_list::num_allocate_visits): New static data member.
3081 (Free_list::init): New function.
3082 (Free_list::remove): New function.
3083 (Free_list::allocate): New function.
3084 (Free_list::dump): New function.
3085 (Free_list::print_stats): New function.
3086 (Layout_task_runner::run): Resize output file for incremental updates.
3087 (Layout::Layout): Initialize new data members.
3088 (Layout::set_incremental_base): New function.
3089 (Layout::init_fixed_output_section): New function.
3090 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
3091 incremental updates.
3092 (Layout::create_gold_note): Do not create gold note section for
3093 incremental updates.
3094 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
3095 for incremental updates.
3096 (Layout::set_section_offsets): For incremental updates, allocate space
3097 from free list.
3098 (Layout::create_symtab_sections): Layout with offsets relative to
3099 start of section; for incremental updates, allocate space from free
3100 list.
3101 (Layout::create_shdrs): For incremental updates, allocate space from
3102 free list.
3103 (Layout::finish_dynamic_section): For incremental updates, do not
3104 check --as-needed (fixed in subsequent patch).
3105 * layout.h (class Free_list): New class.
3106 (Layout::set_incremental_base): New function.
3107 (Layout::incremental_base): New function.
3108 (Layout::init_fixed_output_section): New function.
3109 (Layout::allocate): New function.
3110 (Layout::incremental_base_): New data member.
3111 (Layout::free_list_): New data member.
3112 * main.cc (main): Print Free_list statistics.
3113 * object.cc (Relobj::finalize_incremental_relocs): Add
3114 clear_counts parameter; clear counts only when clear_counts is set.
3115 (Sized_relobj::Sized_relobj): Initialize new base class.
3116 (Sized_relobj::do_layout): Don't report special sections.
3117 (Sized_relobj::do_for_all_local_got_entries): New function.
3118 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
3119 symtab_off to all symbol table offsets.
3120 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
3121 * object.h (class Got_offset_list): Move to top of file.
3122 (Object::Object): Allow case where input_file == NULL.
3123 (Object::~Object): Likewise.
3124 (Object::input_file): Assert that input_file != NULL.
3125 (Object::lock): Allow case where input_file == NULL.
3126 (Object::unlock): Likewise.
3127 (Object::is_locked): Likewise.
3128 (Object::token): Likewise.
3129 (Object::release): Likewise.
3130 (Object::is_incremental): New function.
3131 (Object::get_mtime): New function.
3132 (Object::for_all_local_got_entries): New function.
3133 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
3134 (Object::set_is_in_system_directory): New function.
3135 (Object::is_in_system_directory): New function.
3136 (Object::do_is_incremental): New function.
3137 (Object::do_get_mtime): New function.
3138 (Object::do_for_all_local_got_entries): New function.
3139 (Object::is_in_system_directory_): New data member.
3140 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
3141 (class Sized_relobj_base): New class.
3142 (class Sized_relobj): Derive from Sized_relobj_base.
3143 (class Sized_relobj::Symbols): Redeclare from base class.
3144 (class Sized_relobj::local_got_offset_list): Remove.
3145 (class Sized_relobj::Output_sections): Redeclare from base class.
3146 (class Sized_relobj::do_for_all_local_got_entries): New function.
3147 (class Sized_relobj::write_local_symbols): Add offset parameter.
3148 (class Sized_relobj::local_symbol_offset_): Update comment.
3149 (class Sized_relobj::local_dynsym_offset_): Update comment.
3150 * options.cc (Input_arguments::add_file): Remove const.
3151 * options.h (Input_file_argument::Input_file_argument):
3152 Initialize arg_serial_ (all constructors).
3153 (Input_file_argument::set_arg_serial): New function.
3154 (Input_file_argument::arg_serial): New function.
3155 (Input_file_argument::arg_serial_): New data member.
3156 (Input_arguments::Input_arguments): Initialize file_count_.
3157 (Input_arguments::add_file): Remove const.
3158 (Input_arguments::number_of_input_files): New function.
3159 (Input_arguments::file_count_): New data member.
3160 (Command_line::number_of_input_files): Call
3161 Input_arguments::number_of_input_files.
3162 * output.cc (Output_segment_headers::Output_segment_headers):
3163 Set current size.
3164 (Output_section::Input_section::current_data_size): New function.
3165 (Output_section::Output_section): Initialize new data members.
3166 (Output_section::add_input_section): Don't do merge sections for
3167 an incremental link; allocate space from free list for an
3168 incremental update.
3169 (Output_section::add_output_section_data): Allocate space from
3170 free list for an incremental update.
3171 (Output_section::update_data_size): New function.
3172 (Output_section::set_fixed_layout): New function.
3173 (Output_section::reserve): New function.
3174 (Output_segment::set_section_addresses): Remove const.
3175 (Output_segment::set_section_list_addresses): Remove const; allocate
3176 space from free list for an incremental update.
3177 (Output_segment::set_offset): Adjust size of RELRO segment for an
3178 incremental update.
3179 * output.h (Output_data::current_data_size): Move here from
3180 child classes.
3181 (Output_data::pre_finalize_data_size): New function.
3182 (Output_data::update_data_size): New function.
3183 (Output_section_headers::update_data_size): new function.
3184 (Output_section_data_build::current_data_size): Move to Output_data.
3185 (Output_data_strtab::update_data_size): New function.
3186 (Output_section::current_data_size): Move to Output_data.
3187 (Output_section::set_fixed_layout): New function.
3188 (Output_section::has_fixed_layout): New function.
3189 (Output_section::reserve): New function.
3190 (Output_section::update_data_size): New function.
3191 (Output_section::has_fixed_layout_): New data member.
3192 (Output_section::free_list_): New data member.
3193 (Output_segment::set_section_addresses): Remove const.
3194 (Output_segment::set_section_list_addresses): Remove const.
3195 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
3196 New function.
3197 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
3198 New function.
3199 * readsyms.cc (Read_symbols::do_read_symbols): Add library
3200 parameter when calling Add_symbols constructor; store argument
3201 serial number for members of a lib group.
3202 (Add_symbols::locks): Allow case where token == NULL.
3203 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
3204 (Read_member::~Read_member): New function.
3205 (Read_member::is_runnable): New function.
3206 (Read_member::locks): New function.
3207 (Read_member::run): New function.
3208 (Check_script::~Check_script): New function.
3209 (Check_script::is_runnable): New function.
3210 (Check_script::locks): New function.
3211 (Check_script::run): New function.
3212 (Check_library::~Check_library): New function.
3213 (Check_library::is_runnable): New function.
3214 (Check_library::locks): New function.
3215 (Check_library::run): New function.
3216 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
3217 (Add_symbols::library_): New data member.
3218 (class Read_member): New class.
3219 (class Check_script): New class.
3220 (class Check_library): New class.
3221 * reloc.cc (Read_relocs::is_runnable): Allow case where
3222 token == NULL.
3223 (Read_relocs::locks): Likewise.
3224 (Scan_relocs::locks): Likewise.
3225 (Relocate_task::locks): Likewise.
3226 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
3227 to clear counters.
3228 (Sized_relobj::incremental_relocs_scan): Fix comment.
3229 (Sized_relobj::do_relocate): Pass output file offset to
3230 write_local_symbols.
3231 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
3232 from class declaration.
3233 * script.cc (read_input_script): Allocate Script_info; pass
3234 argument serial number to report_script.
3235 * script.h (class Script_info): Move to incremental.h.
3236 * symtab.cc (Symbol_table::add_from_incrobj): New function.
3237 * symtab.h (Symbol_table::add_from_incrobj): New function.
3238 (Symbol_table::set_file_offset): New function.
3239
b961d0d7
CC
32402011-04-05 Cary Coutant <[email protected]>
3241
3242 * incremental-dump.cc (dump_incremental_inputs): Change signature
3243 to take a Sized_incremental_binary; change caller. Use readers
3244 in Sized_incremental_binary.
3245 * incremental.cc
3246 (Sized_incremental_binary::find_incremental_inputs_sections):
3247 Rename do_find_incremental_inputs_sections to this.
3248 (Sized_incremental_binary::setup_readers): New function.
3249 (Sized_incremental_binary::do_check_inputs): Check
3250 has_incremental_info_ flag; move setup code to setup_readers;
3251 use input readers.
3252 (Sized_incremental_binary::do_file_is_unchanged): New function.
3253 (Sized_incremental_binary::do_get_input_reader): New function.
3254 * incremental.h (class Incremental_binary): Move to end of file.
3255 (Incremental_binary::file_is_unchanged): New function.
3256 (Incremental_binary::do_file_is_unchanged): New function.
3257 (Incremental_binary::Input_reader): New class.
3258 (Incremental_binary::get_input_reader): New function.
3259 (class Sized_incremental_binary): Move to end of file.
3260 (Sized_incremental_binary::Sized_incremental_binary): Setup the
3261 input section reader classes.
3262 (Sized_incremental_binary::has_incremental_info): New function.
3263 (Sized_incremental_binary::inputs_reader): New function.
3264 (Sized_incremental_binary::symtab_reader): New function.
3265 (Sized_incremental_binary::relocs_reader): New function.
3266 (Sized_incremental_binary::got_plt_reader): New function.
3267 (Sized_incremental_binary::do_file_is_unchanged): New function.
3268 (Sized_incremental_binary::Sized_input_reader): New class.
3269 (Sized_incremental_binary::get_input_reader): New function.
3270 (Sized_incremental_binary::find_incremental_inputs_sections):
3271 Rename do_find_incremental_inputs_sections to this.
3272 (Sized_incremental_binary::setup_readers): New function.
3273 (Sized_incremental_binary::has_incremental_info_): New data member.
3274 (Sized_incremental_binary::inputs_reader_): New data member.
3275 (Sized_incremental_binary::symtab_reader_): New data member.
3276 (Sized_incremental_binary::relocs_reader_): New data member.
3277 (Sized_incremental_binary::got_plt_reader_): New data member.
3278 (Sized_incremental_binary::current_input_file_): New data member.
3279
a869183f
PP
32802011-04-05 Paul Pluzhnikov <[email protected]>
3281
3282 PR gold/12640
3283 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
3284 violation.
3285
32862011-03-30 Cary Coutant <[email protected]>
c7975edd
CC
3287
3288 * archive.cc (Archive::include_member): Adjust call to report_object.
3289 (Add_archive_symbols::run): Add script_info to call to
3290 report_archive_begin.
3291 (Lib_group::include_member): Adjust call to report_object.
3292 (Add_lib_group_symbols::run): Adjust call to report_object.
3293 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
3294 blocks. Add object count for script input files.
3295 * incremental.cc (Incremental_inputs::report_archive_begin): Add
3296 script_info parameter; change all callers.
3297 (Incremental_inputs::report_object): Add script_info parameter;
3298 change all callers.
3299 (Incremental_inputs::report_script): Store backpointer to
3300 incremental info entry.
3301 (Output_section_incremental_inputs::set_final_data_size): Record
3302 additional information for scripts.
3303 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3304 * incremental.h (Incremental_script_entry::add_object): New function.
3305 (Incremental_script_entry::get_object_count): New function.
3306 (Incremental_script_entry::get_object): New function.
3307 (Incremental_script_entry::objects_): New data member; adjust
3308 constructor.
3309 (Incremental_inputs::report_archive_begin): Add script_info parameter.
3310 (Incremental_inputs::report_object): Add script_info parameter.
3311 (Incremental_inputs_reader::get_object_count): New function.
3312 (Incremental_inputs_reader::get_object_offset): New function.
3313 * options.cc (Input_arguments::add_file): Return reference to
3314 new input argument.
3315 * options.h (Input_argument::set_script_info): New function.
3316 (Input_argument::script_info): New function.
3317 (Input_argument::script_info_): New data member; adjust all
3318 constructors.
3319 (Input_file_group::add_file): Return reference to new input argument.
3320 (Input_file_lib::add_file): Likewise.
3321 (Input_arguments::add_file): Likewise.
3322 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
3323 * script.cc (Parser_closure::Parser_closure): Add script_info
3324 parameter; adjust all callers.
3325 (Parser_closure::script_info): New function.
3326 (Parser_closure::script_info_): New data member.
3327 (read_input_script): Report scripts earlier to incremental info.
3328 (script_add_file): Set script_info in Input_argument.
3329 (script_add_library): Likewise.
3330 * script.h (Script_options::Script_info): Rewrite class.
3331
a869183f 33322011-03-29 Cary Coutant <[email protected]>
e0c52780
CC
3333
3334 * archive.cc (Library_base::should_include_member): Move
3335 method here from class Archive.
3336 (Archive::Archive): Initialize base class.
3337 (Archive::should_include_member): Move to base class.
3338 (Archive::do_for_all_unused_symbols): New function.
3339 (Add_archive_symbols::run): Remove redundant access to
3340 incremental_inputs.
3341 (Lib_group::Lib_group): Initialize base class.
3342 (Lib_group::do_filename): New function.
3343 (Lib_group::include_member): Pass pointer to Lib_group to
3344 report_object.
3345 (Lib_group::do_for_all_unused_symbols): New function.
3346 (Add_lib_group_symbols::run): Report archive information for
3347 incremental links.
3348 * archive.h (class Library_base): New base class.
3349 (class Archive): Derive from Library_base.
3350 (Archive::filename): Move to base class.
3351 (Archive::set_incremental_info): Likewise.
3352 (Archive::incremental_info): Likewise.
3353 (Archive::Should_include): Likewise.
3354 (Archive::should_include_member): Likewise.
3355 (Archive::Armap_entry): Remove.
3356 (Archive::Unused_symbol_iterator): Remove.
3357 (Archive::unused_symbols_begin): Remove.
3358 (Archive::unused_symbols_end): Remove.
3359 (Archive::do_filename): New function.
3360 (Archive::do_get_mtime): New function.
3361 (Archive::do_for_all_unused_symbols): New function.
3362 (Archive::task_): Move to base class.
3363 (Archive::incremental_info_): Likewise.
3364 (class Lib_group): Derive from Library_base.
3365 (Lib_group::do_filename): New function.
3366 (Lib_group::do_get_mtime): New function.
3367 (Lib_group::do_for_all_unused_symbols): New function.
3368 (Lib_group::task_): Move to base class.
3369 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
3370 function.
3371 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
3372 function.
3373 * incremental.cc (Incremental_inputs::report_archive_begin):
3374 Use Library_base; call library's get_mtime; add incremental inputs
3375 entry before members.
3376 (class Unused_symbol_visitor): New class.
3377 (Incremental_inputs::report_archive_end): Use Library_base; use
3378 visitor class to record unused symbols; don't add incremental inputs
3379 entry after members.
3380 (Incremental_inputs::report_object): Use Library_base.
3381 * incremental.h
3382 (Incremental_archive_entry::Incremental_archive_entry): Remove
3383 unused Archive parameter.
3384 (Incremental_inputs::report_archive_begin): Use Library_base.
3385 (Incremental_inputs::report_archive_end): Likewise.
3386 (Incremental_inputs::report_object): Likewise.
3387 * object.cc (Sized_relobj::do_for_all_global_symbols): New
3388 function.
3389 * object.h (Object::for_all_global_symbols): New function.
3390 (Object::do_for_all_global_symbols): New function.
3391 (Sized_relobj::do_for_all_global_symbols): New function.
3392 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
3393 function.
3394 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
3395 function.
3396
61ab3e40
ILT
33972011-03-27 Ian Lance Taylor <[email protected]>
3398
3399 * archive.cc (Archive::interpret_header): Return -1 if something
3400 goes wrong. Change callers accordingly.
3401
30e1f9e6
CC
34022011-03-25 Cary Coutant <[email protected]>
3403
3404 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
3405 * testsuite/Makefile.in: Regenerate.
3406
9370ce59 34072011-03-23 Rafael Ávila de Espíndola <[email protected]>
9c793f14
RÁE
3408
3409 * plugin.cc (get_view): New.
3410 (Plugin::load): Pass get_view to the plugin.
3411 (Plugin_manager::get_view): New.
3412
9312bb0a
ILT
34132011-03-21 Ian Lance Taylor <[email protected]>
3414
3415 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 3416 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 3417
7e12ba9e
ST
34182011-03-21 Sriraman Tallam <[email protected]>
3419
3420 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
3421 Change == to -eq.
3422 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
3423 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
3424 Change == to -eq.
3425 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
3426 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
3427
fd7a005d
ILT
34282011-03-14 Ian Lance Taylor <[email protected]>
3429
3430 * script-sections.cc (Sort_output_sections::script_compare):
3431 Rename from is_before, change return type.
3432 (Sort_output_sections::operator()): Adjust accordingly.
3433
ed16fd1b
ILT
34342011-03-11 Jeffrey Yasskin <[email protected]>
3435
3436 PR gold/12572
3437 * testsuite/odr_violation2.cc: Add comment to make all error line
3438 numbers double digits.
3439 * testsuite/debug_msg.sh: Adjust expected errors.
3440
71ff8986
ILT
34412011-03-09 Jeffrey Yasskin <[email protected]>
3442
3443 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
3444 but mark earlier ones as non-canonical
3445 (offset_to_iterator): Update search target and example
3446 (do_addr2line): Return extra lines in a vector*
3447 (format_file_lineno): Extract from do_addr2line
3448 (one_addr2line): Add vector* out-param
3449 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
3450 when a lineno entry appeared last for its instruction
3451 (Dwarf_line_info): Add vector* out-param
3452 * object.cc (Relocate_info): Pass NULL for the vector* out-param
3453 * symtab.cc (Odr_violation_compare): Include the lineno in the
3454 comparison again.
3455 (linenos_from_loc): New. Combine the canonical line for an
3456 address with its other lines.
3457 (True_if_intersect): New. Helper functor to make
3458 std::set_intersection a query.
3459 (detect_odr_violations): Compare sets of lines instead of just
3460 one line for each function. This became less deterministic, but
3461 has fewer false positives.
3462 * symtab.h: Declarations.
3463 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
3464 mix an optimized and non-optimized object in the same binary
3465 (odr_violation2.so): Same.
3466 * testsuite/Makefile.in: Regenerate from Makefile.am.
3467 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
3468 * testsuite/debug_msg.sh: Update line numbers and add
3469 assertions.
3470 * testsuite/odr_violation1.cc: Use OdrDerived, in a
3471 non-optimized context.
3472 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
3473 isn't inlined, and use OdrDerived in an optimized context.
3474 * testsuite/odr_header1.h: Defines OdrDerived, where
3475 optimization will change the
3476 first-instruction-in-the-destructor's file and line number.
3477 * testsuite/odr_header2.h: Defines OdrBase.
3478
a19fefdc
ILT
34792011-03-09 Ian Lance Taylor <[email protected]>
3480
3481 * fileread.cc (File_read::clear_views): Don't delete the whole
3482 file view.
3483
ecb351e9
ILT
34842011-03-08 Ian Lance Taylor <[email protected]>
3485
3486 PR gold/12525
3487 * fileread.cc: #include <climits>.
3488 (GOLD_IOV_MAX): Define.
3489 (File_read::read_multiple): Limit number of entries by iov_max.
3490 * fileread.h (class File_read): Always set max_readv_entries to
3491 128.
3492
b821d13c
ILT
34932011-03-07 Ian Lance Taylor <[email protected]>
3494
3495 PR gold/12525
3496 * options.h (class General_options): Add -dy and -dn.
3497
89243142
CC
34982011-03-02 Cary Coutant <[email protected]>
3499
3500 * testsuite/script_test_9.t: Add TLS segment.
3501
d0773f31
ILT
35022011-03-02 Simon Baldwin <[email protected]>
3503
3504 * configure.ac: Add check for gnu_indirect_function support in
3505 the toolchain building binutils.
3506 * configure: Rebuild.
3507
9370ce59 35082011-02-18 Rafael Ávila de Espíndola <[email protected]>
badc8139
RÁE
3509
3510 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
3511 plugin only symbols.
3512 (Symbol_table::sized_finalize_symbol) Mark symbol only present
3513 in plugin files as not needed in the symbol table.
3514
4cf7a849
ST
35152011-02-11 Sriraman Tallam <[email protected]>
3516
3517 * output.cc (Output_section::add_input_section): Delay fill
3518 generation for section ordering.
3519
b578bd7d
ILT
35202011-02-09 Ian Lance Taylor <[email protected]>
3521
3522 PR gold/12316
3523 * object.h (class Sized_relobj): Remove clear_local_symbols.
3524 * reloc.cc (Sized_relobj::do_relocate): Don't call
3525 clear_local_symbols.
3526
9370ce59 35272011-02-08 Rafael Ávila de Espíndola <[email protected]>
84ced98a
RÁE
3528
3529 * plugin.cc (is_visible_from_outside): Return true for symbols
3530 in the -u option.
3531
55382fb7
ILT
35322011-02-04 Jeffrey Yasskin <[email protected]>
3533
3534 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
3535 filename.
3536
4e271fff
ST
35372011-02-02 Sriraman Tallam <[email protected]>
3538
3539 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 3540 to std::string.
4e271fff 3541 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 3542 section_name to be std::string.
4e271fff
ST
3543 (is_function_ctor_or_dtor): Change type of parameter to std::string.
3544
d433c3ac
ILT
35452011-01-25 Ian Lance Taylor <[email protected]>
3546
3547 * script.cc (script_add_extern): Rewrite to use
3548 add_symbol_reference.
3549
880473a6
DK
35502011-01-25 Doug Kwan <[email protected]>
3551
d433c3ac 3552 * icf.cc (get_section_contents): Always lock section's object.
880473a6 3553
f30f86fa
ILT
35542011-01-24 Ian Lance Taylor <[email protected]>
3555
3556 * options.h (class General_options): Accept
3557 --no-detect-odr-violations.
3558
8e51a0b9
ILT
35592011-01-24 Ian Lance Taylor <[email protected]>
3560
3561 * version.cc (version_string): Bump to 1.11.
3562
0f3b89d8
ILT
35632011-01-24 Ian Lance Taylor <[email protected]>
3564
3565 * plugin.cc (class Plugin_rescan): Define new class.
3566 (Plugin_manager::claim_file): Set any_claimed_.
3567 (Plugin_manager::save_archive): New function.
3568 (Plugin_manager::save_input_group): New function.
3569 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
3570 necessary.
3571 (Plugin_manager::new_undefined_symbol): New function.
3572 (Plugin_manager::rescan): New function.
3573 (Plugin_manager::rescannable_defines): New function.
3574 (Plugin_manager::add_input_file): Set any_added_.
3575 * plugin.h (class Plugin_manager): define new fields rescannable_,
3576 undefined_symbols_, any_claimed_, and any_added_. Declare
3577 Plugin_rescan as friend. Declare new functions.
3578 (Plugin_manager::Rescannable): Define type.
3579 (Plugin_manager::Rescannable_list): Define type.
3580 (Plugin_manager::Undefined_symbol_list): Define type.
3581 (Plugin_manager::Plugin_manager): Initialize new fields.
3582 * archive.cc (Archive::defines_symbol): New function.
3583 (Add_archive_symbols::run): Pass archive to plugins if any.
3584 * archive.h (class Archive): Declare defines_symbol.
3585 * readsyms.cc (Input_group::~Input_group): New function.
3586 (Finish_group::run): Pass input_group to plugins if any.
3587 * readsyms.h (class Input_group): Declare destructor.
3588 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
3589 any.
3590
3bb951e5
ILT
35912011-01-10 Ian Lance Taylor <[email protected]>
3592
3593 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
3594 section as relro.
3595 (Layout::set_segment_offsets): Reset increase_relro before calling
3596 set_section_addresses a second time.
3597
0aa45fac
CC
35982011-01-04 Cary Coutant <[email protected]>
3599
3600 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
3601 sections before NOBITS sections.
3602
0db46eb4
L
36032011-01-01 H.J. Lu <[email protected]>
3604
3605 * version.cc (print_version): Update copyright to 2011.
3606
829c9745
CC
36072010-12-23 Cary Coutant <[email protected]>
3608
3609 * output.h (Output_data_reloc::add_output_section): Pass OD instead
3610 of OS to this->add. Add OD parameter to second form of the function.
3611
7500420b
ILT
36122010-12-20 Ian Lance Taylor <[email protected]>
3613
3614 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
3615 second of two consecutive entries with same offset.
3616
f8e9a930
RW
36172010-12-16 Ralf Wildenhues <[email protected]>
3618
3619 * testsuite/Makefile.am (ifuncmain2static_LDADD)
3620 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
3621 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
3622 to avoid unneeded links against $(LDADD).
3623 * testsuite/Makefile.in: Regenerate.
3624
2fbb4320
ILT
36252010-12-15 Ian Lance Taylor <[email protected]>
3626
3627 PR gold/12324
3628 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
3629 for R_X86_64_32 and R_X86_64_PC32.
3630 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
3631 ver_matching_def_pic.o.
3632 (ver_matching_def_pic.o): New target.
3633
fedb228d
RW
36342010-12-14 Ralf Wildenhues <[email protected]>
3635
3636 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
3637 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
3638 Move definition before File_read::View member definitions.
3639 (File_read::View::~View): Initialize and hold lock before
3640 updating current_mapped_bytes.
3641
9b547ce6
RW
36422010-12-14 Ralf Wildenhues <[email protected]>
3643
3644 * dwarf_reader.cc: Remove outdated comment.
3645 * gold-threads.cc: Fix typo in error message.
3646 * archive.cc: Fix typos in comments.
3647 * archive.h: Likewise.
3648 * arm-reloc-property.cc: Likewise.
3649 * arm-reloc-property.h: Likewise.
3650 * arm-reloc.def: Likewise.
3651 * arm.cc: Likewise.
3652 * attributes.h: Likewise.
3653 * cref.cc: Likewise.
3654 * ehframe.cc: Likewise.
3655 * fileread.h: Likewise.
3656 * gold.h: Likewise.
3657 * i386.cc: Likewise.
3658 * icf.cc: Likewise.
3659 * incremental.h: Likewise.
3660 * int_encoding.cc: Likewise.
3661 * layout.h: Likewise.
3662 * main.cc: Likewise.
3663 * merge.h: Likewise.
3664 * object.cc: Likewise.
3665 * object.h: Likewise.
3666 * options.cc: Likewise.
3667 * readsyms.cc: Likewise.
3668 * reduced_debug_output.cc: Likewise.
3669 * reloc.cc: Likewise.
3670 * script-sections.cc: Likewise.
3671 * sparc.cc: Likewise.
3672 * symtab.h: Likewise.
3673 * target-reloc.h: Likewise.
3674 * target.cc: Likewise.
3675 * target.h: Likewise.
3676 * timer.cc: Likewise.
3677 * timer.h: Likewise.
3678 * x86_64.cc: Likewise.
3679
83e17bd5
CC
36802010-12-09 Cary Coutant <[email protected]>
3681
3682 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
3683 stack.
3684 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
3685 parameter; change all callers.
3686 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
3687 * options.h (warn_execstack): New option.
3688
017257f8
DK
36892010-12-07 Doug Kwan <[email protected]>
3690
3691 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
3692 like function call relocations.
3693
c20cbc06
ILT
36942010-12-07 Ian Lance Taylor <[email protected]>
3695
3696 * archive.cc (Archive::get_elf_object_for_member): Permit
3697 punconfigured to be NULL.
3698 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
3699 (Archive::include_member): Pass NULL to get_elf_object_for_member
3700 if we searched for the archive and this is the first included
3701 object.
3702
4dbfafcc
ILT
37032010-12-01 Ian Lance Taylor <[email protected]>
3704
3705 * dwarf_reader.h (class Sized_dwarf_line_info): Add
3706 track_relocs_type_ field.
3707 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3708 Set track_relocs_type_.
3709 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
3710 contents when using RELA relocs.
3711 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
3712 reloc_map_.
3713 * reloc.cc (Track_relocs::next_addend): New function.
3714 * reloc.h (class Track_relocs): Declare next_addend.
3715
e5e19edd
ILT
37162010-12-01 Ian Lance Taylor <[email protected]>
3717
3718 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
3719 virtual destructor.
3720
9a5ce24c
ILT
37212010-12-01 Ian Lance Taylor <[email protected]>
3722
3723 * README: Update compilers known to work and fail.
3724
c7791212
NC
37252010-11-23 Matthias Klose <[email protected]>
3726
3727 * configure.in: For --enable-gold, handle value `default' instead of
3728 `both*'. Always install ld as ld.bfd, install as ld if gold is
3729 not the default.
3730 * configure: Regenerate.
3731
0ad220c9
DK
37322010-11-18 Doug Kwan <[email protected]>
3733
3734 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
3735 and right_alignment to be zero. Store result alignment only if it is
3736 greater than existing alignment.
3737
ab8056e0
CC
37382010-11-16 Cary Coutant <[email protected]>
3739
3740 PR gold/12220
3741 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3742 Check for ".zdebug_line".
3743
fd064a5b
CC
37442010-11-16 Doug Kwan <[email protected]>
3745 Cary Coutant <[email protected]>
3746
3747 * output.h (Output_segment::set_section_addresses): Pass increase_relro
3748 by reference; adjust all callers.
3749 * output.cc (Output_segment::set_section_addresses): Adjust references
3750 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
3751 list is empty.
3752 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
3753 end at page boundary.
3754
6fc6ea19
CC
37552010-11-16 Cary Coutant <[email protected]>
3756
3757 PR gold/12220
3758 * layout.cc (Layout::choose_output_section): Transform names of
3759 compressed sections even when using a script with a SECTIONS clause.
3760 (Layout::output_section_name): Remove code to transform
3761 compressed debug section names.
3762 * output.cc (Output_section::add_input_section): Use uncompressed
3763 section size when tracking input sections.
3764
95a2c8d6
RS
37652010-11-11 Richard Sandiford <[email protected]>
3766
3767 * symtab.h (Symbol::NON_PIC_REF): Remove.
3768 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
3769 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
3770 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
3771 (Symbol::use_plt_offset): Take a flags argument and pass it
3772 directly to needs_dynamic_reloc. Restrict check for undefined
3773 weak symbols to function calls.
3774 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
3775 (Target_arm::Scan::global): Use it.
3776 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
3777 (Target_arm::Relocate::relocate): Likewise.
3778 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
3779 parameter with an r_type parameter. Use get_reference_flags
3780 to get the flags.
3781 (Target_arm::Relocate::relocate): Update accordingly.
3782 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
3783 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
3784 (Target_i386::Scan::global): Likewise.
3785 (Target_i386::Relocate::relocate): Likewise.
3786 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
3787 parameter with an r_type parameter. Use get_reference_flags
3788 to get the flags.
3789 (Target_i386::Relocate::relocate): Update accordingly.
3790 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
3791 (Target_powerpc::Scan::global): Use it.
3792 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
3793 (Target_powerpc::Relocate::relocate): Likewise.
3794 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
3795 (Target_sparc::Scan::global): Use it.
3796 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
3797 (Target_sparc::Relocate::relocate): Likewise.
3798 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
3799 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
3800 (Target_x86_64::Scan::global): Likewise.
3801 (Target_x86_64::Relocate::relocate): Likewise.
3802
f625ae50
DK
38032010-11-08 Doug Kwan <[email protected]>
3804 Cary Coutant <[email protected]>
3805
3806 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
3807 (Arm_exidx_merge_section::section_contents_): New data member.
3808 (Arm_input_section::Arm_input_section): Initialize original_contents_.
3809 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 3810 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
3811 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
3812 in parameters instead of calling Object::section_contents without
3813 locking.
3814 (Arm_output_section::group_section): New parameter TASK. Pass it
3815 to callees that need locking objects.
3816 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
3817 to lock EXIDX input sections. Fix a formatting issue. Call
3818 Arm_exidx_merged_section::build_contents to create merged section
3819 contents.
3820 (Arm_output_section::create_stub_group): New parameter TASK. Use it
3821 to lock object of stub table owner.
3822 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
3823 TEXT_SIZE to initialize data member TEXT_SIZE_.
3824 (Arm_exidx_input_section::addralign): Fix typo in comment.
3825 (Arm_exidx_input_section::text_size): New method.
3826 (Target_arm::do_relax): New parameter TASK. Pass it to callees
3827 that require locking objects. Lock objects before scanning for stubs
3828 and updating local symbols.
3829 (Arm_input_section<big_endian>::init): Copy contents of original
3830 input section.
2e702c99 3831 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
3832 original input section instead of calling Object::section_contents
3833 without locking.
3834 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
3835 size without calling Object::section_size().
3836 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
3837 for size. Allocate a buffer for merged EXIDX entries.
3838 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 3839 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
3840 building code to Arm_exidx_merged_section::build_contetns. Write
3841 out contetns in buffer instead of building it on the fly.
3842 (Arm_relobj::make_exidx_input_section): Also pass text section size
3843 to Arm_exidx_input_section constructor.
3844 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
3845 (Arm_dynobj::do_read_symbols): Fix memory leak.
3846 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
3847 * target.h: (class Task): Add forward declaration.
3848 (Target::relax): Add new parameter TASK and pass it to
3849 Target::do_relax().
3850 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
3851
5f9bcf58
CC
38522010-11-05 Cary Coutant <[email protected]>
3853
3854 PR gold/10708
3855 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
3856 object when reading from the file.
3857 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
3858 second layout pass.
3859 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
3860 when reading section contents.
3861 (get_section_contents): Likewise.
3862 (icf::find_identical_sections): Likewise.
3863 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
3864 object when reading from the file.
3865 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
3866 the object when doing deferred section layout.
3867
e597fa08
NC
38682010-11-03 Nick Clifton <[email protected]>
3869
3870 PR gold/12001
3871 * script.h (class Symbol_assignment: name): New member. Returns
3872 the name of the symbol.
3873 * scrfipt.cc (Script_options::is_pending_assignment): New member.
3874 Returns true if the given symbol name is on the list of
3875 assignments wating to be processed.
3876 * archive.cc (should_incldue_member): If the symbol is undefined,
3877 check to see if it is on the list of symbols pending assignment.
3878
3f9a3278
ILT
38792010-11-03 Ryan Mansfield <[email protected]>
3880
3881 * script-sections.cc (Script_sections::find_memory_region): Check
3882 for a NULL output section pointer.
3883
d06fb4d1
DK
38842010-10-29 Doug Kwan <[email protected]>
3885
3886 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
3887 Output_section::add_relaxed_input_section.
3888 * output.cc (Output_section::add_relaxed_input_section): Add new
3889 arguments LAYOUT and NAME. Set section order index.
3890 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
3891 Copy section order index.
3892 * output.h (Output_section::add_relaxed_input_section): Add new
3893 arguments LAYOUT and NAME.
3894
90e24de5
ILT
38952010-10-29 Viktor Kutuzov <[email protected]>
3896
3897 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 3898 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
3899 * testsuite/Makefile.in: Regenerate.
3900
c9484ea5
DK
39012010-10-20 Doug Kwan <[email protected]>
3902
3903 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
3904 without SHF_LINK_ORDER flags.
3905 * layout.cc (Layout::choose_output_section): Do not filter
3906 SHF_LINK_ORDER flag in a relocatable link.
3907
5bc2f5be
CC
39082010-10-17 Cary Coutant <[email protected]>
3909
3910 * output.h (Output_segment::set_section_addresses): Change function
3911 signature. Update all callers.
3912 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
3913 sections.
3914 (Output_segment::set_section_addresses): Align after last TLS
3915 section. Add padding before last relro section instead of after.
3916
0c91cf04
DK
39172010-10-17 Doug Kwan <[email protected]>
3918
3919 * gold/arm.cc (Target_arm::got_section): Use correct order and set
3920 GOT output section to be writable.
3921
8c21d9d3
CC
39222010-10-14 Cary Coutant <[email protected]>
3923
3924 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
3925 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
3926 * gold.cc (queue_initial_tasks): Check parameters for incremental link
3927 mode.
3928 * incremental.cc (report_command_line): Ignore all forms of
3929 --incremental.
3930 * layout.cc (Layout::Layout): Check parameters for incremental link
3931 mode.
3932 * options.cc (General_options::parse_incremental): New function.
3933 (General_options::parse_no_incremental): New function.
3934 (General_options::parse_incremental_full): New function.
3935 (General_options::parse_incremental_update): New function.
3936 (General_options::incremental_mode_): New data member.
3937 (General_options::finalize): Check incremental_mode_.
3938 * options.h (General_options): Update help text for --incremental.
3939 Add --no-incremental, --incremental-full, --incremental-update.
3940 (General_options::Incremental_mode): New enum type.
3941 (General_options::incremental_mode): New function.
3942 (General_options::incremental_mode_): New data member.
3943 * parameters.cc (Parameters::incremental_mode_): New data member.
3944 (Parameters::set_options): Set incremental_mode_.
3945 (Parameters::set_incremental_full): New function.
3946 (Parameters::incremental): New function.
3947 (Parameters::incremental_update): New function.
3948 (set_parameters_incremental_full): New function.
3949 * parameters.h (Parameters::set_incremental_full): New function.
3950 (Parameters::incremental): New function.
3951 (Parameters::incremental_update): New function.
3952 (Parameters::incremental_mode_): New data member.
3953 (set_parameters_incremental_full): New function.
3954 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
3955 incremental link mode.
3956 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
3957 (Sized_relobj::do_relocate_sections): Likewise.
3958 * testsuite/Makefile.am (incremental_test): Use --incremental-full
3959 option.
3960 * testsuite/Makefile.in: Regenerate.
3961 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 3962
bb32aa18 39632010-10-12 Viktor Kutuzov <[email protected]>
eb373049
ILT
3964
3965 * script-sections.h (class Script_sections): Make
3966 Sections_elements typedef public.
3967 * script-sections.cc (class Sort_output_sections): Add elements_
3968 field. Add constructor which sets it; change all callers.
3969 (Sort_output_sections::is_before): New function.
3970 (Sort_output_sections::operator()): Call is_before.
3971 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
3972 conditional.
3973 * testsuite/script_test_10.sh: New test. Test script section
3974 order.
3975 * testsuite/script_test_10.t: Likewise.
3976 * testsuite/script_test_10.s: Likewise.
3977 * testsuite/Makefile.am: Wrap the cross linker tests and the
3978 common tests into NATIVE_OR_CROSS_LINKER.
3979 (check_SCRIPTS): Add script_test_10.sh.
3980 (check_DATA): Add script_test_10.stdout.
3981 (script_test_10.o, script_test_10): New targets.
3982 (script_test_10.stdout): New target.
3983 * configure, testsuite/Makefile.in: Regenerate.
3984
3cef7179
ILT
39852010-10-12 Viktor Kutuzov <[email protected]>
3986
3987 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
3988 error for the deprecated relocations.
3989 (Target_arm::Scan::global): Likewise.
3990 (Target_arm::Relocate::relocate): Likewise.
3991
7411e9a8
RS
39922010-10-12 Richard Sandiford <[email protected]>
3993
3994 * fileread.cc (Input_file::find_file): Initialize *found_name
3995 and *namep when using the fallback search for case 4.
3996
6a9da32a
CC
39972010-10-11 Cary Coutant <[email protected]>
3998
3999 * options.h (class General_options): Redefine -z lazy as an alias for
4000 the negation of -z now.
4001
ac897c20
ILT
40022010-10-11 Ian Lance Taylor <[email protected]>
4003
4004 * resolve.cc (symbol_to_bits): Report the value of the unsupported
4005 binding.
4006
ea5cae92
NC
40072010-10-06 Nick Clifton <[email protected]>
4008
4009 * script-sections.cc(class Memory_region): Remove
4010 current_lma_offset_ field. Rename current_vma_offset_ to
4011 current_offset_. Add last_section_ field.
4012 (Memory_region::get_current_vma_address): Rename to
4013 get_current_address.
4014 (Memory_region::get_current_lma_address): Delete.
4015 (Memory_region::increment_vma_offset): Rename to
4016 increment_offset.
4017 (Memory_region::increment_lma_offset): Delete.
4018 (Memory_region::attributes_compatible): New method. Returns
4019 true if the provided section is compatible with the region.
4020 (Memory_region::get_last_section): New method. Returns the last
4021 section to use the region.
4022 (Memory_region::set_last_section): New method. Stores the last
4023 section to use the region.
4024 (Script_sections::block_in_region): New method. Returns true if
4025 a block of memory is contained within a region.
4026 (Script_sections::find_memory_region): New method. Locates a
4027 memory region to be used to set a VMA or LMA address.
4028 (Output_section_definition::set_section_addresses): Add code to
4029 check for addresses set by memory regions.
4030 (Output_segment::set_section_addresses): Remove memory region
4031 walking code.
4032 (Script_sections::create_segment): Add a warning if a header
4033 segment is created outside of any region.
4034 * script-sections.h (class Script_sections): Add prototypes for
4035 find_memory_region and block_in_region methods.
4036 * testsuite/memory_test.s: Use .long instead of .word.
4037 * testsuite/memory_test.t: Add some more output sections.
4038 * testsuite/memory_test.sh: Update expected output.
4039
a9bfd952
DK
40402010-10-02 Doug Kwan <[email protected]>
4041
4042 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
4043 defintion to symtab.h
4044 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
4045 declaration to defintion.
4046
bacff3ab
NC
40472010-10-01 Nick Clifton <[email protected]>
4048
4049 * expression.cc (eval): Replace dummy argument with NULL.
4050 (eval_maybe_dot): Check for a NULL result section pointer.
4051 (Symbol_expression::value): Likewise.
4052 (Dot_expression::value): Likewise.
4053 (BINARY_EXPRESSION): Likewise.
4054 (Max_expression::value): Likewise.
4055 (Min_expression::value): Likewise.
4056 (Absolute_expression::value): Likewise.
4057 (Addr_expression::value_from_output_section): Likewise.
4058 (Loaddddr_expression::value_from_output_section): Likewise.
4059 (Segment_start_expression::value): Likewise.
4060 * script-sections.cc
4061 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
4062 argument with NULL.
4063 (Sections_elememt_dot_assignment::set_section_addresses):
4064 Likewise.
4065 (Output_data_expression::do_write_to_buffer): Likewise.
4066 (Output_section_definition::finalize_symbols): Likewise.
4067 (Output_section_definition::set_section_addresses): Likewise.
4068
f81bc8b5
DK
40692010-09-30 Doug Kwan <[email protected]>
4070
4071 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
4072
c95e9f27
ST
40732010-09-28 Sriraman Tallam <[email protected]>
4074
4075 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 4076 function.
c95e9f27
ST
4077 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
4078 virtual function.
4079 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
4080 virtual function.
4081 * icf.cc (get_section_contents): Inline merge sections only when
4082 target allows it.
4083
3cac54d2
RW
40842010-09-27 Ralf Wildenhues <[email protected]>
4085
4086 * configure: Regenerate.
4087
2904037a
ILT
40882010-09-17 Ian Lance Taylor <[email protected]>
4089
4090 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
4091 * testsuite/Makefile.am (memory_test.o): New target.
4092 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
4093 memory_test.t.
4094 * testsuite/Makefile.in: Rebuild.
2904037a 4095
bca7fb63
DK
40962010-09-17 Doug Kwan <[email protected]>
4097
4098 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
4099 defintion if relocation uses GOT entries of the symbol.
4100 * testsuite/icf_safe_test.sh: Fix test.
4101 * testsuite/icf_safe_so_test.sh: Fix test.
4102
4ef28648
CC
41032010-09-16 Cary Coutant <[email protected]>
4104
4105 * script_sections.cc (class Memory_region): Remove "NULL" from
4106 vector initializations.
4107
793990de
CC
41082010-09-15 Cary Coutant <[email protected]>
4109
4110 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
4111 Resolve forwarding symbols.
4112
81e015e2
DK
41132010-09-15 Doug Kwan <[email protected]>
4114
4115 * gold/testsuite/script_test_3.t: Add ARM special sections.
4116 * gold/testsuite/script_test_4.t: Same.
4117 * gold/testsuite/script_test_5.t: Same.
4118 * gold/testsuite/script_test_6.t: Same.
4119 * gold/testsuite/script_test_7.t: Same.
4120 * gold/testsuite/script_test_7.t: Same.
4121 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
4122
36171d64
CC
41232010-09-14 Cary Coutant <[email protected]>
4124
4125 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
4126 (Target_x86_64::Relocate::relocate_tls): Replace check for
4127 saw_tls_block_reloc_ with test for executable section.
4128
d89051bd
CC
41292010-09-12 Cary Coutant <[email protected]>
4130
4131 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
4132 position-independent executables to shared libraries need dynamic
4133 relocations.
4134 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
4135 position-independent executables.
4136 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
4137 * testsuite/Makefile.in: Regenerate.
4138
fca41f0f
NC
41392010-09-10 Nick Clifton <[email protected]>
4140
4141 PR gold/11997
4142 * testsuite/memory_test.t: Discard any sections that are not
4143 needed.
4144
6695e4b3
L
41452010-09-09 H.J. Lu <[email protected]>
4146
4147 PR gold/11996
4148 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
4149 "This::" to work around a bug in gcc 4.2.
4150
4151 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
4152
0f72bf6f
RÁE
41532010-09-09 Rafael Espindola <[email protected]>
4154
4155 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
4156 sections with different PF_X flags in the same segment.
4157 (Layout::find_first_load_seg): Search all segments to find the first
4158 one.
4159 * options.h (rosegment): New.
4160
41612010-09-08 Rafael Espindola <[email protected]>
a6577478 4162
05a79166 4163 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 4164
aa98ff75
DK
41652010-09-08 Doug Kwan <[email protected]>
4166
4167 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
4168 (Arm_relobj::do_relocate_sections): Add new parameter for output
4169 file to match the parent.
4170 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
4171 of local symbols instead of input values. Update code to track
4172 changes in gold::relocate_section.
4173 * object.cc (Sized_relobj::compute_final_local_value): New methods.
4174 (Sized_relobj::compute_final_local_value_internal): New methods.
4175 (Sized_relobj::do_finalize_local_symbols): Move code from loop
4176 body into private version of Sized_relobj::compute_final_local_value.
4177 Call the inline method.
4178 * object.h (Symbol_value::Symbol_value): Define destructor. Free
4179 merged symbol value if there is one.
4180 (Symbol_value::has_output_value): New method defintiion.
4181 (Sized_relobj::Compute_final_local_value_status): New enum type.
4182 (Sized_relobj::compute_final_local_value): New methods.
4183 (Sized_relobj::compute_final_local_value_internal): New methods.
4184 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
4185 and arm_cortex_a8.sh.
4186 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
4187 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
4188 New tests.
4189 * Makefile.in: Regenerate.
4190 * testsuite/arm_bl_out_of_range.s: Update test.
4191 * testsuite/thumb_bl_out_of_range.s: Ditto.
4192 * testsuite/thumb_blx_out_of_range.s: Ditto.
4193 * testsuite/arm_branch_out_of_range.sh: New file.
4194 * testsuite/arm_cortex_a8.sh: Ditto.
4195 * testsuite/arm_cortex_a8_b.s: Ditto.
4196 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
4197 * testsuite/arm_cortex_a8_b_local.s: Ditto.
4198 * testsuite/arm_cortex_a8_bl.s: Ditto.
4199 * testsuite/arm_cortex_a8_blx.s: Ditto.
4200 * testsuite/arm_cortex_a8_local.s: Ditto.
4201 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
4202 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
4203
05a79166
L
42042010-09-08 Rafael Espindola <[email protected]>
4205
4206 * Makefile.am (memory_test.stdout): Run readelf with -W.
4207 * Makefile.in: Regenerate.
4208 * testsuite/memory_test.sh: Make the regexps accept both 32 and
4209 64 bit output.
4210
33dbc701
RÁE
42112010-09-08 Rafael Espindola <[email protected]>
4212
4213 * script-sections.cc (Script_sections::add_memory_region): Convert
4214 field precision to int.
4215 * script.cc (script_set_section_region, script_set_section_region):
4216 Convert field precision to int.
4217
731ca54a
RÁE
42182010-09-08 Rafael Espindola <[email protected]>
4219
4220 * arm.cc (do_finalize_sections): Create the __exidx_start and
4221 __exdix_end symbols even when the section is missing.
4222
7f8cd844
NC
42232010-09-08 Nick Clifton <[email protected]>
4224
4225 * README: Remove claim that MEMORY is not supported.
4226 * expression.cc (script_exp_function_origin)
4227 (script_exp_function_length): Move from here to ...
4228 * script.cc: ... here.
4229 (script_set_section_region, script_add_memory)
4230 (script_parse_memory_attr, script_include_directive): New
4231 functions.
4232 * script-sections.cc
4233 (class Memory_region): New class.
4234 (class Output_section_definition): Add set_memory_region,
4235 set_section_vma, set_section_lma and get_section_name methods.
4236 (class Script_Sections): Add add_memory_region,
4237 find_memory_region, find_memory_region_origin,
4238 find_memory_region_length and set_memory_region methods.
4239 Have set_section_addresses method walk the list of set memory
4240 regions.
4241 Extend the print methos to display memory regions.
4242 * script-sections.h: Add prototypes for new methods.
4243 Add enum for MEMORY region attributes.
4244 * yyscript.y: Add support for parsing MEMORY regions.
4245 * script-c.h: Add prototypes for new functions.
4246 * testsuite/Makefile.am: Add test of MEMORY region functionality.
4247 * testsuite/Makefile.in: Regenerate.
4248 * testsuite/memory_test.sh: New script.
4249 * testsuite/memory_test.s: New assembler source file.
4250 * testsuite/memory_test.t: New linker script.
4251
a4649286
DK
42522010-08-27 Doug Kwan <[email protected]>
4253
4254 * gold/resolve.cc (Symbol_table::should_override): Let a weak
4255 reference override an existing dynamic weak reference.
4256 * testsuite/Makefile.am: Add new test dyn_weak_ref.
4257 * testsuite/Makefile.in: Regenerate.
4258 * testsuite/dyn_weak_ref.sh: New file.
4259 * testsuite/dyn_weak_ref_1.c: Ditto.
4260 * testsuite/dyn_weak_ref_2.c: Ditto.
4261
b56648ad
ILT
42622010-08-27 Ian Lance Taylor <[email protected]>
4263
4264 * incremental.h (class Incremental_input_entry): Add virtual
4265 destructor.
4266
809313cb
ILT
42672010-08-27 Ian Lance Taylor <[email protected]>
4268
4269 * testsuite/start_lib_test_3.c: Mark t3 as used.
4270
11e32464
NC
42712010-08-27 Nick Clifton <[email protected]>
4272
4273 * options.cc (version_script): Fix small typo in previous
4274 whitespace tidyup.
4275
ca09d69a
NC
42762010-08-25 Nick Clifton <[email protected]>
4277
4278 * archive.cc: Formatting fixes: Remove whitespace between
4279 typename and following asterisk. Remove whitespace between
4280 function name and opening parenthesis.
4281 * archive.h: Likewise.
4282 * arm.cc: Likewise.
4283 * attributes.cc: Likewise.
4284 * attributes.h: Likewise.
4285 * common.cc: Likewise.
4286 * copy-relocs.cc: Likewise.
4287 * dirsearch.h: Likewise.
4288 * dynobj.cc: Likewise.
4289 * ehframe.cc: Likewise.
4290 * ehframe.h: Likewise.
4291 * expression.cc: Likewise.
4292 * fileread.cc: Likewise.
4293 * fileread.h: Likewise.
4294 * gc.h: Likewise.
4295 * gold-threads.cc: Likewise.
4296 * gold.cc: Likewise.
4297 * i386.cc: Likewise.
4298 * icf.h: Likewise.
4299 * incremental-dump.cc: Likewise.
4300 * incremental.cc: Likewise.
4301 * layout.cc: Likewise.
4302 * layout.h: Likewise.
4303 * main.cc: Likewise.
4304 * merge.cc: Likewise.
4305 * merge.h: Likewise.
4306 * object.cc: Likewise.
4307 * object.h: Likewise.
4308 * options.cc: Likewise.
4309 * options.h: Likewise.
4310 * output.cc: Likewise.
4311 * output.h: Likewise.
4312 * plugin.cc: Likewise.
4313 * plugin.h: Likewise.
4314 * powerpc.cc: Likewise.
4315 * reloc.cc: Likewise.
4316 * script-c.h: Likewise.
4317 * script-sections.cc: Likewise.
4318 * script.cc: Likewise.
4319 * stringpool.cc: Likewise.
4320 * symtab.cc: Likewise.
4321 * symtab.h: Likewise.
4322 * target.cc: Likewise.
4323 * timer.cc: Likewise.
4324 * timer.h: Likewise.
4325 * version.cc: Likewise.
4326 * x86_64.cc: Likewise.
4327
b8fa8750
NC
43282010-08-24 Nick Clifton <[email protected]>
4329
4330 PR 11899
4331 * layout.cc (segment_precedes): Sort segments by their physical
4332 addresses, if they have been set.
4333
9919d93b
CC
43342010-08-23 Cary Coutant <[email protected]>
4335
4336 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
4337 symbols data.
4338 (Lib_group::include_member): Unlock object after deleting its
4339 symbols data.
4340 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
4341 the bug fixed here.
4342
97b4be1c
CC
43432010-08-19 Neil Vachharajani <[email protected]>
4344 Cary Coutant <[email protected]>
4345
4346 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
4347 constructor, and set_blocker.
4348 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
4349 readsyms_blocker_.
4350 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
4351 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
4352 * testsuite/Makefile.am (start_lib_test): New test case.
4353 * testsuite/Makefile.in: Regenerate.
4354 * testsuite/start_lib_test_main.c: New file.
4355 * testsuite/start_lib_test_1.c: New file.
4356 * testsuite/start_lib_test_2.c: New file.
4357 * testsuite/start_lib_test_3.c: New file.
4358
dd0b1884
ILT
43592010-08-19 Ian Lance Taylor <[email protected]>
4360
4361 * Makefile.in: Rebuild with automake 1.11.1.
4362 * aclocal.m4: Likewise.
4363 * testsuite/Makefile.in: Likewise.
4364
7223e9ca
ILT
43652010-08-19 Ian Lance Taylor <[email protected]>
4366
4367 PR 10893
4368 * i386.cc (class Output_data_plt_i386): Update declarations.
4369 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
4370 local_ifuncs_ fields.
4371 (Target_i386::do_plt_section_for_global): New function.
4372 (Target_i386::do_plt_section_for_local): New function.
4373 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
4374 parameter; change all callers. Initialize global_ifuncs_ and
4375 local_ifuncs_. If doing a static link define __rel_iplt_start and
4376 __rel_iplt_end.
4377 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
4378 (Output_data_plt_i386::add_local_ifunc_entry): New function.
4379 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
4380 symbols.
4381 (Target_i386::make_plt_section): New function, broken out of
4382 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
4383 (Target_i386::make_plt_entry): Call make_plt_section.
4384 (Target_i386::make_local_ifunc_plt_entry): New function.
4385 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
4386 (Target_i386::Scan::local): Handle IFUNC symbols. Add
4387 R_386_IRELATIVE to switch.
4388 (Target_i386::Scan::global): Likewise.
4389 (Target_i386::Relocate::relocate): Likewise.
4390 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
4391 switch.
4392 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
4393 (Target_x86_64::do_plt_section_for_global): New function.
4394 (Target_x86_64::do_plt_section_for_local): New function.
4395 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
4396 parameter; change all callers. If doing a static link define
4397 __rela_iplt_start and __rela_iplt_end.
4398 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
4399 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
4400 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
4401 to point to .plt.
4402 (Target_x86_64::make_local_ifunc_plt_entry): New function.
4403 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
4404 switch.
4405 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
4406 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
4407 R_X86_64_IRELATIVE to switch.
4408 (Target_x86_64::Scan::global): Likewise.
4409 (Target_x86_64::Relocate::relocate): Likewise.
4410 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
4411 switch.
4412 * target.h (class Target): Add plt_section_for_global and
4413 plt_section_for_local functions. Add do_plt_section_for_global
4414 and do_plt_section_for_local virtual functions.
4415 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
4416 clarifying comments.
4417 (Symbol::use_plt_offset): Handle IFUNC symbol.
4418 * object.cc (Sized_relobj::Sized_relobj): Initialize
4419 local_plt_offsets_.
4420 (Sized_relobj::local_has_plt_offset): New function.
4421 (Sized_relobj::local_plt_offset): New function.
4422 (Sized_relobj::set_local_plt_offset): New function.
4423 (Sized_relobj::do_count): Handle IFUNC symbol.
4424 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
4425 a bit away from input_shndx_ field. Add set_is_func_symbol and
4426 is_ifunc_symbol functions.
4427 (class Sized_relobj): Update declarations. Remove Tls_got_entry
4428 and Local_tls_got_offsets. Define Local_plt_offsets. Add
4429 local_plt_offsets_ field.
4430 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
4431 * output.h (class Output_section_data): Add non-const
4432 output_section function.
4433 (class Output_data_got): Update declarations.
4434 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
4435 Add use_plt_offset parameter to global and local constructors.
4436 Change all callers. Change local_sym_index_ field to 31 bits.
4437 Change GSYM_CODE and CONSTANT_CODE accordingly.
4438 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
4439 doing a static link don't set sh_link field.
4440 (Output_data_got::Got_entry::write): Use PLT offset if
4441 appropriate.
4442 (Output_data_got::add_global_plt): New function.
4443 (Output_data_got::add_local_plt): New function.
4444 * target-reloc.h (relocate_section): Handle IFUNC symbol.
4445 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
4446 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
4447 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
4448 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
4449 IFUNC conditional.
4450 * testsuite/ifunc-sel.h: New file.
4451 * testsuite/ifuncmain1.c: New file.
4452 * testsuite/ifuncmain1vis.c: New file.
4453 * testsuite/ifuncmod1.c: New file.
4454 * testsuite/ifuncdep2.c: New file.
4455 * testsuite/ifuncmain2.c: New file.
4456 * testsuite/ifuncmain3.c: New file.
4457 * testsuite/ifuncmod3.c: New file.
4458 * testsuite/ifuncmain4.c: New file.
4459 * testsuite/ifuncmain5.c: New file.
4460 * testsuite/ifuncmod5.c: New file.
4461 * testsuite/ifuncmain6pie.c: New file.
4462 * testsuite/ifuncmod6.c: New file.
4463 * testsuite/ifuncmain7.c: New file.
4464 * configure, testsuite/Makefile.in: Rebuild.
4465
56f75c03
ILT
44662010-08-18 Ian Lance Taylor <[email protected]>
4467
4468 * incremental.cc
4469 (Output_section_incremental_inputs::write_input_files): Add cast
4470 to avoid signed/unsigned comparison warning.
4471 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4472
55455f89
CC
44732010-08-12 Cary Coutant <[email protected]>
4474
4475 * common.cc (Sort_commons::operator()): Remove unnecessary code.
4476
e2054bcb
ILT
44772010-08-13 Ian Lance Taylor <[email protected]>
4478
4479 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
4480
74f67560
DK
44812010-08-12 Cary Coutant <[email protected]>
4482 Doug Kwan <[email protected]>
4483
4484 * resolve.cc (Symbol_table::should_override): When a weak dynamic
4485 defintion overrides non-weak undef, remember that the original undef
4486 is not weak.
4487 * symtab.cc (Symbol_table::sized_write_global): For undef without
4488 an original weak binding, set binding to global in output.
4489 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
4490 * testsuite/Makefile.in: Regenerate.
4491 * testsuite/strong_ref_weak_def.sh: New file.
4492 * testsuite/strong_ref_weak_def_1.c: Ditto.
4493 * testsuite/strong_ref_weak_def_2.c: Ditto.
4494
d1238d12
CC
44952010-08-12 Cary Coutant <[email protected]>
4496
4497 * testsuite/incremental_test.sh: Rewrite.
4498 * testsuite/incremental_test_1.c: Rewrite.
4499 * testsuite/incremental_test_2.c: Rewrite.
4500
0e70b911
CC
45012010-08-12 Cary Coutant <[email protected]>
4502
4503 * arm.cc (Target_arm::got_size): Add const.
4504 (Target_arm::got_entry_count): New function.
4505 (Target_arm::plt_entry_count): New function.
4506 (Target_arm::first_plt_entry_offset): New function.
4507 (Target_arm::plt_entry_size): New function.
4508 (Output_data_plt_arm::entry_count): New function.
4509 (Output_data_plt_arm::first_plt_entry_offset): New function.
4510 (Output_data_plt_arm::get_plt_entry_size): New function.
4511 * i386.cc (Target_i386::got_size): Add const.
4512 (Target_i386::got_entry_count): New function.
4513 (Target_i386::plt_entry_count): New function.
4514 (Target_i386::first_plt_entry_offset): New function.
4515 (Target_i386::plt_entry_size): New function.
4516 (Output_data_plt_i386::entry_count): New function.
4517 (Output_data_plt_i386::first_plt_entry_offset): New function.
4518 (Output_data_plt_i386::get_plt_entry_size): New function.
4519 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
4520 find_incremental_inputs_sections. Dump incremental_got_plt section.
4521 * incremental.cc: Include target.h.
4522 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
4523 parameter. Adjust all callers. Find incremental_got_plt section.
4524 (Incremental_inputs::create_data_sections): Create incremental_got_plt
4525 section.
4526 (Output_section_incremental_inputs::set_final_data_size): Calculate
4527 size of incremental_got_plt section.
4528 (Output_section_incremental_inputs::do_write): Write the
4529 incremental_got_plt section.
4530 (Got_plt_view_info): New struct.
4531 (Local_got_offset_visitor): New class.
4532 (Global_got_offset_visitor): New class.
4533 (Global_symbol_visitor_got_plt): New class.
4534 (Output_section_incremental_inputs::write_got_plt): New function.
4535 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
4536 Add parameter. Adjust all callers.
4537 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4538 (Incremental_inputs::got_plt_section): New function.
4539 (Incremental_inputs::got_plt_section_): New data member.
4540 (Incremental_got_plt_reader): New class.
4541 * layout.cc (Layout::create_incremental_info_sections): Add the
4542 incremental_got_plt section.
4543 * object.h (Got_offset_list::get_list): New function.
4544 (Got offset_list::for_all_got_offsets): New function.
4545 (Sized_relobj::local_got_offset_list): New function.
4546 * powerpc.cc (Target_powerpc::got_size): Add const.
4547 (Target_powerpc::got_entry_count): New function.
4548 (Target_powerpc::plt_entry_count): New function.
4549 (Target_powerpc::first_plt_entry_offset): New function.
4550 (Target_powerpc::plt_entry_size): New function.
4551 (Output_data_plt_powerpc::entry_count): New function.
4552 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
4553 (Output_data_plt_powerpc::get_plt_entry_size): New function.
4554 * sparc.cc (Target_sparc::got_size): Add const.
4555 (Target_sparc::got_entry_count): New function.
4556 (Target_sparc::plt_entry_count): New function.
4557 (Target_sparc::first_plt_entry_offset): New function.
4558 (Target_sparc::plt_entry_size): New function.
4559 (Output_data_plt_sparc::entry_count): New function.
4560 (Output_data_plt_sparc::first_plt_entry_offset): New function.
4561 (Output_data_plt_sparc::get_plt_entry_size): New function.
4562 * symtab.h (Symbol::got_offset_list): New function.
4563 (Symbol_table::for_all_symbols): New function.
4564 * target.h (Sized_target::got_entry_count): New function.
4565 (Sized_target::plt_entry_count): New function.
4566 (Sized_target::plt_entry_size): New function.
4567 * x86_64.cc (Target_x86_64::got_size): Add const.
4568 (Target_x86_64::got_entry_count): New function.
4569 (Target_x86_64::plt_entry_count): New function.
4570 (Target_x86_64::first_plt_entry_offset): New function.
4571 (Target_x86_64::plt_entry_size): New function.
4572 (Output_data_plt_x86_64::entry_count): New function.
4573 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
4574 (Output_data_plt_x86_64::get_plt_entry_size): New function.
4575
09ec0418
CC
45762010-08-12 Cary Coutant <[email protected]>
4577
4578 * archive.cc: Include incremental.h.
4579 (Archive::Archive): Initialize incremental_info_.
4580 (Archive::include_member): Record archive members in incremental info.
4581 (Add_archive_symbols::run): Record begin and end of an archive in
4582 incremental info.
4583 (Lib_group::include_member): Record objects in incremental info.
4584 * archive.h (Incremental_archive_entry): Forward declaration.
4585 (Archive::set_incremental_info): New member function.
4586 (Archive::incremental_info): New member function.
4587 (Archive::Unused_symbol_iterator): New class.
4588 (Archive::unused_symbols_begin): New member function.
4589 (Archive::unused_symbols_end): New member function.
4590 (Archive::incremental_info_): New data member.
4591 * incremental-dump.cc (find_input_containing_global): New function.
4592 (dump_incremental_inputs): Dump new incremental info sections.
4593 * incremental.cc: Include symtab.h.
4594 (Output_section_incremental_inputs): New class.
4595 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
4596 new incremental info sections.
4597 (Sized_incremental_binary::do_check_inputs): Likewise.
4598 (Incremental_inputs::report_archive): Remove.
4599 (Incremental_inputs::report_archive_begin): New function.
4600 (Incremental_inputs::report_archive_end): New function.
4601 (Incremental_inputs::report_object): New function.
4602 (Incremental_inputs::finalize_inputs): Remove.
4603 (Incremental_inputs::report_input_section): New function.
4604 (Incremental_inputs::report_script): Rewrite.
4605 (Incremental_inputs::finalize): Do nothing but finalize string table.
4606 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
4607 (Incremental_inputs::sized_create_inputs_section_data): Remove.
4608 (Incremental_inputs::create_data_sections): New function.
4609 (Incremental_inputs::relocs_entsize): New function.
4610 (Output_section_incremental_inputs::set_final_data_size): New function.
4611 (Output_section_incremental_inputs::do_write): New function.
4612 (Output_section_incremental_inputs::write_header): New function.
4613 (Output_section_incremental_inputs::write_input_files): New function.
4614 (Output_section_incremental_inputs::write_info_blocks): New function.
4615 (Output_section_incremental_inputs::write_symtab): New function.
4616 * incremental.h (Incremental_script_entry): Forward declaration.
4617 (Incremental_object_entry): Forward declaration.
4618 (Incremental_archive_entry): Forward declaration.
4619 (Incremental_inputs): Forward declaration.
4620 (Incremental_inputs_header_data): Remove.
4621 (Incremental_inputs_header): Remove.
4622 (Incremental_inputs_header_write): Remove.
4623 (Incremental_inputs_entry_data): Remove.
4624 (Incremental_inputs_entry): Remove.
4625 (Incremental_inputs_entry_write): Remove.
4626 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
4627 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
4628 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4629 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
4630 Likewise.
4631 (Incremental_input_entry): New class.
4632 (Incremental_script_entry): New class.
4633 (Incremental_object_entry): New class.
4634 (Incremental_archive_entry): New class.
4635 (Incremental_inputs::Incremental_inputs): Initialize new data members.
4636 (Incremental_inputs::report_inputs): Remove.
4637 (Incremental_inputs::report_archive): Remove.
4638 (Incremental_inputs::report_archive_begin): New function.
4639 (Incremental_inputs::report_archive_end): New function.
4640 (Incremental_inputs::report_object): Change prototype.
4641 (Incremental_inputs::report_input_section): New function.
4642 (Incremental_inputs::report_script): Change prototype.
4643 (Incremental_inputs::get_reloc_count): New function.
4644 (Incremental_inputs::set_reloc_count): New function.
4645 (Incremental_inputs::create_data_sections): New function.
4646 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
4647 (Incremental_inputs::inputs_section): New function.
4648 (Incremental_inputs::symtab_section): New function.
4649 (Incremental_inputs::relocs_section): New function.
4650 (Incremental_inputs::get_stringpool): Add const.
4651 (Incremental_inputs::command_line): Add const.
4652 (Incremental_inputs::inputs): Remove.
4653 (Incremental_inputs::command_line_key): New function.
4654 (Incremental_inputs::input_file_count): New function.
4655 (Incremental_inputs::input_files): New function.
4656 (Incremental_inputs::relocs_entsize): New function.
4657 (Incremental_inputs::sized_create_inputs_section_data): Remove.
4658 (Incremental_inputs::finalize_inputs): Remove.
4659 (Incremental_inputs::Input_info): Remove.
4660 (Incremental_inputs::lock_): Remove.
4661 (Incremental_inputs::inputs_): Change type.
4662 (Incremental_inputs::inputs_map_): Remove.
4663 (Incremental_inputs::current_object_entry_): New data member.
4664 (Incremental_inputs::inputs_section_): New data member.
4665 (Incremental_inputs::symtab_section_): New data member.
4666 (Incremental_inputs::relocs_section_): New data member.
4667 (Incremental_inputs::reloc_count_): New data member.
4668 (Incremental_inputs_reader): New class.
4669 (Incremental_symtab_reader): New class.
4670 (Incremental_relocs_reader): New class.
4671 * layout.cc (Layout::finalize): Move finalization of incremental info
4672 and creation of incremental info sections to follow finalization of
4673 symbol table. Set offsets for postprocessing sections.
4674 (Layout::create_incremental_info_sections): Call
4675 Incremental_inputs::create_data_sections. Add incremental symtab
4676 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
4677 sections to layout after input sections.
4678 * layout.h (struct Timespec): Forward declaration.
4679 (Layout::incremental_inputs): Add const.
4680 (Layout::create_incremental_info_sections): Add parameter.
4681 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
4682 * object.cc: Include incremental.h.
4683 (Relobj::finalize_incremental_relocs): New function.
4684 (Sized_relobj::do_layout): Record input sections in incremental info.
4685 * object.h (Object::output_section): New function.
4686 (Object::output_section_offset): Moved from Relobj.
4687 (Object::get_incremental_reloc_base): New function.
4688 (Object::get_incremental_reloc_count): New function.
4689 (Object::do_output_section): New function.
4690 (Object::do_output_section_offset): Moved from Relobj.
4691 (Object::do_get_incremental_reloc_base): New function.
4692 (Object::do_get_incremental_reloc_count): New function.
4693 (Object::Object): Initialize new data members.
4694 (Relobj::output_section): Renamed do_output_section and moved to
4695 protected.
4696 (Relobj::output_section_offset): Moved to Object.
4697 (Relobj::do_get_incremental_reloc_base): New function.
4698 (Relobj::do_get_incremental_reloc_count): New function.
4699 (Relobj::allocate_incremental_reloc_counts): New function.
4700 (Relobj::count_incremental_reloc): New function.
4701 (Relobj::finalize_incremental_relocs): New function.
4702 (Relobj::next_incremental_reloc_index): New function.
4703 (Relobj::reloc_counts_): New data member.
4704 (Relobj::reloc_bases_): New data member.
4705 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
4706 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
4707 (Sized_relobj::incremental_relocs_scan): New function.
4708 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4709 (Sized_relobj::incremental_relocs_write): New function.
4710 (Sized_relobj::incremental_relocs_write_reltype): New function.
4711 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
4712 incremental link.
4713 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
4714 archives and object files elsewhere.
4715 (Add_symbols::run): Report object files here.
4716 (Finish_group::run): Report end of archive at end of group.
4717 * reloc.cc: Include layout.h, incremental.h.
4718 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
4719 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
4720 (Sized_relobj::incremental_relocs_scan): New function.
4721 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4722 (Sized_relobj::do_relocate_sections): Write incremental relocations.
4723 (Sized_relobj::incremental_relocs_write): New function.
4724 (Sized_relobj::incremental_relocs_write_reltype): New function.
4725 * script.cc (read_input_script): Rewrite test for incremental link.
4726 Change call to Incremental_inputs::report_script.
4727 * symtab.h (Symbol_table::first_global_index): New function.
4728 (Symbol_table::output_count): New function.
4729
ce0d1972
DK
47302010-08-12 Doug Kwan <[email protected]>
4731
4732 * arm.cc (Target_arm::merge_object_attributes): Check command line
4733 options --no-wchar-size-warning and --no-enum-size-warning.
4734 * options.h (General_options): Add ld-compatible options
4735 --no-enum-size-warning and --no-wchar-size-warning.
4736
6e5710ce
ILT
47372010-08-04 Ian Lance Taylor <[email protected]>
4738
4739 * x86_64.cc (Target_x86_64::Scan::local): Use
4740 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
4741 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
4742 (Target_x86_64::Scan::global): Likewise.
4743 (Target_x86_64::Relocate::relocate): Likewise.
4744 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
4745 Likewise.
4746
fef830db
CC
47472010-08-03 Cary Coutant <[email protected]>
4748
4749 * merge.cc (Output_merge_string::do_add_input_section): Count strings
4750 to reserve space in merged_strings vector. Keep total input size
4751 for stats.
4752 (Output_merge_string::do_print_merge_stats): Print total input size.
4753 * merge.h (Output_merge_string): Add input_size_ field.
4754 * stringpool.cc (Stringpool_template::string_length): Move
4755 implementations out of Stringpool_template class and place in
4756 stringpool.h.
4757 * stringpool.h (string_length): Move out of Stringpool_template.
4758
1e3811b0
ILT
47592010-08-03 Ian Lance Taylor <[email protected]>
4760
4761 PR 11712
4762 * layout.cc (relaxation_loop_body): If address of load segment is
4763 set, adjust address to include headers if possible.
4764
7af0c620
ILT
47652010-08-03 Ian Lance Taylor <[email protected]>
4766
4767 * version.cc (version_string): Bump to 1.10.
4768
22f0da72
ILT
47692010-08-03 Ian Lance Taylor <[email protected]>
4770
4771 PR 11805
4772 * layout.h (enum Output_section_order): Define.
4773 (class Layout): Update declarations.
4774 * layout.cc (Layout::get_output_section): Add order parameter.
4775 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
4776 is_first_non_relro parameters. Change all callers.
4777 (Layout::choose_output_section): Likewise.
4778 (Layout::add_output_section_data): Likewise.
4779 (Layout::make_output_section): Likewise. Set order.
4780 (Layout::default_section_order): New function.
4781 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
4782 * output.cc (Output_section::Output_section): Initialize order_.
4783 Don't initialize deleted fields.
4784 (Output_segment::Output_segment): Don't initialize deleted
4785 fields.
4786 (Output_segment::add_output_section_to_load): New function
4787 replacing add_output_section. Change all callers to call this or
4788 add_output_section_to_nonload.
4789 (Output_segment::add_output_section_to_nonload): New function.
4790 (Output_segment::remove_output_section): Rewrite.
4791 (Output_segment::add_initial_output_data): Likewise.
4792 (Output_segment::has_any_data_sections): Likewise.
4793 (Output_segment::is_first_section_relro): Likewise.
4794 (Output_segment::maximum_alignment): Likewise.
4795 (Output_segment::has_dynamic_reloc): New function replacing
4796 dynamic_reloc_count. Change all callers.
4797 (Output_segment::has_dynamic_reloc_list): New function replacing
4798 dynamic_reloc_count_list. Change all callers.
4799 (Output_segment::set_section_addresses): Rewrite.
4800 (Output_segment::set_offset): Rewrite.
4801 (Output_segment::find_first_and_last_list): Remove.
4802 (Output_segment::set_tls_offsets): Rewrite.
4803 (Output_segment::first_section_load_address): Likewise.
4804 (Output_segment::output_section_count): Likewise.
4805 (Output_segment::section_with_lowest_load_address): Likewise.
4806 (Output_segment::write_section_headers): Likewise.
4807 (Output_segment::print_sections_to_map): Likewise.
4808 * output.h (class Output_data): Remove dynamic_reloc_count_
4809 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
4810 (Output_data::add_dynamic_reloc): Rewrite.
4811 (Output_data::has_dynamic_reloc): New function.
4812 (Output_data::dynamic_reloc_count): Remove.
4813 (class Output_section): Add order_ field. Remvoe is_relro_local_,
4814 is_last_relro_, is_first_non_relro_, is_interp_,
4815 is_dynamic_linker_section_ fields. Add order and set_order
4816 functions. Remove is_relro_local, set_is_relro_local,
4817 is_last_relro, set_is_last_relro, is_first_non_relro,
4818 set_is_first_non_relro functions, is_interp, set_is_interp,
4819 is_dynamic_linker_section, and set_is_dynamic_linker_section
4820 functions.
4821 (class Output_segment): Change Output_data_list from std::list to
4822 std:;vector. Add output_lists_ field. Remove output_data_ and
4823 output_bss_ fields. Update declarations.
4824
3ff2ccb0
ILT
48252010-08-02 Ian Lance Taylor <[email protected]>
4826
4827 * arm.cc (Target_arm::gc_process_relocs): Use typename.
4828 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
4829 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
4830
88a4108b
ILT
48312010-08-02 Ian Lance Taylor <[email protected]>
4832
4833 PR 11855
4834 * script.cc (Script_options::Script_options): Initialize
4835 symbol_definitions_ and symbol_references_.
4836 (Script_options::add_symbol_assignment): Update
4837 symbol_definitions_ and symbol_references_.
4838 (Script_options::add_symbol_reference): New function.
4839 (script_symbol): New function.
4840 * script.h (class Script_options): Add symbol_definitions_ and
4841 symbol_references_ fields.
4842 (Script_options::referenced_const_iterator): New type.
4843 (Script_options::referenced_begin): New function.
4844 (Script_options::referenced_end): New function.
4845 (Script_options::is_referenced): New function.
4846 (Script_options::any_unreferenced): New function.
4847 * script-c.h (script_symbol): Declare.
4848 * yyscript.y (exp): Call script_symbol.
4849 * symtab.cc: Include "script.h".
4850 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
4851 Change all callers. Check symbols referenced by scripts.
4852 (Symbol_table::add_undefined_symbols_from_command_line): Add
4853 layout parameter. Change all callers.
4854 (Symbol_table::do_add_undefined_symbols_from_command_line):
4855 Likewise. Break out loop body. Check symbols referenced by
4856 scripts.
4857 (Symbol_table::add_undefined_symbol_from_command_line): New
4858 function broken out of
4859 do_add_undefined_symbols_from_command_line.
4860 * symtab.h (class Symbol_table): Update declarations.
4861 * archive.cc: Include "layout.h".
4862 (Archive::should_include_member): Add layout parameter. Change
4863 all callers. Check for symbol mentioned in expression.
4864 * archive.h (class Archive): Update declaration.
4865 * object.cc (Sized_relobj::do_should_include_member): Add layout
4866 parameter.
4867 * object.h (Object::should_include_member): Add layout parameter.
4868 Change all callers.
4869 (Object::do_should_include_member): Add layout parameter.
4870 (class Sized_relobj): Update declaration.
4871 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
4872 parameter.
4873 * dynobj.h (class Sized_dynobj): Update declaration.
4874 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
4875 layout parameter.
4876 * plugin.h (class Sized_pluginobj): Update declaration.
4877
5f1ab67a
ILT
48782010-08-02 Ian Lance Taylor <[email protected]>
4879
4880 PR 11866
4881 * output.cc (Output_segment::set_offset): Search for the first and
4882 last sections rather than assuming that the list is in order.
4883 (Output_segment::find_first_and_last_list): New function.
4884 * output.h (class Output_segment): Update declarations.
4885 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
4886 (relro_strip_test_SOURCES): New variable.
4887 (relro_strip_test_DEPENDENCIES): New variable.
4888 (relro_strip_test_LDFLAGS): New variable.
4889 (relro_strip_test_LDADD): New variable.
4890 (relro_strip_test.so): New target.
4891
a8df5856
ILT
48922010-08-02 Ian Lance Taylor <[email protected]>
4893
4894 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
4895 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
4896 (Target_i386::got_tlsdesc_section): New function.
4897 (Target_i386::got_section): Create space for GOT entries for
4898 TLSDESC relocations.
4899 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
4900 R_386_TLS_GOTDESC.
4901 (Target_i386::Scan::global): Likewise.
4902 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
4903 using TLSDESC GOT.
4904 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
4905 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
4906 (Target_x86_64::got_tlsdesc_section): New function.
4907 (Target_x86_64::got_section): Create space for GOT entries for
4908 TLSDESC relocations.
4909 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
4910 R_386_TLS_GOTDESC.
4911 (Target_x86_64::Scan::global): Likewise.
4912 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
4913 using TLSDESC GOT.
4914
0c10a0a6
ILT
49152010-08-02 Ian Lance Taylor <[email protected]>
4916
4917 * testsuite/final_layout.sh: Use dc to convert from hex to
4918 decimal.
4919
41cbeecc
ST
49202010-07-29 Sriraman Tallam <[email protected]>
4921
4922 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
4923 paramter to the call to gold::gc_process_relocs.
4924 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
4925 paramter to the call to gold::gc_process_relocs.
4926 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
4927 parameter to the call to gold::gc_process_relocs.
4928 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
4929 template parameter to the call to gold::gc_process_relocs.
4930 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
4931 paramter to the call to gold::gc_process_relocs.
4932 * gc.h (get_embedded_addend_size): New function.
4933 (gc_process_relocs): Save the size of the reloc for use by ICF.
4934 * icf.cc (get_section_contents): Get the addend from the text section
4935 for SHT_REL relocation sections.
4936 * icf.h (Icf::Reloc_addend_size_info): New typedef.
4937 (Icf::Reloc_info): Add new member reloc_addend_size_info.
4938 * int_encoding.h (read_from_pointer): New overloaded function.
4939 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
4940 * testsuite/icf_sht_rel_addend_test.sh: New file.
4941 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
4942 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
4943
6ea55b82
RW
49442010-07-28 Ralf Wildenhues <[email protected]>
4945
4946 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
4947 * Makefile.in: Regenerate.
4948 * testsuite/Makefile.in: Regenerate.
4949
9691462b
ILT
49502010-07-27 Jeffrey Yasskin <[email protected]>
4951
4952 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
4953 * gold/testsuite/debug_msg.cc: Likewise.
4954 * gold/testsuite/odr_violation1.cc
4955 * gold/testsuite/odr_violation2.cc
4956
76897331
CC
49572010-07-21 Cary Coutant <[email protected]>
4958
4959 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
4960 string, and length fields.
4961 (Output_merge_string::Merged_strings_list): New type.
4962 (Output_merge_string::Merged_strings_lists): New typedef.
4963 (Output_merge_string): Replace merged_strings_ with
4964 merged_strings_lists_.
4965 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
4966 Merged_strings_list per input object and section. Don't store pointer
4967 to the string. Don't store length with each merged string entry.
4968 (Output_merge_string::finalize_merged_data): Loop over list of merged
4969 strings lists. Recompute length of each merged string.
4970
78384e8f
CC
49712010-07-15 Cary Coutant <[email protected]>
4972
4973 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
4974 here.
4975
783659f9
ILT
49762010-07-14 Ian Lance Taylor <[email protected]>
4977
4978 * descriptors.cc (Descriptors::open): Report correct name in error
4979 message.
4980
131687b4
DK
49812010-07-13 Doug Kwan <[email protected]>
4982
4983 * arm.cc (Arm_input_section::Arm_input_section): For a
4984 SHT_ARM_EXIDX section, always keeps the input sections.
4985 (Arm_input_section::set_exidx_section_link): New method.
4986 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
4987 has_errors_ to false.
4988 (Arm_exidx_input_section::has_errors,
4989 Arm_exidx_input_section::set_has_errors): New methods.
4990 (Arm_exidx_input_section::has_errors_): New data member.
4991 (Arm_relobj::get_exidx_shndx_list): New method.
4992 (Arm_output_section::append_text_sections_to_list): Do not skip
4993 section without SHF_EXECINSTR.
4994 (Arm_output_section::fix_exidx_coverage): Skip input sections with
4995 errors.
2e702c99 4996 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
4997 section header. Make error messages more verbose. Check for
4998 a non-executable section linked to an EXIDX section.
4999 (Arm_relobj::do_read_symbols): Remove error checking, which has been
5000 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
5001 check that there is no deferred EXIDX section if we exit early.
5002 Instead of not making an EXIDX section in case of an error, make one
5003 and set the has_errors flag of it.
5004 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
5005 in a relocatable link.
5006 (Target_arm::do_relax): Look for the EXIDX output section instead of
5007 assuming that it is called .ARM.exidx.
2e702c99 5008 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
5009 section list. Do not check for SHF_EXECINSTR section flags but
5010 skip any input section with errors.
5011 * output.cc (Output_section::Output_section): Initialize
5012 always_keeps_input_sections_ to false.
5013 (Output_section::add_input_section): Check for
5014 always_keeps_input_sections_.
5015 * output.h (Output_section::always_keeps_input_sections,
5016 Output_section::set_always_keeps_input_sections): New methods.
5017 (Output_section::always_keeps_input_sections): New data member.
5018
69517287
RÁE
50192010-07-13 Rafael Espindola <[email protected]>
5020
5021 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
5022 * fileread.h (Input_file): Add try_extra_search_path and find_file.
5023
82742395
ILT
50242010-07-13 Philip Herron <[email protected]>
5025 Ian Lance Taylor <[email protected]>
5026
5027 * output.h (Output_section_lookup_maps::add_merge_section):
5028 Correct check of whether value was inserted.
5029 (Output_section_lookup_maps::add_merge_input_section): Likewise.
5030 (Output_section_lookup_maps::add_relaxed_input_section):
5031 Likewise.
5032 * arm.cc (Target_arm::got_section): Remove used local os.
5033 * i386.cc (Target_i386::got_section): Likewise.
5034 * x86_64.cc (Target_x86_64::got_section): Likewise.
5035 * sparc.cc (Target_sparc::got_section): Likewise.
5036 (Target_sparc::relocate): Remove unused local have_got_offset.
5037 * powerpc.cc (Target_powerpc::relocate): Likewise.
5038
f2d707b5
ILT
50392010-07-13 Ian Lance Taylor <[email protected]>
5040
241531d6
ILT
5041 * compressed_output.cc (zlib_decompress): Fix signature in
5042 !HAVE_ZLIB_H case.
5043
f2d707b5
ILT
5044 * archive.cc (Archive::include_member): Unlock an external member
5045 of a thin archive. Don't bother to delete an object we know is
5046 NULL.
5047
a2e47362
CC
50482010-07-12 Cary Coutant <[email protected]>
5049
5050 * compressed_output.cc (zlib_decompress): New function.
5051 (get_uncompressed_size): New function.
5052 (decompress_input_section): New function.
5053 * compressed_output.h (get_uncompressed_size): New function.
5054 (decompress_input_section): New function.
5055 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
5056 Handle compressed debug sections.
5057 * layout.cc (is_compressed_debug_section): New function.
5058 (Layout::output_section_name): Map compressed section names to
5059 canonical names.
5060 * layout.h (is_compressed_debug_section): New function.
5061 (is_debug_info_section): Recognize compressed debug sections.
5062 * merge.cc: Include compressed_output.h.
5063 (Output_merge_data::do_add_input_section): Handle compressed
5064 debug sections.
5065 (Output_merge_string::do_add_input_section): Handle compressed
5066 debug sections.
5067 * object.cc: Include compressed_output.h.
5068 (Sized_relobj::Sized_relobj): Initialize new data members.
5069 (build_compressed_section_map): New function.
5070 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
5071 * object.h (Object::section_is_compressed): New method.
5072 (Object::do_section_is_compressed): New method.
5073 (Sized_relobj::Compressed_section_map): New type.
5074 (Sized_relobj::do_section_is_compressed): New method.
5075 (Sized_relobj::compressed_sections_): New data member.
5076 * output.cc (Output_section::add_input_section): Handle compressed
5077 debug sections.
5078 * reloc.cc: Include compressed_output.h.
5079 (Sized_relobj::write_sections): Handle compressed debug sections.
5080
ce279a62
CC
50812010-07-08 Cary Coutant <[email protected]>
5082
5083 * resolve.cc (Symbol_table::resolve): Remember whether undef was
5084 weak when resolving to a dynamic def.
5085 (Symbol_table::should_override): Add adjust_dyndef flag; set it
5086 for weak undef/dynamic def cases. Adjust callers.
5087 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
5088 undef_binding_weak_.
5089 (Symbol_table::sized_write_globals): Adjust symbol binding.
5090 (Symbol_table::sized_write_symbol): Add binding parameter.
5091 * symtab.h (Symbol::set_undef_binding): New method.
5092 (Symbol::is_undef_binding_weak): New method.
5093 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
5094 (Symbol_table::should_override): Add new parameter.
5095 (Symbol_table::sized_write_symbol): Add new parameter.
5096
5097 * testsuite/weak_undef_file1.cc: Add new test case.
5098 * testsuite/weak_undef_file2.cc: Fix header comment.
5099 * testsuite/weak_undef_test.cc: Add new test case.
5100
b2286c10
DK
51012010-06-29 Doug Kwan <[email protected]>
5102
5103 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
5104 Initialize USE_SYMBOL_.
5105 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
5106 definition.
5107 (Arm_reloc_property::uses_symbol_): New data member declaration.
5108 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
5109 uses symbol value and symbol is undefined but not weakly undefined.
5110
4802450a
RÁE
51112010-06-28 Rafael Espindola <[email protected]>
5112
5113 * plugin.cc (Plugin::load): Use dlerror.
5114
e5ca47ba
ILT
51152010-06-26 Jeffrey Yaskin <[email protected]>
5116
5117 * symtab.cc (detect_odr_violations): When reporting an ODR
5118 violation, report an object where the symbol is defined.
5119
8a75a161
DK
51202010-06-25 Doug Kwan <[email protected]>
5121
5122 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
5123 (Target_arm::section_may_have_icf_unsafe_pointers): New method
5124 definition.
5125 (Target_arm::Scan::local_reloc_may_be_function_pointer,
5126 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
5127 target hook to detect function points.
5128 (Target_arm::Scan::possible_function_pointer_reloc): New method.
5129 * icf.h (Icf::check_section_for_function_pointers): Change type of
5130 parameter SECTION_NAME to const reference to std::string. Use
5131 target hook to determine if section may have unsafe pointers.
5132 * target.h (Target::section_may_have_icf_unsafe_pointers): New
5133 method definition.
5134
42218b9f
RÁE
51352010-06-21 Rafael Espindola <[email protected]>
5136
5137 * fileread.cc (Input_file::find_fie): New
5138 (Input_file::open): Use Input_file::find_fie.
5139 * fileread.h (Input_file::find_fie): New
5140 * plugin.cc (set_extra_library_path): New.
5141 (Plugin::load): Add set_extra_library_path to the transfer vector.
5142 (Plugin_manager::set_extra_library_path): New.
5143 (Plugin_manager::add_input_file): Use the extra search path if set.
5144 (set_extra_library_path(): New.
5145 * plugin.h (Plugin_manager): Add set_extra_library_path and
5146 extra_search_path_.
5147
a0506cca
CC
51482010-06-19 Cary Coutant <[email protected]>
5149
5150 * layout.cc (gdb_sections): Add .debug_types.
5151 (lines_only_debug_sections): Likewise.
5152
6508b958
RÁE
51532010-06-18 Rafael Espindola <[email protected]>
5154
5155 * plugin.cc (add_input_file,add_input_library)
5156 (Plugin_manager::add_input_file): Make filename arguments const.
5157 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
5158 const.
5159
3e235302
DK
51602010-06-16 Doug Kwan <[email protected]>
5161
5162 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
5163 .ARM.attributes section if we have not merged any input
5164 attributes sections.
5165
106e8a6c
DK
51662010-06-15 Viktor Kutuzov <[email protected]>
5167
5168 * arm.cc: Allow combining objects with no EABI version
5169 information.
5170
91ff43fe
RÁE
51712010-06-15 Rafael Espindola <[email protected]>
5172
5173 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
5174
68ed838c
ILT
51752010-06-15 Viktor Kutuzov <[email protected]>
5176
5177 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
5178 (struct iovec): Correct !HAVE_READV definition.
5179
f3a2388f
CC
51802010-06-10 Cary Coutant <[email protected]>
5181
5182 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
5183 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
5184 reloc sections.
5185 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
5186
5187 PR 11683
5188 * symtab.h (Symbol::is_placeholder): New member function.
5189 * target-reloc.h (relocate_section): Check for placeholder symbols.
5190
5191 * testsuite/Makefile.am (plugin_test_8): New test.
5192 (plugin_test_9): New test.
5193 * testsuite/Makefile.in: Regenerate.
5194
e1df38aa
NC
51952010-06-09 Nick Clifton <[email protected]>
5196
5197 * yyscript.y (input_list_element): Allow strings prefixed with
5198 the '-' character. Treat these as libraries.
5199 * script.cc (script_add_library): New function. Adds a library
5200 specified by "-l<name>" found in an input script.
5201 * script-c.h: Add prototype for script_add_library.
5202
25bbe950
DK
52032010-06-07 Doug Kwan <[email protected]>
5204
5205 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
5206 Restrict stub-group size to be within long conditional branch
5207 range when working around cortex-A8 erratum.
5208
0f32ea4c
ILT
52092010-06-07 Damien Diederen <[email protected]>
5210
5211 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
5212 #ifdef typo.
5213
8fe2a369
ST
52142010-06-03 Sriraman Tallam <[email protected]>
5215
5216 PR gold/11658
5217 * output.cc
5218 (Output_section::Input_section_sort_entry::compare_section_ordering):
5219 Change to return non-zero correctly.
5220 (Output_section::Input_section_sort_section_order_index_compare
5221 ::operator()): Change to fix ambiguity in comparisons.
5222
6e9ba2ca
ST
52232010-06-01 Sriraman Tallam <[email protected]>
5224
5225 * gold.h (is_wildcard_string): New function.
5226 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
5227 (Layout::layout_eh_frame): Ditto.
5228 (Layout::find_section_order_index): New method.
5229 (Layout::read_layout_from_file): New method.
5230 * layout.h (Layout::find_section_order_index): New method.
5231 (Layout::read_layout_from_file): New method.
5232 (Layout::input_section_position_): New private member.
5233 (Layout::input_section_glob_): New private member.
5234 * main.cc (main): Call read_layout_from_file here.
5235 * options.h (--section-ordering-file): New option.
5236 * output.cc (Output_section::input_section_order_specified_): New
5237 member.
5238 (Output_section::Output_section): Initialize new member.
5239 (Output_section::add_input_section): Add new parameter.
5240 Keep input sections when --section-ordering-file is used.
5241 (Output_section::set_final_data_size): Sort input sections when
5242 section ordering file is specified.
5243 (Output_section::Input_section_sort_entry): Add new parameter.
5244 Check sorting type.
5245 (Output_section::Input_section_sort_entry::compare_section_ordering):
5246 New method.
5247 (Output_section::Input_section_sort_compare::operator()): Change to
5248 consider section_order_index.
5249 (Output_section::Input_section_sort_init_fini_compare::operator()):
5250 Change to consider section_order_index.
5251 (Output_section::Input_section_sort_section_order_index_compare
5252 ::operator()): New method.
5253 (Output_section::sort_attached_input_sections): Change to sort
5254 according to section order when specified.
e1df38aa
NC
5255 (Output_section::add_input_section<32, true>): Add new parameter.
5256 (Output_section::add_input_section<64, true>): Add new parameter.
5257 (Output_section::add_input_section<32, false>): Add new parameter.
5258 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
5259 * output.h (Output_section::add_input_section): Add new parameter.
5260 (Output_section::input_section_order_specified): New
5261 method.
5262 (Output_section::set_input_section_order_specified): New method.
5263 (Input_section::Input_section): Initialize section_order_index_.
5264 (Input_section::section_order_index): New method.
5265 (Input_section::set_section_order_index): New method.
5266 (Input_section::section_order_index_): New member.
5267 (Input_section::Input_section_sort_section_order_index_compare): New
5268 struct.
5269 (Output_section::input_section_order_specified_): New member.
5270 * script-sections.cc (is_wildcard_string): Delete and move modified
5271 method to gold.h.
5272 (Output_section_element_input::Output_section_element_input): Modify
5273 call to is_wildcard_string.
5274 (Output_section_element_input::Input_section_pattern
5275 ::Input_section_pattern): Ditto.
5276 (Output_section_element_input::Output_section_element_input): Ditto.
5277 * testsuite/Makefile.am (final_layout): New test case.
5278 * testsuite/Makefile.in: Regenerate.
5279 * testsuite/final_layout.cc: New file.
5280 * testsuite/final_layout.sh: New file.
5281
3537c84b
RÁE
52822010-06-01 Rafael Espindola <[email protected]>
5283
5284 * plugin.cc (Plugin::load): Pass the output name to the plugin.
5285
105b6afd
RÁE
52862010-06-01 Rafael Espindola <[email protected]>
5287
5288 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
5289 visibility of symbols.
5290
29e11421
DK
52912010-05-27 Doug Kwan <[email protected]>
5292
5293 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
5294 from start of output section instead of address for a local symbol
5295 in a merged or relaxed section when doing a relocatable link.
5296
5e0f337e
RÁE
52972010-05-26 Rafael Espindola <[email protected]>
5298
5299 PR 11604
5300 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
5301 adding sections the garbage collector removed.
5302 * gold/testsuite/Makefile.am: Add test.
5303 * gold/testsuite/Makefile.in: Regenerate.
5304 * gold/testsuite/plugin_test_7.sh: New.
5305 * gold/testsuite/plugin_test_7_1.c: New.
5306 * gold/testsuite/plugin_test_7_2.c: New.
5307
f4187277
RÁE
53082010-05-26 Rafael Espindola <[email protected]>
5309
5310 * script-sections.cc (Output_section_definition::set_section_addresses):
5311 Check for --section-start.
5312
5c388529
DK
53132010-05-26 Doug Kwan <[email protected]>
5314
5315 * arm.cc (Arm_scan_relocatable_relocs): New class.
5316 (Target_arm::relocate_special_relocatable): New method.
5317 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
5318 (Arm_relocate_functions::thumb_branch_common): Same.
5319 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
5320 instead of Default_scan_relocatable_relocs.
5321 * target-reloc.h (relocate_for_relocatable): Let target handle
5322 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
5323 * target.h (Sized_target::relocate_special_relocatable): New method.
5324
bca1c3ae
ILT
53252010-05-25 Viktor Kutuzov <[email protected]>
5326
5327 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
5328
0439c796
DK
53292010-05-23 Doug Kwan <[email protected]>
5330
5331 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
5332 instead of a cast.
5333 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
5334 with a direct branch, not a conditional branch, to a stub.
5335 * merge.cc (Output_merge_base::record_input_section): New method
5336 defintion.
5337 (Output_merge_data::do_add_input_section): Record input section if
5338 keeps-input-sections flag is set.
5339 (Output_merge_string::do_add_input_section): Ditto.
5340 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
5341 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
5342 INPUT_SECTIONS_.
5343 (Output_merge_base::keeps_input_sections,
5344 Output_merge_base::set_keeps_input_sections,
5345 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
5346 method definitions.
5347 (Output_merge_base::Input_sections): New type declaration.
5348 (Output_merge_base::input_sections_begin,
5349 Output_merge_base::input_sections_end,
5350 Output_merge_base::do_set_keeps_input_sections): New method definitions.
5351 (Output_merge_base::bool keeps_input_sections_,
5352 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
5353 Output_merge_base::input_sections_): New data members.
5354 (Output_merge_data::do_set_keeps_input_sections): New method
5355 defintion.
5356 (Output_merge_string::do_set_keeps_input_sections): Ditto.
5357 * output.cc (Output_section::Input_section::relobj): Move method
5358 defintion from class declaration to here and handle merge sections.
5359 (Output_section::Input_section::shndx): Ditto.
5360 (Output_section::Output_section): Remove initializations of removed
5361 data members and initialize new data member LOOKUP_MAPS_.
5362 (Output_section::add_input_section): Set keeps-input-sections flag
5363 for a newly created merge output section as appropriate. Adjust code
5364 to use Output_section_lookup_maps class.
5365 (Output_section::add_relaxed_input_section): Adjst code for lookup
5366 maps code refactoring.
2e702c99 5367 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
5368 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
5369 class. If adding input section to a newly created merge output
5370 section fails, remove the new merge section.
5371 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 5372 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 5373 (Output_section::find_merge_section): Ditto.
0439c796 5374 (Output_section::build_lookup_maps): New method defintion.
2e702c99 5375 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
5376 Output_section_lookup_maps class.
5377 (Output_section::get_input_sections): Export merge sections. Adjust
5378 code to use Output_section_lookup_maps class.
5379 (Output_section:::add_script_input_section): Adjust code to use
5380 Output_section_lookup_maps class. Update lookup maps for merge
5381 sections also.
5382 (Output_section::discard_states): Use Output_section_lookup_maps.
5383 (Output_section::restore_states): Same.
5384 * output.h (Merge_section_properties): Move class defintion out of
5385 Output_section.
5386 (Output_section_lookup_maps): New class.
5387 (Output_section::Input_section::is_merge_section): New method
5388 defintion.
5389 (Output_section::Input_section::relobj): Move defintion out of class
5390 defintion. Declare method only.
5391 (Output_section::Input_section::shndx): Ditto.
5392 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 5393 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
5394 (Output_section::Merge_section_by_properties_map,
5395 Output_section::Output_section_data_by_input_section_map,
5396 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
5397 Remove types.
2e702c99 5398 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
5399 KEEPS_INPUT_SECTIONS.
5400 (Output_section::build_lookup_maps): New method declaration.
5401 (Output_section::merge_section_map_,
5402 Output_section::merge_section_by_properties_map_,
5403 Output_section::relaxed_input_section_map_,
5404 Output_section::is_relaxed_input_section_map_valid_): Remove data
5405 members.
5406 (Output_section::lookup_maps_): New data member.
5407
76295588
L
54082010-05-21 Doug Kwan <[email protected]>
5409
5410 PR gold/11619
5411 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
5412 avoid a compilation error.
5413
d103a984
RÁE
54142010-05-19 Rafael Espindola <[email protected]>
5415
5416 * script-sections.cc (Output_section_definition::allocate_to_segment):
5417 Update the phdrs_list even when the output section is NULL.
5418 * testsuite/Makefile.am: Add test.
5419 * testsuite/Makefile.in: Regenerate.
5420 * testsuite/script_test_9.cc: New.
5421 * testsuite/script_test_9.sh: New.
5422 * testsuite/script_test_9.t: New.
5423
6625d24e
DK
54242010-05-19 Doug Kwan <[email protected]>
5425
5426 * arm.cc (Arm_input_section::original_size): New method.
5427 (Arm_input_section::do_addralign): Add a cast.
5428 (Arm_input_section::do_output_offset): Remove static cast.
5429 (Arm_input_section::original_addralign,
5430 Arm_input_section::original_size_): Change type to uint32_t.
5431 (Arm_input_section::init): Add safe casts for section alignment
5432 and size.
5433 (Arm_input_section::set_final_data_size): Do not set address and
5434 offset of stub table.
5435 (Arm_output_section::fix_exidx_coverage): Change use of of
5436 Output_section::Simple_input_section to that of
5437 Output_section::Input_section.
5438 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
5439 except for the first pass.
5440 * output.cc (Output_section::get_input_sections): Change type of
5441 input_sections to std::list<Input_section>.
5442 (Output_section::add_script_input_section): Rename from
5443 Output_section::add_simple_input_section. Change type of SIS
5444 parameter from Simple_input_section to Input_section.
5445 * output.h (Output_section::Simple_input_section): Remove class.
5446 (Output_section::Input_section): Change class visibility to public.
5447 (Output_section::Input_section::addralign): Use stored alignments
5448 for special input sections if set.
5449 (Output_section::Input_section::set_addralign): New method.
5450 (Output_section::get_input_sections): Change parameter type from
5451 list of Simple_input_section to list of Input_section.
5452 (Output_section::add_script_input_section): Rename from
5453 Output_section::add_simple_input_section. Change first parameter's
5454 type from Simple_input_section to Input_section and remove the
5455 second and third parameters.
5456 * script-sections.cc (Input_section::Input_section_list): Change
5457 type to list of Output_section::Input_section/
5458 (Input_section_info::Input_section_info): Change parameter type of
5459 INPUT_SECTION to Output_section::Input_section.
5460 (Input_section_info::input_section): Change return type.
5461 (Input_section_info::input_section_): Change type to
5462 Output_section::Input_section.
5463 (Output_section_element_input::set_section_addresses): Adjust code
5464 to use Output_section::Input_section instead of
5465 Output_section::Simple_input_section. Adjust code for renaming
5466 of Output_section::add_simple_input_section.
5467 (Orphan_output_section::set_section_addresses): Ditto.
5468
e1e82ea4
RW
54692010-05-18 Ralf Wildenhues <[email protected]>
5470
5471 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
5472 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
5473
91e75c8a
RÁE
54742010-05-18 Rafael Espindola <[email protected]>
5475
5476 * options.cc (General_options::finalize): Handle -nostdlib.
5477 * options.h (nostdlib): New option.
5478 * script.cc (script_add_search_dir): Handle -nostdlib.
5479
da59ad79
DK
54802010-05-12 Doug Kwan <[email protected]>
5481
5482 * arm.cc (Target_arm::do_finalize_sections): Create an empty
5483 attributes section only if there no attributes section after merging.
5484 (Target_arm::merge_object_attributes): Move value of
e1df38aa 5485 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
5486 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
5487 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
5488 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
5489 and arm_attr_merge_7.stdout.
5490 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
5491 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
5492 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
5493 arm_attr_merge_7b.o): New rules.
5494 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
5495 arm_attr_merge_7
5496 * testsuite/Makefile.in: Regenerate.
5497 * testsuite/arm_attr_merge.sh: New file.
5498 * testsuite/arm_attr_merge_[67][ab].s: Same.
5499
3e01a7fd
NC
55002010-05-05 Nick Clifton <[email protected]>
5501
5502 * po/es.po: Updated Spanish translation.
5503
7ad2014a
L
55042010-04-27 H.J. Lu <[email protected]>
5505
5506 * Makefile.am (install-exec-local): Properly install gold as
5507 default cross linker.
5508 * Makefile.in: Regenerated.
5509
4fda8867
NC
55102010-04-27 H.J. Lu <[email protected]>
5511 Nick Clifton <[email protected]>
5512
5513 * configure.ac (install_as_default): Define and set to false
5514 unless --enable-gold or --enable-gold=both/gold has been
5515 specified.
5516 * configure: Regenerate.
5517
5518 * Makefile.am (install-exec-local): Install the executable as
5519 'ld.gold'. If install_as_default is true then also install it as
5520 'ld'.
5521 * Makefile.in: Regenerated.
5522
bd288ea2
ILT
55232010-04-24 Ian Lance Taylor <[email protected]>
5524
5525 * layout.cc (Layout::layout_reloc): In relocatable link don't
5526 combine reloc sections for grouped sections.
5527
ef38fd8a
ST
55282010-04-23 Sriraman Tallam <[email protected]>
5529
5530 * gc.h (gc_process_relocs): Pass information on relocs pointing to
5531 sections that are not ordinary to icf.
5532 * icf.cc (get_section_contents): Handle relocation pointing to section
5533 with no object or shndx information.
5534 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
5535 * testsuite/Makefile.in: Regenerate.
5536 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
5537 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
5538
f6973bdc
ILT
55392010-04-22 Ian Lance Taylor <[email protected]>
5540
5541 * expression.cc (Expression::Expression_eval_info): Add
5542 result_alignment_pointer field.
5543 (Expression::eval_with_dot): Add result_alignment_pointer
5544 parameter. Change all callers.
5545 (Expression::eval_maybe_dot): Likewise.
5546 (class Binary_expression): Add alignment_pointer parameter to
5547 left_value and right_value. Change all callers.
5548 (BINARY_EXPRESSION): Set result alignment.
5549 (class Trinary_expression): Add alignment_pointer parameter to
5550 arg2_value and arg3_value. Change all callers.
5551 (Trinary_cond::value): Set result alignment.
5552 (Max_expression::value, Min_expression::value): Likewise.
5553 (Align_expression::value): Likewise.
5554 * script-sections.cc (class Sections_element): Add dot_alignment
5555 parameter to set_section_addresses virtual function. Update
5556 instantiations.
5557 (class Output_section_element): Likewise.
5558 (Script_sections::create_segments): Add dot_alignment parameter.
5559 Change all callers.
5560 (Script_sections::create_segments_from_phdrs_clause): Likewise.
5561 (Script_sections::set_phdrs_clause_addresses): Likewise.
5562 * script-sections.h: Update declarations.
5563 * script.h: Update declarations.
5564 * output.h (Output_segment::set_minimum_p_align): Don't decrease
5565 min_p_align.
5566 * testsuite/script_test_3.t: Set large alignment.
5567 * testsuite/script_test_3.sh: Make sure that at least one LOAD
5568 segment has expected alignment.
5569
9c9c98a5
NC
55702010-04-22 Nick Clifton <[email protected]>
5571
5572 * po/gold.pot: Updated by the Translation project.
5573 * po/vi.po: Updated Vietnamese translation.
5574
2253bfba
L
55752010-04-22 H.J. Lu <[email protected]>
5576
5577 * testsuite/Makefile.am (check_PROGRAMS): Add
5578 icf_virtual_function_folding_test.
5579 * testsuite/Makefile.in: Regenerated.
5580
85fdf906
AH
55812010-04-15 Andrew Haley <[email protected]>
5582
5583 * options.h (merge_exidx_entries): New option.
5584 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
5585 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
5586 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
5587 (Target_arm::merge_exidx_entries): New function.
5588 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
5589 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
5590 to Arm_exidx_fixup constructor.
5591 Add new arg, merge_exidx_entries.
5592 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
5593 Arm_output_section::fix_exidx_coverage.
5594
ce97fa81
ST
55952010-04-18 Sriraman Tallam <[email protected]>
5596
5597 * icf.cc (get_section_contents): Check for preemptible functions.
5598 Ignore addend when appropriate.
5599 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
5600 section folded.
5601 (add_from_relobj): Check for section folded.
5602 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
5603 * symtab.h (should_add_dynsym_entry): Add new parameter.
5604 * target-reloc.h (scan_relocs): Check for section folded.
5605 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
5606 Check reloc types for function pointers in shared objects.
5607 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
5608 case.
5609 (icf_preemptible_functions_test): New test case.
5610 (icf_string_merge_test): New test case.
5611 * testsuite.Makefile.in: Regenerate.
5612 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
5613 bar_glob. Refactor code.
5614 * testsuite/icf_preemptible_functions_test.cc: New file.
5615 * testsuite/icf_preemptible_functions_test.sh: New file.
5616 * testsuite/icf_string_merge_test.cc: New file.
5617 * testsuite/icf_string_merge_test.sh: New file.
5618 * testsuite/icf_virtual_function_folding_test.cc: New file.
5619 * testsuite/icf_virtual_function_folding_test.sh: New file.
5620
04ceb17c
DK
56212010-04-14 Doug Kwan <[email protected]>
5622
5623 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
5624 for local symbol recounting if we remove a section due to ICF.
5625 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
5626 there are no regular objects in input.
5627
153e7da4
DK
56282010-04-13 Doug Kwan <[email protected]>
5629
5630 * arm.cc (Arm_input_section::set_final_data_size): Compute
5631 accurate final data size instead of using current data size.
5632
4dbd9faf
DK
56332010-04-09 Doug Kwan <[email protected]>
5634
5635 * layout.cc (Layout::choose_output_section): Handle script section
5636 types.
5637 (Layout::make_output_section_for_script): Add section type parameter.
5638 Handle script section types.
5639 * layout.h (Layout::make_output_section_for_script): Add section
5640 type parameter.
5641 * output.cc (Output_section::Output_section): Initialize data member
5642 is_noload_.
5643 (Output_section::do_reset_address_and_file_offset): Do not set address
5644 to 0 if section is a NOLOAD section.
5645 * output.h (Output_section::is_noload): New method.
5646 (Output_section::set_is_noload): Ditto.
5647 (Output_section::is_noload_): New data member.
5648 * script-c.h (Script_section_type): New enum type.
5649 (struct Parser_output_section_header): Add new file section_type.
5650 * script-sections.cc (Sections_element::output_section_name): Add
5651 parameter for returning script section type.
5652 (Output_section_definition::output_section_name): Ditto.
5653 (Output_section_definition::section_type)P; New method.
5654 (Output_section_definiton::script_section_type_name): Ditto.
5655 (Output_section_definition::script_section_type_): New data member.
5656 (Output_section_definition::Output_section_definition): Initialize
5657 data member Output_section_definition::script_section_type_.
5658 (Output_section_definition::create_sections): Pass script section type
5659 to Layout::make_output_section_for_script.
5660 (Output_section_definition::output_section_name): Return script
5661 section type to caller.
5662 (Output_section_definition::set_section_address): Do not advance
5663 dot value and load address if section type is NOLOAD. Set address
5664 of NOLOAD sections regardless of section flags.
5665 (Output_section_definition::print): Print section type if it is
5666 not SCRIPT_SECTION_TYPE_NONE.
5667 (Output_section_definition::section_type): New method.
5668 (Output_section_definition::script_section_type_name): Ditto.
5669 (Script_sections::output_section_name): Add new parameter
5670 PSECTION_TYPE for returning script section type. Pass it to
5671 section elements. Handle discard sections.
5672 (Sort_output_sections::operator()): Handle NOLOAD sections.
5673 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 5674 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
5675 returning script section type.
5676 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
5677 INFO and NOLOAD.
5678 * yyscript.y (union): Add new field SECTION_TYPE.
5679 (COPY, DSECT, INFO, NOLOAD): New tokens.
5680 (opt_address_and_section_type): Change type to output_section_header.
5681 (section_type): New non-terminal
5682 (section_header): Handle section type.
2253bfba 5683 (opt_address_and_section_type): Return section type value.
4dbd9faf 5684
721ea635
L
56852010-04-09 H.J. Lu <[email protected]>
5686
5687 * testsuite/plugin_common_test_1.c (foo): Add prototype.
5688 * testsuite/plugin_common_test_2.c (foo): Likewise.
5689
6bf924b0
DK
56902010-04-08 Doug Kwan <[email protected]>
5691
5692 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
5693 Output_merge_data.
5694 * output.cc (Output_section::add_merge_input_section): Simplify
5695 code and return status of Output_merge_base::add_input_section.
e1df38aa 5696 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
5697 returns true.
5698
24af6f92
DK
56992010-04-07 Doug Kwan <[email protected]>
5700
5701 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
5702 if section is marked as containing instructions but has no mapping
5703 symbols.
5704 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
5705 correct section index.
5706 (Arm_relobj::find_linked_text_section): Ditto.
5707
00698fc5
CC
57082010-04-07 Cary Coutant <[email protected]>
5709
5710 * archive.cc (include_member): Destroy Read_symbols_data object before
5711 releasing file.
5712 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
5713 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
5714 (Read_symbols_data::~Read_symbols_data) New destructor.
5715 (Section_relocs::Section_relocs) New constructor.
5716 (Section_relocs::~Section_relocs) New destructor.
5717 (Read_relocs_data::Read_relocs_data) New constructor.
5718 (Read_relocs_data::~Read_relocs_data) New destructor.
5719 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
5720 pointers to NULL after deleting.
5721
7296d933
DK
57222010-04-07 Doug Kwan <[email protected]>
5723
5724 * arm.cc: Replace "endianity" with "endianness" in comments.
5725 (Arm_exidx_cantunwind): Ditto.
5726 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
5727 (Arm_relobj::merge_flags_and_attributes): New method.
5728 (Arm_relobj::merge_flags_and_attributes_): New data member.
5729 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
5730 (Arm_relobj::scan_sections_for_stubs): Ditto.
5731 (Arm_relobj::do_read_symbols): Check to see if we really want to
5732 merge processor-specific flags and attributes. Exit early if
5733 an object is empty except for section names and the undefined symbol.
5734 (Target_arm::do_finalize_sections): Move check for ELF format to
5735 Arm_relobj::do_read_symbols. Merge processor specific flags and
5736 attributes from a regular object only when we have determined that
5737 it is aapropriate. Do not create an .ARM.attributes section in
5738 output if there is no regular input object.
5739 (Target_arm::merge_processor_specific_flags): Check
5740 --warn-mismatch before printing any error.
5741 (Target_arm::merge_object_attributes): Ditto.
5742 * gold.cc (queue_middle_tasks): Handle the case in which there is
5743 no regular object in input.
5744 * options.cc (General_options::parse_EB): New method.
5745 (General_options::parse_EL): Same.
5746 (General_options::General_options): Initialize endianness_.
5747 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
5748 New options.
5749 (General_options::Endianness): New enum.
5750 (General_options::endianness): New method.
5751 (General_options::endianness_): New data member.
5752 * parameters.cc (Parameters::set_options): Check target endianness.
5753 (Parameters::set_target_once): Ditto.
5754 (Parameters::check_target_endianness): New method.
5755 (parameters_force_valid_target): If either -EL or -EB is specified,
5756 use it to define endianness of default target.
5757 * parameters.h (Parameters::check_target_endianness): New method
5758 declaration.
5759 * target.h (class Target): Change "endianity" to "endianness"
5760 in comments.
5761
efc8d4f2
RW
57622010-04-07 Ralf Wildenhues <[email protected]>
5763
5764 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
5765 * configure: Regenerate.
5766 * Makefile.in: Regenerate.
5767 * testsuite/Makefile.in: Regenerate.
5768
be234d88
CC
57692010-04-06 Cary Coutant <[email protected]>
5770
5771 gcc PR lto/42757
5772 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
5773 prevailing definitions of common symbols.
5774 * testsuite/plugin_test_6.sh: New test case.
5775 * testsuite/plugin_common_test_1.c: New test case.
5776 * testsuite/plugin_common_test_2.c: New test case.
5777 * testsuite/Makefile.am (plugin_test_6): New test case.
5778 * testsuite/Makefile.in: Regenerate.
5779
bd32c6bd
NC
57802010-04-06 Nick Clifton <[email protected]>
5781
5782 * po/vi.po: New Vietnamese translation.
5783
323c532f
DK
57842010-03-30 Doug Kwan <[email protected]>
5785
5786 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
5787
4fcd97eb
DK
57882010-03-25 Doug Kwan <[email protected]>
5789
5790 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
5791 to avoid a conversion warning on a 32-bit host.
5792
4ebf39db
ILT
57932010-03-24 Ian Lance Taylor <[email protected]>
5794
5795 * testsuite/script_test_3.t: Add a TLS segment.
5796 * testsuite/Makefile.am (check_PROGRAMS): Add
5797 tls_phdrs_script_test.
5798 (tls_phdrs_script_test_SOURCES): Define.
5799 (tls_phdrs_script_test_DEPENDENCIES): Define.
5800 (tls_phdrs_script_test_LDFLAGS): Define.
5801 (tls_phdrs_script_test_LDADD): Define.
5802 * testsuite/Makefile.in: Rebuild.
5803
4a599bdd
CC
58042010-03-23 Cary Coutant <[email protected]>
5805
5806 * fileread.cc (find_or_make_view): Fix comment.
5807
6c93b22c
ILT
58082010-03-23 Ian Lance Taylor <[email protected]>
5809
5810 * script-sections.cc (class Orphan_section_placement): Define
5811 PLACE_TLS and PLACE_TLS_BSS.
5812 (Orphan_section_placement::Orphan_section_placement): Initialize
5813 new places.
5814 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
5815 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
5816 (tls_script_test_SOURCES): Define.
5817 (tls_script_test_DEPENDENCIES): Define.
5818 (tls_script_test_LDFLAGS): Define.
5819 (tls_script_test_LDADD): Define.
5820 * testsuite/Makefile.in: Rebuild.
5821
a2c7281b
DK
58222010-03-22 Doug Kwan <[email protected]>
5823
5824 * arm.cc (Arm_relocate_functions::abs8,
5825 Arm_relocate_functions::abs16): Use correct check for overflow
5826 specified in the ARM ELF specs.
5827 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
5828 target of a BLX instruction specially.
5829 (Reloc_stub::stub_type_for_reloc): Ditto.
5830 (Relocate::relocate): Use symbolic names instead of numeric relocation
5831 codes to report error.
5832 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
5833 workaround.
5834 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
5835 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
5836 thumb2_blx_out_of_range.stdout
5837 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
5838 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
5839 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
5840 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
5841 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
5842 thumb2_blx_in_range, thumb2_blx_in_range.o,
5843 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
5844 thumb2_blx_out_of_range.o): New rules.
2e702c99 5845 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
5846 thumb2_blx_in_range and thumb2_blx_out_of_range.
5847 * testsuite/Makefile.in: Regenerate.
5848 * arm_branch_in_range.sh: Add tests for THUMB BLX.
5849 * testsuite/thumb_blx_in_range.s: New file.
5850 * testsuite/thumb_blx_out_of_range.s: New file.
5851
b0193076
RÁE
58522010-03-22 Rafael Espindola <[email protected]>
5853
5854 * archive.cc (Should_include): Move to archive.h.
5855 (should_include_member): Make it a member of Archive.
5856 (Lib_group): New.
5857 (Add_lib_group_symbols): New.
5858 * archive.h: Include options.h.
5859 (Archive_member): Moved from Archive.
5860 (Should_include): Moved from archive.cc.
5861 (Lib_group): New.
5862 (Add_lib_group_symbols): New.
5863 * dynobj.cc (do_should_include_member): New.
5864 * dynobj.h (do_should_include_member): New.
5865 * gold.cc (queue_initial_tasks): Update call to queue.
5866 * main.cc (main): Print lib group stats.
5867 * object.cc (do_should_include_member): New.
5868 * object.h: Include archive.h.
5869 (Object::should_include_member): New.
5870 (Object::do_should_include_member): New.
5871 (Sized_relobj::do_should_include_member): New.
5872 * options.cc (General_options::parse_start_lib): New.
5873 (General_options::parse_end_lib): New.
5874 (Input_arguments::add_file): Handle lib groups.
5875 (Input_arguments::start_group): Check we are not in a lib.
5876 (Input_arguments::start_lib): New.
5877 (Input_arguments::end_lib): New.
5878 * options.h (General_options): Add start_lib and end_lib.
5879 (Input_argument::lib_): New.
5880 (Input_argument::lib): New.
5881 (Input_argument::is_lib): New.
5882 (Input_file_lib): New.
5883 (Input_arguments::in_lib_): New.
5884 (Input_arguments::in_lib): New.
5885 (Input_arguments::start_lib): New.
5886 (Input_arguments::end_lib_): New.
5887 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
5888 in unused members as preempted.
5889 (Sized_pluginobj::do_should_include_member): New.
5890 * plugin.h (Sized_pluginobj::do_should_include_member): New.
5891 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
5892 return the blocker.
5893 (Read_symbols::do_whole_lib_group): New.
5894 (Read_symbols::do_lib_group): New.
5895 (Read_symbols::do_read_symbols): Handle lib groups.
5896 (Read_symbols::get_name): Handle lib groups.
5897 * readsyms.h (Read_symbols): Add an archive member pointer.
5898 (Read_symbols::do_whole_lib_group): New.
5899 (Read_symbols::do_lib_group): New.
5900 (Read_symbols::member_): New.
5901 * script.cc (read_input_script): Update call to queue_soon.
5902
d099120c
DK
59032010-03-19 Doug Kwan <[email protected]>
5904
5905 * arm.cc (Stub_table::Stub_table): Initialize new data members
5906 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
5907 (Stub_table::add_reloc_stub): Assign stub offset and update
5908 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
5909 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
5910 New data members.
2e702c99 5911 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
5912 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
5913 instead of going over all reloc stubs.
2e702c99 5914 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
5915 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
5916 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 5917 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
5918 Stringpool_template::offset_.
5919 * stringpool.h (Stringpool_template::set_no_zero_null): Set
5920 Stringpool_template::offset_ to zero.
5921
1aa37384
DK
59222010-03-15 Doug Kwan <[email protected]>
5923
5924 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
5925 offset_.
5926 (Stringpool_template::new_key_offset): New method.
5927 (Stringpool_template::add_string): Assign offsets when adding new
5928 strings.
5929 (Stringpool_template::set_string_offsets): Do not set string offsets
5930 when not optimizing.
5931 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
5932 member size_.
2e702c99
RM
5933 (Chunked_vector::clear): Clear size_.
5934 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
5935 (Chunked_vector::size): Return size_.
5936 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 5937 (Chunked_vector::size_): New data member.
1aa37384
DK
5938 (Stringpool_template::set_no_zero_null): Assert string set is empty.
5939 (Stringpool_template::new_key_offset): New method declaration.
5940 (Stringpool_template::offset_): New data member.
5941
b672b057
RÁE
59422010-03-15 Rafael Espindola <[email protected]>
5943
5944 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
5945 Add_symbols' constructor.
5946 * readsyms.h (Add_symbols): Remove the input_group member.
5947
b6848d3c
ILT
59482010-03-10 Ian Lance Taylor <[email protected]>
5949
5950 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
5951 target to ask whether a reference to a symbol requires a stack
5952 split.
5953 * target.h (Target::is_call_to_non_split): New function.
5954 (Target::do_is_call_to_non_split): Declare virtual function.
5955 * target.cc: Include "symtab.h".
5956 (Target::do_is_call_to_non_split): New function.
5957 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
5958
a2a5469e
CC
59592010-03-10 Cary Coutant <[email protected]>
5960
5961 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
5962 (File_read::open[1]): Remove initial mapping of whole_file_view_.
5963 (File_read::open[2]): Add whole_file_view_ to list of views.
5964 (File_read::make_view): Remove test of whole_file_view_.
5965 (File_read::find_or_make_view): Create whole_file_view_ if
5966 necessary.
5967 (File_read::clear_views): Replace bool parameter with enum;
5968 adjust all callers. Don't delete views with permanent data;
5969 do delete cached views and views from archives if
5970 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
5971 if clearing the corresponding view.
5972 * fileread.h (File_read::Clear_views_mode): New enum.
5973 (File_read::View::is_permanent_view): New method.
5974 (File_read::clear_views): Replace bool parameter
5975 with enum; adjust all callers.
5976 * options.h (General_options): Change keep_files_mapped option;
5977 add map_whole_files.
5978 * readsyms.cc (Add_symbols::run): Delete sd_ object before
5979 releasing the file.
5980 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
5981 the file.
5982
8861f32b
DM
59832010-03-10 David S. Miller <[email protected]>
5984
5985 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
5986
d62d0f5f
ST
59872010-03-09 Sriraman Tallam <[email protected]>
5988
5989 * icf.cc (get_section_contents): Add '@' marker after processing the
5990 merge reloc.
5991
9177756d
DK
59922010-03-08 Doug Kwan <[email protected]>
5993
5994 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
5995 due to a conversion warning.
5996 (Arm_relobj::update_output_local_symbol_count): Check for local
5997 symbol with unset output index.
5998
9e9e071b
ILT
59992010-03-05 Ian Lance Taylor <[email protected]>
6000
6001 * options.h (class General_options): Add --spare-dynamic-tags.
6002 * output.cc (Output_data_dynamic::set_final_data_size): Implement
6003 --spare-dynamic-tags.
6004
a81ee015
ILT
60052010-03-05 Ian Lance Taylor <[email protected]>
6006
6007 * incremental.cc: Include "libiberty.h".
6008
44ec90b9
RO
60092010-03-05 Rainer Orth <[email protected]>
6010
6011 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
6012 function, is_info_ member.
6013 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
6014 (Versions::Versions): Update caller.
6015 (Versions::define_base_version): Likewise.
6016 (Versions::add_def): Likewise.
6017
0897ed3b
ST
60182010-03-03 Sriraman Tallam <[email protected]>
6019
6020 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
6021 (Scan::possible_function_pointer_reloc): New function.
6022 (Scan::local_reloc_may_be_function_pointer): Change to call
6023 possible_function_pointer_reloc.
6024 (Scan::global_reloc_may_be_function_pointer): Ditto.
6025 * icf.h (Icf::check_section_for_function_pointers): Change to reject
6026 relocations in ".data.rel.ro._ZTV" section.
6027 * testsuite/icf_safe_so_test.sh: Change to pass i386.
6028 * testsuite/icf_safe_so_test.cc: Ditto.
6029 * testsuite/icf_safe_test.cc: Ditto.
6030 * testsuite/icf_safe_test.sh: Ditto.
6031
d3bbad62
ILT
60322010-03-03 Viktor Kutuzov <[email protected]>
6033 Ian Lance Taylor <[email protected]>
6034
6035 * target-reloc.h (relocate_section): Check the symbol table index
6036 for -1U before setting the local symbol index.
6037 (scan_relocatable_relocs): If copying the relocation, record that
6038 the local symbol is required.
6039 * object.h (Symbol_value::is_output_symtab_index_set): New
6040 function.
6041 (Symbol_value::may_be_discarded_from_output_symtab): New
6042 function.
6043 (Symbol_value::has_output_symtab_entry): New function.
6044 (Symbol_value::needs_output_symtab_entry): Remove.
6045 (Symbol_value::output_symtab_index): Make sure the symbol index is
6046 set.
6047 (Symbol_value::set_output_symtab_index): Make sure the symbol
6048 index is not set. Make sure the new index is valid.
6049 (Symbol_value::set_must_have_output_symtab_entry): New function.
6050 (Symbol_value::has_output_dynsym_entry): New function.
6051 (Symbol_value::set_output_dynsym_index): Make sure the new index
6052 is valid.
6053 (Sized_relobj::set_must_have_output_symtab_entry): New function.
6054 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
6055 local symbol if permitted.
6056 (Sized_relobj::do_finalize_local_symbols): Call
6057 is_output_symtab_index_set rather than needs_output_symtab_entry.
6058 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
6059 rather than needs_output_symtab_entry. Call
6060 has_output_dynsym_entry rather than needs_output_dynsym_entry.
6061 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
6062 is_output_symtab_index_set rather than needs_output_symtab_entry.
6063 * testsuite/discard_locals_relocatable_test.c: New file.
6064 * testsuite/discard_locals_test.sh: Test -r.
6065 * testsuite/Makefile.am (check_DATA): Add
6066 discard_locals_relocatable_test1.syms,
6067 discard_local_relocatable_test2.syms.
6068 (MOSTLYCLEANFILES): Likewise. Also add
6069 discard_locals_relocatable_test1.lout and
6070 discard_locals_relocatable_test2.out.
6071 (discard_locals_relocatable_test1.syms): New target.
6072 (discard_locals_relocatable_test.o): New target.
6073 (discard_locals_relocatable_test1.out): New target.
6074 (discard_locals_relocatable_test2.syms): New target.
6075 (discard_locals_relocatable_test2.out): New target.
6076 (various): Add missing ../ld-new dependencies.
6077 * testsuite/Makefile.in: Rebuild.
6078
7e8ccf26
NC
60792010-03-03 Nick Clifton <[email protected]>
6080
6081 * po/fi.po: New Finnish translation.
6082
2a0ff005
DK
60832010-03-01 Doug Kwan <[email protected]>
6084
6085 * layout.cc (Layout::Layout): Force section types of .init_array*,
6086 .preinit_array* and .fini_array* sections.
6087 * output.cc (Output_section::Input_section_sort_entry::has_priority):
6088 Fix check of return value of std::string::find.().
6089 (Output_section::Input_section_sort_compare::operator()): Remove
6090 comment about .init_array.
6091 (Output_section::Input_section_sort_init_fini_compare::operator()):
6092 New method.
6093 (Output_section::sort_attached_input_sections): Handle .init_array
6094 and .fini_array specially.
6095 * output.h (Output_section::Inut_section_sort_compare): Update
6096 comment.
6097 (Output_section::Input_section_sort_init_fini_compare): New struct.
6098
c3e4ae29
DK
60992010-02-26 Doug Kwan <[email protected]>
6100
6101 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
6102 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
6103 * testsuite/debug_msg.sh: Avoid matching source line number for
6104 use of global variable undef_int.
6105
2fd9ae7a
DK
61062010-02-26 Doug Kwan <[email protected]>
6107
6108 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
6109 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
6110 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
6111 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
6112 * options.cc (General_options::General_options): Initialize member
6113 fix_v4bx_.
6114 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
6115 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
6116 and rm_no_fix_v4bx.stdout
6117 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
6118 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
6119 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
6120 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
6121 and arm_no_fix_v4bx.
6122 * Makefile.in: Regenerate.
6123 * testsuite/arm_fix_v4bx.s: New file.
6124 * testsuite/arm_fix_v4bx.sh: Ditto.
6125
67ec7d0b
DK
61262010-02-24 Doug Kwan <[email protected]>
6127
6128 * arm.cc (Target_arm::got_section): Make the .got section the first
6129 non RELRO section in the data segment.
6130 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
6131 suffixes of section names.
6132
10165461
DK
61332010-02-24 Doug Kwan <[email protected]>
6134
6135 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
6136 flags and attributes merging if an input file is a binary file.
6137 * fileread.cc (Input_file::open): Record format of original file.
6138 * fileread.h (Input_file::Format): New enum type.
2e702c99 6139 (Input_file::Input_file): Initialize data member format_.
10165461
DK
6140 (Input_file::format): New method definition.
6141 (Input_file::format_):: New data member.
6142
4a54abbb
DK
61432010-02-24 Doug Kwan <[email protected]>
6144
6145 * arm.cc (Arm_output_data_got): New class.
6146 (ARM_TCB_SIZE): New constant
6147 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
6148 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
6149 If user uses a script with a SECTIONS clause, issue only a warning
6150 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 6151 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
6152 garbage collection.
6153 (Target_arm::got_mode_index_entry): Handle static linking.
6154 (Target_arm::Scan::local): Ditto.
6155 (Target_arm::Scan::global): Ditto.
6156 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
6157 all incorrectly implemented relocations.
e1df38aa 6158 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
6159 Arm_output_section::fix_exidx_coverage.
6160 * layout.cc (Layout::section_name_mapping): Remove trailing dots
6161 from ".ARM.exidx." and ".ARM.extab.".
6162
ca419a6f
ILT
61632010-02-23 Viktor Kutuzov <[email protected]>
6164
6165 * arm.cc (Target_arm::do_finalize_sections): Create attribute
6166 section if it does not already exist.
6167 * attributes.cc (Attributes_section_data::Attributes_section_data):
6168 Don't crash if size is zero.
6169
135b9c78
ILT
61702010-02-23 Viktor Kutuzov <[email protected]>
6171 Ian Lance Taylor <[email protected]>
6172
6173 * gold.cc (queue_middle_tasks): If no input files were opened,
6174 exit.
6175 * workqueue.h (Task_function::Task_function): Assert that there is
6176 a blocker.
6177
bb0bfe4f
DK
61782010-02-22 Doug Kwan <[email protected]>
6179
6180 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
6181 * icf.cc (get_section_contents): Cast snprintf arguments to long long
6182 types to avoid warnings due to different uint64_t implementations
6183 on different hosts.
6184
2a2b6d42
DK
61852010-02-21 Doug Kwan <[email protected]>
6186
6187 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
6188 handling of the maximum backward branch offset.
2e702c99 6189 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
6190 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
6191 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 6192 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
6193 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
6194 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
6195 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
6196 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
6197 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
6198 thumb_bl_out_of_range thumb_bl_out_of_range.o,
6199 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
6200 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
6201 thumb2_bl_out_of_range.o): New rules.
6202 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
6203 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
6204 thumb2_bl_out_of_range
6205 * testsuite/Makefile.in: Regenerate.
6206 * testsuite/arm_bl_in_range.s: New file.
6207 * testsuite/arm_bl_out_of_range.s: Ditto.
6208 * testsuite/arm_branch_in_range.sh: Ditto.
6209 * testsuite/arm_branch_range.t: Ditto.
6210 * testsuite/thumb2_branch_range.t: Ditto.
6211 * testsuite/thumb_bl_in_range.s: Ditto.
6212 * testsuite/thumb_bl_out_of_range.s: Ditto.
6213 * testsuite/thumb_branch_range.t: Ditto.
6214
b487ad64
ST
62152010-02-20 Sriraman Tallam <[email protected]>
6216
6217 * gc.h (gc_process_relocs): Change vectors to point to the new list.
6218 Add reloc offset information.
6219 * icf.cc (get_section_contents): Change iterators to point to the new
6220 vectors. Add reloc offset information to the contents.
6221 * icf.h (Icf::Sections_reachable_info): New typedef.
6222 (Icf::Sections_reachable_list): New typedef.
6223 (Icf::Offset_info): New typedef.
6224 (Icf::Reloc_info): New struct typedef.
6225 (Icf::Reloc_info_list): New typedef.
6226 (Icf::symbol_reloc_list): Delete method.
6227 (Icf::addend_reloc_list): Delete method.
6228 (Icf::section_reloc_list): Delete method.
6229 (Icf::reloc_info_list): New method.
6230 (Icf::reloc_info_list_): New member.
6231
f96accdf
DK
62322010-02-19 Doug Kwan <[email protected]>
6233
6234 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
6235 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
6236 * arm.cc (Arm_relocation_functions): New forward declaration.
6237 (Target_arm::Target_arm): Initialize new data members
6238 got_mod_index_offset_ and tls_base_symbol_defined_.
6239 (Target_arm::Relocate::relocate_tls): New method.
6240 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
6241 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
6242 New methods.
2e702c99 6243 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
6244 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
6245 (Target_arm::got_mod_index_offset_,
6246 Target_arm::tls_base_symbol_defined_): New data members.
6247 (Target_arm::Scan::local, Target::Scan::global,
6248 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
6249 relocations.
6250
c8761b9a
DK
62512010-02-18 Doug Kwan <[email protected]>
6252
6253 * arm.cc (Arm_relobj::find_linked_text_section): New method.
6254 (Arm_relobj::make_exidx_input_section): Pass section index of linked
6255 text section as a parameter becuase some broken tools may not set
6256 the link in section header.
6257 (Target_arm::has_got_section): New method.
6258 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
6259 without any mapping symbol as data only. Remove warning.
6260 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
6261 link in its section header, try to discover the link by inspecting the
6262 REL31 relocation at the beginning of the section.
6263 (Target_arm::Scan::check_non_pic): Report name of offending relocation
6264 in error message.
6265 (Target_arm::Scan::global): Treat any reference to the symbol
6266 _GLOBAL_OFFSET_TABLE_ as a GOT access.
6267
21bb3914
ST
62682010-02-12 Sriraman Tallam <[email protected]>
6269
6270 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
6271 (Scan::global_reloc_may_be_function_pointer): New function.
6272 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6273 (Scan::global_reloc_may_be_function_pointer): New function.
6274 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6275 (Scan::global_reloc_may_be_function_pointer): New function.
6276 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
6277 (Scan::global_reloc_may_be_function_pointer): New function.
6278 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
6279 (Scan::global_reloc_may_be_function_pointer): New function.
6280 (Scan::possible_function_pointer_reloc): New function.
6281 (Target_x86_64::can_check_for_function_pointers): New function.
6282 * gc.h (gc_process_relocs): Scan relocation types to determine if
6283 function pointers were taken for targets that support it.
6284 * icf.cc (Icf::find_identical_sections): Include functions for
6285 folding in safe ICF whose pointer is not taken.
6286 * icf.h (Secn_fptr_taken_set): New typedef.
6287 (fptr_section_id_): New member.
6288 (section_has_function_pointers): New function.
6289 (set_section_has_function_pointers): New function.
6290 (check_section_for_function_pointers): New function.
6291 * options.h: Fix comment for safe ICF option.
6292 * target.h (can_check_for_function_pointers): New function.
6293 * testsuite/Makefile.am: Add icf_safe_so_test test case.
6294 Modify icf_safe_test for X86-64.
6295 * testsuite/Makefile.in: Regenerate.
6296 * testsuite/icf_safe_so_test.cc: New file.
6297 * testsuite/icf_safe_so_test.sh: New file.
6298 * testsuite/icf_safe_test.cc (kept_func_3): New function.
6299 (main): Change to take pointer to function kept_func_3.
6300 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
6301 folding is done correctly for X86-64.
6302
0da6fa6c
DM
63032010-02-12 David S. Miller <[email protected]>
6304
6305 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
6306 is_symbolless parameter.
6307 (Output_reloc<SHT_REL>::is_symbolless): New.
6308 (Output_reloc<SHT_REL>::is_symbolless_): New.
6309 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
6310 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
6311 (Output_reloc<SHT_RELA>::is_symbolless): New.
6312 (Output_data_reloc::add_global): Handle is_symbolless.
6313 (Output_data_reloc::add_global_relative): Likewise.
6314 (Output_data_reloc::add_local): Likewise.
6315 (Output_data_reloc::add_local_relative): Likewise.
6316 (Output_data_reloc::add_symbolless_global_addend): New.
6317 (Output_data_reloc::add_symbolless_local_addend): New.
6318 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
6319 is_symbolless.
6320 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
6321 instead of ->is_relative_
6322 (Output_reloc::write): Likewise.
6323 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
6324 (Output_reloc::write_rel): Simplify.
6325
6326 * sparc.cc (Target_sparc::Scan::local): Use
6327 ->add_symbolless_local_addend as needed.
6328 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
6329 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
6330 based upon relocation offset.
6331
e4782e83
DK
63322010-02-11 Doug Kwan <[email protected]>
6333
6334 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
6335 (Target_arm::Scan::global): Ditto. Also remove a comment before the
6336 beginning of function.
6337 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
6338 and MOVT_ABS relocations. Those are non issued in scanning. Fix
6339 parameter is_32bit in calls to should_apply_static_reloc.
6340 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
6341 (check_DATA): Add arm_abs_global.stdout.
6342 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
6343 arm_abs_global.stdout): New rules.
6344 (MOSTLLYCLEANFILES): Add arm_abs_global
6345 * Makefile.in: Regenerate.
6346 * testsuite/arm_abs_global.s: New file.
6347 * testsuite/arm_abs_global.sh: Ditto.
6348 * testsuite/arm_abs_lib.s: Ditto.
6349
93ceb764
ILT
63502010-02-11 Ian Lance Taylor <[email protected]>
6351
6352 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
6353 Read_relocs task.
6354 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
6355 Allocate_commons_task first.
6356 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
6357 task, rather than symtab_lock_.
6358 (Gc_process_relocs::~Gc_process_relocs): New function.
6359 (Gc_process_relocs::is_runnable): Check this_blocker_.
6360 (Gc_process_relocs::locks): Use next_blocker_ rather than
6361 blocker_.
6362 (Scan_relocs::~Scan_relocs): New function.
6363 (Scan_relocs::is_runnable): Check this_blocker_ rather than
6364 symtab_lock_.
6365 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
6366 next_blocker_.
6367 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
6368 fields. Add this_blocker_ and next_blocker_ fields. Adjust
6369 constructor accordingly.
6370 (class Gc_process_relocs): Likewise.
6371 (class Scan_relocs): Likewise.
6372 * common.h (class Allocate_commons_task): Remove symtab_lock_
6373 field, and corresponding constructor parameter.
6374 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
6375 symtab_lock_.
6376 (Allocate_commons_task::locks): Likewise.
6377
114dfbe1
ILT
63782010-02-11 Ian Lance Taylor <[email protected]>
6379
6380 * gold-threads.h (class Once): Define.
6381 (class Initialize_lock): Rewrite as child of Once.
6382 * gold-threads.cc (class Once_initialize): Define.
6383 (once_pointer_control): New static variable.
6384 (once_pointer, once_arg): New static variables.
6385 (c_run_once): New static function.
6386 (Once::Once, Once::run_once, Once::internal_run): New functions.
6387 (class Initialize_lock_once): Remove.
6388 (initialize_lock_control): Remove.
6389 (initialize_lock_pointer): Remove.
6390 (initialize_lock_once): Remove.
6391 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
6392 (Initialize_lock::initialize): Rewrite.
6393 (Initialize_lock::do_run_once): New function.
6394 * archive.cc (Archive::interpret_header): Only clear name if it is
6395 not already empty.
6396 * fileread.cc: Include "gold-threads.h"
6397 (file_counts_lock): New static variable.
6398 (file_counts_initialize_lock): Likewise.
6399 (File_read::release): Only increment counts when using --stats.
6400 Use a lock around the increment.
6401 * parameters.cc (class Set_parameters_target_once): Define.
6402 (set_parameters_target_once): New static variable.
6403 (Parameters::Parameters): Move here from parameters.h.
6404 (Parameters::set_target): Rewrite.
6405 (Parameters::set_target_once): New function.
6406 (Parameters::clear_target): Move here and rewrite.
6407 * parameters.h (class Parameters): Update declarations. Add
6408 set_parameters_target_once_ field.
6409 (Parameters::Parameters): Move to parameters.cc.
6410 (Parameters::clear_target): Likewise.
6411 * readsyms.cc (Read_symbols::do_group): Create a Start_group
6412 task.
6413 (Start_group::~Start_group): New function.
6414 (Start_group::is_runnable): New function.
6415 (Start_group::locks, Start_group::run): New functions.
6416 (Finish_group::run): Change saw_undefined to size_t.
6417 * readsyms.h (class Start_group): Define.
6418 (class Finish_group): Change saw_undefined_ field to size_t.
6419 (Finish_group::Finish_group): Remove saw_undefined and
6420 this_blocker parameters. Change all callers.
6421 (Finish_group::set_saw_undefined): New function.
6422 (Finish_group::set_blocker): New function.
6423 * symtab.h (class Symbol_table): Change saw_undefined to return
6424 size_t. Change saw_undefined_ field to size_t.
6425 * target-select.cc (Set_target_once::do_run_once): New function.
6426 (Target_selector::Target_selector): Initialize set_target_once_
6427 field. Don't initialize lock_ and initialize_lock_ fields.
6428 (Target_selector::instantiate_target): Rewrite.
6429 (Target_selector::set_target): New function.
6430 * target-select.h (class Set_target_once): Define.
6431 (class Target_selector): Update declarations. Make
6432 Set_target_once a friend. Remove lock_ and initialize_lock_
6433 fields. Add set_target_once_ field.
6434
fa17a3f4
ILT
64352010-02-10 Ian Lance Taylor <[email protected]>
6436
6437 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
6438 queueing any tasks.
6439 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
6440 (queue_middle_tasks): Add all blockers before queueing any tasks.
6441 (queue_final_tasks): Likewise.
6442 * token.h (Task_token::add_blockers): New function.
6443 * object.h (Input_objects::number_of_relobjs): New function.
6444
c7177d31
ILT
64452010-02-10 Ian Lance Taylor <[email protected]>
6446
5de0e392
ILT
6447 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
6448 shared, not if not position independent.
6449 * x86_64.cc (Relocate::relocate_tls): Likewise.
6450 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
6451 (tls_pie_pic_test): New target.
6452 * testsuite/Makefile.in: Rebuild.
6453
c7177d31
ILT
6454 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
6455 (tls_test_main_pie.o, tls_test_pie.o): New targets.
6456 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
6457 * testsuite/Makefile.in: Rebuild.
6458
684b268a
DM
64592010-02-09 David S. Miller <[email protected]>
6460
6461 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
6462 R_SPARC_RELATIVE using ->add_local_relative().
6463 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
6464
612a8d3d
DM
6465 * output.h (Output_data_dynamic::add_section_size): New method
6466 that takes two Output_data objects.
6467 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
6468 entry param. Handle it in initializers.
6469 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
6470 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
6471 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
6472 arg.
6473 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
6474 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
6475 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
6476 for dynrel_includes_plt.
6477 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6478 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6479 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
6480 before .rela.plt
6481 (Target_sparc::do_finalize_sections): Update to pass true for
6482 dynrel_includes_plt.
6483 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
6484 output before .rela.plt
6485 (Target_powerpc::do_finalize_sections): Update to pass true for
6486 dynrel_includes_plt when 32-bit.
6487
cb1be87e
DK
64882010-02-08 Doug Kwan <[email protected]>
6489
6490 * arm.cc (Arm_relobj::simple_input_section_output_address): New
6491 method.
6492 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
6493 Arm_relobj::scan_section_for_cortex_a8_stubs,
6494 Arm_relobj::do_relocation_section): Instead of calling
6495 Output_section::output_address, use faster
6496 Arm_relobj::simple_input_section_output_address.
6497
705b5121
DM
64982010-02-08 David S. Miller <[email protected]>
6499
6500 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
6501 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
6502 relocation helper function.
6503
024c4466
DM
6504 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
6505 just like R_SPARC_GOT{10,13,22}.
6506 (Target_sparc::Scan::local): Likewise.
6507 (Target_sparc::Relocate:relocate): Likewise.
6508
9109c078
ILT
65092010-02-06 Ian Lance Taylor <[email protected]>
6510
6511 * configure.ac: Rewrite targetobjs duplicate removal code to use
6512 only shell constructs.
6513 * configure: Rebuild.
6514
cf846138
DK
65152010-02-05 Doug Kwan <[email protected]>
6516
6517 PR 11247
6518 * arm.cc (Arm_relobj::section_is_scannable): New method.
6519 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
6520 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
6521
6cfaf60b
DK
65222010-02-04 Doug Kwan <[email protected]>
6523
6524 PR 11247
6525 * arm-reloc-property.cc (cstdio): Include.
6526 * configure.ac (targetobjs): Remove duplicates.
6527 * configure: Regenerate.
6528 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
6529 big and little endian version for a given address size.
6530
5c57f1be
DK
65312010-02-03 Doug Kwan <[email protected]>
6532
6533 * arm-reloc-property.cc
6534 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6535 definition.
6536 * arm-reloc-property.h
6537 (Arm_reloc_property_table::get_implemented_static_reloc_property):
6538 New method definition.
6539 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6540 declaration.
6541 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
6542 overflow to N.
6543 (GOT_PREL): Change implemented to Y.
6544 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
6545 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
6546 (Arm_relocate_functions::movw_abs_nc): Remove method.
6547 (Arm_relocate_functions::movt_abs): Ditto.
6548 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
6549 (Arm_relocate_functions::thm_movt_abs): Ditto.
6550 (Arm_relocate_functions::movw_rel_nc): Ditto.
6551 (Arm_relocate_functions::movw_rel): Ditto.
6552 (Arm_relocate_functions::movt_rel): Ditto.
6553 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
6554 (Arm_relocate_functions:thm_movw_rel): Ditto.
6555 (Arm_relocate_functions:thm_movt_rel): Ditto.
6556 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
6557 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
6558 New method definitions.
6559 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
6560 (Arm_relocation_functions::arm_grp_ldr): Ditto.
6561 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
6562 (Arm_relocation_functions::arm_grp_ldc): Ditto.
6563 (Target_arm::Relocate::relocate): Check for non-static or
6564 unimplemented relocation code and exit early. Change calls to
6565 Target_arm::reloc_uses_thumb_bit and
6566 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
6567 instead. Refactor code to handle similar relocations to increase
6568 code sharing. Remove check for unsupported relocation code in switch
6569 statement.
6570 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
6571 relocation property table to find out size. Change error message to
6572 print out the name of a relocation code instead of the numeric value.
6573 (Target_arm::scan_reloc_for_stub): Use relocation property table
6574 instead of calling Target_arm::reloc_uses_thumb_bit().
6575
218c5831
DK
65762010-02-02 Doug Kwan <[email protected]>
6577
6578 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
6579 types of relaxed input section.
6580
0d31c79d
DK
65812010-02-02 Doug Kwan <[email protected]>
6582
6583 * Makefile.am (HFILES): Add arm-reloc-property.h.
6584 (DEFFILES): New.
2e702c99
RM
6585 (TARGETSOURCES): Add arm-reloc-property.cc
6586 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
6587 (libgold_a_SOURCES): $(DEFFILES)
6588 * Makefile.in: Regenerate.
6589 * arm-reloc-property.cc: New file.
6590 * arm-reloc-property.h: New file.
6591 * arm-reloc.def: New file.
6592 * arm.cc: Update comments.
6593 (arm-reloc-property.h): New included header.
6594 (arm_reloc_property_table): New global variable.
6595 (Target_arm::do_select_as_default_target): New method definition.
6596 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
6597 arm-reloc-property to targ_extra_obj.
6598 * parameters.cc (set_parameters_target): Call
6599 Target::select_as_default_target().
6600 * target.h (Target::select_as_default_target): New method definition.
6601 (Target::do_select_as_default_target): Same.
6602
546c7457
DK
66032010-02-01 Doug Kwan <[email protected]>
6604
6605 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
6606 first_output_text_section_.
6607 (Arm_exidx_fixup::first_output_text_section): New method definition.
6608 (Arm_exidx_fixup::first_output_text_section_): New data member.
6609 (Arm_exidx_fixup::process_exidx_section): Record the first text
6610 output section seen.
6611 (Arm_output_section::fix_exidx_coverage): Set correct linked section
6612 and entsize in output section header.
6613
11b861d5
DK
66142010-01-29 Viktor Kutuzov <[email protected]>
6615
6616 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
6617 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
6618 (Arm_relocate_functions::thm_alu11): New Method.
6619 (Arm_relocate_functions::thm_pc8): New Method.
6620 (Arm_relocate_functions::thm_pc12): New Method.
6621 (Target_arm::Scan::local): Handle the relocations.
6622 (Target_arm::Scan::global): Likewise.
6623 (Target_arm::Relocate::relocate): Likewise.
6624 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6625
c9a2c125
DK
66262010-01-29 Doug Kwan <[email protected]>
6627
6628 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
6629 of relocation types as ld.
6630
1521477a
DK
66312010-01-29 Doug Kwan <[email protected]>
6632
6633 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
6634 to public.
6635 (Arm_relocate_functions::thumb_branch_common): Ditto.
6636 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
6637 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
6638 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
6639 Arm_relocate_functions::jump24): Remove.
6640 (Target_arm::Relocate::relocate): Adjust code to call
6641 Arm_relocation_functions::arm_branch_common and
6642 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 6643 wrappers. Merge switch-cases together to reduce source code size.
1521477a 6644
e7eca48c
DK
66452010-01-29 Doug Kwan <[email protected]>
6646
6647 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
6648 output_local_symbol_count_needs_update_.
6649 (Arm_relobj::output_local_symbol_count_needs_update,
6650 Arm_relobj::set_output_local_symbol_count_needs_update,
6651 Arm_relobj::update_output_local_symbol_count): New methods.
6652 (Arm_relobj::output_local_symbol_count_needs_update_): New data
6653 member.
6654 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
6655 of pointed function as in a R_ARM_PREL31 relocation.
6656 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
6657 for output local symbol count updating.
6658 (Target_arm::do_relax): Update output local symbol counts in objects
6659 if necessary.
6660 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
6661
02961d7e
ILT
66622010-01-29 Viktor Kutuzov <[email protected]>
6663
6664 * arm.cc: Added support for the ARM relocations:
6665 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
6666 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
6667 (Arm_relocate_functions::movw_rel_nc): Renamed (was
6668 movw_prel_nc).
6669 (Arm_relocate_functions::movw_rel): New method.
6670 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
6671 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
6672 thm_movw_prel_nc).
6673 (Arm_relocate_functions::thm_movw_rel): New method.
6674 (Arm_relocate_functions::thm_movt_rel): Renamed (was
6675 thm_movt_prel).
6676 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
6677 relocations.
6678 (Target_arm::Scan::global): Likewise.
6679 (Target_arm::Relocate::relocate): Likewise.
6680 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6681 Likewise.
6682
b10d2873
ILT
66832010-01-27 Viktor Kutuzov <[email protected]>
6684
6685 * arm.cc: Added support for ARM group relocations.
6686 (Target_arm::reloc_needs_sym_origin): New method.
6687 (Arm_relocate_functions::calc_grp_kn): New method.
6688 (Arm_relocate_functions::calc_grp_residual): New method.
6689 (Arm_relocate_functions::calc_grp_gn): New method.
6690 (Arm_relocate_functions::arm_grp_alu): New Method.
6691 (Arm_relocate_functions::arm_grp_ldr): New Method.
6692 (Arm_relocate_functions::arm_grp_ldrs): New Method.
6693 (Arm_relocate_functions::arm_grp_ldc): New Method.
6694 (Target_arm::Scan::local): Handle the ARM group relocations.
6695 (Target_arm::Scan::global): Likewise.
6696 (Target_arm::Relocate::relocate): Likewise.
6697 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6698 Likewise.
6699
2b328d4e
DK
67002010-01-26 Doug Kwan <[email protected]>
6701
6702 * arm.cc (set): Include.
6703 (class Arm_exidx_fixup): Change type of last_input_section_ to const
6704 pointer type.
2e702c99 6705 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
6706 (Arm_output_section::append_text_sections_to_list): New method.
6707 (Arm_output_section::fix_exidx_coverage): Ditto.
6708 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 6709 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
6710 Relobj::set_section_offset() instead of
6711 Sized_relobj::invalidate_section_offset().
2e702c99 6712 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
6713 parameter for section headers. Ignore relocation sections for
6714 unallocated sections and EXIDX sections.
6715 (Target_arm::fix_exidx_coverage): New method.
6716 (Target_arm::output_section_address_less_than): New type.
6717 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
6718 linked text section instead of the EXIDX section.
6719 (Arm_output_section::create_stub_group): Add an assertion to check
6720 that this is not an EXIDX output section.
6721 (Arm_output_section::append_text_sections_to_list): New method.
6722 (Arm_output_section::fix_exidx_coverage): Ditto.
6723 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 6724 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
6725 (Target_arm::do_relax): Fix EXIDX output section coverage in the
6726 first pass.
6727 (Target_arm::fix_exidx_coverage): New method.
6728 * object.h (Relobj::set_output_section): New method.
6729 (Sized_relobj::invalidate_section_offset): Remove method.
6730 (Sized_relobj::do_invalidate_section_offset): Remove method.
6731 (Sized_relobj::do_set_section_offset): Handle offset value -1.
6732
c7f3c371
DK
67332010-01-25 Doug Kwan <[email protected]>
6734
6735 * arm.cc (Arm_exidx_merged_section::do_output_offset):
6736 Fix warning due to signed and unsigned comparison on a 32-bit host.
6737
8923b24c
DK
67382010-01-22 Doug Kwan <[email protected]>
6739
6740 * arm.cc (Target_arm::do_relax): Record an output section for section
6741 offset adjustment it contains any stub table that has changed.
6742 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
6743 offsets in an output section if necessary.
6744 * output.cc (Output_section::Output_section): Initialize
6745 section_offsets_need_adjustments_.
6746 (Output_section::add_input_section_for_script): Renamed to
6747 Output_section::add_simple_input_section.
6748 (Output_section::save_states): Add a comment.
6749 (Output_section::discard_states): New method defintion.
6750 (Output_section::adjust_section_offsets): Same.
6751 * output.h (Output_section::add_input_section_for_script): Renamed to
6752 Output_section::add_simple_input_section.
6753 (Output_section::discard_states): New method declaration.
6754 (Output_section::adjust_section_offsets): Same.
6755 (Output_section::section_offsets_need_adjustment,
6756 Output_section::set_section_offsets_need_adjustment): New method
6757 definitions.
6758 (Output_section::section_offsets_need_adjustment_): New data member.
6759 * script-sections.cc
6760 (Output_section_element_input::set_section_address): Adjust code for
6761 renaming of Output_section::add_input_section_for_script.
6762 (Orphan_output_section::set_section_address): Same.
6763
9b2fd367
DK
67642010-01-22 Viktor Kutuzov <[email protected]>
6765
6766 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
6767 Fix_v4bx enum values .
6768 * gold/options.h (General_options): New option definitions.
6769 (General_options::fix_v4bx): New method.
6770 (General_options::Fix_v4bx): New enum.
6771 * gold/options.cc (General_options::parse_fix_v4bx): New method.
6772 (General_options::parse_fix_v4bx_interworking): New method.
6773
80d0d023
DK
67742010-01-22 Doug Kwan <[email protected]>
6775
6776 * arm.cc (Arm_exidx_fixup): New class.
6777
af2cdeae
DK
67782010-01-21 Doug Kwan <[email protected]>
6779
6780 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
6781 classes.
6782 (Arm_exidx_section_offset_map): New type.
6783
993d07c1
DK
67842010-01-21 Doug Kwan <[email protected]>
6785
6786 * arm.cc (Arm_exidx_input_section): New class.
6787 (Arm_relobj::exidx_input_section_by_link,
6788 Arm_relobj::exidx_input_section_by_shndx,
6789 Arm_relobj::make_exidx_input_section): New methods.
6790 (read_arm_attributes_section): Remove.
6791 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
6792 information about them.
6793 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
6794 to here.
6795
5ac169d4
DK
67962010-01-20 Doug Kwan <[email protected]>
6797
6798 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
6799 Input_section_specifier to Section_id.
6800 (Target_arm::new_arm_input_section: Adjust code for change of key
6801 type.
6802 (Target_arm::find_arm_input_section): Ditto.
6803 * gc.h (object.h): Include for Section_id nand Section_id_hash.
6804 (Section_id): Remove.
6805 (Garbage_collection::Section_id_hash): Remove.
6806 * icf.h (object.h): Include for Section_id nand Section_id_hash.
6807 (Section_id): Remove.
6808 (Icf::Section_id_hash): Remove.
6809 * object.h (Section_id, Const_section_id, Section_id_hash,
6810 Const_section_id_hash): New type definitions.
6811 * output.cc (Output_section::add_relaxed_input_section): Change to
6812 use Const_section_id instead of Input_section_specifier as key type.
6813 (Output_section::add_merge_input_section): Ditto.
6814 (Output_section::build_relaxation_map): Change to use Section_id
6815 instead of Input_section_specifier as key type.
2e702c99 6816 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
6817 Ditto.
6818 (Output_section::convert_input_sections_to_relaxed_sections): Change
6819 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 6820 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
6821 (Output_section::find_relaxed_input_section): Ditto.
6822 * output.h (Input_section_specifier): Remove class.
6823 (Output_section::Output_section_data_by_input_section_map): Change
6824 key type to Const_section_id.
6825 (Output_section::Output_relaxed_input_section_by_input_section_map):
6826 Ditto.
6827 (Output_section::Relaxation_map): Change key type to Section_id.
6828
a2162063
ILT
68292010-01-20 Viktor Kutuzov <[email protected]>
6830
6831 * gold/arm.cc: Added support for R_ARM_V4BX relocation
6832 (class Arm_v4bx_stub): New class.
6833 (DEF_STUBS): Updated definition to support v4_veneer_bx.
6834 (Stub_factory::make_arm_v4bx_stub): New method.
6835 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
6836 (Stub_table::empty): Handle v4bx stubs.
6837 (Stub_table::add_arm_v4bx_stub): New method.
6838 (Stub_table::find_arm_v4bx_stub): New method.
6839 (Arm_relocate_functions::v4bx): New method.
6840 (Target_arm::fix_v4bx): New method.
6841 (Target_arm::Target_arm): Handle R_ARM_V4BX.
6842 (Stub_table::relocate_stubs): Likewise.
6843 (Stub_table::do_write): Likewise.
6844 (Stub_table::update_data_size_and_addralign): Likewise.
6845 (Stub_table::finalize_stubs): Likewise.
6846 (Target_arm::Scan::local): Likewise.
6847 (Target_arm::Scan::global): Likewise.
6848 (Target_arm::do_finalize_sections): Likewise.
6849 (Target_arm::Relocate::relocate): Likewise.
6850 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6851 Likewise.
6852 (Target_arm::scan_reloc_for_stub): Likewise.
6853 (Target_arm::scan_reloc_section_for_stubs): Likewise.
6854
5696ab0b
ILT
68552010-01-19 Ian Lance Taylor <[email protected]>
6856
6857 * output.cc (Output_section_headers::do_sized_write): Write large
6858 segment count to sh_info field.
6859 (Output_file_header::do_sized_write): For large segment count,
6860 write PN_XNUM to e_phnum field.
6861
800d0f56
ILT
68622010-01-15 Viktor Kutuzov <[email protected]>
6863
6864 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
6865 (Arm_relocate_functions::thm_jump8): New function.
6866 (Arm_relocate_functions::thm_jump11): New function.
6867 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
6868 R_ARM_THM_JUMP11.
6869 (Target_arm::Scan::global): Likewise.
6870 (Target_arm::Relocate::relocate): Likewise.
6871 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6872 Likewise.
6873
41263c05
DK
68742010-01-14 Doug Kwan <[email protected]>
6875
6876 * arm.cc (map, utility): Include headers.
6877 (Target_arm::apply_cortex_a8_workaround): New method.
6878 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
6879 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
6880 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
6881 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
6882 the --[no-]fix-cortex-a8 command line options.
6883 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
6884 (Target_arm::relocate_stub): Use addend in instruction template.
6885 * options.h (DEFINE_bool): Set the user-set flag.
6886 (General_options): Add --[no-]-fix-cortex options.
6887 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 6888 : Update fast look-up map after conversion.
41263c05 6889
459e9b03
ST
68902010-01-14 Sriraman Tallam <[email protected]>
6891
6892 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
6893 in the first pass of do_layout.
6894
b521dfe4
DK
68952010-01-13 Doug Kwan <[email protected]>
6896
6897 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
6898 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
6899 apparent compiler problem of not folding static constant integral
6900 data members of elfcpp::Elf_sizes<32>.
6901
44272192
DK
69022010-01-13 Doug Kwan <[email protected]>
6903
6904 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
6905 Arm_relobj::section_needs_cortex_a8_stub_scanning,
6906 Arm_relobj::scan_section_for_cortex_a8_erratum,
6907 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
6908 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
6909 sections to scan for relocation stubs into a new method
6910 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
6911 relocation and Cortex-A8 stub scanning.
6912 (Target_arm::do_relax): Force stubs to be after stubbed sections
6913 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 6914 the beginning of a new relaxation pass. Update a comment.
44272192
DK
6915 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
6916
44b71ece
ILT
69172010-01-12 Ian Lance Taylor <[email protected]>
6918
6919 * target-reloc.h (visibility_error): New inline function.
6920 (relocate_section): Call visibility_error.
6921 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
6922 (MOSTLYCLEANFILES): Likewise.
6923 (protected_4_pic.o, protected_3.err): New targets.
6924 * testsuite/protected_4.cc: New file.
6925
a120bc7f
DK
69262010-01-12 Doug Kwan <[email protected]>
6927
6928 * arm.cc (Cortex_a8_reloc): New class.
6929 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
6930 and cortex_a8_relocs_info_.
6931 (Target_arm::fix_cortex_a8): New method definition.
6932 (Target_arm::Cortex_a8_relocs_info): New type.
6933 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
6934 New data member declarations.
6935 (Target_arm::scan_reloc_for_stub): Record information about
6936 relocations for THUMB branches that might be exempted from the
6937 Cortex-A8 workaround.
6938 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
6939 at the beginning of a relaxation pass.
6940
20138696
DK
69412010-01-12 Doug Kwan <[email protected]>
6942
6943 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
6944 (Arm_relobj::Mapping_symbol_position,
6945 Arm_reloj::Mapping_symbol_position_less,
6946 Arm_relobj::Mapping_symbols_info): New types.
6947 (Target_arm::is_mapping_symbol_name): New method definition.
6948 (Arm_relobj::do_count_local_symbols): Save information about mapping
6949 symbols.
6950
089d69dc
DK
69512010-01-11 Doug Kwan <[email protected]>
6952
6953 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
6954 Arm_relocate_functions::thumb32_branch_upper,
6955 Arm_relocate_functions::thumb32_branch_lower,
6956 Arm_relocate_functions::thumb32_cond_branch_offset,
6957 Arm_relocate_functions::thumb32_cond_branch_upper,
6958 Arm_relocate_functions::thumb32_cond_branch_lower,
6959 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
6960 branch offset encoding.
6961 (Arm_relocate_functions::thumb_branch_common): Use new branch
6962 offset encoding methods to avoid code duplication.
6963 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
6964 (Stub_addend_reader::operator()): Use new branch encoding method
6965 to avoid code duplication.
6966
99e5bff2
DK
69672010-01-11 Doug Kwan <[email protected]>
6968
6969 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
6970 (Target_arm::do_finalize_sections): Define special EXIDX section
6971 symbols only if referenced.
6972 * gc.h (Garbage_collection::add_reference): New method.
6973 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
6974 code duplication.
6975
98e090bd
ILT
69762010-01-11 Ian Lance Taylor <[email protected]>
6977
d0a91bd8
ILT
6978 * script.cc (Version_script_info::build_expression_list_lookup):
6979 Change complaing about duplicate wildcard match from error to
6980 warning.
6981
98e090bd
ILT
6982 * script.cc (class Lazy_demangler): Recreate--revert part of patch
6983 of 2009-12-30.
6984 (Version_script_info::Version_script_info): Initialize globs_,
6985 default_version_, default_is_global_, and exact_. Don't
6986 initialize globals_ or locals_.
6987 (Version_script_info::build_lookup_tables): Build local symbols
6988 first.
6989 (Version_script_info::unquote): New function.
6990 (Version_script_info::add_exact_match): New function.
6991 (Version_script_info::build_expression_list_lookup): Remove lookup
6992 parameter. Add is_global parameter. Change all callers. Handle
6993 wildcard pattern specially. Unquote pattern. Call
6994 add_exact_match.
6995 (Version_script_info::get_name_to_match): New function.
6996 (Version_script_info::get_symbol_version): New function.
6997 (Version_script_info::get_symbol_version_helper): Remove.
6998 (Version_script_info::check_unmatched_names): Call unquote.
6999 * script.h (class Version_script_info): Change get_symbol_version
7000 to be non-inline and add is_global parameter; change all callers.
7001 Rewrite symbol_is_local. Update declarations. Define struct
7002 Version_tree_match, Exact, Globs. Don't define struct Lookup.
7003 Remove globals_ and locals_ members. Add exact_, globs_,
7004 default_version_, is_global_.
7005 (Version_script_info::Glob): Remove pattern, add expression and
7006 is_global. Update constructor. Change all callers.
7007 * dynobj.cc (Versions::finalize): Mark the version symbol as the
7008 default version.
7009 (Versions::symbol_section_contents): If a symbol is undefined, or
7010 defined in a dynamic object, set the version index to
7011 VER_NDX_LOCAL.
7012 * symtab.cc (Symbol_table::add_from_relobj): Don't call
7013 symbol_is_local.
7014 (Symbol_table::add_from_pluginobj): Likewise.
7015 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
7016
d56962d3
DK
70172010-01-11 Doug Kwan <[email protected]>
7018
7019 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
7020 (incremental_dump_LDADD): Add linking option for libintl.
7021 * Makefile.in: Regenerate.
7022
94e6ee91
L
70232010-01-11 H.J. Lu <[email protected]>
7024
7025 PR gold/11144
7026 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
7027 instead of -Ds.
7028 * testsuite/Makefile.in: Regenerated.
7029
e96c574b
DK
70302010-01-10 Doug Kwan <[email protected]>
7031
7032 * options.h (DEFINE_var): Use parentheses around argument varname__
7033 in macro body to avoid any unintended subsequent substitutions.
7034
7198066b
ILT
70352010-01-10 Ian Lance Taylor <[email protected]>
7036
ba4d53bf
ILT
7037 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
7038 candidates before doing symbol resolution.
7039
7198066b
ILT
7040 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
7041 ODR candidates if only one is weak.
7042
a2beed37
ILT
70432010-01-08 Ian Lance Taylor <[email protected]>
7044
7045 * script.cc (Version_script_info::build_expression_list_lookup):
7046 Don't warn about ambiguous version, just record the ambiguity.
7047 (Version_script_info::get_symbol_version_helper): Give error if
7048 version is ambiguous.
7049
2fb7225c
DK
70502010-01-08 Doug Kwan <[email protected]>
7051
7052 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
7053 prev_data_size_ and prev_addralign_. Remove initializer for
7054 deleted data member has_been_changed_.
7055 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
7056 to determine if the table is empty.
7057 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
7058 Remove.
7059 (Stub_table::add_reloc_stub): Define method in class definition
7060 instead of just declaring it there.
7061 (Stub_table::add_cortex_a8_stub): New method definition.
7062 (Stub_table::update_data_size_and_addralign): Ditto.
7063 (Stub_table::finalize_stubs): Ditto.
7064 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
7065 (Stub_table::do_addralign_): Return address alignment in the
7066 (Stub_table::do_reset_address_and_file_offset): Define method in
7067 class definition instead of declaring it there. Set current data
7068 size to be the data size of the previous pass.
7069 (Stub_table::set_final_data_size): Use current data size as the
7070 final data size.
7071 (Stub_table::relocate_stub): Change parameter type of stub from
7072 Reloc_stub pointer to Stub pointer.
7073 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
7074 (Stub_table::Cortex_a8_stub_list): New typedef.
7075 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
7076 Stub_table::prev_addralign_): New data member.
7077 (Arm_relobj::Arm_relobj): Initialize data member
7078 section_has_cortex_a8_workaround_.
7079 (Arm_relobj::section_has_cortex_a8_workaround,
7080 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
7081 definitions.
7082 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
7083 declarations.
7084 (Target_arm::relocate_stub): Change parameter type of stub from
7085 Reloc_stub pointer to Stub pointer.
7086 (Insn_template::size, Insn_template::alignment): Handle
7087 THUMB16_SPECIAL_TYPE.
7088 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
7089 Stub_table::update_data_size_and_addralign,
7090 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
7091 definitions.
2e702c99 7092 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
2fb7225c
DK
7093 (Stub_table::do_write): Ditto.
7094 (Target_arm::do_relax): Adjust code for changes in Stub_table.
7095
880cd20d
ILT
70962010-01-08 Ian Lance Taylor <[email protected]>
7097
7098 PR 11108
7099 * symtab.h (class Symbol): Remove fields is_target_special_ and
7100 has_plt_offset_. Add field is_defined_in_discarded_section_.
7101 (Symbol::is_defined_in_discarded_section): New function.
7102 (Symbol::set_is_defined_in_discarded_section): New function.
7103 (Symbol::has_plt_offset): Rewrite.
7104 (Symbol::set_plt_offset): Verify that new offset is not -1U.
7105 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
7106 Don't initialize is_target_special_ or has_plt_offset_.
7107 Initialize is_defined_in_discarded_section_.
7108 (Symbol_table::add_from_relobj): If appropriate, set
7109 is_defined_in_discarded_section.
7110 * resolve.cc (Symbol::override_base_with_special): Don't test
7111 is_target_special_. Change has_plt_offset_ to has_plt_offset().
7112 * target-reloc.h (relocate_section): Do special handling for
7113 symbols defined in discarded sections for global symbols as well
7114 as local symbols.
7115
2703e3eb
ILT
71162010-01-08 Ian Lance Taylor <[email protected]>
7117
7118 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
7119 the SHT_SYMTAB case.
7120
339d40a3
ILT
71212010-01-08 Ian Lance Taylor <[email protected]>
7122
7123 * object.cc (Sized_relobj::do_layout): Don't get confused if
7124 layout_eh_frame returns NULL.
7125
abecea76
ILT
71262010-01-08 Ian Lance Taylor <[email protected]>
7127
7128 PR 11084
7129 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
7130 dynamic symbol table, use the normal symbol table.
7131 (Sized_dynobj::do_read_symbols): Remove assertion about type of
7132 symbol table.
7133
6b7dd3f3
ILT
71342010-01-08 Ian Lance Taylor <[email protected]>
7135
7136 PR 11072
7137 * layout.cc (Layout::include_section): Remove .gnu_debuglink
7138 sections.
7139
36c50e63
L
71402010-01-08 H.J. Lu <[email protected]>
7141
7142 * version.cc (print_version): Change to "Copyright 2010".
7143
e291e7b9
ILT
71442010-01-08 Ian Lance Taylor <[email protected]>
7145
7146 PR 10287
7147 PR 11063
7148 * i386.cc (class Target_i386): Change return type of plt_section
7149 to be non-const.
7150 (class Output_data_plt_i386): Add tls_desc_rel_ field.
7151 (Output_data_plt_i386::Output_data_plt_i386): Initialize
7152 tls_desc_rel_ field.
7153 (Output_data_plt_i386::rel_tls_desc): New function.
7154 (Target_i386::rel_tls_desc_section): New function.
7155 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
7156 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
7157 R_386_TLS_DESC reloc in rel_tls_desc_section.
7158 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
7159 Define struct Tlsdesc_info.
7160 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
7161 (Target_x86_64::do_reloc_symbol_index): New function.
7162 (Target_x86_64::add_tlsdesc_info): New function.
7163 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
7164 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
7165 tlsdesc_rel_ field.
7166 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
7167 all callers.
7168 (Output_data_plt_x86_64::rela_tlsdesc): New function.
7169 (Target_x86_64::rela_tlsdesc_section): New function.
7170 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
7171 handling.
7172 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
7173 (Target_x86_64::do_reloc_addend): New function.
7174 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
7175 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
7176 declarations. Define TARGET_CODE. Add arg field to u1_ union.
7177 (Output_reloc::type): New function.
7178 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
7179 (Output_reloc::is_target_specific): New function.
7180 (Output_reloc::target_arg): New function.
7181 (class Output_reloc) [SHT_RELA]: Add four new constructors for
7182 absolute relocs and target specific relocs.
7183 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
7184 add_target_specific.
7185 (class Output_data_reloc) [SHT_RELA]: Likewise.
7186 * output.cc (Output_reloc::Output_reloc): Add four new versions
7187 for absolute relocs and target specific relocs.
7188 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
7189 (Output_reloc::get_symbol_index): Likewise.
7190 (Output_reloc::local_section_offset): Check that local_sym_index_
7191 is not TARGET_CODE or 0.
7192 (Output_reloc::symbol_value): Likewise.
7193 (Output_reloc::write) [SHT_RELA]: Call target for target specific
7194 reloc.
7195 * target.h (class Target): Add reloc_symbol_index and reloc_addend
7196 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
7197 functions.
7198 * layout.cc (add_target_dynamic_tags): Use output section for
7199 DT_PLTRELSZ and DT_JMPREL.
7200
3a44184e
ILT
72012010-01-07 Ian Lance Taylor <[email protected]>
7202
7203 PR 11061
7204 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
7205 function.
7206 (class Output_data_reloc_generic): Define.
7207 (class Output_data_reloc_base): Change base class to
7208 Output_data_reloc_generic. Change add() method to call
7209 bump_relative_reloc_count for a relative reloc. Remove
7210 sort_relocs_ field.
7211 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
7212 to sort_relocs().
7213 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
7214 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
7215 appropriate.
7216 * layout.h (class Layout): Update declaration.
7217
ea715a34
ILT
72182010-01-07 Ian Lance Taylor <[email protected]>
7219
7220 * output.h (class Output_data): Add const version of
7221 output_section and do_output_section.
7222 (class Output_section_data): Add const version of
7223 do_output_section.
7224 (class Output_section): Likewise.
7225 * layout.cc (Layout::add_target_dynamic_tags): New function.
7226 * layout.h (class Layout): Update declarations.
7227 * arm.cc (Target_arm::do_finalize_sections): Use
7228 add_target_dynamic_tags.
7229 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7230 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
7231 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
7232 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7233
659948a4
ILT
72342010-01-07 Ian Lance Taylor <[email protected]>
7235
7236 PR 11042
7237 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
7238 object as needed.
7239
9d3b86f6
ILT
72402010-01-07 Dmitry Gorbachev <[email protected]>
7241 Ian Lance Taylor <[email protected]>
7242
7243 PR 11019
7244 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
7245 Xindex::read_symtab_xindex.
7246
bb0d3eb0
DK
72472010-01-07 Doug Kwan <[email protected]>
7248
7249 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
7250 (Insn_template::thumb16_bcond_insn): New method declaration.
7251 (Insn_template): Fix spelling.
7252 (Stub::thumb16_special): New method declaration.
7253 (Stub::do_write): Define virtual method which was previously pure
7254 virtual.
7255 (Stub::do_thumb16_special): New method declaration.
7256 (Stub::do_fixed_endian_write): New template member.
7257 (Reloc_stub::do_write): Remove.
7258 (Reloc_stub::do_fixed_endian_write): Remove.
7259 (Cortex_a8_stub): New class definition.
7260 (Stub_factory::make_cortex_a8_stub): New method definition.
7261 (Stub_factory::Stub_factory): Add missing static storage class
7262 qualifier for elf32_arm_stub_a8_veneer_blx.
7263
ffeef7df
ILT
72642010-01-07 Ian Lance Taylor <[email protected]>
7265
dc3f80fe
ILT
7266 PR 10980
7267 * options.h (class General_options): Add --warn-unresolved-symbols
7268 and --error-unresolved-symbols.
7269 * errors.cc (Errors::undefined_symbol): Implement
7270 --warn-unresolved-symbols.
7271
ffeef7df
ILT
7272 * options.h (class General_options): Add -z text and -z textoff.
7273 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
7274
f1ec9ded
ST
72752010-01-06 Sriraman Tallam <[email protected]>
7276
7277 * gc.h (Garbage_collection::Cident_section_map): New typedef.
7278 (Garbage_collection::cident_sections): New function.
7279 (Garbage_collection::add_cident_section): New function.
7280 (Garbage_collection::cident_sections_): New member.
7281 (gc_process_relocs): Add references to sections whose names are C
7282 identifiers.
7283 * gold.h (cident_section_start_prefix): New constant.
7284 (cident_section_stop_prefix): New constant.
7285 (is_cident): New function.
7286 * layout.cc (Layout::define_section_symbols): Replace string constants
7287 with the newly defined constants.
7288 * object.cc (Sized_relobj::do_layout): Track sections whose names are
7289 C identifiers.
7290 * testsuite/Makefile.am: Add gc_orphan_section_test.
7291 * testsuite/Makefile.in: Regenerate.
7292 * testsuite/gc_orphan_section_test.cc: New file.
7293 * testsuite/gc_orphan_section_test.sh: New file.
7294
6eda8c29
ILT
72952010-01-06 Ian Lance Taylor <[email protected]>
7296
b9674e17
ILT
7297 PR 10980
7298 * options.h (class General_options): Add --warn-shared-textrel.
7299 * layout.cc (Layout::finish_dynamic_section): Implement
7300 --warn-shared-textrel.
7301
6eda8c29
ILT
7302 PR 10980
7303 * options.h (class General_options): Add --warn-multiple-gp.
7304
32dcd44e
ILT
73052010-01-06 Viktor Kutuzov <[email protected]>
7306
7307 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
7308 $(THREADSLIB) and $(LIBDL).
7309 * Makefile.in: Rebuild.
7310
a192ba05
ILT
73112010-01-06 Ian Lance Taylor <[email protected]>
7312
7313 PR 10980
7314 * options.cc (General_options::parse_section_start): New function.
7315 (General_options::section_start): New function.
7316 (General_options::General_options): Initialize all members.
7317 * options.h: Include <map>
7318 (class General_options): Add --section-start. Add section_starts_
7319 member.
7320 * layout.cc (Layout::attach_allocated_section_to_segment): If
7321 --section-start was used, set the address of the segment. Remove
7322 local sort_sections.
7323 (Layout::relaxation_loop_body): If the address of the load segment
7324 has been set by --section-start, don't use it.
7325 * output.h (Output_segment::update_flags_for_output_section): New
7326 function.
7327 * output.cc (Output_segment::add_output_section): Call
7328 update_flags_for_output_section.
7329
dde3f402
ILT
73302010-01-05 Ian Lance Taylor <[email protected]>
7331
62dfdd4d
ILT
7332 PR 10980
7333 * options.h (class General_options): Add --undefined-version.
7334 * script.cc (struct Version_expression): Add was_matched_by_symbol
7335 field.
7336 (Version_script_info::matched_symbol): New function.
7337 (Version_script_info::get_symbol_version_helper): Call
7338 matched_symbol.
7339 (Version_script_info::check_unmatched_names): New function.
7340 * script.h (class Version_script_info): Update declarations.
7341 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
7342
9c4ae156
ILT
7343 * options.h (class General_options): Use DEFINE_bool_alias for
7344 allow_multiple_definition.
7345 * resolve.cc (Symbol_table::should_override): Don't test
7346 allow_multiple_definition.
7347
dde3f402
ILT
7348 PR 10980
7349 * options.h (class General_options): Add --cref.
7350 * main.cc (main): Print cref table if --cref. Don't close mapfile
7351 until after printing cref table.
7352 * cref.cc: Include "symtab.h".
7353 (class Cref_inputs): Define Cref_table_compare and Cref_table.
7354 (Cref_table_compare::operator()): New function.
7355 (Cref_inputs::gather_cref): New function.
7356 (filecol): New static const.
7357 (Cref_inputs::print_cref): New function.
7358 (Cref::print_cref): New function.
7359 * cref.h: Include <cstdio>.
7360 (class Cref): Update declarations.
7361 * mapfile.h (Mapfile::file): New function.
7362 * object.h (class Object): Define Symbols. Declare virtual
7363 do_get_global_symbols.
7364 (Object::get_global_symbols): New function.
7365 * object.cc (Input_objects::add_object): Pass object to cref_ if
7366 --cref.
7367 (Input_objects::archive_start): Likewise.
7368 (Input_objects::archive_stop): Likewise.
7369 (Input_objects::print_cref): New function.
7370 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
7371 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
7372 --cref.
7373 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
7374 function.
7375 * plugin.h (class Sized_pluginobj): Update declarations.
7376
8781f709
ILT
73772010-01-05 Ian Lance Taylor <[email protected]>
7378
7379 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
7380 to is_default_version. Rename insdef to insdefault.
7381 (Symbol_table::add_from_relobj): Rename def to is_default_version
7382 and local to is_forced_local.
7383 (Symbol_table::add_from_pluginobj): Likewise.
7384 (Symbol_table::add_from_dynobj): Likewise.
7385 (Symbol_table::define_special_symbol): Rename insdef to
7386 insdefault.
7387
fe35d28d
ILT
73882010-01-04 Ian Lance Taylor <[email protected]>
7389
30bc8c46
ILT
7390 PR 10980
7391 * options.h (class General_options): Add
7392 --allow-multiple-definition and -z muldefs.
7393 * resolve.cc (Symbol_table::should_override): Don't warn about a
7394 multiple symbol definition if --allow-multiple-definition or -z
7395 muldefs.
7396
7eaea549
ILT
7397 PR 10980
7398 * options.h (class General_options): Add --add-needed and
7399 --copy-dt-needed-entries. Tweak --as-needed help entry.
7400 * object.cc (Input_objects::check_dynamic_dependencies): Give an
7401 error if --copy-dt-needed-entries aka --add-needed is used and
7402 would cause a change in behaviour.
7403
fe35d28d
ILT
7404 PR 10980
7405 * options.h (class General_options): Add -G as a short version of
7406 --shared. Add no-op options -assert, -g, and -i.
7407
55a2bb35
ST
74082010-01-04 Sriraman Tallam <[email protected]>
7409
7410 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
7411 check for .text or .gnu.linkonce.t sections.
7412 * icf.cc (Icf::find_identical_sections): Ditto.
7413 Change the detection for mangled function name within the section
7414 name.
7415 * icf.h (is_section_foldable_candidate): New function.
7416
719328e1
ILT
74172009-12-30 Ian Lance Taylor <[email protected]>
7418
7419 PR 10980
7420 * options.h (class General_options): Permit two dashes with
7421 --retain-symbols-file.
7422
d7bb5745
ILT
74232009-12-30 Ian Lance Taylor <[email protected]>
7424
403a15dd
ILT
7425 PR 10979
7426 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
7427 don't put the file header and segment headers in the text
7428 segment.
7429
eda294df
ILT
7430 PR 10979
7431 * common.cc (Sort_commons::operator()): Stabilize sort when both
7432 entries are NULL.
7433 (Symbol_table::do_allocate_commons_list): When allocating common
7434 symbols, skip a symbol which is no longer common.
7435 * symtab.h (Symbol::is_common): Test whether the symbol comes from
7436 an object before checking its type.
7437 * testsuite/common_test_2.c: New file.
7438 * testsuite/common_test_3.c: New file.
7439 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
7440 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
7441 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
7442 (common_test_2_pic.o, common_test_2.so): New targets.
7443 (common_test_3_pic.o, common_test_3.so): New targets.
7444 * testsuite/Makefile.in: Rebuild.
7445
d7bb5745
ILT
7446 PR 10979
7447 * script.cc (read_input_script): If we see a new SECTIONS clause,
7448 and we have added an input section, give an error.
7449 * layout.h (class Layout): Add have_added_input_section function.
7450 Add have_added_input_section_ field.
7451 * layout.cc (Layout::Layout): Initialize
7452 have_added_input_section_.
7453 (Layout::layout): Set have_added_input_section_.
7454 (Layout::layout_eh_frame): Likewise.
7455
fc59c572
ILT
74562009-12-30 Ian Lance Taylor <[email protected]>
7457
7458 PR 10931
7459 * options.h (class General_options): Add --sort-common option.
7460 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
7461 * common.cc (Sort_common): Add sort_order parameter to
7462 constructor. Add sort_order_ field.
7463 (Sort_commons::operator): Check sort_order_.
7464 (Symbol_table::allocate_commons): Determine the sort order.
7465 (Symbol_table::do_allocate_commons): Add sort_order parameter.
7466 Change all callers.
7467 (Symbol_table::do_allocate_commons_list): Likewise.
7468
1c74fab0
ILT
74692009-12-30 Ian Lance Taylor <[email protected]>
7470
7471 PR 10916
7472 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
7473 symbols from this object, don't change the visibility of an
7474 undefined symbol.
7475 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
7476
6affe781
ILT
74772009-12-30 Ian Lance Taylor <[email protected]>
7478
7479 PR 10861
7480 * script.h (class Version_script_info): Define Language enum.
7481 Update declarations. Define Glob, Exact, and Lookup types. Add
7482 new fields globals_, locals_, and is_finalized_.
7483 * script.cc: Various formatting fixes.
7484 (class Parser_closure): Change language_stack_ from a vector of
7485 std::string to one of Version_script_info::Language. Adjust all
7486 uses accordingly.
7487 (class Lazy_demangler): Remove.
7488 (struct Version_expression): Change language from std::string to
7489 Version_script_info::Language.
7490 (Version_script_info::Version_script_info): New function.
7491 (Version_script_info::~Version_script_info): Don't call clear.
7492 (Version_script_info::finalize): New function.
7493 (Version_script_info::build_lookup_tables): New function.
7494 (Version_script_info::build_expression_list_lookup): New
7495 function.
7496 (Version_script_info::get_symbol_version_helper): Rewrite to use
7497 lookup tables.
7498 (Version_script_info::print_expression_list): Adjust to use
7499 Version_script_info::Language.
7500 (script_push_lex_into_version_mode): Check that the version script
7501 has not been finalized.
7502 (version_script_push_lang): Change language string to
7503 Version_script_info::Language.
7504 * options.cc (Command_line::version_script): New function.
7505 * options.h (class General_options): Add finalize_dynamic_list
7506 function. Change version_script from declaration to definition.
7507 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
7508 * testsuite/version_script.map: Remove duplicate def of foo.
7509 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
7510 version_script.map.
7511 * testsuite/Makefile.in: Rebuild.
7512
818bf354
ILT
75132009-12-30 Ian Lance Taylor <[email protected]>
7514
7515 PR 10843
7516 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
7517 if the input symbol index is 0, make the output symbol index 0.
7518
ebcc8304
ILT
75192009-12-30 Ian Lance Taylor <[email protected]>
7520
7521 PR 10670
7522 * options.h (class General_options): Add -x/--discard-all.
7523 * object.cc (Sized_relobj::do_count_local_symbols): Handle
7524 --discard-all. If the local symbol needs a dynamic entry, check
7525 that before handling --discard-locals.
7526
176fe33f
ILT
75272009-12-30 Ian Lance Taylor <[email protected]>
7528
bb321bb1
ILT
7529 PR 10450
7530 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
7531 flags to PF_R.
7532 (Output_segment::add_output_section): Don't change the flags if
7533 the type is PT_TLS.
7534
176fe33f
ILT
7535 PR 10450
7536 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
7537 GNU hash table if they need a dynamic value. Otherwise, don't add
7538 them if they are defined in a dynamic object or are forced local.
7539
e8cd95c7
ILT
75402009-12-29 Ian Lance Taylor <[email protected]>
7541
1b81fb71
ILT
7542 PR 10450
7543 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
7544 .gnu.hash table for a 32-bit target.
7545
8d6d383d
ILT
7546 PR 10450
7547 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
7548 regular and a dynamic object only needs a dynamic symbol table
7549 entry if it is externally visible.
7550
e785ec03
ILT
7551 PR 10450
7552 * i386.cc (class Target_i386): Initialize global_offset_table_ in
7553 constructor. Add global_offset_table_ field.
7554 (Target_i386::got_section): Set global_offset_table_.
7555 (Target_i386::do_finalize_sections): Set global_offset_table_
7556 size.
7557 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
7558 in constructor. Add global_offset_table_ field.
7559 (Target_x86_64::got_section): Set global_offset_table_.
7560 (Target_x86_64::do_finalize_sections): Set global_offset_table_
7561 size.
7562
1a2dff53
ILT
7563 * layout.cc (Layout::Layout): Initialize increase_relro_.
7564 (Layout::get_output_section): Add is_relro, is_last_relro, and
7565 is_first_non_relro parameters. Change all callers.
7566 (Layout::choose_output_section): Likewise.
7567 (Layout::add_output_section_data): Likewise.
7568 (Layout::make_output_section): Likewise.
7569 (Layout::set_segment_offsets): Clear increase_relro when using a
7570 linker script.
7571 * layout.h (class Layout): Add increase_relro method. Add
7572 increase_relro_ field. Update declarations.
7573 * output.cc (Output_section::Output_section): Initialize
7574 is_last_relro_ and is_first_non_relro_.
7575 (Output_segment::add_output_section): Group relro sections is
7576 do_sort is true. Handle is_last_relro and is_first_non_relro.
7577 (Output_segment::maximum_alignment): Remove relro handling.
7578 (Output_segment::set_section_addresses): Add increase_relro
7579 parameter. Change all callers. Add initial alignment to align
7580 relro sections on separate page. Remove old relro handling.
7581 (Output_segment::set_section_list_addresses): Remove in_relro
7582 parameter. Change all callers.
7583 (Output_segment::set_offset): Add increase parameter. Change all
7584 callers. Remove old relro handling.
7585 * output.h (class Output_section): Add new methods: is_last_relro,
7586 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
7587 Add is_last_relro_ and is_first_non_relro_ fields.
7588 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
7589 Create separate .got.plt section. Call increase_relro.
7590 * x86_64.cc (Target_x86_64::got_section): Likewise.
7591 * testsuite/relro_script_test.t: Add .got.plt.
7592
f0ba79e2
ILT
7593 PR 10450
7594 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
7595 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
7596 (Layout::finalize): Call set_dynamic_symbol_size.
7597 (Layout::set_dynamic_symbol_size): New function.
7598 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
7599 set_dynamic_symbol_size.
7600
e8cd95c7
ILT
7601 PR 10450
7602 * output.h (class Output_section): Add is_entsize_zero_ field.
7603 * output.cc (Output_section::Output_section): Initialize
7604 is_entsize_zero_.
7605 (Output_section::set_entsize): If two different entsizes are
7606 requested, force it to zero.
7607 (Output_section::add_input_section): Set flags for .debug_str
7608 before updating section flags. Set entsize.
7609 (Output_section::update_flags_for_input_section): Set SHF_MERGE
7610 and SHF_STRING if all input sections have those flags.
7611
3e1b9a8a
RÁE
76122009-12-29 Rafael Espindola <[email protected]>
7613
7614 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
7615 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
7616 reporting.
3e1b9a8a 7617
3dcad376
ST
76182009-12-29 Sriraman Tallam <[email protected]>
7619
7620 * options.cc (General_options::parse_version): Allow -v to exit
7621 without an error if there is nothing to link.
7622
084e2665
ILT
76232009-12-29 Ian Lance Taylor <[email protected]>
7624
7625 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
7626 using a version of gcc before 4.1.
7627 * configure: Rebuild.
7628
250acde3
CD
76292009-12-28 Chris Demetriou <[email protected]>
7630
7631 * attributes.cc (Output_attributes_section_data::do_write): Use
7632 std::vector::front rather than std::vector::data.
7633
99fff23b
ILT
76342009-12-28 Ian Lance Taylor <[email protected]>
7635
7636 * symtab.h (class Symbol_table): Add enum Defined.
7637 * resolve.cc (Symbol_table::should_override): Add defined
7638 parameter. Change all callers. Test whether object is NULL
7639 before calling a method on it.
7640 (Symbol_table::report_resolve_problem): Add defined parameter.
7641 Change all callers.
7642 (Symbol_table::should_override_with_special): Likewise.
7643 * symtab.cc (Symbol_table::define_in_output_data): Add defined
7644 parameter. Change all callers.
7645 (Symbol_table::do_define_in_output_data): Likewise.
7646 (Symbol_table::define_in_output_segment): Likewise.
7647 (Symbol_table::do_define_in_output_segment): Likewise.
7648 (Symbol_table::define_as_constant): Likewise.
7649 (Symbol_table::do_define_as_constant): Likewise.
7650 * script.h (class Symbol_assignment): Add is_defsym parameter to
7651 constructor; change all callers.
7652 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
7653 parameter. Change all callers. Add is_defsym_ field.
7654 (class Parser_closure): Add parsing_defsym parameter to
7655 constructor; change all callers. Add parsing_defsym accessor
7656 function. Add parsing_defsym_ field.
7657
556bd683
ILT
76582009-12-28 Ian Lance Taylor <[email protected]>
7659
7660 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 7661 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 7662
1782c879
ILT
76632009-12-23 Ian Lance Taylor <[email protected]>
7664
7665 * i386.cc (Target_i386::do_calls_non_split): Recognize
7666 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
7667 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
7668 -fsplit-stack prologue when using %r11.
1782c879 7669
329ca2b1
ST
76702009-12-21 Sriraman Tallam <[email protected]>
7671
7672 * options.cc (General_options::parse_version): Make -v continue and do
7673 the link like GNU ld does.
7674
d675ff46
RÁE
76752009-12-17 Rafael Avila de Espindola <[email protected]>
7676
7677 * Makefile.am (CCFILES): Add timer.cc.
7678 (HFILES): Add timer.h.
7679 * configure.ac: Check for sysconf and times.
7680 * main.cc: include timer.h.
7681 (main): Use Timer instead of get_run_time.
7682 * timer.cc: New.
7683 * timer.h: New.
7684 * workqueue.cc: include timer.h.
7685 (Workqueue::find_and_run_task):
7686 Report user, sys and wall time.
7687 * Makefile.in: Regenerate.
7688 * config.in: Regenerate.
7689 * configure: Regenerate.
7690
d6344fb5
DK
76912009-12-16 Doug Kwan <[email protected]>
7692
7693 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
7694 sections.
7695 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
7696 relaxed input sections.
7697 * output.cc (Output_section::find_relaxed_input_section): Change
7698 return type to Output_relaxed_input_section pointer. Adjust code
7699 for new type of relaxed_input_section_map_.
7700 * output.h (Output_section::find_relaxed_input_section): Change
7701 return type to Output_relaxed_input_section pointer.
7702 (Output_section::Output_relaxed_input_section_by_input_section_map):
7703 New type.
7704 (Output_section::relaxed_input_section_map_): Change type to
7705 Output_section::Output_relaxed_input_section_by_input_section_map.
7706 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
7707 input section.
7708
0e0d5469
ILT
77092009-12-15 Ian Lance Taylor <[email protected]>
7710
7711 * layout.cc (Layout::create_shstrtab): Only write out after input
7712 sections if we are compressing debug sections.
7713
0649a889
ILT
77142009-12-15 Ian Lance Taylor <[email protected]>
7715
7716 * archive.cc (Archive::add_symbols): Only look up a symbol without
7717 a version if there is, in fact, a version.
7718
2ea97941
ILT
77192009-12-14 Ian Lance Taylor <[email protected]>
7720
7721 Revert -Wshadow changes, all changes from:
7722 2009-12-11 Doug Kwan <[email protected]>
7723 2009-12-11 Nick Clifton <[email protected]>
7724 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
7725
b0eec2cc
DK
77262009-12-11 Doug Kwan <[email protected]>
7727
7728 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
7729 due to -Wshadow.
7730 * attributes.cc (Object_attribute::size): Ditto.
7731 (Attributes_section_data::size): Ditto.
7732 (Attributes_section_data::Attributes_section_data): Ditto.
7733 (Output_attributes_section_data::do_write): Ditto.
7734 * attributes.h (Object_attribute::set_type): Ditto.
7735 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
7736
91d6fa6a
NC
77372009-12-11 Nick Clifton <[email protected]>
7738
7739 * archive.cc: Fix shadowed variable warnings.
7740 * arm.cc: Likewise.
7741 * compressed_output.cc: Likewise.
7742 * compressed_output.h: Likewise.
7743 * configure: Likewise.
7744 * dwarf_reader.cc: Likewise.
7745 * dynobj.cc: Likewise.
7746 * dynobj.h: Likewise.
7747 * ehframe.cc: Likewise.
7748 * ehframe.h: Likewise.
7749 * errors.cc: Likewise.
7750 * expression.cc: Likewise.
7751 * fileread.cc: Likewise.
7752 * fileread.h: Likewise.
7753 * freebsd.h: Likewise.
7754 * i386.cc: Likewise.
7755 * icf.cc: Likewise.
7756 * incremental.h: Likewise.
7757 * layout.cc: Likewise.
7758 * layout.h: Likewise.
7759 * mapfile.cc: Likewise.
7760 * merge.cc: Likewise.
7761 * merge.h: Likewise.
7762 * object.cc: Likewise.
7763 * object.h: Likewise.
7764 * options.h: Likewise.
7765 * output.cc: Likewise.
7766 * output.h: Likewise.
7767 * parameters.cc: Likewise.
7768 * plugin.cc: Likewise.
7769 * powerpc.cc: Likewise.
7770 * reduced_debug_output.cc: Likewise.
7771 * reduced_debug_output.h: Likewise.
7772 * reloc.cc: Likewise.
7773 * reloc.h: Likewise.
7774 * resolve.cc: Likewise.
7775 * script-sections.cc: Likewise.
7776 * script.cc: Likewise.
7777 * script.h: Likewise.
7778 * sparc.cc: Likewise.
7779 * symtab.cc: Likewise.
7780 * symtab.h: Likewise.
7781 * target-select.cc: Likewise.
7782 * target-select.h: Likewise.
7783 * token.h: Likewise.
7784 * workqueue.cc: Likewise.
7785 * workqueue.h: Likewise.
7786 * x86_64.cc: Likewise.
7787
a0351a69
DK
77882009-12-10 Doug Kwan <[email protected]>
7789
7790 * arm.cc (attributes.h): New include.
7791 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
7792 (Arm_relobj::~Arm_relobj): Delete object pointed by
7793 attributes_section_data_.
7794 (Arm_relobj::attributes_section_data): New method definition.
7795 (Arm_relobj::attributes_section_data_): New data member declaration.
7796 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
7797 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
7798 attributes_section_data_.
7799 (Arm_dynobj::attributes_section_data): New method definition.
7800 (Arm_dynobj::attributes_section_data_): New data member declaration.
7801 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
7802 initialization value of may_use_blx_ to false.
2e702c99 7803 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
7804 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
7805 object attributes to compute results instead of hard-coding.
7806 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
7807 Target_arm::get_secondary_compatible_arch,
7808 Target_arm::set_secondary_compatible_arch
7809 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7810 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
7811 New method declarations.
7812 (Target_arm::get_aeabi_object_attribute): New method definition.
7813 (Target_arm::attributes_section_data_): New data member declaration.
7814 (read_arm_attributes_section): New template definition.
7815 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
7816 (Arm_dynobj::do_read_symbols): Ditto.
7817 (Target_arm::do_finalize_sections): Merge attributes sections from
7818 input. Check for BLX use after attributes section merging.
7819 Fix __exidx_start and __exidx_end visibility. Create an
7820 .ARM.attributes section if necessary.
7821 (Target_arm::get_secondary_compatible_arch,
7822 Target_arm::set_secondary_compatible_arch,
7823 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7824 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 7825 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
7826 New method definitions.
7827
b59befec
ILT
78282009-12-09 Ian Lance Taylor <[email protected]>
7829
7830 * plugin.cc (Plugin::load): Don't cast from void* to a function
7831 pointer.
7832
1276bc89
ILT
78332009-12-09 Ian Lance Taylor <[email protected]>
7834
7835 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
7836 information fields.
7837
2f2de248
L
78382009-12-09 H.J. Lu <[email protected]>
7839
7840 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
7841 Replace two_file_shared_1.so with two_file_shared_2.so.
7842 * testsuite/Makefile.in: Regenerated.
7843
4f787271
DK
78442009-12-08 Doug Kwan <[email protected]>
7845
7846 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
7847 (HFILES): Add attributes.h and int_encoding.h.
7848 * Makefile.in: Regenerate.
7849 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
7850 function definitions to int_encoding.cc
7851 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
7852 prototypes to int_encoding.h
7853 * reduced_debug_output.cc (int_encoding.h): New include.
7854 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
7855 function definitions to int_encoding.cc
7856 (insert_into_vector, read_from_pointer): Move template definitions to
7857 int_encoding.h
7858 * attributes.cc: New file.
7859 * attributes.h: New file.
7860 * int_encoding.cc: New file.
7861 * int_encoding.h: New file.
7862
20b52f1a
RÁE
78632009-12-07 Rafael Avila de Espindola <[email protected]>
7864
7865 PR gold/11055
7866 * incremental-dump.cc (dump_incremental_inputs): New.
7867 (main): Use dump_incremental_inputs.
7868
53d7974c
L
78692009-12-07 H.J. Lu <[email protected]>
7870
7871 PR gold/10893
7872 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
7873 checking elfcpp::STT_FUNC.
7874 (Target_i386::Relocate::relocate): Likewise.
7875 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
7876
7877 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
7878 symbols from shared libraries into normal FUNC symbols.
7879
7880 * symtab.h (Symbol): Add is_func and use it.
7881
05a352e6
DK
78822009-12-05 Doug Kwan <[email protected]>
7883
7884 * arm.cc (Target_arm::arm_info): Initialize new fields
7885 attributes_section and attributes_vendor.
7886 * i386.cc (Target_i386::i386_info): Same.
7887 * object.cc (Sized_relobj::do_layout): Skip attribute section.
7888 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
7889 fields attributes_section and attributes_vendor.
53d7974c 7890 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
7891 * target.h (Target::attributes_section, Target::attributes_vendor,
7892 Target::is_attributes_section, Target::attribute_arg_type,
7893 Target::attributes_order): New method definitions.
7894 (Target::Target_info::attributes_section,
7895 Target::Target_info::attributes_vendor): New fields.
7896 (Target::do_attribute_arg_type, Target::do_attributes_order): New
7897 virtual method definitions.
7898 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
7899 attributes_section and attributes_vendor.
7900 * testsuite/testfile.cc (Target_test::test_target_info): Same.
7901
f4e5969c
DK
79022009-12-05 Doug Kwan <[email protected]>
7903
7904 * arm.cc: Update comments about interworking and stub generation.
7905 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
7906 considered as non-PIC.
7907 (Arm_relocate_functions::base_abs): Fix formatting.
7908 (Arm_relocate_functions::got_prel): Fix comment. Change interface
7909 of function to use GOT entry address instead of offset.
7910 (Target_arm::Scan::global): Issue an error if a symbol would need a
7911 PLT does not get one because it is untyped. Remove code to create
7912 dynamic symbols for relative branches.
7913 (Target_arm::Relocate::relocate: Use 0 instead of false since function
7914 takes unsigned integer instead of boolean.
7915
1abce4a6
L
79162009-12-05 H.J. Lu <[email protected]>
7917
7918 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
7919 (two_file_test_LDADD): Likewise.
7920 (common_test_1_LDADD): Likewise.
7921 (exception_test_LDADD) Likewise.
7922 (weak_test_LDADD): Likewise.
7923 (many_sections_test_LDADD): Likewise.
7924 (initpri1_LDADD): Likewise.
7925 (script_test_1_LDADD): Likewise.
7926 (script_test_2_LDADD): Likewise.
7927 (justsyms_LDADD): Likewise.
7928 (binary_test_LDADD): Likewise.
7929 (large_LDADD): Likewise.
7930 * testsuite/Makefile.in: Regenerated.
7931
adcf2816 79322009-12-04 H.J. Lu <[email protected]>
1abce4a6 7933
adcf2816
L
7934 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
7935 (Symbol_table::override_with_special): Likewise.
7936 (Symbol_table::add_from_object): Likewise.
7937
28e67f5d
RÁE
79382009-12-04 Rafael Avila de Espindola <[email protected]>
7939
7940 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
7941 Don't set the data_offset twice.
7942
ae10a101
RÁE
79432009-12-04 Rafael Avila de Espindola <[email protected]>
7944
7945 * testsuite/Makefile.in: Regenerate.
7946
f59f41f3
DK
79472009-12-03 Doug Kwan <[email protected]>
7948
7949 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
7950 (Target_arm::do_finalize_sections): Add parameter for symbol table
7951 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
7952 * i386.cc (Target_i386::do_finalize_sections): Add an additional
7953 parameter for symbol table pointer.
7954 * layout.cc (Layout::finalize): Call Target::finalize_sections with
7955 an additional parameter for a pointer to symbol table.
7956 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
7957 parameter for a symbol table pointer.
7958 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
7959 * target.h (Target::finalize_sections, Target::do_finalize_sections):
7960 Ditto.
7961 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
7962 parameter for a symbol table pointer.
7963
ca55d848
RÁE
79642009-12-03 Rafael Avila de Espindola <[email protected]>
7965
7966 * incremental.cc (Incremental_inputs_header)
7967 (Incremental_inputs_header_write, Incremental_inputs_entry)
7968 (Incremental_inputs_entry_write): Move ...
7969 * incremental.h (Incremental_inputs_header)
7970 (Incremental_inputs_header_write, Incremental_inputs_entry)
7971 (Incremental_inputs_entry_write): here.
7972
3aec4f9c
RÁE
79732009-12-02 Rafael Avila de Espindola <[email protected]>
7974
7975 * incremental.cc (make_sized_incremental_binary): Set the target.
7976 Error if it is incompatible.
7977 * output.h (Output_file): Add filename method.
7978
9c0ae74d
RÁE
79792009-12-02 Rafael Avila de Espindola <[email protected]>
7980
7981 * incremental.cc (Incremental_inputs_entry): Remove unused argument
7982 from the get_* methods.
7983
a45500ae
RÁE
79842009-12-02 Rafael Avila de Espindola <[email protected]>
7985
7986 * incremental-dump.cc (main): Check that the offeset of a script is 0.
7987 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
7988 Write 0 for the data_offset of scripts.
7989
325e6408
RÁE
79902009-12-02 Rafael Avila de Espindola <[email protected]>
7991
7992 * testsuite/Makefile.am: Add the incremental_test.sh test.
7993 * testsuite/incremental_test.sh: New.
7994 * testsuite/incremental_test_1.c: New.
7995 * testsuite/incremental_test_2.c: New.
7996
954c3e2e
RÁE
79972009-12-01 Rafael Avila de Espindola <[email protected]>
7998
7999 * incremental-dump.cc (main): Fix typos.
8000
f8086623
RÁE
80012009-11-27 Rafael Avila de Espindola <[email protected]>
8002
8003 PR gold/11025
8004 * incremental-dump.cc (main): Use llu to print 64 bit values.
8005
3b0dd6ac
L
80062009-11-26 Per Øyvind Karlsen <[email protected]>
8007 H.J. Lu <[email protected]>
8008
8009 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
8010 $(LIBDL).
8011 (incremental_dump_LDADD): Likewise.
8012 * Makefile.in: Regenerated.
8013
a6d1ef57 80142009-11-25 Doug Kwan <[email protected]>
e1df38aa 8015
a6d1ef57
DK
8016 Revert:
8017
8018 2009-11-25 Doug Kwan <[email protected]>
8019
8020 * arm.cc (Target_arm::Target_arm): Move method definition
8021 outside of class definition. Add code to handle
8022 --target1-rel, --target1-abs and --target2= options.
8023 (Target_arm::get_reloc_reloc_type): Change method to be
8024 non-static and const.
8025 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
8026 New data member declaration.
8027 (Target_arm::Scan::local, Target_arm::Scan::global,
8028 Target_arm::Relocate::relocate,
8029 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8030 Adjust call to Target_arm::get_real_reloc_type.
8031 (Target_arm::get_real_reloc_type): Use command line options
8032 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8033 * options.h (--target1-rel, --target1-abs, --target2): New
8034 ARM-only options.
8035
50aeb7d4
DK
80362009-11-25 Doug Kwan <[email protected]>
8037
8038 * arm.cc (Target_arm::Target_arm): Move method definition outside of
8039 class definition. Add code to handle --target1-rel, --target1-abs
8040 and --target2= options.
8041 (Target_arm::get_reloc_reloc_type): Change method to be non-static
8042 and const.
8043 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
8044 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): Adjust
8048 call to Target_arm::get_real_reloc_type.
8049 (Target_arm::get_real_reloc_type): Use command line options to
8050 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8051 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
8052 options.
8053
51938283
DK
80542009-11-25 Doug Kwan <[email protected]>
8055
8056 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
8057 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
8058 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
8059 formatting.
8060 (Arm_relocate_functions::thm_call): Replace body with a call to
8061 Arm_relocate_functions::thumb_branch_common.
8062 (Arm_relocate_functions::thm_jump24,
8063 Arm_relocate_functions::thm_xpc22): New method definitions.
8064 (Arm_relocate_functions::thumb_branch_common): New method definition.
8065 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
8066 operator.
8067 (Target_arm::Relocate::relocate): Adjust call to thm_call.
8068 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
8069
e2b8f3c4
RÁE
80702009-11-24 Rafael Avila de Espindola <[email protected]>
8071
8072 * Makefile.am: Build incremental-dump
8073 * Makefile.in: Regenerate.
8074 * incremental-dump.cc: New.
8075 * incremental.cc (Incremental_inputs_header_data,
8076 Incremental_inputs_entry_data): Move to incremental.h
8077 * incremental.h: (Incremental_inputs_header_data,
8078 Incremental_inputs_entry_data): Move from incremental.cc
8079
bcba9aec
RÁE
80802009-11-24 Rafael Avila de Espindola <[email protected]>
8081
8082 * incremental.cc (Incremental_inputs_header,
8083 Incremental_inputs_header_write, Incremental_inputs_entry,
8084 Incremental_inputs_entry_write): Add a typedef with the data type.
8085
7c3afe08
RÁE
80862009-11-24 Rafael Avila de Espindola <[email protected]>
8087
8088 * incremental.cc (Incremental_inputs_header,
8089 Incremental_inputs_header_write, Incremental_inputs_entry,
8090 Incremental_inputs_entry_write): Update comment about which
8091 type has the filed descriptions.
8092
d204b6e9
DK
80932009-11-15 Doug Kwan <[email protected]>
8094
8095 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
8096 (Arm_relocate_functions::arm_branch_common): Change method defintion
8097 in class definition to a method declaration and update list of formal
8098 parameters.
8099 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
8100 Arm_relocation_functions::jump24): Adjust call to
8101 Arm_relocate_functions::arm_branch_common. Update list of formal
8102 parameters.
8103 (Arm_relocate_functions::xpc25): New method definition.
8104 (Arm_relocate_functions::arm_branch_common): Move method defintion
8105 out from class definition. Use stubs for mode-switching and extending
8106 branch ranges.
8107 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
8108 specially. Change code to enable use of stubs in ARM branches.
8109
43d12afe
DK
81102009-11-10 Doug Kwan <[email protected]>
8111
8112 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
8113 in method declaration.
8114 (Target_arm::relocate_stub): New method declaration.
8115 (Target_arm::default_target): Change to return a pointer instead of
8116 a const reference.
8117 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
8118 Target_arm::default_target.
8119 (Arm_Relobj::do_relocate_sections): Remove options paramater in
8120 method definition.
8121 (Target_arm::relocate_section): Adjust view.
8122 (Target_arm::relocate_stub): New method definition.
8123
ac33a407
DK
81242009-11-10 Doug Kwan <[email protected]>
8125
8126 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
8127 a format warning.
8128 * incremental.cc (open_incremental_binary): Initialized local
8129 variables to avoid warnings.
8130 * object.cc (make_elf_object): Ditto.
8131 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
8132 a format warning.
e1df38aa 8133
88ee28e9
L
8134009-11-09 H.J. Lu <[email protected]>
8135
8136 PR gold/10930
8137 * testsuite/plugin_test.c: Include "config.h".
8138
2daedcd6
DK
81392009-11-09 Doug Kwan <[email protected]>
8140
8141 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
8142 (arm_symbol_value): Remove.
8143 (Arm_relocate_functions::arm_branch_common,
8144 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
8145 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
8146 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
8147 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
8148 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
8149 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
8150 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
8151 Arm_relocate_functions::thm_mobw_abs_nc,
8152 Arm_relocate_functions::thm_mov_abs,
8153 Arm_relocate_functions::movw_prel_nc,
8154 Arm_relocate_functions::thm_movt_abs,
8155 Arm_relocate_functions::movt_prel,
8156 Arm_relocate_functions::thm_movw_prel_nc,
8157 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
8158 (Target_arm::Relocate::relocate): Only decompose address into two
8159 parts if relocation type uses the thumb-bit and pass the actual
8160 bit instead of a flag indicating that the thumb-bit is used. Adjust
8161 calls to methods in Arm_relocate_functions for this change.
8162
1276bc89 81632009-11-08 Ian Lance Taylor <[email protected]>
3e4afc80
ILT
8164
8165 PR 10925
8166 * reloc.cc: Instantiate
8167 Sized_relobj::initialize_input_to_output_maps and
8168 Sized_relobj:free_input_to_output_maps.
8169
e53ad1b5
ILT
81702009-11-06 Ian Lance Taylor <[email protected]>
8171
8172 PR 10876
8173 * defstd.cc (in_segment): Set only_if_ref true for "end".
8174
eb44217c
DK
81752009-11-06 Doug Kwan <[email protected]>
8176
8177 * arm.cc (class Reloc_stub): Correct a comment.
8178 (Target_arm::Target_arm): Initialize arm_input_section_map_.
8179 (Target_arm::scan_section_for_stubs): New method declaration.
8180 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
8181 Change methods from private to protected.
8182 (Target_arm::do_may_relax): New method definition.
8183 (Target_arm::do_relax, Target_arm::group_sections,
8184 Target_arm::scan_reloc_for_stub,
8185 Target_arm::scan_reloc_section_for_stubs): New method declarations.
8186 (Target_arm::arm_input_section_map_): New data member declaration.
8187 (Target_arm::scan_reloc_for_stub,
8188 Target_arm::scan_reloc_section_for_stubs,
8189 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
8190 Target_arm::do_relax): New method definitions.
8191
5d329b7d
ILT
81922009-11-06 Mikolaj Zalewski <[email protected]>
8193
8194 * configure.ac: Check for (struct stat)::st_mtim
8195 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
8196 * config.in: Regenerate.
8197 * configure: Regenerate.
8198
96a0d71b
ILT
81992009-11-05 Ian Lance Taylor <[email protected]>
8200
8201 PR 10910
8202 * output.cc (Output_segment::add_output_section): Add missing
8203 return statement.
8204
594c8e5e
ILT
82052009-11-04 Ian Lance Taylor <[email protected]>
8206
8207 PR 10880
8208 * object.h (class Object): Add is_needed and set_is_needed
8209 methods. Add is_needed_ field. Make bool fields into bitfields.
8210 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
8211 defined in a dynamic object and referenced by a regular object,
8212 set is_needed for the dynamic object.
8213 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
8214 if the file is marked with as_needed and it is not needed.
8215
22b127cc
ILT
82162009-11-04 Ian Lance Taylor <[email protected]>
8217
8218 PR 10887
8219 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
8220 tags if data is discarded by linker script.
8221 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8222 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
8223 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
8224 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8225
f5c870d2
ILT
82262009-11-04 Ian Lance Taylor <[email protected]>
8227
8228 * layout.cc (Layout::get_output_section): Add is_interp and
8229 is_dynamic_linker_section parameters. Change all callers.
8230 (Layout::choose_output_section): Likewise.
8231 (Layout::make_output_section): Likewise.
8232 (Layout::add_output_section_data): Add is_dynamic_linker_section
8233 parameter. Change all callers.
8234 * layout.h (class Layout): Update declarations.
8235 * output.h (class Output_section): Add is_interp, set_is_interp,
8236 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
8237 Add is_interp_, is_dynamic_linker_section_ fields. Change
8238 generate_code_fills_at_write_ to a bitfield.
8239 * output.cc (Output_section::Output_sections): Initialize new
8240 fields.
8241 (Output_segment::add_output_section): Add do_sort parameter.
8242 Change all callers.
8243
1ae4d23b
ILT
82442009-11-03 Ian Lance Taylor <[email protected]>
8245
8246 PR 10860
8247 * options.h (class General_options): Add --warn-common.
8248 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
8249 merging two common symbols.
8250 (Symbol_table::should_override): Handle --warn-common when merging
8251 a common symbol with a defined symbol. Use report_resolve_problem
8252 for multiple definitions.
8253 (Symbol_table::report_resolve_problem): New function.
8254 * symtab.h (class Symbol_table): Declare report_resolve_problem.
8255
55da9579
DK
82562009-11-03 Doug Kwan <[email protected]>
8257
8258 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
8259 stub_factory_.
8260 (Target_arm::stub_factory): New method definition.
8261 (Target_arm::new_arm_input_section,
8262 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
8263 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 8264 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
8265 New type definitions.
8266 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
8267 member declarations.
8268 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
8269 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
8270 New method definitions.
8271
37a9ac43
ILT
82722009-11-03 Ian Lance Taylor <[email protected]>
8273
8274 * options.h (class General_options): Add --warn_constructors.
8275
b3d6a3d4
ILT
82762009-11-03 Ian Lance Taylor <[email protected]>
8277
8278 PR 10893
8279 * defstd.cc (in_section): Add entries for __rel_iplt_start,
8280 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
8281
934b01dd
ILT
82822009-11-03 Ian Lance Taylor <[email protected]>
8283
8284 PR 10895
8285 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
8286 --msgid-bugs-address.
8287 (install-pdf): New target.
8288 (install-data_yes): Look up one directory to find mkinstalldirs.
8289
03c1939b
L
82902009-11-03 H.J. Lu <[email protected]>
8291
8292 * po/Make-in (.po.gmo): Don't generate .gmo files in source
8293 tree.
8294
ebd95253
DK
82952009-10-30 Doug Kwan <[email protected]>
8296
8297 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
8298
e9bbb538
DK
82992009-10-30 Doug Kwan <[email protected]>
8300
8301 * arm.cc (Stub_addend_reader): New struct template definition
8302 and partial specializations.
8303 (Stub_addend_reader::operator()): New method definition for a
8304 partially specialized template.
8305
d5b40221
DK
83062009-10-30 Doug Kwan <[email protected]>
8307
8308 * arm.cc (Arm_relobj::processor_specific_flags): New method
8309 definition.
8310 (Arm_relobj::do_read_symbols): New method declaration.
8311 (Arm_relobj::processor_specific_flags_): New data member declaration.
8312 (Arm_dynobj): New class definition.
8313 (Target_arm::do_finalize_sections): Add input_objects parameter.
8314 (Target_arm::do_adjust_elf_header): New method declaration.
8315 (Target_arm::are_eabi_versions_compatible,
8316 (Target_arm::merge_processor_specific_flags): New method declaration.
8317 (Target_arm::do_make_elf_object): New overloaded method definitions
8318 and declaration.
8319 (Arm_relobj::do_read_symbols): New method definition.
8320 (Arm_dynobj::do_read_symbols): Ditto.
8321 (Target_arm::do_finalize_sections): Add input_objects parameters.
8322 Merge processor-specific flags from all input objects.
8323 (Target_arm::are_eabi_versions_compatible,
8324 Target_arm::merge_processor_specific_flags,
8325 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
8326 New method definitions.
8327 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
8328 Input_objects pointer type parameter.
8329 * layout.cc (Layout::finalize): Pass input objects to target's.
8330 finalize_sections function.
8331 * output.cc (Output_file_header::do_sized_write): Set ELF file
8332 header's processor-specific flags.
8333 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
8334 Input_objects pointer type parameter.
8335 * sparc.cc (Target_sparc::do_finalize_sections): Same.
8336 * target.h (Input_objects): New forward class declaration.
8337 (Target::processor_specific_flags,
8338 Target::are_processor_specific_flags_sect): New method definitions.
8339 (Target::finalize_sections): Add input_objects parameter.
8340 (Target::Target): Initialize processor_specific_flags_ and
8341 are_processor_specific_flags_set_.
8342 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
8343 parameter.
8344 (Target::set_processor_specific_flags): New method definition.
8345 (Target::processor_specific_flags_,
8346 Target::are_processor_specific_flags_set_): New data member
8347 declarations.
8348 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
8349 Input_objects pointer type parameter.
8350
ebabffbd
DK
83512009-10-30 Doug Kwan <[email protected]>
8352
8353 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
8354
ad0f2072
ILT
83552009-10-28 Ian Lance Taylor <[email protected]>
8356
8357 * object.h (class Relobj): Drop options parameter from
8358 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
8359 do_scan_relocs, do_relocate. Change all callers.
8360 (class Sized_relobj): Drop options parameters from
8361 do_gc_process_relocs, do_scan_relocs, do_relocate,
8362 do_relocate_sections, relocate_sections, emit_relocs_scan,
8363 emit_relocs_scan_reltype. Change all callers.
8364 (struct Relocate_info): Remove options field and all references to
8365 it.
8366 * reloc.h (class Read_relocs): Remove options constructor
8367 parameter and options_ field. Change all callers.
8368 (class Gc_process_relocs, class Scan_relocs): Likewise.
8369 (class Relocate_task): Likewise.
8370 * target-reloc.h (scan_relocs): Remove options parameter. Change
8371 all callers.
8372 (scan_relocatable_relocs): Likewise.
8373 * target.h (class Sized_target): Remove options parameter from
8374 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
8375 all callers.
8376 * gc.h (gc_process_relocs): Remove options parameter. Change all
8377 callers.
8378 * arm.cc: Update functions to remove options parameters.
8379 * i386.cc: Likewise.
8380 * powerpc.cc: Likewise.
8381 * sparc.cc: Likewise.
8382 * x86_64.cc: Likewise.
8383 * testsuite/testfile.cc: Likewise.
8384
8ffa3667
DK
83852009-10-28 Doug Kwan <[email protected]>
8386
8387 * arm.cc (Arm_relobj): New class definition.
e1df38aa 8388 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
8389 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
8390 New method definitions.
8391
40f36857
CC
83922009-10-28 Cary Coutant <[email protected]>
8393
8394 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
8395 (Plugin::cleanup_done_): New member.
8396 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
8397 (Plugin_manager::cleanup_done_): Remove.
8398 (Plugin_manager::add_input_file): Edit error message.
8399 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
8400 (Plugin_manager::cleanup): Remove use of cleanup_done_.
8401
2c849493
ILT
84022009-10-27 Mikolaj Zalewski <[email protected]>
8403
8404 * fileread.cc: (File_read::View::~View): Use the new
8405 data_ownership_ filed.
8406 (File_read::~File_read): Dispose the new whole_file_view_.
8407 (File_read::open): Mmap the whole file if needed.
8408 (File_read::open): Use whole_file_view_ instead of contents_.
8409 (File_read::find_view): Use whole_file_view_ if applicable.
8410 (File_read::do_read): Use whole_file_view_ instead of contents_.
8411 (File_read::make_view): Use whole_file_view_ instead of contents_,
8412 update File_read::View::View call.
8413 (File_read::find_or_make_view): Update File_read::View::View
8414 call.
8415 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
8416 remove contents_
8417 (File_read::View::Data_ownership): New enum.
8418 (File_read::View::View): Replace bool mapped_ with Data_ownership
8419 argument.
8420 (File_read::View::mapped_): Remove (replaced by data_ownership_).
8421 (File_read::View::data_ownership_): New field.
8422 (File_read::contents_): Remove (replaced by whole_file_view_).
8423 (File_read::whole_file_view_): New field.
8424 * options.h (class General_options): Add --keep-files-mapped.
8425
24998053
CC
84262009-10-27 Cary Coutant <[email protected]>
8427
8428 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
8429 * testsuite/Makefile.am (plugin_test_5): New test case.
8430 * testsuite/Makefile.in: Regenerate.
8431
72adc4fa
DK
84322009-10-25 Doug Kwan <[email protected]>
8433
8434 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
8435 from private to protected to allow access by child class.
8436 (Sized_relobj::do_relocate_sections): New method declaration.
8437 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 8438 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
8439 Sized_relobj::relocate_sections. Instantiate template explicitly
8440 for different target sizes and endianity.
8441
07f508a2
DK
84422009-10-24 Doug Kwan <[email protected]>
8443
8444 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
8445 (Arm_input_section::as_arm_input_section): New method.
8446 (Arm_output_section): New class definition.
8447 (Arm_output_section::create_stub_group,
8448 Arm_output_section::group_sections): New method definitions.
8449
10ad9fe5
DK
84502009-10-22 Doug Kwan <[email protected]>
8451
8452 * arm.cc (Arm_input_section): New class definition.
8453 (Arm_input_section::init, Arm_input_section:do_write,
8454 Arm_input_section::set_final_data_size,
8455 Arm_input_section::do_reset_address_and_file_offset): New method
8456 definitions.
8457
56ee5e00
DK
84582009-10-21 Doug Kwan <[email protected]>
8459
8460 * arm.cc (Stub_table, Arm_input_section): New forward class
8461 declarations.
8462 (Stub_table): New class defintion.
8463 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
8464 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
8465 New method definition.
8466
b569affa
DK
84672009-10-21 Doug Kwan <[email protected]>
8468
8469 * arm.cc: Update copyright comments.
8470 (Target_arm): New forward class template declaration.
8471 (Arm_address): New type.
8472 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
8473 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
8474 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
8475 constants.
8476 (Insn_template): Same.
8477 (DEF_STUBS): New macro.
8478 (Stub_type): New enum type.
8479 (Stub_template): New class definition.
8480 (Stub): Same.
8481 (Reloc_stub): Same.
8482 (Stub_factory): Same.
8483 (Target_arm::Target_arm): Initialize may_use_blx_ and
8484 should_force_pic_veneer_.
8485 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
8486 Target_arm::should_force_pic_veneer,
8487 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
8488 Target_arm::using_thumb_only, Target_arm:;default_target): New
8489 method defintions.
8490 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
8491 New data member declarations.
8492 (Insn_template::size, Insn_template::alignment): New method defintions.
8493 (Stub_template::Stub_template): New method definition.
8494 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
8495 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
8496 (Stub_factory::Stub_factory): New method definition.
8497 * gold.h (string_hash): New template.
8498 * output.h (Input_section_specifier::hash_value): Use
8499 gold::string_hash.
8500 (Input_section_specifier::string_hash): Remove.
8501 * stringpool.cc (Stringpool_template::string_hash): Use
8502 gold::string_hash.
8503
6c172549
DK
85042009-10-20 Doug Kwan <[email protected]>
8505
8506 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
8507 symbols of relaxed input sections.
8508 * output.h (Output_section::find_relaxed_input_section): Make
8509 method public.
8510
c5617f2f
DK
85112009-10-16 Doug Kwan <[email protected]>
8512
8513 * dynobj.cc (Versions::Versions): Initialize version_script_.
8514 Only insert base version symbol definition for a shared object
8515 if version script defines any version versions.
8516 (Versions::define_base_version): New method definition.
8517 (Versions::add_def): Check that base version is not needed.
8518 (Versions::add_need): Define base version lazily.
8519 * dynobj.h (Versions::define_base_version): New method declaration.
8520 (Versions::needs_base_version_): New data member declaration.
8521 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
8522 (check_DATA): Add no_version_test.stdout.
8523 (libno_version_test.so, no_version_test.o no_version_test.stdout):
8524 New make rules.
8525 * testsuite/Makefile.in: Regenerate.
8526 * testsuite/no_version_test.c: New file.
8527 * testsuite/no_version_test.sh: Ditto.
8528
3c12dcdb
DK
85292009-10-16 Doug Kwan <[email protected]>
8530
8531 * expression.cc (class Segment_start_expression): New class definition.
8532 (Segment_start_expression::value): New method definition.
8533 (script_exp_function_segment_start): Return a new
8534 Segment_start_expression.
8535 * gold/script-c.h (script_saw_segment_start_expression): New function
8536 prototype.
8537 * script-sections.cc (Script_sections::Script_sections): Initialize
8538 SAW_SEGMENT_START_EXPRESSION_ to false.
8539 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
8540 and -Tbbs options to specify section addresses if given in
8541 command line and no SEGMENT_START expression is seen in a script.
8542 * script-sections.h (Script_sections::saw_segment_start_expression,
8543 Script_sections::set_saw_segment_start_expression): New method
8544 definition.
8545 (Script_sections::saw_segment_start_expression_): New data member
8546 declaration.
8547 * script.cc (script_saw_segment_start_expression): New function.
8548 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
8549 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
8550 script_test_7.sh and script_test_8.sh.
8551 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
8552 script_test_8.stdout.
8553 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
8554 (script_test_6, script_test_6.stdout, script_test_7,
8555 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
8556 * Makefile.in: Regenerate.
8557 * testsuite/script_test_6.sh: New file.
8558 * testsuite/script_test_6.t: Same.
8559 * testsuite/script_test_7.sh: Same.
8560 * testsuite/script_test_7.t: Same.
8561 * testsuite/script_test_8.sh: Same.
8562
64b1ae37
DK
85632009-10-16 Doug Kwan <[email protected]>
8564
8565 * output.cc (Output_segment::set_section_list_address): Cast
8566 expressions to unsigned long long type to avoid format warnings.
8567
661be1e2
ILT
85682009-10-15 Ian Lance Taylor <[email protected]>
8569
12edd763 8570 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 8571 dot assignment to script_sections_.
12edd763
ILT
8572 * script-sections.cc (Script_sections::add_dot_assignment):
8573 Initialize if necessary.
8574
68b6574b
ILT
8575 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
8576 program headers with no load segment if there is a linker script.
8577
661be1e2
ILT
8578 * layout.cc (Layout::set_segment_offsets): Align the file offset
8579 to the segment aligment for -N or -n with no load segment.
8580 * output.cc (Output_segment::add_output_section): Don't crash if
8581 the first section is a TLS section.
8582 (Output_segment::set_section_list_addresses): Print an error
8583 message if the address moves backward in a linker script.
8584 * script-sections.cc
8585 (Output_section_element_input::set_section_addresses): Don't
8586 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
8587 (Orphan_output_section::set_section_addresses): Likewise.
8588
f15f61a7
DK
85892009-10-15 Doug Kwan <[email protected]>
8590
8591 * layout.cc (Layout::finish_dynamic_section): Generate tags
8592 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
8593 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
8594 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
8595
82bb573a
ILT
85962009-10-14 Ian Lance Taylor <[email protected]>
8597
8598 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
8599 fields.
8600 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
8601 data_shdr fields of relinfo.
8602 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
8603 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
8604 R_386_TLS_LDO_32, adjust based on section flags.
8605 (Target_i386::Relocate::fix_up_ldo): Remove.
8606
374ad285
ILT
86072009-10-13 Ian Lance Taylor <[email protected]>
8608
8609 Add support for -pie.
8610 * options.h (class General_options): Add -pie and
8611 --pic-executable.
8612 (General_options::output_is_position_independent): Test -pie.
8613 (General_options::output_is_executable): Return true if not shared
8614 and not relocatable.
8615 (General_options::output_is_pie): Remove.
8616 * options.cc (General_options::finalize): Reject incompatible uses
8617 of -pie.
8618 * gold.cc (queue_middle_tasks): A -pie link is not static.
8619 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
8620 * symtab.cc (Symbol::final_value_is_known): Return false if
8621 output_is_position_independent.
8622 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
8623 output_is_position_independent.
8624 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
8625 output_is_position_independent.
8626 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
8627 output_is_position_independent.
8628 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
8629 two_file_pie_test.
8630 (basic_pie_test.o, basic_pie_test): New targets.
8631 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
8632 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
8633 (two_file_pie_test): New target.
8634 * testsuite/Makefile.in: Rebuild.
8635 * README: Remove note saying that -pie is not supported.
8636
c6585162
ILT
86372009-10-13 Bernhard Reutner-Fischer <[email protected]>
8638
8639 * options.h (class General_options): Add -init and -fini.
8640 * layout.cc (Layout::finish_dynamic_section): Emit
8641 given init and fini functions.
8642
032ce4e9
ST
86432009-10-13 Sriraman Tallam <[email protected]>
8644
8645 * gc.h (gc_process_relocs): Check if icf is enabled using new
8646 function.
8647 * gold.cc (queue_initial_tasks): Likewise.
8648 (queue_middle_tasks): Likewise.
8649 * object.cc (do_layout): Likewise.
8650 * symtab.cc (is_section_folded): Likewise.
8651 * main.cc (main): Likewise.
8652 * reloc.cc (Read_relocs::run): Likewise.
8653 (Sized_relobj::do_scan_relocs): Likewise.
8654 * icf.cc (is_function_ctor_or_dtor): New function.
8655 (Icf::find_identical_sections): Check if function is ctor or dtor when
8656 safe icf is chosen.
8657 * options.h (General_options::icf): Change option to be an enum.
8658 (Icf_status): New enum.
8659 (icf_enabled): New method.
8660 (icf_safe_folding): New method.
8661 (set_icf_status): New method.
8662 (icf_status_): New variable.
8663 * (options.cc) (General_options::finalize): Set icf_status_.
8664 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
8665 icf_test and icf_keep_unique_test to use the --icf enum flag.
8666 * testsuite/icf_safe_test.sh: New file.
e1df38aa 8667 * testsuite/icf_safe_test.cc: New file.
032ce4e9 8668
f345227a
ST
86692009-10-12 Sriraman Tallam <[email protected]>
8670
8671 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
8672 includes to gc.h and icf.h.
8673 * arm.cc: Include gc.h.
8674 * gold.cc: Likewise.
8675 * i386.cc: Likewise.
8676 * powerpc.cc: Likewise.
8677 * sparc.cc: Likewise.
8678 * x86_64.cc: Likewise.
8679 * gc.h: Include icf.h.
8680
1c7814ed
ILT
86812009-10-11 Ian Lance Taylor <[email protected]>
8682
8683 * plugin.cc: Include "gold.h" before other header files.
8684
ae3b5189
CD
86852009-10-10 Chris Demetriou <[email protected]>
8686
8687 * options.h (Input_file_argument::Input_file_type): New enum.
8688 (Input_file_argument::is_lib_): Replace with...
8689 (Input_file_argument::type_): New member.
8690 (Input_file_argument::Input_file_argument): Take Input_file_type
8691 'type' rather than boolean 'is_lib' as second argument.
8692 (Input_file_argument::is_lib): Use type_.
8693 (Input_file_argument::is_searched_file): New function.
8694 (Input_file_argument::may_need_search): Handle is_searched_file.
8695 * options.cc (General_options::parse_library): Support -l:filename.
8696 (General_options::parse_just_symbols): Update for Input_file_argument
8697 changes.
8698 (Command_line::process): Likewise.
8699 * archive.cc (Archive::get_file_and_offset): Likewise.
8700 * plugin.cc (Plugin_manager::release_input_file): Likewise.
8701 * script.cc (read_script_file, script_add_file): Likewise.
8702 * fileread.cc (Input_file::Input_file): Likewise.
8703 (Input_file::will_search_for): Handle is_searched_file.
8704 (Input_file::open): Likewise.
8705 * readsyms.cc (Read_symbols::get_name): Likewise.
8706 * testsuite/Makefile.am (searched_file_test): New test.
8707 * testsuite/Makefile.in: Regenerate.
8708 * testsuite/searched_file_test.cc: New file.
8709 * testsuite/searched_file_test_lib.cc: New file.
8710
f3048a1d
ILT
87112009-10-09 Andrew Pinski <[email protected]>
8712 Ian Lance Taylor <[email protected]>
8713
8714 * descriptor.cc: Include <cstdio> and "binary-io.h".
8715 (Descriptors::open): Open the files in binary mode always.
8716 * script.cc (Lex::get_token): Treat \r as whitespace.
8717
d4780e57
ILT
87182009-10-09 Ian Lance Taylor <[email protected]>
8719
8720 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
8721
d9a893b8
ILT
87222009-10-09 Andrew Pinski <[email protected]>
8723 Ian Lance Taylor <[email protected]>
8724
8725 * configure.ac: Check for readv function also.
8726 * fileread.cc (readv): Define if not HAVE_READV.
8727 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
8728 does not exist.
8729 * config.in: Regenerate.
8730 * configure: Regenerate.
8731
c0a62865
DK
87322009-10-09 Doug Kwan <[email protected]>
8733
8734 * layout.cc (Layout::make_output_section): Call target hook to make
8735 ordinary output section.
8736 (Layout::finalize): Adjust parameter list of call the
8737 Target::may_relax().
8738 * layout.h (class Layout::section_list): New method.
8739 * merge.h (Output_merge_base::entsize): Change visibility to public.
8740 (Output_merge_base::is_string, Output_merge_base::do_is_string):
8741 New methods.
8742 (Output_merge_string::do_is_string): New method.
8743 * object.cc (Sized_relobj::do_setup): renamed from
8744 Sized_relobj::set_up.
8745 * object.h (Sized_relobj::adjust_shndx,
8746 Sized_relobj::initializ_input_to_output_maps,
8747 Sized_relobj::free_input_to_output_maps): Change visibilities to
8748 protected.
8749 (Sized_relobj::setup): Virtualize.
8750 (Sized_relobj::do_setup): New method declaration.
8751 (Sized_relobj::invalidate_section_offset,
8752 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
8753 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
8754 * options.cc (parse_int): New function.
8755 * options.h (parse_int): New declaration.
8756 (DEFINE_int): New macro.
8757 (stub_group_size): New option.
8758 * output.cc (Output_section::Output_section): Initialize memebers
8759 merge_section_map_, merge_section_by_properties_map_,
8760 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
8761 (Output_section::add_input_section): Handled deferred code-fill
8762 generation and remove an old comment.
8763 (Output_section::add_relaxed_input_section): New method definition.
8764 (Output_section::add_merge_input_section): Use merge section by
8765 properties map to speed to search. Update merge section maps
8766 as appropriate.
8767 (Output_section::build_relaxation_map): New method definition.
8768 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8769 Same.
8770 (Output_section::relax_input_section): Renamed to
8771 Output_section::convert_input_sections_to_relaxed_sections and change
8772 interface to take a vector of pointers to relaxed sections.
8773 (Output_section::find_merge_section,
8774 Output_section::find_relaxed_input_section): New method definitions.
8775 (Output_section::is_input_address_mapped,
8776 Output_section::output_offset, Output_section::output_address):
8777 Use output section data maps to speed up searching.
8778 (Output_section::find_starting_output_address): Add comments.
8779 (Output_section::do_write,
8780 Output_section::write_to_postprocessing_buffer): Do code-fill
8781 generation as appropriate.
8782 (Output_section::get_input_sections): Invalidate relaxed input section
8783 map.
8784 (Output_section::restore_states): Adjust type of checkpoint .
8785 Invalidate relaxed input section map.
8786 * output.h (Output_merge_base): New class declaration.
8787 (Input_section_specifier): New class defintion.
8788 (class Output_relaxed_input_section) Change base class to
8789 Output_section_data_build.
8790 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
8791 base class initializer.
8792 (Output_section::add_relaxed_input_section): New method declaration.
8793 (Output_section::Input_section): Change visibility to protected.
2e702c99 8794 (Output_section::Input_section::relobj,
c0a62865
DK
8795 Output_section::Input_section::shndx): Handle relaxed input sections.
8796 Output_section::input_sections) Change visibility to protected. Also
8797 define overload to return a non-const pointer.
8798 (Output_section::Merge_section_properties): New class defintion.
8799 (Output_section::Merge_section_by_properties_map,
8800 Output_section::Output_section_data_by_input_section_map,
8801 Output_section::Relaxation_map): New types.
8802 (Output_section::relax_input_section): Rename method to
8803 Output_section::convert_input_sections_to_relaxed_sections and change
8804 interface to take a vector of relaxed section pointers.
8805 (Output_section::find_merge_section,
8806 Output_section::find_relaxed_input_section,
8807 Output_section::build_relaxation_map,
8808 Output_section::convert_input_sections_in_list_to_relaxed_sections):
8809 New method declarations.
8810 (Output_section::merge_section_map_
8811 Output_section::merge_section_by_properties_map_,
8812 Output_section::relaxed_input_section_map_,
8813 Output_section::is_relaxed_input_section_map_valid_,
8814 Output_section::generate_code_fills_at_write_): New data members.
8815 * script-sections.cc
8816 (Output_section_element_input::set_section_addresses): Call
8817 current_data_size and addralign methods of relaxed input sections.
8818 (Orphan_output_section::set_section_addresses): Call current_data_size
8819 and addralign methods of relaxed input sections.
8820 * symtab.cc (Symbol_table::compute_final_value): Extract template
8821 from the body of Symbol_table::sized_finalize_symbol.
8822 (Symbol_table::sized_finalized_symbol): Call
8823 Symbol_table::compute_final_value.
8824 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
8825 (Symbol_table::compute_final_value): New templated method declaration.
8826 * target.cc (Target::do_make_output_section): New method defintion.
8827 * target.h (Target::make_output_section): New method declaration.
8828 (Target::relax): Add more parameters for input objects, symbol table
8829 and layout. Adjust call to do_relax.
8830 (Target::do_make_output_section): New method declaration.
8831 (Target::do_relax): Add parameters for input objects, symbol table
8832 and layout.
8833
d446d6c4
ILT
88342009-10-09 Andrew Pinski <[email protected]>
8835
8836 * pread.c: Include stdio.h.
8837
bc06c745
ILT
88382009-10-09 Andrew Pinski <[email protected]>
8839
8840 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
8841 defined.
8842
75aea3d0
ILT
88432009-10-09 Andrew Pinski <[email protected]>
8844
8845 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8846 Change read_shndx type to unsigned int.
8847 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
8848 int.
8849 (Sized_dwarf_line_info::read_line_mappings): Likewise.
8850 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
8851 Change read_shndx type to unsigned int.
8852 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
8853 int.
8854 (Sized_dwarf_line_info::read_line_mappings): Likewise.
8855 * layout.cc (Layout::create_symtab_sections): Cast the result of
8856 local_symcount * symsize to off_t in the gold_assert.
8857
be8fcb75
ILT
88582009-10-09 Viktor Kutuzov <[email protected]>
8859
8860 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
8861 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
8862 R_ARM_BASE_ABS.
8863 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
8864 (Arm_relocate_functions::thm_abs5): New function.
8865 (Arm_relocate_functions::abs12): New function.
8866 (Arm_relocate_functions::abs16): New function.
8867 (Arm_relocate_functions::base_abs): New function.
8868 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
8869 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
8870 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
8871 R_ARM_BASE_ABS.
8872 (Scan::global): Likewise.
8873 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
8874 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
8875 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
8876 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
8877 R_ARM_BASE_ABS.
8878
c2a122b6
ILT
88792009-10-09 Viktor Kutuzov <[email protected]>
8880
8881 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
8882 (Arm_relocate_functions::movt_prel): New function.
8883 (Arm_relocate_functions::thm_movw_prel_nc): New function.
8884 (Arm_relocate_functions::thm_movt_prel): New function.
8885 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
8886 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
8887 (Scan::global, Relocate::relocate): Likewise.
8888 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8889
c4aa1e2d
ILT
88902009-10-09 Mikolaj Zalewski <[email protected]>
8891
8892 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
8893 Incremental_checker.
8894 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
8895 unsigned int.
8896 (class Incremental_inputs_header): New class.
8897 (Incremental_inputs_header_writer): Edit comment.
8898 (Incremental_inputs_entry): New class.
8899 (Incremental_inputs_entry_writer): Edit comment.
8900 (Sized_incremental_binary::do_find_incremental_inputs_section):
8901 Add *strtab_shndx parameter, fill it.
8902 (Sized_incremental_binary::do_check_inputs): New method.
8903 (Incremental_checker::can_incrementally_link_output_file): Use
8904 Sized_incremental_binary::check_inputs.
8905 (Incremental_inputs::report_command_line): Save command line in
8906 command_line_.
8907 * incremental.h:
8908 (Incremental_binary::find_incremental_inputs_section): New
8909 method.
8910 (Incremental_binary::do_find_incremental_inputs_section): Add
8911 strtab_shndx parameter.
8912 (Incremental_binary::do_check_inputs): New pure virtual method.
8913 (Sized_incremental_binary::do_check_inputs): Declare.
8914 (Incremental_checker::Incremental_checker): Add incremental_inputs
8915 parameter, use it to initialize incremental_inputs_.
8916 (Incremental_checker::incremental_inputs_): New field.
8917 (Incremental_checker::command_line): New method.
8918 (Incremental_checker::inputs): New method.
8919 (Incremental_checker::command_line_): New field.
8920
c549a694
ILT
89212009-10-09 Mikolaj Zalewski <[email protected]>
8922
8923 * incremental.cc: Include <cstdarg> and "target-select.h".
8924 (vexplain_no_incremental): New function.
8925 (explain_no_incremental): New function.
8926 (Incremental_binary::error): New method.
8927 (Sized_incremental_binary::do_find_incremental_inputs_section): New
8928 method.
8929 (make_sized_incremental_binary): New function.
8930 (open_incremental_binary): New function.
8931 (can_incrementally_link_file): Add checks if output is ELF and has
8932 inputs section.
8933 * incremental.h: Include "elfcpp_file.h" and "output.h".
8934 (Incremental_binary): New class.
8935 (Sized_incremental_binary): New class.
8936 (open_incremental_binary): Declare.
8937 * object.cc (is_elf_object): Use
8938 elfcpp::Elf_recognizer::is_elf_file.
8939 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
8940 * output.h (Output_file::filesize): New method.
8941
fd3c5f0b
ILT
89422009-10-07 Viktor Kutuzov <[email protected]>
8943
8944 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
8945 New function.
8946 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
8947 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
8948 function.
8949 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
8950 function.
8951 (Arm_relocate_functions::movw_abs_nc): New function.
8952 (Arm_relocate_functions::movt_abs): New function.
8953 (Arm_relocate_functions::thm_movw_abs_nc): New function.
8954 (Arm_relocate_functions::thm_movt_abs): New function.
8955 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
8956 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
8957 (Scan::global): Likewise.
8958 (Relocate::relocate): Likewise.
8959 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8960
7f5309a5
ILT
89612009-10-07 Viktor Kutuzov <[email protected]>
8962
8963 * arm.cc (Arm_relocate_functions::got_prel) New function.
8964 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
8965 (Relocate::relocate): Likewise.
8966 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8967
364c7fa5
ILT
89682009-10-06 Ian Lance Taylor <[email protected]>
8969
8970 * options.h (class General_options): Define
8971 split_stack_adjust_size parameter.
8972 * object.h (class Object): Add uses_split_stack_ and
8973 has_no_split_stack_ fields. Add uses_split_stack and
8974 has_no_split_stack accessor functions. Declare
8975 handle_split_stack_section.
8976 (class Reloc_symbol_changes): Define.
8977 (class Sized_relobj): Define Function_offsets. Declare
8978 split_stack_adjust, split_stack_adjust_reltype, and
8979 find_functions.
8980 * object.cc (Object::handle_split_stack_section): New function.
8981 (Sized_relobj::do_layout): Call handle_split_stack_section.
8982 * dynobj.cc (Sized_dynobj::do_layout): Call
8983 handle_split_stack_section.
8984 * reloc.cc (Sized_relobj::relocate_sections): Call
8985 split_stack_adjust for executable sections in split_stack
8986 objects. Pass reloc_map to relocate_section.
8987 (Sized_relobj::split_stack_adjust): New function.
8988 (Sized_relobj::split_stack_adjust_reltype): New function.
8989 (Sized_relobj::find_functions): New function.
8990 * target-reloc.h: Include "object.h".
8991 (relocate_section): Add reloc_symbol_changes parameter. Change
8992 all callers.
8993 * target.h (class Target): Add calls_non_split method. Declare
8994 do_calls_non_split virtual method. Declare match_view and
8995 set_view_to_nop.
8996 * target.cc: Include "elfcpp.h".
8997 (Target::do_calls_non_split): New function.
8998 (Target::match_view): New function.
8999 (Target::set_view_to_nop): New function.
9000 * gold.cc (queue_middle_tasks): Give an error if mixing
9001 split-stack and non-split-stack objects with -r.
9002 * i386.cc (Target_i386::relocate_section): Add
9003 reloc_symbol_changes parameter.
9004 (Target_i386::do_calls_non_split): New function.
9005 * x86_64.cc (Target_x86_64::relocate_section): Add
9006 reloc_symbol_changes parameter.
9007 (Target_x86_64::do_calls_non_split): New function.
9008 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
9009 parameter.
9010 * powerpc.cc (Target_powerpc::relocate_section): Add
9011 reloc_symbol_changes parameter.
9012 * sparc.cc (Target_sparc::relocate_section): Add
9013 reloc_symbol_changes parameter.
9014 * configure.ac: Call AM_CONDITIONAL for the default target.
9015 * configure: Rebuild.
9016 * testsuite/Makefile.am (TEST_AS): New variable.
9017 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
9018 (check_DATA): Add split_i386 and split_x86_64 files.
9019 (SPLIT_DEFSYMS): Define.
9020 (split_i386_[1234n].o): New targets.
9021 (split_i386_[124]): New targets.
9022 (split_i386_[1234r].stdout): New targets.
9023 (split_x86_64_[1234n].o): New targets.
9024 (split_x86_64_[124]): New targets.
9025 (split_x86_64_[1234r].stdout): New targets.
9026 (MOSTLYCLEANFILES): Add new executables.
9027 * testsuite/split_i386.sh: New file.
9028 * testsuite/split_x86_64.sh: New file.
9029 * testsuite/split_i386_1.s: New file.
9030 * testsuite/split_i386_2.s: New file.
9031 * testsuite/split_i386_3.s: New file.
9032 * testsuite/split_i386_4.s: New file.
9033 * testsuite/split_i386_n.s: New file.
9034 * testsuite/split_x86_64_1.s: New file.
9035 * testsuite/split_x86_64_2.s: New file.
9036 * testsuite/split_x86_64_3.s: New file.
9037 * testsuite/split_x86_64_4.s: New file.
9038 * testsuite/split_x86_64_n.s: New file.
9039 * testsuite/testfile.cc (Target_test): Update relocation_section
9040 function.
9041 * testsuite/Makefile.in: Rebuild.
9042
e8a9fcda
ILT
90432009-10-06 Ian Lance Taylor <[email protected]>
9044
9045 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
9046 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
9047 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
9048 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
9049 the address on ldo_addrs_.
9050 (Target_i386::Relocate::fix_up_ldo): New function.
9051
e99daf92
ILT
90522009-10-06 Rafael Espindola <[email protected]>
9053
9054 * plugin.cc (add_input_library): New.
9055 (Plugin::load): Add add_input_library to tv.
9056 (Plugin_manager::add_input_file): Add the is_lib argument.
9057 (add_input_file): Update call to Plugin_manager::add_input_file.
9058 (add_input_library): New.
9059 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
9060
966d4097
DK
90612009-09-30 Doug Kwan <[email protected]>
9062
9063 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
9064 symbol and call Symbol::may_need_copy_reloc to determine if
9065 a copy reloc is needed.
9066 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
9067 nocopyreloc is given in command line.
9068 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
9069 given in command line.
9070 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
9071 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
9072 of the removed Target_i386::may_need_copy_reloc.
9073 * options.h (copyreloc): New option with default value false.
9074 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9075 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
9076 instead of the removed Target_powerpc::may_need_copy_reloc.
9077 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9078 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
9079 instead of the removed Target_sparc::may_need_copy_reloc.
9080 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
9081 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
9082 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
9083 instead of the removed Target_x86_64::may_need_copy_reloc.
9084
029ba973
ILT
90852009-09-30 Ian Lance Taylor <[email protected]>
9086
9087 * object.h (class Object): Remove target_ field, and target,
9088 sized_target, and set_target methods.
9089 (Object::sized_target): Remove.
9090 (class Sized_relobj): Update declarations. Remove sized_target.
9091 * object.cc (Sized_relobj::setup): Remove target parameter.
9092 Change all callers.
9093 (Input_objects::add_object): Don't do anything with the target.
9094 (make_elf_sized_object): Add punconfigured parameter. Change all
9095 callers. Set or test parameter target.
9096 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
9097 Change all callers.
9098 * parameters.cc (Parameters::set_target): Change parameter type to
9099 be non-const.
9100 (Parameters::default_target): Remove.
9101 (set_parameters_target): Change parameter type to be non-const.
9102 (parameters_force_valid_target): New function.
9103 (parameters_clear_target): New function.
9104 * parameters.h (class Parameters): Update declarations. Remove
9105 default_target method. Add sized_target and clear_target
9106 methods. Change target_ to be non-const.
9107 (set_parameters_target): Update declaration.
9108 (parameters_force_valid_target): Declare.
9109 (parameters_clear_target): Declare.
9110 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
9111 as NULL if we aren't searching.
9112 (Add_symbols::run): Don't check for compatible target.
9113 * fileread.cc (Input_file::open_binary): Call
9114 parameters_force_valid_target.
9115 * gold.cc (queue_middle_tasks): Likewise.
9116 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
9117 set_target on object.
9118 * dynobj.h (class Sized_dynobj): Update declarations.
9119 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
9120 make_elf_object returns NULL.
9121 (Archive::include_member): Don't check whether object target is
9122 compatible.
9123 * output.cc (Output_section::add_input_section): Get target from
9124 parameters.
9125 (Output_section::relax_input_section): Likewise.
9126 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
9127 parameters.
9128 (Sized_relobj::do_scan_relocs): Likewise.
9129 (Sized_relobj::relocate_sections): Likewise.
9130 * resolve.cc (Symbol_table::resolve): Likewise.
9131 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
9132 parameter. Change all callers.
9133 (Symbol_table::add_from_object): Get target from parameters.
9134 (Symbol_table::add_from_relobj): Don't check object target.
9135 (Symbol_table::add_from_dynobj): Likewise.
9136 (Symbol_table::define_special_symbol): Get target from
9137 parameters.
9138 * symtab.h (class Symbol_table): Update declaration.
9139 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
9140 parameter. Change all callers. Clear parameter target.
9141 (Binary_test): Test target here.
9142 * testsuite/object_unittest.cc (gold_testsuite): Remove
9143 target_test_pointer parameter. Change all callers.
9144 (Object_test): Test target here.
9145
a6a22b83
ILT
91462009-09-26 Ian Lance Taylor <[email protected]>
9147
9148 * testsuite/initpri1.c: Don't try to use constructor priorities if
9149 compiling with gcc before 4.3.
9150
6a8f49fe
ILT
91512009-09-22 Mikolaj Zalewski <[email protected]>
9152
9153 * testsuite/retain_symbols_file_test.sh (check_present): Change
9154 output file name to retain_symbols_file_test.stdout.
9155 (check_absent): Likewise.
9156
8c604651
CS
91572009-09-18 Craig Silverstein <[email protected]>
9158
9159 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
9160 * options.cc: Include <cerrno> and <fstream>.
9161 (General_options::finalize): Parse -retain-symbols-file tag.
9162 * options.h: New flag.
9163 (General_options): New method should_retain_symbol, new
9164 variable symbols_to_retain.
9165 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
9166 should_retain_symbol map.
9167 * testsuite/Makefile.am (retain_symbols_file_test): New test.
9168 * testsuite/Makefile.in: Regenerate.
9169 * testsuite/retain_symbols_file_test.sh: New file.
9170
ca58b19f
NC
91712009-09-18 Nick Clifton <[email protected]>
9172
9173 * po/es.po: Updated Spanish translation.
9174
20e6d0d6
DK
91752009-09-17 Doug Kwan <[email protected]>
9176
9177 * debug.h (DEBUG_RELAXATION): New constant.
9178 (DEBUG_ALL): Add DEBUG_RELAXATION.
9179 (debug_string_to_enum): Add relaxation debug option.
9180 * layout.cc
9181 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
9182 Layout::Relaxation_debug_check::read_sections,
9183 Layout::Relaxation_debug_check::read_sections): New method definitions.
9184 (Layout::Layout): Initialize data members
9185 record_output_section_data_from_scrips_,
9186 script_output_section_data_list_ and relaxation_debug_check_.
9187 (Layout::save_segments, Layout::restore_segments,
9188 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9189 Layout::relaxation_loop_body): New method definitions.
9190 (Layout::finalize): Support relaxation. Move section layout code to
9191 Layout::relaxation_loop_body.
9192 (Layout::set_asection_address_from_script): Move code for orphan
9193 section placement out.
9194 (Layout::place_orphan_sections_in_script): New method definition.
9195 * layout.h (Output_segment_headers, Output_file_header):
9196 New forward class declarations.
9197 (Layout::~Layout): Define.
9198 (Layout::new_output_section_data_from_script): New method definition.
9199 (Layout::place_orphan_sections_in_script): New method declaration.
9200 (Layout::Segment_states): New type declaration.
9201 (Layout::save_segments, Layout::restore_segments,
9202 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9203 Layout::relaxation_loop_body): New method declarations.
9204 (Layout::Output_section_data_list): New type declaration.
9205 (Layout::Relaxation_debug_check): New class definition.
9206 (Layout::record_output_section_data_from_script_,
9207 Layout::script_output_section_data_list_, Layout::segment_states_,
9208 Layout::relaxation_debug_check_): New data members.
9209 * output.cc: (Output_section_headers::do_size): New method definition.
9210 (Output_section_headers::Output_section_headers): Move size
9211 computation to Output_section_headers::do_size.
9212 (Output_segment_headers::do_size): New method definition.
e1df38aa 9213 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
9214 Output_file_header::do_size and call it.
9215 (Output_file_header::do_size): New method definition.
9216 (Output_data_group::Output_data_group): Adjust call to
9217 Output_section_data.
9218 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
9219 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 9220 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
9221 RELAXED_INPUT_SECTION_CODE.
9222 (Output_section::Output_section): Initialize data member checkpoint_.
9223 (Output_section::~Output_section): Delete checkpoint object pointed
9224 by checkpoint_.
9225 (Output_section::add_input_section): Always add an Input_section if
9226 relaxing.
9227 (Output_section::add_merge_input_section): Add assert.
9228 (Output_section::relax_input_section): New method definition.
9229 (Output_section::set_final_data_size): Set load address to zero for
9230 an unallocated section.
9231 (Output_section::do_address_and_file_offset_have_reset_values):
9232 New method definition.
9233 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
9234 Handle relaxed input section.
9235 (Output_section::sort_attached_input_sections): Checkpoint input
9236 section list lazily.
9237 (Output_section::get_input_sections): Change type of input_sections to
9238 list of Simple_input_section pointers. Checkpoint input section list
9239 lazily. Also handle relaxed input sections.
9240 (Output_section::add_input_section_for_script): Take a reference to
9241 a Simple_input_section object instead of Relobj pointer and section
9242 index as parameter. Handle relaxed input sections.
9243 (Output_section::save_states, Output_section::restore_states): New
9244 method definitions.
9245 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
9246 (Output_data::is_data_size_fixed): New method definition.
9247 (Output_data::reset_addresss_and_file_offset): Do not reset data size
9248 if it is fixed.
9249 (Output_data::address_and_file_offset_have_reset_values): New method
9250 definition.
9251 (Output_data::do_address_and_file_offset_have_reset_values): New method
9252 definition.
9253 (Output_data::set_data_size): Check that data size is not fixed.
9254 (Output_data::fix_data_size): New method definition.
9255 (Output_data::is_data_size_fixed_): New data member.
9256 (Output_section_headers::set_final_data_size): New method definition.
9257 (Output_section_headers::do_size): New method declaration.
9258 (Output_segment_headers::set_final_data_size): New method definition.
9259 (Output_segment_headers::do_size): New method declaration.
9260 (Output_file_header::set_final_data_size)::New method definition.
9261 (Output_file_header::do_size)::New method declaration.
9262 (Output_section_data::Output_section_data): Add new parameter
9263 is_data_size_fixed and use it to fix data size.
9264 (Output_data_const::Output_data_const): Adjust call to base class
9265 constructor and fix data size.
9266 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
9267 base class constructor and fix data size.
9268 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
9269 base class constructor and fix data size.
9270 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
9271 class constructor and fix data size.
9272 (Output_data_group::set_final_data_size): New method definition.
9273 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
9274 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
9275 class constructor and fix data size.
9276 (Output_relaxed_input_section): New class definition.
9277 (Output_section::Simple_input_section): New class definition.
9278 (Output_section::get_input_sections): Adjust parameter list.
9279 (Output_section::add_input_section_for_script): Same.
9280 (Output_section::save_states, Output_section::restore_states,
9281 Output_section::do_address_and_file_offset_have_reset_values,
9282 (Output_section::Input_section::Input_section): Handle
9283 RELAXED_INPUT_SECTION_CODE. Add new overload for
9284 Output_relaxed_input_section.
9285 (Output_section::Input_section::is_input_section,
9286 Output_section::Input_section::set_output_section): Handle relaxed
9287 input section.
9288 (Output_section::Input_section::is_relaxed_input_section,
9289 Output_section::Input_section::output_section_data,
9290 Output_section::Input_section::relaxed_input_section): New method
9291 definitions.
9292 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
9293 value.
9294 (Output_section::Input_section::u1_): Update comments.
9295 (Output_section::Input_section::u2_): Add new union member poris.
9296 (Output_section::Checkpoint_output_section): New classs definition.
9297 (Output_section::relax_input_section): New method declaration.
9298 (Output_section::checkpoint_): New data member.
9299 (Output_segment): Update comments.
9300 (Output_segment::Output_segment): Un-privatize copy constructor.
9301 (Output_segment::operator=): Un-privatize.
9302 * script-sections.cc (Output_section_element::Input_section_list):
9303 Change element type to Output_section::Simple_input_section.
9304 (Output_section_element_dot_assignment::set_section_addresses):
9305 Register output section data for relaxation clean up.
9306 (Output_data_exression::Output_data_expression): Adjust call to base
9307 constructor to fix data size.
9308 (Output_section_element_data::set_section_addresses): Register
9309 Output_data_expression object for relaxation clean up.
9310 (struct Input_section_info): Replace Relobj pointer and section index
9311 pair with Output_section::Simple_input_section and Convert struct to a
9312 class.
9313 (Input_section_sorter::operator()): Adjust access to
e1df38aa 9314 Input_section_info data member to use accessors.
20e6d0d6
DK
9315 (Output_section_element_input::set_section_addresses): Use layout
9316 parameter. Adjust code to use Output_section::Simple_input_section
9317 and Input_secction_info classes. Register filler for relaxation
9318 clean up.
9319 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
9320 and section index pair with Output_section::Simple_input_section
9321 class. Adjust code accordingly.
9322 (Phdrs_element::release_segment): New method definition.
9323 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
9324 segment list.
9325 (Script_sections::release_segments): New method definition.
9326 * gold/script-sections.h (Script_sections::release_segments): New
9327 method declaration.
9328 * gold/target.h (Target::may_relax, Target::relax,
9329 Target::do_may_relax, Target::do_relax): New method definitions.
9330
5e445df6
ILT
93312009-09-17 Viktor Kutuzov <[email protected]>
9332
9333 * arm.cc (has_signed_unsigned_overflow): New function.
9334 (Arm_relocate_functions::abs8): New function.
9335 (Target_arm::Scan::local): Handle R_ARM_ABS8.
9336 (Target_arm::Scan::global): Likewise.
9337 (Target_arm::relocate::relocate): Likewise.
9338 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9339 Likewise.
9340
8c604651 93412009-09-16 Cary Coutant <[email protected]>
72fef11a
CC
9342
9343 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
9344 * testsuite/Makefile.in: Regenerate.
9345
1e9cc1c2
NC
93462009-09-11 Nick Clifton <[email protected]>
9347
9348 * po/gold.pot: Updated by the Translation project.
9349
6a89f575
CC
93502009-09-08 Cary Coutant <[email protected]>
9351
9352 * output.cc (Output_file::open): Add execute permission to empty file.
9353 * testsuite/Makefile.am (permission_test): New test.
9354 * testsuite/Makefile.in: Regenerate.
9355
fdcac5af
ILT
93562009-09-02 Ian Lance Taylor <[email protected]>
9357
9358 * output.cc (Output_file::resize): Call map_no_anonymous rather
9359 than map.
9360
44453f85
ILT
93612009-09-01 Mikolaj Zalewski <[email protected]>
9362
9363 * gold.cc: Include "incremental.h".
9364 (queue_initial_tasks): Call Incremental_checker methods.
9365 * incremental.cc: Include "output.h".
9366 (Incremental_checker::can_incrementally_link_output_file): New
9367 method.
9368 * incremental.h (Incremental_checker): New class.
9369
9370 * output.cc (Output_file::open_for_modification): New method.
9371 (Output_file::map_anonymous): Changed return type to bool. Record
9372 map in base_ field.
9373 (Output_file::map_no_anonymous): New method, broken out of map.
9374 (Output_file::map): Use map_no_anonymous and map_anonymous.
9375 * output.h (class Output_file): Update declarations.
9376
293c1386
CC
93772009-08-24 Cary Coutant <[email protected]>
9378
9379 * options.h (Command_line::Pre_options): New class.
9380 (Command_line::pre_options): New member.
9381 * options.cc (gold::options::ready_to_register): New variable.
9382 (One_option::register_option): Do nothing if not registering options.
9383 Assert if same short option registered twice.
9384 (General_options::General_options): Turn off option registration when
9385 done constructing.
9386 (Command_line::Pre_options::Pre_options): New constructor.
9387
f773f3d2
CC
93882009-08-24 Cary Coutant <[email protected]>
9389
06a73cfe
CC
9390 * options.h (General_options::no_keep_memory): Remove incorrect
9391 short option.
f773f3d2 9392
a15af8e2
RW
93932009-08-24 Ralf Wildenhues <[email protected]>
9394
9395 * Makefile.am (am__skiplex, am__skipyacc): New.
9396 * Makefile.in: Regenerate.
9397
c462b41b
RW
93982009-08-22 Ralf Wildenhues <[email protected]>
9399
14ec8efd
RW
9400 * Makefile.am (AM_CPPFLAGS): Renamed from ...
9401 (INCLUDES): ... this.
9402 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
9403 (AM_CPPFLAGS): Renamed from ...
9404 (INCLUDE): ... this.
9405 * Makefile.in, testsuite/Makefile.in: Regenerate.
9406
81ecdfbb
RW
9407 * Makefile.in: Regenerate.
9408 * aclocal.m4: Likewise.
9409 * config.in: Likewise.
9410 * configure: Likewise.
9411 * testsuite/Makefile.in: Likewise.
9412
c462b41b
RW
9413 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9414 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9415 * Makefile.in: Regenerate.
9416 * testsuite/Makefile.in: Regenerate.
9417
2da73f13
CC
94182009-08-19 Cary Coutant <[email protected]>
9419
9420 * resolve.cc (Symbol_table::resolve): Don't complain about defined
9421 symbols in shared libraries overridden by hidden or internal symbols
9422 in the main program.
9423
2db70501
CD
94242009-08-19 Chris Demetriou <[email protected]>
9425
9426 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
9427 checking source file names in error messages.
9428
f733487b
DK
94292009-08-18 Doug Kwan <[email protected]>
9430
9431 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
9432 an elcpp::Ehdr as parameter. Adjust call to set_target.
9433 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
9434 an elfcpp::Ehdr as parameter.
9435 * object.cc (Object::set_target): Remove the version that looks up
9436 a target and sets it.
9437 (Sized_relobj::setup): Take a Target object instead of
9438 an elfcpp::Ehdr as parameter. Adjust call to set_target.
9439 (make_elf_sized_object): Find target and ask target to
9440 make an ELF object.
9441 * object.h: (Object::set_target): Remove the version that looks up
9442 a target and sets it.
9443 (Sized_relobj::setup): Take a Target object instead of
9444 an elfcpp:Ehdr as parameter.
9445 * target.cc: Include dynobj.h.
9446 (Target::do_make_elf_object_implementation): New.
2e702c99 9447 (Target::do_make_elf_object): New.
f733487b
DK
9448 * target.h (Target::make_elf_object): New template declaration.
9449 (Target::do_make_elf_object): New method declarations.
9450 (Target::do_make_elf_object_implementation): New template declaration.
9451
cc70f101
ILT
94522009-08-14 Ian Lance Taylor <[email protected]>
9453
9454 * gold.h (FUNCTION_NAME): Define.
9455 (gold_unreachable): Use FUNCTION_NAME.
9456
ef5e0cb1
ST
94572009-08-12 Sriraman Tallam <[email protected]>
9458
9459 * icf.cc (Icf::find_identical_sections): Issue a warning when a
9460 symbol in the --keep-unique list is not found.
9461
48c187ce
ST
94622009-08-12 Sriraman Tallam <[email protected]>
9463
9464 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
9465 been maked as --keep-unique.
9466 (Icf::unfold_section): New function.
9467 * icf.h (Icf::unfold_section): New function.
9468 * options.h (General_options::keep_unique): New option.
9469 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
9470 * testsuite/Makefile.in: Regenerate.
9471 * testsuite/icf_keep_unique_test.sh: New file.
9472 * testsuite/icf_keep_unique_test.cc: New file.
9473
645afe0c
CC
94742009-08-12 Cary Coutant <[email protected]>
9475
9476 PR 10471
9477 * resolve.cc (Symbol_table::resolve): Check for references from
9478 dynamic objects to hidden and internal symbols.
9479 * testsuite/Makefile.am (hidden_test.sh): New test.
9480 * testsuite/Makefile.in: Regenerate.
9481 * testsuite/hidden_test.sh: New script.
9482 * testsuite/hidden_test_1.c: New test source.
9483 * testsuite/hidden_test_main.c: New test source.
9484
11af873f
DK
94852009-08-11 Doug Kwan <[email protected]>
9486
9487 * arm.cc: Update comments.
9488 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
9489 segment to locate the .ARM.exidx section if present.
9490
b9f7d72d
DK
94912009-08-09 Doug Kwan <[email protected]>
9492
9493 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
9494 patch.
9495
ddd3c53c
ST
94962009-08-07 Sriraman Tallam <[email protected]>
9497 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
9498 compiler warnings.
9499
27721062
ST
95002009-08-06 Sriraman Tallam <[email protected]>
9501
9502 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
9503 valid tls_segment only for non-debug-section relocations.
9504 * testsuite/Makefile.am: Add gc_tls_test.
9505 * testsuite/Makefile.in: Regenerate.
9506 * testsuite/gc_tls_test.cc: New file.
9507 * testsuite/gc_tls_test.sh: New file.
9508
ef15dade 95092009-08-05 Sriraman Tallam <[email protected]>
e1df38aa 9510
ef15dade
ST
9511 * icf.cc: New file.
9512 * icf.h: New file.
9513 * Makefile.am (CCFILES): Add icf.cc.
9514 (HFILES): Add icf.h
9515 * Makefile.in: Regenerate.
9516 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
9517 * gc.h (gc_process_relocs): Populate lists used by icf to contain
9518 section, symbol and addend information for the relocs.
9519 * gold.cc (queue_middle_tasks): Call identical code folding.
9520 * gold.h: Add defines for multimap.
9521 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
9522 to the call of finalize_local_symbols.
9523 * main.cc (main): Create object of class Icf.
9524 * object.cc (Sized_relobj::do_layout): Allow this function to be
9525 called twice during icf.
9526 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
9527 to sections marked as identical by icf.
9528 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
9529 when available.
9530 (Sized_relobj::do_section_entsize): New function.
9531 * object.h (Object::section_entsize): New function.
9532 (Object::do_section_entsize): New pure virtual function.
9533 (Relobj::finalize_local_symbols): Add new parameter.
9534 (Relobj::do_section_entsize): New function.
9535 * options.h (General_options::icf): New option.
9536 (General_options::icf_iterations): New option.
9537 (General_options::print_icf_sections): New option.
9538 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
9539 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
9540 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
9541 icf.
9542 * symtab.cc (Symbol_table::is_section_folded): New function.
9543 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
9544 to sections marked as identical by icf.
9545 * symtab.h (Symbol_table::set_icf): New function.
9546 (Symbol_table::icf): New function.
9547 (Symbol_table::is_section_folded): New function.
9548 (Symbol_table::icf_): New data member.
9549 * target-reloc.h (relocate_section): Ignore sections folded by icf.
9550 * testsuite/Makefile.am: Add commands to build icf_test.
9551 * testsuite/Makefile.in: Regenerate.
9552 * testsuite/icf_test.sh: New file.
9553 * testsuite/icf_test.cc: New file.
9554
c3b65ac4
CD
95552009-07-24 Chris Demetriou <[email protected]>
9556
9557 * layout.cc (is_compressible_debug_section): Fix incorrect
9558 comment about compressed section names.
9559
1caf2c51
ILT
95602009-07-20 Ian Lance Taylor <[email protected]>
9561
9562 PR 10419
9563 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
9564
1ef4d87f
ILT
95652009-07-16 Ian Lance Taylor <[email protected]>
9566
9567 PR 10400
9568 * layout.h: #include <map>.
9569 (class Kept_section): Change from struct to class. Add accessors
9570 and setters. Add section size to Comdat_group mapping. Change
9571 Comdat_group to std::map. Add is_comdat_ field. Add
9572 linkonce_size field in union.
9573 (class Layout): Update declaration of find_or_add_kept_section.
9574 Don't declare find_kept_object.
9575 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
9576 parameter. Add object, shndx, is_comdat, and is_group_name
9577 parameters. Change all callers. Adjust for new Kept_section.
9578 (Layout::find_kept_object): Remove.
9579 * object.cc (Sized_relobj::include_section_group): Update use of
9580 Kept_section. Rename secnum to shndx. Only record
9581 Kept_comdat_section if sections are the same size.
9582 (Sized_relobj::include_linkonce_section): Update use of
9583 Kept_section. Only record Kept_comdat_section if sections are the
9584 same size. Set size of linkonce section.
9585 (Sized_relobj::map_to_kept_section): Update call to
9586 get_kept_comdat_section.
9587 * object.h (class Sized_relobj): Rename fields in
9588 Kept_comdat_section to drop trailing underscores; change object
9589 field to Relobj*. Change Kept_comdat_section_table to store
9590 struct rather than pointer.
9591 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
9592 Add kept_object and kept_shndx parameters. Change all callers.
9593 (Sized_relobj::get_kept_comdat_section): Change return type to
9594 bool. Add kept_object and kept_shndx parameters. Change all
9595 callers.
9596 * plugin.cc (Pluginobj::include_comdat_group): Update call to
9597 Layout::find_or_add_kept_section.
9598
37c3b7b0
ILT
95992009-07-09 Ian Lance Taylor <[email protected]>
9600
9601 * merge.cc (Object_merge_map::initialize_input_to_output_map):
9602 Reserve space in the hash table.
9603
98fa85cb
ILT
96042009-07-06 Mikolaj Zalewski <[email protected]>
9605
9606 * fileread.cc (File_read::get_mtime): New method.
9607 * fileread.h (Timespec): New structure.
9608 (File_read::get_mtime): New method.
9609 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
9610 Renamed from timestamp_nsec.
9611 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
9612 Elf_Xword.
e1df38aa 9613 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 9614 timestamp_nsec.
e1df38aa 9615 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
9616 (Incremental_inputs::report_obejct): Save mtime; style fix.
9617 (Incremental_inputs::report_script): Save mtime; style fix.
9618 (Incremental_inputs::finalize_inputs): Style fix.
9619 (Incremental_inputs::finalize): Style fix.
9620 (Incremental_inputs::create_input_section_data): Store inputs
9621 mtime.
9622 * incremental.h (Incremental_inputs::report_script): Add mtime
9623 argument.
9624 (Incremental_inputs::Input_info::Input_info): Intialize only one
9625 union member.
9626 (Incremental_inputs::Input_info::archive): Move to nameless
9627 union.
9628 (Incremental_inputs::Input_info::obejct): Move to nameless union.
9629 (Incremental_inputs::Input_info::script): Move to nameless union.
9630 (Incremental_inputs::mtime): New field.
9631 * script.cc (read_input_script): Pass file mtime to
9632 Incremental_input.
9633 * script.h (Script_info::inputs): Style fix.
9634
c9d70757
ILT
96352009-07-01 Ian Lance Taylor <[email protected]>
9636
9637 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
9638 instead of 32.
9639
9c547ec3
ILT
96402009-06-24 Ian Lance Taylor <[email protected]>
9641
9642 PR 10156
9643 * layout.cc (Layout::choose_output_section): If we find an
9644 existing section, update the flags.
9645 (Layout::create_notes): New function, broken out of
9646 Layout::finalize.
9647 (Layout::finalize): Don't create note sections.
9648 (Layout::create_note): Don't crash if linker script discards
9649 section.
9650 (Layout::create_gold_note): Likewise.
9651 (Layout::create_build_id): Likewise. Don't set
9652 after_input_sections on the section.
9653 (Layout::create_executable_stack_info): Remove target parameter.
9654 Change caller.
9655 * layout.h (class Layout): Declare create_notes. Update
9656 declaration of create_executable_stack_info.
9657 * gold.cc (queue_middle_tasks): Call create_notes.
9658 * output.cc (Output_section::update_flags_for_input_section): Move
9659 here from output.h. If SHF_ALLOC flag is newly set, mark address
9660 invalid.
9661 * output.h (Output_data::mark_address_invalid): New function.
9662 (class Output_section): Only declare, not define,
9663 update_flags_for_input_section. Remove set_flags.
9664
55458500
ILT
96652009-06-24 Ian Lance Taylor <[email protected]>
9666
9667 * script-sections.cc (Output_section_definition::
9668 set_section_addresses): Rename shadowing local load_address to
9669 laddr.
9670
1307d6cd
ILT
96712009-06-24 Ian Lance Taylor <[email protected]>
9672
9673 PR 10244
9674 * reloc.cc (relocate_sections): Skip empty relocation sections.
9675
ec3f783e
ILT
96762009-06-23 Ian Lance Taylor <[email protected]>
9677
9678 PR 10156
9679 * layout.cc (Layout::create_note): Use choose_output_section
9680 rather than make_output_section.
9681
459c9f1c
ILT
96822009-06-23 Ian Lance Taylor <[email protected]>
9683
9684 PR 10237
9685 * options.cc (General_options::parse_V): Set printed_version_.
9686 (General_options::General_options): Initialize printed_version_.
9687 * options.h (class General_options): Add printed_version_ field.
9688 * gold.cc (queue_initial_tasks): If there are no input files,
9689 don't give a fatal error if we printed the version information.
9690 (queue_middle_tasks): If using -r with a shared object, give a
9691 fatal error rather than an ordinary error.
9692
1518dc8f
ILT
96932009-06-23 Ian Lance Taylor <[email protected]>
9694
9695 PR 10219
9696 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
9697 (Layout::make_output_section): Set have_stabstr_section_ if we see
9698 a .stab*str section.
9699 (Layout::finalize): Call link_stabs_sections.
9700 (Layout::link_stabs_sections): New file.
9701 * layout.h (class Layout): Add have_stabstr_section_ field.
9702 Declare link_stabs_sections.
9703
3d857b98
DK
97042009-06-23 Doug Kwan <[email protected]>
9705
9706 * Makefile.am (libgold_a_LIBADD): New.
9707 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 9708 * Makefile.in: Regenerate.
3d857b98
DK
9709 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
9710 * configure: Regenerate.
9711 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
9712 * fileread.cc: Include sys/state.h
9713 * gold.h: Declare memmem and strndup if found missing.
9714 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
9715
0639a6f6
ILT
97162009-06-23 Ian Lance Taylor <[email protected]>
9717
9718 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
9719 * configure: Rebuild.
9720
8d63875c
ILT
97212009-06-23 Ian Lance Taylor <[email protected]>
9722
9723 PR 10147
9724 * object.cc (Object::section_contents): Don't try to get a view if
9725 the section has length zero.
9726 (Object::handle_gnu_warning_section): If the section is empty, use
9727 the name of the section as the warning.
9728
f7c8a183
ILT
97292009-06-23 Ian Lance Taylor <[email protected]>
9730
9731 PR 10133
9732 * stringpool.h (class Stringpool_template): Add optimize_ field.
9733 (Stringpool_template::set_optimize): New function.
9734 * stringpool.cc (Stringpool_template::Stringpool_template):
9735 Initialize optimize_ field.
9736 (Stringpool_template::set_string_offsets): Test local optimize
9737 fild rather than parameter.
9738 * layout.cc (Layout::Layout): Call set_optimize on the section
9739 name stringpool.
9740
e6a307ba
ILT
97412009-06-22 Ian Lance Taylor <[email protected]>
9742
9743 PR 10030
9744 * yyscript.y: Parse TARGET.
9745 * script.cc (script_set_target): New function.
9746 * script-c.h (script_set_target): Declare.
9747 * options.cc (General_options::string_to_object_format): Rename
9748 from string_to_object_format in anonymous namespace. Change
9749 callers.
9750 * options.h (class General_options): Declare
9751 string_to_object_format.
9752
3ee173de
ILT
97532009-06-22 Ian Lance Taylor <[email protected]>
9754
9755 * script-sections.cc (Script_sections::create_segments): Don't put
9756 program headers in a PT_LOAD segment if -n or -N.
9757
97582009-06-22 Ian Lance Taylor <[email protected]>
e1c74d60
ILT
9759
9760 PR 10141
9761 * options.h (class General_options): Add -z lazy and -z now. Sort
9762 -z options into alphabetical order.
9763 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
9764
cd6739a1 97652009-06-21 Ian Lance Taylor <[email protected]>
8a5e3e08
ILT
9766
9767 * layout.cc (Layout::make_output_section): Call
9768 Target::new_output_section.
9769 (Layout::attach_allocated_section_to_segment): Put large section
9770 sections in a separate load segment with the large segment flag
9771 set.
9772 (Layout::segment_precedes): Sort large data segments after other
9773 load segments.
9774 (align_file_offset): New static function.
9775 (Layout::set_segment_offsets): Use align_file_offset.
9776 * output.h (class Output_section): Add is_small_section_ and
9777 is_large_section_ fields.
9778 (Output_section::is_small_section): New function.
9779 (Output_section::set_is_small_section): New function.
9780 (Output_section::is_large_section): New function.
9781 (Output_section::set_is_large_section): New function.
9782 (Output_section::is_large_data_section): New function.
9783 (class Output_segment): Add is_large_data_segment_ field.
9784 (Output_segment::is_large_data_segment): New function.
9785 (Output_segment::set_is_large_data_segment): New function.
9786 * output.cc (Output_section::Output_section): Initialize new
9787 fields.
9788 (Output_segment::Output_segment): Likewise.
9789 (Output_segment::add_output_section): Add assertion that large
9790 data sections always go in large data segments. Force small data
9791 sections to the end of the list of data sections. Force small BSS
9792 sections to the start of the list of BSS sections. For large BSS
9793 sections to the end of the list of BSS sections.
9794 * symtab.h (class Symbol): Declare is_common_shndx.
9795 (Symbol::is_defined): Check Symbol::is_common_shndx.
9796 (Symbol::is_common): Likewise.
9797 (class Symbol_table): Define enum Commons_section_type. Update
9798 declarations. Add small_commons_ and large_commons_ fields.
9799 * symtab.cc (Symbol::is_common_shndx): New function.
9800 (Symbol_table::Symbol_table): Initialize new fields.
9801 (Symbol_table::add_from_object): Put small and large common
9802 symbols in the right list.
9803 (Symbol_table::sized_finalized_symbol): Check
9804 Symbol::is_common_shndx.
9805 (Symbol_table::sized_write_globals): Likewise.
9806 * common.cc (Symbol_table::do_allocate_commons): Allocate new
9807 common symbol lists. Don't call do_allocate_commons_list if the
9808 list is empty.
9809 (Symbol_table::do_allocate_commons_list): Remove is_tls
9810 parameter. Add comons_section_type parameter. Change all
9811 callers. Handle small and large common symbols.
9812 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
9813 Symbol::is_common_shndx.
9814 * resolve.cc (symbol_to_bits): Likewise.
9815 * target.h (Target::small_common_shndx): New function.
9816 (Target::small_common_section_flags): New function.
9817 (Target::large_common_shndx): New function.
9818 (Target::large_common_section_flags): New function.
9819 (Target::new_output_section): New function.
9820 (Target::Target_info): Add small_common_shndx, large_common_shndx,
9821 small_common_section_flags, and large_common_section_flags
9822 fields.
9823 (Target::do_new_output_section): New virtual function.
9824 * arm.cc (Target_arm::arm_info): Initialize new fields.
9825 * i386.cc (Target_i386::i386_info): Likewise.
9826 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
9827 Likewise.
9828 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
9829 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
9830 (Target_x86_64::do_new_output_section): New function.
9831 * configure.ac: Define conditional MCMODEL_MEDIUM.
9832 * testsuite/Makefile.am (check_PROGRAMS): Add large.
9833 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
9834 (large_LDFLAGS): Define.
9835 * testsuite/large.c: New file.
9836 * testsuite/testfile.cc (Target_test::test_target_info):
9837 Initialize new fields.
9838 * configure, testsuite/Makefile.in: Rebuild.
9839
bb04269c
DK
98402009-06-05 Doug Kwan <[email protected]>
9841
9842 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 9843 * Makefile.in: Regenerate.
bb04269c
DK
9844 * i386.cc (class Target_i386): Define new virtual method to
9845 override do_is_local_label_name in parent.
9846 * object.cc (Sized_relobj::do_count_local_symbols): Discard
9847 local symbols if --discard-locals or -X is given.
9848 * options.h (class General_options): Declare new options
9849 '--discard-locals' and '-X' for discarding locals.
9850 * target.h (class Target): Define new methods is_local_label_name.
9851 Declare new virtual method do_is_local_label_name.
9852 * target.cc: New file.
9853 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
9854 (check_SCRIPTS): Add discard_locals_test.sh.
9855 (check_DATA): Add discard_local_tests.syms.
9856 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
9857 (discard_local_tests.syms, discard_locals_test.o): New make rules.
9858 * testsuite/Makefile.in: Regenerate.
9859 * testsuite/discard_locals_test.c: New file.
9860 * testsuite/discard_locals_test.sh: Same.
9861
805bb01c
DK
98622009-06-05 Doug Kwan <[email protected]>
9863
9864 * object.cc (Sized_relobj::Sized_relobj): Initialize
9865 discarded_eh_frame_shndx_ to -1U.
9866 (Sized_relobj::do_layout): Record index of a discard .eh_frame
9867 section.
9868 (Sized_relobj::do_count_local_symbols): Skip local symbols in
9869 a discarded .eh_frame section.
9870 (Sized_relobj::do_finalize_local_symbols): Ditto.
9871 * object.h (class Sized_relobj): Declare new member
9872 discarded_eh_frame_shndx_.
9873 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
9874 (local_labels_test.o, local_labels_test): New rules.
9875 * testsuite/Makefile.in: Regenerate.
9876
1dcd334d
DK
98772009-06-04 Doug Kwan <[email protected]>
9878
9879 * layout.cc (Layout::section_name_mapping): Add mapping for
9880 special ARM sections.
9881
96d49306
DK
98822009-06-03 Doug Kwan <[email protected]>
9883
9884 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
9885 (utils::has_overflow): Same.
9886
dff16297
ILT
98872009-06-03 Ian Lance Taylor <[email protected]>
9888
9889 * layout.cc (Layout::section_name_mapping): New array, replacing
9890 Layout::linkonce_mapping.
9891 (Layout::section_name_mapping_count): New variable, replacing
9892 Layout::linkonce_mapping_count.
9893 (Layout::linkonce_output_name): Remove.
9894 (Layout::output_section_name): Rewrite.
9895 * layout.h (class Layout): Rename Linkonce_mapping to
9896 Section_name_mapping, linkonce_mapping to section_name_mapping,
9897 linkonce_mapping_count to section_name_mapping_count. Don't
9898 declare linkonce_output_name.
9899
c121c671
DK
99002009-06-03 Doug Kwan <[email protected]>
9901
9902 * gold/arm.cc (namespace utils): New.
9903 (Target_arm::reloc_is_non_pic): Define new method.
9904 (class Arm_relocate_functions): New.
9905 (Target_arm::Relocate::relocate): Handle relocation types used by
9906 Android.
9907
07800fab
ILT
99082009-06-03 Ian Lance Taylor <[email protected]>
9909
9910 * arm.cc (Target_arm::scan::global): Use || instead of |.
9911
c121c671
DK
99122009-06-02 Doug Kwan <[email protected]>
9913
9914 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
9915 issued_non_pic_error_.
9916 (class Target_arm::Scan): Declare new method check_non_pic.
9917 Define new method symbol_needs_plt_entry.
9918 Declare new data member issued_non_pic_error_.
9919 (class Target_arm::Relocate): Declare new method
9920 should_apply_static_reloc.
9921 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
9922 (Target_arm::Scan::check_non_pic): Define new method.
9923 (Target_arm::Scan::local): Handle a small subset of reloc types used
9924 by Android.
9925 (Target_arm::Scan::local): Same.
9926 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
9927
b19b0c6d
ILT
99282009-05-31 Mikolaj Zalewski <[email protected]>
9929
9930 * incremental.cc (Incremental_inputs::report_command_line): Filter
9931 out --incremental-* options.
9932
94cdfcff
DK
99332009-05-29 Doug Kwan <[email protected]>
9934
9935 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
9936 template class.
9937 (class Target_arm): Update comment.
9938 (Target_arm::Target_arm): Initialize new data members GOT_,
9939 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
9940 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
9941 and Target_arm::rel_dyn_section.
9942 Declare new_enum Target_arm::Got_type.
9943 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
9944 and DYNBSS_.
9945 Update commments for member do_dynsym_value.
9946 (Target_arm::got_size, Target_arm::plt_section,
9947 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
9948 new methods inside class defintion.
9949 (Target_arm::got_section): Define new method.
9950 (Target_arm::rel_dyn_section): Same.
9951 (Output_data_plt_arm): New template class.
9952 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
9953 (Output_data_plt_arm:do_adjust_output_section): Define new method.
9954 (Output_data_plt_arm::add_entry): Same.
9955 (Output_data_plt_arm::first_plt_entry): Define new
9956 static data member for PLT instruction template.
9957 (Output_data_plt_arm::plt_entry): Same.
9958 (Output_data_plt_arm::do_write): Define new method.
9959 (Target_arm::make_plt_entry): Same.
9960 (Target_arm::do_finalize_sections): Same.
9961 (Target_arm::do_dynsym_value): Same.
9962
4a657b0d
DK
99632009-05-28 Doug Kwan <[email protected]>
9964
9965 * Makefile.am (TARGETSOURCES): Add arm.cc.
9966 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
9967 * Makefile.in: Regenerate.
9968 * arm.cc: New file.
9969 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
9970
e7ae8c36
DK
99712009-05-26 Doug Kwan <[email protected]>
9972
9973 * options.cc (General_options::parse_exclude_libs). Fix a comment.
9974 (General_options::check_excluded_libs): Strip off directories in
9975 archive name before matching like GNU ld does.
9976 * testsuite/Makefile.am (MOSTLYCLEANFILES,
9977 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
9978 (exclude_libs_test_LDFLAGS): Add linker option
9979 -Wl,--exclude-libs,libexclude_libs_test_3
9980 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
9981 an explicit archive without using -l.
9982 (alt/libexclude_libs_test_3.a): New make rule.
9983 * testsuite/Makefile.in: Regenerate.
9984 * testsuite/exclude_libs_test.c : Declare lib3_default().
9985 (main): Call it.
9986 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
9987 * exclude_libs_test_3.c: New file.
9988
f12e7348
NC
99892009-05-26 Nick Clifton <[email protected]>
9990
9991 * po/id.po: New Indonesian translation.
9992 * po/gold.pot: Updated template file.
9993
4daadc0d
ST
99942009-05-22 Sriraman Tallam <[email protected]>
9995
e1df38aa 9996 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
9997 gc_comdat_test files. Add -Wl,--gc-sections to build
9998 gc_comdat_test.
9999 * testsuite/Makefile.in: Regenerate.
10000 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
10001
531813ad
ST
100022009-05-21 Sriraman Tallam <[email protected]>
10003
10004 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
10005 kept comdat section was garbage collected.
10006 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
10007 * testsuite/Makefile.in: Regenerate.
10008 * testsuite/gc_comdat_test.sh: New file.
10009 * testsuite/gc_comdat_test_1.cc: New file.
10010 * testsuite/gc_comdat_test_2.cc: New file.
10011
65514900
CC
100122009-05-19 Doug Kwan <[email protected]>
10013
10014 * archive.cc (Archive::Archive): Move constructor from archive.h
10015 to here. Initialize no_export_.
10016 (Archive::get_elf_object_for_member): Set no_export flag of object.
10017 * archive.h (Archive::Archive): Move constructor body to
10018 archive.cc.
10019 (Archive::no_export): New method.
10020 (Archive::no_export_): New field.
10021 * object.h (Object::Object): Initialize no_export_ to false.
10022 (Object::no_export, Object::set_no_export): New methods.
10023 (Object::no_export_): New field.
10024 * options.cc (General_options::parse_exclude_libs): New method.
10025 (General_options::check_excluded_libs) Same.
10026 * options.h (exclude_libs): New option.
10027 (General_options::check_excluded_libs): New method declaration.
10028 (General_options::excluded_libs_): New field.
10029 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
10030 default or protected visibility if an object has no-export flag set.
10031 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
10032 (check_SCRIPTS): Add exclude_libs_test.sh.
10033 (check_DATA): Add exclude_libs_test.syms.
10034 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
10035 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
10036 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
10037 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
10038 (exclude_libs_test.syms, libexclude_libs_test_1.a,
10039 libexclude_libs_test_2.a): New rules.
10040 * testsuite/Makefile.in: Regenerate.
10041 * testsuite/exclude_libs_test.c: New file.
10042 * testsuite/exclude_libs_test.sh: Ditto.
10043 * testsuite/exclude_libs_test_1.c: Ditto.
10044 * testsuite/exclude_libs_test_2.c: Ditto.
10045
1b77ea50
ILT
100462009-05-15 Ian Lance Taylor <[email protected]>
10047
10048 * configure.ac: Check for declarations for cases where libiberty.h
10049 checks HAVE_DECL_xxx.
10050 * configure, config.in: Rebuild.
10051
072fe7ce
ILT
100522009-05-15 Mikolaj Zalewski <[email protected]>
10053
10054 * gold.h (Incremental_argument_list): Remove (invalid) forward
10055 declaration.
10056 * incremental.cc (Incremental_inputs::report_achive): New method.
10057 (Incremental_inputs::report_object): New method.
10058 (Incremental_inputs::report_script): New method.
10059 (Incremental_inputs::finalize_inputs): New method.
10060 (Incremental_inputs::finalize): Call finalize_inputs().
10061 (Incremental_inputs::sized_create_incremental_inputs_section_data):
10062 Create inputs entries.
10063 * incremental.h (Incremental_input_type): New enum.
10064 (Incremental_inputs::Incremental_input): Initialize new fields.
10065 (Incremental_inputs::report_inputs): New method.
10066 (Incremental_inputs::report_achive): New method.
10067 (Incremental_inputs::report_object): New method.
10068 (Incremental_inputs::report_script): New method.
10069 (Incremental_inputs::finalize_inputs): New method.
10070 (Incremental_inputs::Input_info): New struct.
10071 (Incremental_inputs::Input_info_map): New typedef.
10072 (Incremental_inputs::lock_): New field.
10073 (Incremental_inputs::Inputs_): New field.
10074 (Incremental_inputs::Inputs_map): New field.
10075 * main.cc (main): Call Incremental_input::report_inputs.
10076 * options.h (Input_argument_list): Typedef moved from
10077 Input_arguments.
10078 (Input_file_group::Files): Remove, use ::Input_argument_list.
10079 (Input_file_group::Input_argument_list): Remove, use
10080 ::Input_argument_list.
10081 * plugin.cc (Plugin_manager::add_input_file): Add error in
10082 incremental build.
10083 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
10084 functions.
10085 * script.cc (read_input_script): Call
10086 Incremental_input::report_script.
10087 * script.h (Script_info): New class.
10088
b0481b0b
ILT
100892009-04-27 Ian Lance Taylor <[email protected]>
10090
10091 * x86_64.cc (do_adjust_output_section): Set entsize to
10092 plt_entry_size.
10093
b22a5a41 100942009-04-23 Elliott Hughes <[email protected]>
6d1e3092
CD
10095
10096 * output.cc (Output_file::close): After short writes, continue
10097 writing from the correct offset in the buffer being written.
10098
40fde488
CD
100992009-04-23 Chris Demetriou <[email protected]>
10100
10101 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
10102 * configure: Regenerate.
10103 * config.in: Regenerate.
10104 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
10105 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
10106
3ce2c28e
ILT
101072009-04-21 Mikolaj Zalewski <[email protected]>
10108
10109 * incremental.cc (Incremental_inputs_header_data): Renamed from
10110 Incremental_input_header_data.
10111 (Incremental_inputs_header_data::data_size): New field.
10112 (Incremental_inputs_header_data::put_input_file_count): Renamed
10113 from input_file_count.
10114 (Incremental_inputs_header_data::put_command_line_offset): Renamed
10115 from command_line_offset.
10116 (Incremental_inputs_header_data::put_reserved): Renamed from
10117 put_reserved.
10118 (Incremental_inputs_entry_data): Renamed from
10119 Incremental_input_entry_data.
10120 (Incremental_inputs_entry_data::data_size): New field.
10121 (Incremental_inputs::report_command_line): New method.
10122 (Incremental_inputs::finalize): New method.
10123 (Incremental_inputs::create_incremental_inputs_data): New method.
10124 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
10125 * incremental.h: New file.
10126 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
10127 (Layout::finalize): Create incremental inputs section in
10128 incremental builds.
10129 (Layout::create_incremental_info_sections): New method.
10130 * layout.h (Layout::incremental_inputs): New method.
10131 (Layout::create_incremental_info_sections): New method.
10132 (Layout::incremental_inputs_): New field.
10133 * main.cc (main): Notify Incremental_input of the command line.
10134
e55bde5e
ILT
101352009-04-01 Ian Lance Taylor <[email protected]>
10136 Mikolaj Zalewski <[email protected]>
10137
10138 * gold.h (reserve_unordered_map): Define, three versions, one for
10139 each version of Unordered_map.
10140 * layout.cc (Layout::Layout): Remove options parameter. Add
10141 number_of_input_files parameter. Don't initialize options_.
10142 Initialize number_of_input_files_ and resized_signatures_. Move
10143 sections_are_attached_.
10144 (Layout::layout_group): Reserve space for group_signatures_.
10145 (Layout::find_or_add_kept_section): Change name parameter to be a
10146 reference. Resize signatures_ map when it gets large enough.
10147 (Layout::layout_eh_frame): Use parameters->options() instead of
10148 this->options_.
10149 (Layout::make_output_section): Likewise.
10150 (Layout::attach_allocated_section_to_segment): Likewise.
10151 (Layout::finalize, Layout::create_executable_stack): Likewise.
10152 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
10153 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
10154 * layout.h (class Layout): Update declarations. Remove options_
10155 field. Add number_of_input_files_ and resized_signatures_
10156 fields. Move sections_are_attached_ field.
10157 * main.cc (main): Pass number of input files to Layout
10158 constructor. Don't pass options.
10159
154b857c
ILT
101602009-03-30 Ian Lance Taylor <[email protected]>
10161
10162 * ffsll.c (ffsll): Correct implementation.
10163
2f35ab9b
ILT
101642009-03-27 Ian Lance Taylor <[email protected]>
10165
fd03461a
ILT
10166 * ffsll.c: New file.
10167 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
10168 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
10169 * ftruncate.c (ftruncate): Declare before definition.
10170 * mremap.c (mremap): Likewise.
10171 * pread.c (pread): Likewise.
10172 * configure, Makefile.in, config.in: Rebuild.
10173
2f35ab9b
ILT
10174 * mremap.c: New file.
10175 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
10176 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
10177 (mremap): Declare if HAVE_MREMAP is not defined.
10178 * configure, Makefile.in, config.in: Rebuild.
10179
33aea2fd
CC
101802009-03-27 Cary Coutant <[email protected]>
10181
10182 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
10183 position independent.
10184 * sparc.cc (Target_sparc::check_non_pic): Likewise.
10185 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
10186
6d479619
CC
101872009-03-24 Cary Coutant <[email protected]>
10188
10189 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
10190 an executable.
10191 (needs_dynamic_reloc): Likewise.
10192
afc06bb8
ILT
101932009-03-24 Ian Lance Taylor <[email protected]>
10194
10195 * yyscript.y (file_cmd): Recognize EXTERN.
10196 (extern_name_list, extern_name_list_body): New nonterminals.
10197 * script.cc (script_add_extern): Define.
10198 * script-c.h (script_add_extern): Declare.
10199
f6060a4d
ILT
102002009-03-24 Rafael Avila de Espindola <[email protected]>
10201
10202 * object.cc (is_elf_object): Define.
10203 * object.h (is_elf_object): Declare.
10204 * archive.cc (Archive::get_elf_object_for_member): Call
10205 is_elf_object.
33aea2fd 10206 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 10207
26736d8e
ILT
102082009-03-24 Elliott Hughes <[email protected]>
10209
10210 * output.cc (Output_file::map_anonymous): Define.
10211 (Output_file::map): Use map_anonymous. If the regular mmap fails,
10212 try an anonymous one. Report the size if the mmap fails.
10213 * output.h (class Output_file): Declare map_anonymous.
10214
22fd9730
ILT
102152009-03-24 Ian Lance Taylor <[email protected]>
10216
10217 * target-select.cc (instantiate_target): Don't acquire the lock if
10218 the instantiated_target_ field has already been set.
10219
cb010894
ILT
102202009-03-23 Ian Lance Taylor <[email protected]>
10221
7f055c20
ILT
10222 * gold-threads.h (class Initialize_lock): Define.
10223 * gold-threads.cc (class Initialize_lock_once): Define.
10224 (initialize_lock_control): New static variable.
10225 (initialize_lock_pointer): New static variable.
10226 (initialize_lock_once): New static function.
10227 (Initialize_lock::Initialize_lock): Define.
10228 (Initialize_lock::initialize): Define.
10229 * target-select.h: Include "gold-threads.h".
10230 (class Target_selector): Add lock_ and initialize_lock_ fields.
10231 Don't define instantiate_target, just declare it.
10232 * target-select.cc (Target_selector::Target_selector): Initialize
10233 new fields.
10234 (Target_selector::instantiate_target): Define.
10235 * descriptors.h: Include "gold-threads.h".
10236 (class Descriptors): Add initialize_lock_ field.
10237 * descriptors.cc (Descriptors::Descriptors): Initialize new
10238 field.
10239 (Descriptors::open): Use initialize_lock_ field
10240 * errors.h (class Errors): Add initialize_lock_ field.
10241 * errors.cc (Errors::Errors): Initialize new field.
10242 (Errors::initialize_lock): Use initialize_lock_ field.
10243 * powerpc.cc (class Target_selector_powerpc): Remove
10244 instantiated_target_ field. In do_recognize call
10245 instantiate_target rather than do_instantiate_target. In
10246 do_instantiate_target just allocate a new target.
10247 * sparc.cc (class Target_selector_sparc): Likewise.
10248
36959681
ILT
10249 * freebsd.h: New file.
10250 * i386.cc: Include "freebsd.h".
10251 (Target_i386): Derive from Target_freebsd rather than
10252 Sized_target.
10253 (Target_selector_i386): Derive from Target_selector_freebsd rather
10254 than Target_selector.
10255 * x86_64.cc: Include "freebsd.h".
10256 (Target_x86_64): Derive from Target_freebsd rather than
10257 Sized_target.
10258 (Target_selector_x86_64): Derive from Target_selector_freebsd
10259 rather than Target_selector.
10260 * target.h (class Target): Add adjust_elf_header and
10261 do_adjust_elf_header.
10262 * output.cc (Output_file_header:: do_sized_write): Call target
10263 adjust_elf_header routine.
10264 * configure.tgt: Set targ_osabi.
10265 * configure.ac: Define GOLD_DEFAULT_OSABI.
10266 * parameters.cc (Parameters::default_target): Pass
10267 GOLD_DEFAULT_OSABI to select_target.
10268 * target-select.h (class Target_selector): Make instantiate_target
10269 protected rather than private.
10270 * Makefile.am (HFILES): Add freebsd.h.
10271 * configure, Makefile.in, config.in: Rebuild.
10272
cb010894
ILT
10273 * merge.cc (do_add_input_section): Correct pend value. Change
10274 message about last entry not being null terminated from error to
10275 warning.
10276
0e879927
ILT
102772009-03-20 Mikolaj Zalewski <[email protected]>
10278
10279 * incremental.cc: New file.
10280 * Makefile.am (CCFILES): Add incremental.cc.
10281 * Makefile.in: Rebuild.
10282
41105937
PP
102832009-03-19 Paul Pluzhnikov <[email protected]>
10284
10285 * layout.cc (Layout::output_section_name): Preserve names
10286 of '.note.' sections.
e1df38aa 10287
60439920
ILT
102882009-03-19 Ian Lance Taylor <[email protected]>
10289
10290 * descriptors.cc (Descriptors::open): Check that the options are
10291 valid before using them.
10292
0d371ad3
ILT
102932009-03-18 Ian Lance Taylor <[email protected]>
10294
10295 * script-sections.h: Include <list>.
10296 (class Script_sections): Change Sections_elements from std::vector
10297 to std::list. Typedef public Elements_iterator. Add
10298 orphan_section_placement_, data_segment_align_start_, and
10299 saw_data_segment_align_ fields. Remove data_segment_align_index_
10300 field.
10301 * script-sections.cc (class Orphan_section_placement): New class.
10302 (class Sections_element): Add virtual functions is_relro and
10303 orphan_section_init. Remove virtual function place_orphan_here.
10304 (class Output_section_definition): Add is_relro and
10305 orphan_section_init. Remove place_orphan_here.
10306 (class Orphan_output_section): Likewise.
10307 (Script_sections::Script_sections): Update for field changes.
10308 (Script_sections::data_segment_align): Set saw_data_segment_align_
10309 and data_segment_align_start_, not data_segment_align_index.
10310 (Script_sections::data_segment_relro_end): Check
10311 saw_data_segment_align_. Use data_segment_align_start_ rather
10312 than data_segment_align_index_.
10313 (Script_sections::place_orphan): Rewrite to use
10314 Orphan_section_placement.
10315
9201d894
ILT
103162009-03-17 Ian Lance Taylor <[email protected]>
10317
9c5b8369
ILT
10318 * archive.cc (Archive::add_symbols): Check for a version attached
10319 to the symbol name in the archive map.
10320 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
10321 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
10322 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
10323 (ver_test_11.a): New target.
10324 * testsuite/Makefile.in: Rebuild.
10325
9201d894
ILT
10326 * configure.ac: Check for chsize and posix_fallocate. Replace
10327 ftruncate.
10328 * ftruncate.c: New file, from gnulib.
10329 * output.cc (posix_fallocate): Define dummy version if not
10330 HAVE_POSIX_FALLOCATE.
10331 (Output_file::map): Call posix_fallocate rather than lseek and
10332 write.
10333 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
10334 * configure, Makefile.in, config.in: Rebuild.
10335
ef4ab7a8 103362009-03-17 Paul Pluzhnikov <[email protected]>
e1df38aa 10337
ef4ab7a8
PP
10338 * layout.h (Layout::create_note): Add section_name parameter.
10339 * layout.cc (Layout::create_note): Likewise.
10340 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 10341
8c500701
ILT
103422009-03-17 Ian Lance Taylor <[email protected]>
10343
e85b18e1
ILT
10344 * descriptors.cc: Include "options.h".
10345 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
10346 (Descriptors::open): Always use O_CLOEXEC when opening a new
10347 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
10348 then set FD_CLOEXEC.
10349
9efe6174
ILT
10350 * sparc.cc (class Target_sparc): Add has_got_section.
10351 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
10352 make sure we have a GOT section.
10353
10354 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
10355 (Target_sparc::Scan::local): Likewise.
10356 (Target_sparc::Scan::global): Likewise.
10357 (Target_sparc::Relocate::relocate): Likewise.
10358 (Target_sparc::Relocate::relocate_tls): Likewise.
10359
8c500701
ILT
10360 * symtab.cc (Symbol_table::define_default_version): New function,
10361 broken out of add_from_object.
10362 (Symbol_table::add_from_object): Call define_default_version.
10363 (Symbol_table::define_special_symbol): Add resolve_oldsym
10364 parameter. Change all callers. If the version for a symbol comes
10365 from a version script, resolve it with the symbol with the same
10366 name with no version. Also add the symbol without a version if
10367 appropriate.
10368 (do_define_in_output_data): If resolving with oldsym, don't delete
10369 sym.
10370 (do_define_in_output_segment): Likewise.
10371 (do_define_as_constant): Likewise.
10372 * symtab.h (class Symbol_table): Update declarations.
10373
f1ed28fb
ILT
103742009-03-13 Ian Lance Taylor <[email protected]>
10375
15f8229b
ILT
10376 * readsyms.cc (Read_symbols::incompatible_warning): New function.
10377 (Read_symbols::requeue): New function.
10378 (Read_symbols::do_read_symbols): If make_elf_object fails because
10379 the target type is not configured, and the file was searched for,
10380 issue a warning and retry with the next directory.
10381 (Add_symbols::run): If the file has an incompatible format, and
10382 it was searched for, requeue the Read_symbols task. On error,
10383 release the object.
10384 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
10385 dirindex parameter to constructor. Change all callers. Declare
10386 incompatible_warning and requeue.
10387 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
10388 input_argument_ and input_group_ fields. Add them to
10389 constructor. Change all callers.
10390 (class Read_script): Add dirindex_ field. Add it to constructor.
10391 Change all callers.
10392 * archive.cc (Archive::setup): Remove input_objects parameter.
10393 Change all callers.
10394 (Archive::get_file_and_offset): Likewise.
10395 (Archive::read_all_symbols): Likewise.
10396 (Archive::read_symbols): Likewise.
10397 (Archive::get_elf_object_for_member): Remove input_objects
10398 parameter. Add punconfigured parameter. Change all callers.
10399 (Archive::add_symbols): Change return type to bool. Check return
10400 value of include_member.
10401 (Archive::include_all_members): Likewise.
10402 (Archive::include_member): Change return type to bool. Return
10403 false if first included object has incompatible target. Set
10404 included_member_ field.
10405 (Add_archive_symbols::run): If add_symbols returns false, requeue
10406 Read_symbols task.
10407 * archive.h (class Archive): Add included_member_ field.
10408 Initialize it in constructor. Add input_file and searched_for
10409 methods. Update declarations.
10410 (class Add_archive_symbols): Add dirpath_, dirindex_, and
10411 input_argument_ fields. Add them to constructor. Change all
10412 callers.
10413 * script.cc: Include "target-select.h".
10414 (class Parser_closure): Add skip_on_incompatible_target_ and
10415 found_incompatible_target_ fields. Add
10416 skip_on_incompatible_target parameter to constructor. Change all
10417 callers. Add methods skip_on_incompatible_target,
10418 clear_skip_on_incompatible_target, found_incompatible_target, and
10419 set_found_incompatible_target.
10420 (read_input_script): Add dirindex parameter. Change all callers.
10421 If parser finds an incompatible target, requeue Read_symbols
10422 task.
10423 (script_set_symbol): Clear skip_on_incompatible_target in
10424 closure.
10425 (script_add_assertion, script_parse_option): Likewise.
10426 (script_start_sections, script_add_phdr): Likewise.
10427 (script_check_output_format): New function.
10428 * script.h (read_input_script): Update declaration.
10429 * script-c.h (script_check_output_format): Declare.
10430 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
10431 (ignore_cmd): Remove OUTPUT_FORMAT.
10432 * fileread.cc (Input_file::Input_file): Add explicit this.
10433 (Input_file::will_search_for): New function.
10434 (Input_file::open): Add pindex parameter. Change all callers.
10435 * fileread.h (class Input_file): Add input_file_argument method.
10436 Declare will_search_for. Update declarations.
10437 * object.cc (make_elf_object): Add punconfigured parameter.
10438 Change all callers.
10439 * object.h (class Object): Make input_file public. Add
10440 searched_for method.
10441 (make_elf_object): Update declaration.
10442 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
10443 restart search.
10444 * dirsearch.h (class Dirsearch): Update declaration.
10445 * options.h (class General_options): Add --warn-search-mismatch.
10446 * parameters.cc (Parameters::is_compatible_target): New function.
10447 * parameters.h (class Parameters): Declare is_compatible_target.
10448 * workqueue.cc (Workqueue::add_blocker): New function.
10449 * workqueue.h (class Workqueue): Declare add_blocker.
10450
f1ed28fb
ILT
10451 * fileread.cc (Input_file::open): Remove options parameter.
10452 Change all callers.
10453 (Input_file::open_binary): Likewise.
10454 * script.cc (read_input_script): Likewise.
10455 * readsyms.h (class Read_symbols): Remove options_ field. Remove
10456 options parameter from constructor. Change all callers.
10457 (class Read_script): Likewise.
10458 * fileread.h (class Input_file): Update declarations.
10459 * script.h (read_input_script): Update declaration.
10460
34dd024a
NC
104612009-03-10 Nick Clifton <[email protected]>
10462
10463 * po/es.po: New Spanish translation.
10464
6d71b17c
CC
104652009-03-06 Cary Coutant <[email protected]>
10466
10467 * options.cc (parse_short_option): Keep dash_z from registering itself.
10468
031cdbed
ILT
104692009-03-03 Ian Lance Taylor <[email protected]>
10470
10471 PR 9918
10472 * target-reloc.h (relocate_section): Pass output_section to
10473 relocate.
10474 * i386.cc (Target_i386::should_apply_static_reloc): Add
10475 output_section parameter. Change all callers.
10476 (Target_i386::Relocate::relocate): Add output_section parameter.
10477 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10478 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
10479 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
10480 * testsuite/two_file_shared.sh: New script.
10481 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
10482 (check_DATA): Add two_file_shared.dbg.
10483 (two_file_shared.dbg): New target.
10484 * testsuite/Makefile.in: Rebuild.
10485
15d5fa16
ILT
104862009-03-01 Ian Lance Taylor <[email protected]>
10487
10488 * configure.ac: Check for byteswap.h.
10489 * configure: Rebuild.
10490 * config.in: Rebuild.
10491
8a4c0b0d
ILT
104922009-03-01 Mikolaj Zalewski <[email protected]>
10493
10494 * layout.cc (Layout::find_or_add_kept_section): New function.
10495 (Layout::add_comdat): Removed.
10496 * layout.h (struct Kept_section): Move out of class Layout.
10497 Remove trailing underscores from field names. Add group_sections
10498 field. Rename group_ field to is_group. Change all uses.
10499 (class Layout): Declare find_or_add_kept_section, not add_comdat.
10500 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
10501 comdat_groups_ field.
10502 (Sized_relobj::include_section_group): Use
10503 find_or_add_kept_section and Kept_section::group_sections.
10504 (Sized_relobj::include_linkonce_section): Likewise.
10505 * object.cc (class Sized_relobj): Don't define Comdat_group or
10506 Comdat_group_table. Remove find_comdat_group and
10507 add_comdat_group. Remove comdat_groups_ field.
10508 * plugin.cc (include_comdat_group): Use
10509 Layout::find_or_add_kept_section.
10510
b4ecf66b
ILT
105112009-02-28 Ian Lance Taylor <[email protected]>
10512
14359ca0
ILT
10513 * README: --gc-sections and map files are now supported. Document
10514 some build requirements.
10515
b4ecf66b
ILT
10516 PR 6992
10517 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
10518 relocatable link set the value of the section symbol to zero.
10519 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
10520 relocatable link don't include the section address in the local
10521 symbol value.
10522
0602e05a
ILT
105232009-02-27 Ian Lance Taylor <[email protected]>
10524
fd9d194f
ILT
10525 PR 6811
10526 * options.h (class Search_directory): Add is_system_directory.
10527 (class General_options): Declare is_in_system_directory.
10528 * options.cc (get_relative_sysroot): Make static.
10529 (get_default_sysroot): Make static.
10530 (General_optoins::is_in_system_directory): New function.
10531 * fileread.cc (Input_file::is_in_system_directory): New function.
10532 * fileread.h (class Input_file): Declare is_in_system_directory.
10533 * object.h (class Object): Add is_in_system_directory.
10534 (class Input_objects): Remove system_library_directory_ field.
10535 * object.cc (Input_objects::add_object): Don't set
10536 system_library_directory_.
10537 (input_objects::found_in_system_library_directory): Remove.
10538 * symtab.cc (Symbol_table::write_globals): Remove input_objects
10539 parameter. Change all callers.
10540 (Symbol_table::sized_write_globals): Likewise.
10541 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
10542 Call Object::is_in_system_directory.
10543 * symtab.h (class Symbol_table): Update declarations.
10544
61edd21f
ILT
10545 PR 5990
10546 * descriptors.h (Open_descriptor): Add is_on_stack field.
10547 * descriptors.cc (Descriptors::open): If the descriptor is on the
10548 top of the stack, remove it. Initialize is_on_stack field.
10549 (Descriptors::release): Only add pod to stack if it is not on the
10550 stack already.
10551 (Descriptors::close_some_descriptor): Clear stack_next and
10552 is_on_stack fields.
10553
e29e076a
ILT
10554 PR 7091
10555 * output.cc (Output_section::find_starting_output_address): Rename
10556 from starting_output_address; add PADDR parameter; change return
10557 type.
10558 * output.h (class Output_section): Declare
10559 find_starting_output_address instead of starting_output_address.
10560 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
10561 section symbol for which we can't find a merge section.
10562
0602e05a
ILT
10563 PR 9836
10564 * symtab.cc (Symbol_table::add_from_object): If the visibility is
10565 hidden or internal, force the symbol to be local.
10566 * resolve.cc (Symbol::override_visibility): Define.
10567 (Symbol::override_base): Use override_visibility.
10568 (Symbol_table::resolve): Likewise.
10569 (Symbol::override_base_with_special): Likewise.
10570 (Symbol_table::override_with_special): If the visibility is hidden
10571 or internal, force the symbol to be local.
10572 * symtab.h (class Symbol): Add set_visibility and
10573 override_visibility.
10574 * testsuite/ver_test_1.sh: New file.
10575 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
10576 (check_DATA): Add ver_test_1.syms.
10577 (ver_test_1.syms): New target.
10578 * testsuite/Makefile.in: Rebuild.
10579
401a9a73
CC
105802009-02-25 Cary Coutant <[email protected]>
10581
10582 * layout.cc (Layout::choose_output_section): Don't rename sections
10583 when using a linker script that has a SECTIONS clause.
10584 * Makefile.in: Regenerate.
10585
10586 * testsuite/Makefile.am (script_test_5.sh): New test case.
10587 * testsuite/Makefile.in: Regenerate.
10588 * testsuite/script_test_5.cc: New file.
10589 * testsuite/script_test_5.sh: New file.
10590 * testsuite/script_test_5.t: New file.
10591
f488e4b0
CC
105922009-02-13 Rafael Avila de Espindola <[email protected]>
10593
10594 * archive.cc (Archive::include_member): Update calls to add_symbols.
10595 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
10596 the Layout argument.
10597 * dynobj.h (do_add_symbols): Add the Layout argument.
10598 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
10599 Layout argument.
10600 * object.h (Object::add_symbols): Add the Layout argument.
10601 (Object::do_add_symbols): Add the Layout argument.
10602 (Sized_relobj::do_add_symbols): Add the Layout argument.
10603 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
10604 Unify the two versions.
10605 (Add_plugin_symbols): Remove.
10606 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
10607 (Sized_pluginobj::do_add_symbols): Unify the two versions.
10608 (Add_plugin_symbols): Remove.
10609 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
10610 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
10611 (Add_symbols::run): Make it work with Pulginobj.
10612
89dd1680
ILT
106132009-02-06 Ian Lance Taylor <[email protected]>
10614
10615 * object.cc (Sized_relobj::do_layout): Make info message start
10616 with lower case letter.
10617
266d0a74
ILT
106182009-02-06 Mikolaj Zalewski <[email protected]>
10619
602b464e
ILT
10620 * binary.cc: Fix file comment.
10621
266d0a74
ILT
10622 * options.h (enum Incremental_disposition): Define.
10623 (class General_options): Add new options: --incremental,
10624 --incremental_changed, --incremental_unchanged,
10625 --incremental_unknown. Add incremental_disposition_ and
10626 implicit_incremental_ fields.
10627 (General_options::incremental_disposition): New function.
10628 (class Position_dependent_options): Add incremental_disposition
10629 option.
10630 (Position_dependent_options::copy_from_options): Set incremental
10631 dispositions.
10632 * options.cc (General_options::parse_incremental_changed): New
10633 function.
2e702c99
RM
10634 (General_options::parse_incremental_unchanged): New function.
10635 (General_options::parse_incremental_unknown): New function.
10636 (General_options::General_options): Initialize new fields
266d0a74 10637 incremental_disposition_ and implicit_incremental_.
2e702c99 10638 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
10639 without --incremental.
10640
f073bbf7
CD
106412009-02-06 Chris Demetriou <[email protected]>
10642
10643 * gold.h (gold_undefined_symbol): Change to take only a Symbol
10644 pointer and to report location as the file name associated with
10645 the symbol.
10646 (gold_undefined_symbol_at_location): New function to replace the
10647 old gold_undefined_symbol functionality.
10648 * target-reloc.h (relocate_section): Update to use
10649 gold_undefined_symbol_at_location.
10650 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
10651 Call gold_undefined_symbol function rather than gold_error.
10652 * errors.h (Errors::undefined_symbol): Take location as a
10653 string, rather than calculating it from a relocation.
10654 * errors.cc (Errors::fatal): Print "fatal error:" before the
10655 formatted message.
10656 (Errors::error, Errors::error_at_location): Print "error: "
10657 before the formatted message.
10658 (Errors::undefined_symbol): Take location as a string, rather
10659 than calculating it from a relocation.
10660 (gold_undefined_symbol_at_location): New function akin to
10661 old gold_undefined_symbol, calculates location from relocation.
10662 (gold_undefined_symbol): Change to take only a Symbol pointer
10663 and to report location as the file name associated with the symbol.
10664 * testsuite/debug_msg.sh: Update for changed error messages.
10665 * testsuite/undef_symbol.sh: Likewise.
10666
8e94a90c
ILT
106672009-02-04 Duncan Sands <[email protected]>
10668
10669 PR 9812
10670 * reduced_debug_output.h
10671 (Output_reduced_debug_abbrev_section::failed): Use format for
10672 gold_warning.
10673 (Output_reduced_debug_info_section::faild): Likewise.
10674
88a0e15b
ILT
106752009-01-31 Mikolaj Zalewski <[email protected]>
10676
10677 * script.cc (Lazy_demangler): New class.
2e702c99 10678 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
10679 symbol only once.
10680
5efc7cd2
CC
106812009-01-29 Cary Coutant <[email protected]>
10682
10683 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
10684 to __tls_get_addr.
10685 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10686
e0ebcf42
ILT
106872009-01-28 Ian Lance Taylor <[email protected]>
10688
5efc7cd2 10689 * version.cc (version_string): Bump to 1.9.
75fe7426 10690
e0ebcf42
ILT
10691 * gold.h: Include <cstring> and <stdint.h>.
10692 * version.cc: Include <cstdio>.
10693 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
10694 warning.
10695 * reduced_debug_output.cc (insert_into_vector): Rename from
10696 Insert_into_vector; change all callers. Use Swap_unaligned to
10697 avoid aliasing issue; remove union since it is unnecessary.
10698
8e2813be 106992009-01-27 Sriraman Tallam <[email protected]>
6d03d481
ST
10700
10701 * Makefile.am (CCFILES): Add gc.cc.
10702 (HFILES): Add gc.h.
10703 * Makefile.in: Regenerate.
10704 * gold.cc (Gc_runner): New class.
10705 (queue_initial_tasks): Call garbage collection related tasks
10706 when corresponding options are invoked.
10707 (queue_middle_gc_tasks): New function.
10708 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
10709 processed early before laying out sections during garbage collection.
10710 * gold.h (queue_middle_gc_tasks): New function.
10711 (is_prefix_of): Move from "layout.cc".
10712 * i386.cc (Target_i386::gc_process_relocs): New function.
10713 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
10714 * main.cc (main): Create object of class "Garbage_collection".
10715 * object.cc (Relobj::copy_symbols_data): New function.
10716 (Relobj::is_section_name_included): New function.
e1df38aa
NC
10717 (Sized_relobj::do_layout): Allow this function to be called twice
10718 during garbage collection and defer layout of section during the
6d03d481
ST
10719 first call.
10720 * object.h (Relobj::get_symbols_data): New function.
10721 (Relobj::is_section_name_included): New function.
10722 (Relobj::copy_symbols_data): New function.
10723 (Relobj::set_symbols_data): New function.
10724 (Relobj::get_relocs_data): New function.
10725 (Relobj::set_relocs_data): New function.
10726 (Relobj::is_output_section_offset_invalid): New pure virtual function.
10727 (Relobj::gc_process_relocs): New function.
10728 (Relobj::do_gc_process_relocs): New pure virtual function.
10729 (Relobj::sd_): New data member.
10730 (Sized_relobj::is_output_section_offset_invalid): New function.
10731 (Sized_relobj::do_gc_process_relocs): New function.
10732 * options.h (General_options::gc_sections): Modify to not be a no-op.
10733 (General_options::print_gc_sections): New option.
10734 * plugin.cc (Plugin_finish::run): Remove function call to
10735 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
10736 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
10737 * reloc.cc (Read_relocs::run): Add task to process relocs and
10738 determine unreferenced sections when doing garbage collection.
10739 (Gc_process_relocs): New class.
10740 (Sized_relobj::do_gc_process_relocs): New function.
10741 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
10742 sections that are garbage collected.
10743 * reloc.h (Gc_process_relocs): New class.
10744 * sparc.cc (Target_sparc::gc_process_relocs): New function.
10745 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
10746 symbols whose corresponding sections are garbage collected.
10747 (Symbol_table::Symbol_table): Add new parameter for the garbage
10748 collection object.
10749 (Symbol_table::gc_mark_undef_symbols): New function.
10750 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10751 (Symbol_table::gc_mark_dyn_syms): New function.
10752 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
10753 as garbage.
10754 (Symbol_table::add_from_object): Likewise.
10755 (Symbol_table::add_from_relobj): When building shared objects, do not
10756 treat externally visible symbols as garbage.
10757 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
10758 table information for static and relocatable links.
10759 * symtab.h (Symbol_table::set_gc): New function.
10760 (Symbol_table::gc): New function.
10761 (Symbol_table::gc_mark_undef_symbols): New function.
10762 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10763 (Symbol_table::gc_mark_dyn_syms): New function.
10764 (Symbol_table::gc_): New data member.
e1df38aa 10765 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
10766 function.
10767 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
10768 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
10769
3b293544
CF
107702009-01-20 Chris Faylor <[email protected]>
10771
10772 * options.h (General_options::gc_sections): Define as a no-op for now.
10773 (General_options::no_keep_memory): Ditto.
10774 (General_options::Bshareable): Define.
10775 * options.cc (General_options::finalize): Honor -Bshareable.
10776
83d22aa8
AS
107772009-01-20 Andreas Schwab <[email protected]>
10778
10779 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
10780 read the value in the contents, since we don't use it. Use the
10781 template endianness when writing.
10782 (Relocate::relocate): Use it for R_PPC_REL16_HA.
10783
cd536b21
AS
107842009-01-19 Andreas Schwab <[email protected]>
10785
10786 * configure.tgt (powerpc64-*): Fix targ_obj.
10787
99e9a495
ILT
107882009-01-15 Ian Lance Taylor <[email protected]>
10789
10790 * object.cc (Sized_relobj::write_local_symbols): Don't write out
10791 local symbols when stripping all symbols.
10792
bbbfea06
CC
107932009-01-14 Cary Coutant <[email protected]>
10794
99e9a495 10795 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 10796
0f7c0701
CC
107972009-01-14 Cary Coutant <[email protected]>
10798
10799 * archive.cc (Archive::get_elf_object_for_member): Remove call
10800 to File_read::claim_for_plugin.
10801 * descriptors.cc (Descriptors::open): Remove reference to
10802 is_claimed.
10803 (Descriptors::claim_for_plugin): Remove.
10804 * descriptors.h (Descriptors::claim_for_plugin): Remove.
10805 (Descriptors::is_claimed): Remove.
10806 (claim_descriptor_for_plugin): Remove.
10807 * fileread.cc (File_read::claim_for_plugin): Remove.
10808 * fileread.h (File_read::claim_for_plugin): Remove.
10809 (File_read::descriptor): Reopen descriptor if necessary.
10810 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
10811 (Plugin_manager::all_symbols_read): Add task parameter. Change
10812 all callers.
10813 (Plugin_manager::get_input_file): New function.
10814 (Plugin_manager::release_input_file): New function.
10815 (Pluginobj::Pluginobj): Add filesize parameter and initialize
10816 corresponding data member.
10817 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
10818 and pass to base constructor. Change all callers.
10819 (get_input_file, release_input_file): New functions.
10820 (make_sized_plugin_object): Add filesize parameter. Change all callers.
10821 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
10822 (Plugin_manager::all_symbols_read): Add task parameter.
10823 (Plugin_manager::get_input_file): New function.
10824 (Plugin_manager::release_input_file): New function.
10825 (Plugin_manager::task_): New data member.
10826 (Pluginobj::Pluginobj): Add filesize parameter.
10827 (Pluginobj::filename): New function.
10828 (Pluginobj::descriptor): New function.
10829 (Pluginobj::filesize): New function.
10830 (Pluginobj::filesize_): New data member.
10831 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
10832 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
10833 File_read::claim_for_plugin; use Object::unlock to unlock the file.
10834
10835 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
10836 with archive libraries.
10837 * testsuite/Makefile.in: Regenerate.
10838 * testsuite/plugin_test.c (struct sym_info): New type.
10839 (get_input_file, release_input_file): New static variables.
10840 (onload): Capture new transfer vector entries.
10841 (claim_file_hook): Stop reading at end of file according to filesize.
10842 Factor out parsing of readelf output into separate function.
10843 (all_symbols_read_hook): Exercise get_input_file and release_input_file
10844 APIs and get the source file name from the symbol table. Convert
10845 source file name to corresponding object file name. Print info
10846 message when adding new input files.
10847 (parse_readelf_line): New function.
10848 * testsuite/plugin_test_1.sh: Add checks for new info messages.
10849 * testsuite/plugin_test_2.sh: Likewise.
10850 * testsuite/plugin_test_3.sh: Likewise.
10851 * testsuite/plugin_test_4.sh: New test case.
10852
62a6d109
ILT
108532009-01-07 Ian Lance Taylor <[email protected]>
10854
10855 * version.cc (version_string): Bump to 1.8.
10856
483620e8
CC
108572008-12-23 Cary Coutant <[email protected]>
10858
10859 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
10860 * plugin.cc (Plugin_manager::finish): Rename as
10861 layout_deferred_objects. Move cleanup to separate function.
10862 (Plugin_manager::cleanup): New function.
10863 (Plugin_finish::run): Call layout_deferred_objects and cleanup
10864 separately.
10865 * plugin.h (Plugin_manager::finish): Rename as
10866 layout_deferred_objects.
10867 (Plugin_manager::cleanup): New function.
10868 (Plugin_manager::cleanup_done): New field.
10869
d66a9eb3
CC
108702008-12-23 Cary Coutant <[email protected]>
10871
10872 * plugin.cc (is_visible_from_outside): New function.
10873 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
10874 so we don't return "IR only" status for exported symbols or -r links.
10875
10876 * testsuite/Makefile.am (plugin_test_3): New test case.
10877 * testsuite/Makefile.in: Regenerate.
10878 * testsuite/plugin_test_3.sh: New file.
10879
5995b570
CC
108802008-12-22 Cary Coutant <[email protected]>
10881
10882 * object.cc (Sized_relobj::layout_section): New function.
10883 (Sized_relobj::do_layout): Defer layout of input sections until after
10884 plugin has provided replacement files.
10885 (Sized_relobj::do_layout_deferred_sections): New function.
10886 * object.h (Relobj::set_section_offset): Remove virtual keyword.
10887 (Relobj::layout_deferred_sections): New function.
10888 (Relobj::do_layout_deferred_sections): New function.
10889 (Sized_relobj::do_layout_deferred_sections): New function.
10890 (Sized_relobj::layout_section): New function.
10891 (Sized_relobj::Deferred_layout): New structure.
10892 (Sized_relobj::deferred_layout_): New field.
10893 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
10894 Change all callers. Layout deferred sections.
10895 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
10896 references.
10897 (Plugin_hook::run): Move code from do_plugin_hook inline.
10898 (Plugin_hook::do_plugin_hook): Remove.
10899 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
10900 (Plugin_manager::finish): Renamed, was cleanup.
10901 (Plugin_manager::should_defer_layout): New function.
10902 (Plugin_manager::add_deferred_layout_object): New function.
10903 (Plugin_manager::Deferred_layout_list): New type.
10904 (Plugin_manager::deferred_layout_objects_): New field.
10905 (Plugin_hook::do_plugin_hook): Remove.
10906
ee769c88
ILT
109072008-12-17 Ian Lance Taylor <[email protected]>
10908
10909 * options.h (class General_options): Add --no case for
10910 --export-dynamic.
10911
abc8dcba
CC
109122008-12-16 Cary Coutant <[email protected]>
10913
10914 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
10915 vector.
10916 (Plugin_manager::claim_file): Create plugin object even if
10917 plugin did not call the add_symbols callback.
10918 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
10919 asking for more symbols than were added.
10920 * testsuite/Makefile.am (plugin_test_1): Add test case with
10921 no global symbols.
10922 (empty.syms): New target.
10923 * testsuite/Makefile.in: Regenerate.
10924 * testsuite/plugin_test.c (claim_file_hook): Add new debug
10925 message. Don't call add_symbols if no globals.
10926 (all_symbols_read_hook): Don't provide replacement for empty
10927 claimed file.
10928
b0074644
ILT
109292008-12-12 Ian Lance Taylor <[email protected]>
10930
68943102
ILT
10931 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
10932 r_type == 0 for a local symbol with r_sym == 0.
10933 (scan_relocatable_relocs): Pass r_sym to
10934 local_non_section_strategy.
10935 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
10936 r_sym parameter.
10937
b0074644
ILT
10938 * configure.ac: Update test for TLS descriptors: they are
10939 supported as of glibc 2.9.
10940 * configure: Rebuild.
10941
c2508178
ILT
109422008-12-11 Ian Lance Taylor <[email protected]>
10943
10944 PR 7091
10945 * target-reloc.h (Default_scan_relocatable_relocs): For each
10946 function, map r_type == 0 to RELOC_DISCARD.
10947
2756a258
CC
109482008-12-10 Cary Coutant <[email protected]>
10949
10950 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
10951 object to override a kept COMDAT group from a plugin object.
10952
bb6f53d3
ILT
109532008-12-09 Ian Lance Taylor <[email protected]>
10954
fbc558e1
ILT
10955 PR 7088
10956 * yyscript.y (file_cmd): Handle INPUT.
10957
bb6f53d3
ILT
10958 * testsuite/initpri1.c: Change all declarations to be full
10959 prototypes by adding void, to avoid compiler warnings.
10960
4674ecfc
CC
109612008-12-05 Rafael Avila de Espindola <[email protected]>
10962
10963 * options.cc (General_options::parse_plugin_opt): New.
10964 (General_options::add_plugin): The argument now is just the filename.
10965 (General_options::add_plugin_option): New.
10966 * options.h (plugin_opt): New.
10967 (add_plugin): Change argument name.
10968 (add_plugin_option): New.
10969 * plugin.cc (Plugin::load): Don't parse the plugin option.
10970 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
10971 (Plugin::add_option): New.
10972 (Plugin::args_): Change type.
10973 (Plugin::filename_): New.
10974 (Plugin_manager::add_plugin_option): New.
10975 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
10976 * testsuite/Makefile.in: Regenerate.
10977
fd06b4aa
CC
109782008-12-05 Cary Coutant <[email protected]>
10979
10980 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
10981 Handle --strip-lto-sections option.
10982 * options.h (strip_lto_sections): New option.
10983
6c52134c
CC
109842008-12-01 Cary Coutant <[email protected]>
10985
10986 * plugin.cc (ld_plugin_message): Change format parameter to const.
10987 Fix mismatch between new[] and delete.
10988
a45248e0
CC
109892008-11-14 Cary Coutant <[email protected]>
10990
10991 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
10992 instead of -1U.
10993
c82fbeee
CS
109942008-11-05 Craig Silverstein <[email protected]>
10995
10996 * options.cc (General_options::parse_dynamic_list): New function.
10997 * options.h (General_options): New flags dynamic_list,
10998 dynamic_list_data, dynamic_list_cpp_new, and
10999 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
11000 (General_options::in_dynamic_list): New function.
11001 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
11002 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
11003 (Lex::can_continue_name): Likewise.
11004 (yylex): Likewise.
11005 (read_script_file): New parameter script_options.
11006 (read_dynamic_list): New function.
11007 (Script_options::define_dynamic_list): New function.
11008 (dynamic_list_keyword_parsecodes): New variable.
11009 (dynamic_list_keywords): New variable.
11010 * script.h (Script_options::define_dynamic_list): New function
11011 prototype.
11012 (read_dynamic_list): New function prototype.
11013 * symtab.cc (strprefix): New macro.
11014 (Symbol::should_add_dynsym_entry): Support dynamic_list,
11015 dynamic_list_data, dynamic_list_cpp_new, and
11016 dynamic_list_cpp_typeinfo.
11017 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
11018 (dynamic_list_expr): New rule.
11019 (dynamic_list_nodes): Likewise.
11020 (dynamic_list_node): Likewise.
11021 * testsuite/Makefile.am (dynamic_list): New test.
11022 * testsuite/Makefile.in: Regenerated.
11023 * testsuite/dynamic_list.t: New file.
11024 * testsuite/dynamic_list.sh: New file.
11025
e0bb29a5
CS
110262008-11-05 Craig Silverstein <[email protected]>
11027
11028 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
11029 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
11030 (t11_last): Likewise.
11031 * testsuite/ver_test_6.c (main): Likewise.
11032
4e1e25e0
CC
110332008-10-07 Cary Coutant <[email protected]>
11034
11035 * options.c (General_options::finalize): Add check for -static and
11036 -shared.
11037 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
11038 is not empty.
11039
92f03fcb
CC
110402008-10-02 Cary Coutant <[email protected]>
11041
11042 * plugin.cc (make_sized_plugin_object): Fix conditional
11043 compilation to work when not all targets are enabled.
11044
fbd8a257
CC
110452008-09-29 Cary Coutant <[email protected]>
11046
11047 * archive.cc (Archive::get_file_and_offset): Use filename instead
11048 of name to get library path.
11049 (Archive::include_member): Unlock external member of a thin archive.
11050
11051 * testsuite/Makefile.am (TEST_AR): New variable.
11052 (thin_archive_test_1): New test.
11053 (thin_archive_test_2): New test.
81636b3f
CC
11054 * testsuite/Makefile.in: Regenerate.
11055 * testsuite/thin_archive_main.cc: New file.
11056 * testsuite/thin_archive_test_1.cc: New file.
11057 * testsuite/thin_archive_test_2.cc: New file.
11058 * testsuite/thin_archive_test_3.cc: New file.
11059 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 11060
eff45813
CC
110612008-09-29 Cary Coutant <[email protected]>
11062
11063 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
11064 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
11065 instead of -1U.
11066 (Sized_relobj::do_finalize_local_symbols): Likewise.
11067 (Sized_relobj::map_to_kept_section): Likewise.
11068 * object.h (Sized_relobj::invalid_address): New constant.
11069 (Sized_relobj::do_output_section_offset): Check for invalid_address
11070 and return -1ULL.
11071 * output.cc (Output_reloc::local_section_offset): Use constant
11072 invalid_address instead of -1U.
11073 (Output_reloc::get_address): Likewise.
11074 (Output_section::output_address): Change -1U to -1ULL.
11075 * output.h (Output_reloc::invalid_address): New constant.
11076 * reloc.cc (Sized_relobj::write_sections): Use constant
11077 invalid_address instead of -1U.
11078 (Sized_relobj::relocate_sections): Likewise.
11079 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
11080 values for merge sections.
11081 * target-reloc.h (relocate_for_relocatable): Use constant
11082 invalid_address instead of -1U.
11083
89fc3421
CC
110842008-09-19 Cary Coutant <[email protected]>
11085
11086 Add plugin functionality for link-time optimization (LTO).
11087 * configure.ac (plugins): Add --enable-plugins option.
11088 * configure: Regenerate.
11089 * config.in: Regenerate.
11090 * Makefile.am (LIBDL): New variable.
11091 (CCFILES): Add plugin.cc.
11092 (HFILES): Add plugin.h.
11093 (ldadd_var): Add LIBDL.
11094 * Makefile.in: Regenerate.
11095
11096 * archive.cc: Include "plugin.h".
11097 (Archive::setup): Don't preread archive symbols when using a plugin.
11098 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
11099 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
11100 files.
11101 (Archive::include_member): Add symbols from plugin objects.
11102 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
11103 * descriptors.cc (Descriptors::open): Check for file descriptors
11104 abandoned by plugins.
11105 (Descriptors::claim_for_plugin): New function.
11106 * descriptors.h (Descriptors::claim_for_plugin): New function.
11107 (Open_descriptor::is_claimed): New field.
11108 (claim_descriptor_for_plugin): New function.
11109 * fileread.cc (File_read::claim_for_plugin): New function.
11110 * fileread.h (File_read::claim_for_plugin): New function.
11111 (File_read::descriptor): New function.
11112 * gold.cc: Include "plugin.h".
11113 (queue_initial_tasks): Add task to call plugin hooks for generating
11114 new object files.
11115 * main.cc: Include "plugin.h".
11116 (main): Load plugin libraries.
11117 * object.h (Pluginobj): Declare.
11118 (Object::pluginobj): New function.
11119 (Object::do_pluginobj): New function.
11120 (Object::set_target): New function.
11121 * options.cc: Include "plugin.h".
11122 (General_options::parse_plugin): New function.
11123 (General_options::General_options): Initialize plugins_ field.
11124 (General_options::add_plugin): New function.
11125 * options.h (Plugin_manager): Declare.
11126 (General_options): Add --plugin option.
11127 (General_options::has_plugins): New function.
11128 (General_options::plugins): New function.
11129 (General_options::add_plugin): New function.
11130 (General_options::plugins_): New field.
11131 * plugin.cc: New file.
11132 * plugin.h: New file.
11133 * readsyms.cc: Include "plugin.h".
11134 (Read_symbols::do_read_symbols): Check for archive before checking
11135 for ELF file. Call plugin hooks to claim files.
11136 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
11137 from a real object file; force override when processing replacement
11138 files.
11139 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
11140 (Symbol::init_base_object): Likewise.
11141 (Symbol::init_base_output_data): Likewise.
11142 (Symbol::init_base_output_segment): Likewise.
11143 (Symbol::init_base_constant): Likewise.
11144 (Symbol::init_base_undefined): Likewise.
11145 (Symbol::output_section): Assert that object is not a plugin.
11146 (Symbol_table::add_from_pluginobj): New function.
11147 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
11148 undefined.
11149 (Symbol_table::sized_write_globals): Likewise.
11150 (Symbol_table::add_from_pluginobj): Instantiate template.
11151 * symtab.h (Sized_pluginobj): Declare.
11152 (Symbol::in_real_elf): New function.
11153 (Symbol::set_in_real_elf): New function.
11154 (Symbol::in_real_elf_): New field.
11155 (Symbol_table::add_from_pluginobj): New function.
11156
11157 * testsuite/Makefile.am (AM_CFLAGS): New variable.
11158 (LIBDL): New variable.
11159 (LDADD): Add LIBDL.
11160 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
11161 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
11162 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
11163 (MOSTLYCLEANFILES): Likewise.
11164 * testsuite/Makefile.in: Regenerate.
11165 * testsuite/plugin_test.c: New file.
11166 * testsuite/plugin_test_1.sh: New file.
11167 * testsuite/plugin_test_2.sh: New file.
11168
de31bda5
ILT
111692008-09-16 Ian Lance Taylor <[email protected]>
11170
9c2d0ef9
ILT
11171 * target-reloc.h (relocate_section): Check whether a symbol is
11172 defined by the ABI before reporting an undefined symbol error.
11173 * target.h (Target::is_defined_by_abi): Make parameter const.
11174 (Target::do_is_defined_by_abi): Likewise.
11175 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
11176 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
11177 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
11178 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
11179 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
11180 * testsuite/Makefile.in: Rebuild.
11181
de31bda5
ILT
11182 * fileread.cc (make_view): Add casts to avoid warning.
11183
9fa33bee
AO
111842008-09-16 Alexandre Oliva <[email protected]>
11185
11186 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
11187 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11188
183fd0e3
AO
111892008-09-16 Alexandre Oliva <[email protected]>
11190
11191 * options.h (General_options::output_is_executable): New.
11192 (General_options::output_is_pie): New.
11193 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
11194 for shared libraries.
11195 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11196
7be8330a
CD
111972008-09-11 Chris Demetriou <[email protected]>
11198
11199 * options.h (origin): New -z option.
11200 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
11201 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
11202 in DT_FLAGS_1.
11203
a9caad02
CC
112042008-09-05 Cary Coutant <[email protected]>
11205
11206 * fileread.cc (File_read::make_view): Add check for attempt to map
11207 beyond end of file.
11208
ae6dce4d
CC
112092008-09-05 Cary Coutant <[email protected]>
11210
11211 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
11212 explicit instantiations.
11213
d7ab2a47
KVH
112142008-08-28 Kris Van Hees <[email protected]>
11215
11216 PR gold/6858
11217 * options.cc (General_options::finalize): Allow undefined symbols
11218 in shlibs if linking -shared.
11219
11220 PR gold/6859
11221 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
11222 symbols as not needing a dynsym entry.
11223
1e52a9c1
CS
112242008-08-20 Craig Silverstein <[email protected]>
11225
11226 * fileread.cc (File_read::open): Do not lock the file unless it
11227 was successfully opened.
11228
d85c80a3
CC
112292008-08-14 Cary Coutant <[email protected]>
11230
11231 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
11232 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
11233 * testsuite/tls_test.cc (struct int128): 128-bit struct
11234 for testing TLS relocs with non-zero addend.
11235 (v12): New TLS variable.
11236 (t12): New test.
11237 (t_last): Add check for v12.
11238 * testsuite/tls_test.h (t12): New function.
11239 * testsuite/tls_test_main.cc (thread_routine): Call new test.
11240
2d924fd9
ILT
112412008-08-13 Ian Lance Taylor <[email protected]>
11242
11243 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
11244 set tls_segment_ or relro_segment_.
11245 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
11246 when appropriate.
11247 * output.h (Output_section::clear_is_relro): New function.
11248 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
11249 sections specially even when output_data_ is empty.
11250 (Output_segment::maximum_alignment): When first section is relro,
11251 only force alignment for PT_LOAD segments.
11252 * script.cc (script_data_segment_align): New function.
11253 (script_data_segment_relro_end): New function.
11254 * script-c.h (script_data_segment_align): Declare.
11255 (script_data_segment_relro_end): Declare.
11256 * script-sections.h (class Script_sections): Declare
11257 data_segment_align and data_segment_relro_end. Add fields
11258 segment_align_index_ and saw_relro_end_.
11259 * script-sections.cc (class Sections_element): Add set_is_relro
11260 virtual function. Add new bool* parameter to place_orphan_here.
11261 Add get_output_section virtual function.
11262 (class Output_section_definition): Add set_is_relro. Add new
11263 bool* parameter to place_orphan_here. Add get_output_section.
11264 Add is_relro_ field.
11265 (Output_section_definition::Output_section_definition): Initialize
11266 evaluated_address_, evaluated_load_address, evaluated_addralign_,
11267 and is_relro_ fields.
11268 (Output_section_definition::place_orphan_here): Add is_relro
11269 parameter.
11270 (Output_section_definition::set_section_addresses): Set relro for
11271 output section.
11272 (Output_section_definition::alternate_constraint): Likewise.
11273 (class Orphan_output_section): Add new bool* parameter to
11274 place_orphan_here. Add get_output_section.
11275 (Orphan_output_section::place_orphan_here): Add is_relro
11276 parameter.
11277 (Script_sections::Script_sections): Initialize
11278 data_segment_align_index_ and saw_relro_end_.
11279 (Script_sections::data_segment_align): New function.
11280 (Script_sections::data_segment_relro_end): New function.
11281 (Script_sections::place_orphan): Set or clear is_relro.
11282 (Script_sections::set_section_addresses): Force alignment of first
11283 TLS section.
11284 * yyscript.y (exp): Call script_data_segment_align and
11285 script_data_segment_relro_end.
11286 * testsuite/relro_script_test.t: New file.
11287 * testsuite/relro_test.cc (using_script): Declare.
11288 (t1, t2): Test using_script.
11289 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
11290 (relro_script_test_SOURCES): Define.
11291 (relro_script_test_DEPENDENCIES): Define.
11292 (relro_script_test_LDFLAGS): Define.
11293 (relro_script_test_LDADD): Define.
11294 (relro_script_test.so): New target.
11295 * testsuite/Makefile.in: Rebuild.
11296
f827c9a9
CC
112972008-08-06 Cary Coutant <[email protected]>
11298
11299 * archive.cc (Archive::total_archives, Archive::total_members)
11300 (Archive::total_members_loaded): New variables.
11301 (Archive::setup): Add parameter. Add option to preread
11302 archive symbols.
11303 (Archive::read_armap): Add counter.
11304 (Archive::get_file_and_offset): New function.
11305 (Archive::get_elf_object_for_member): New function.
11306 (Archive::read_all_symbols): New function.
11307 (Archive::read_symbols): New function.
11308 (Archive::add_symbols): Add counters.
11309 (Archive::include_all_members): Use armap to find members if it's
11310 already built.
11311 (Archive::include_member): Skip reading symbols if already read.
11312 Factored code into Archive::get_file_and_offset and
11313 Archive::get_elf_object_for_member. Changed call to
11314 Mapfile::report_include_archive_member.
11315 (Archive::print_stats): New function.
11316 * archive.h: Declare Object and Read_symbols_data classes.
11317 (Archive::Archive): Add initializers for new members.
11318 (Archive::setup): Add parameter.
11319 (Archive::print_stats): New function.
11320 (Archive::total_archives, Archive::total_members)
11321 (Archive::total_members_loaded): New variables.
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::Archive_member): New class.
11327 (Archive::members_): New member.
11328 (Archive::num_members_): New member.
11329 * main.cc: Include archive.h.
11330 (main): Call Archive::print_stats.
11331 * mapfile.cc (Mapfile::report_include_archive_member): Delete
11332 archive parameter; member_name is now the fully-decorated name.
11333 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
11334 * options.h: (General_options): Add --preread-archive-symbols option.
11335 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
11336 Archive::setup.
11337
de4c45bd
ILT
113382008-08-04 Ian Lance Taylor <[email protected]>
11339
11340 * symtab.h (Symbol::use_plt_offset): New function.
11341 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
11342 * powerpc.cc (Relocate::relocate): Likewise.
11343 * sparc.cc (Relocate::relocate): Likewise.
11344 * x86_64.cc (Relocate::relocate): Likewise.
11345 * testsuite/weak_plt.sh: New test.
11346 * testsuite/weak_plt_main.cc: New test.
11347 * testsuite/weak_plt_shared.cc: New test.
11348 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
11349 (check_PROGRAMS): Add weak_plt.
11350 (check_DATA): Add weak_plt_shared.so.
11351 (weak_plt_main_pic.o, weak_plt): New targets.
11352 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
11353 * testsuite/Makefile.in: Rebuild.
11354
11355 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
11356 gcctestdir/ld.
11357 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
11358 * testsuite/Makefile.in: Rebuild.
11359
323ee3f4
AM
113602008-08-04 Alan Modra <[email protected]>
11361
11362 * Makefile.am (POTFILES.in): Set LC_ALL=C.
11363 * Makefile.in: Regenerate.
11364 * po/POTFILES.in: Regenerate.
11365
7c07ecec
ILT
113662008-07-29 Ian Lance Taylor <[email protected]>
11367
11368 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
11369 symbols before other symbols.
11370 * testsuite/script_test_2.cc (test_addr): Declare.
11371 (test_addr_alias): Declare.
11372 (main): Check that test_addr and test_addr_alias have the right
cd536b21 11373 values.
7c07ecec
ILT
11374 * testsuite/script_test_2.t: Define test_addr_alias and
11375 test_addr.
11376
5778530e
ILT
113772008-07-24 Ian Lance Taylor <[email protected]>
11378
2a00e4fb
ILT
11379 PR 5990
11380 * descriptors.cc: New file.
11381 * descriptors.h: New file.
11382 * gold-threads.h (class Hold_optional_lock): New class.
11383 * fileread.cc: Include "descriptors.h".
11384 (File_read::~File_read): Release descriptor rather than closing
11385 it.
11386 (File_read::open) [file]: Call open_descriptor rather than open.
11387 Set is_descriptor_opened_.
11388 (File_read::open) [memory]: Assert that descriptor is not open.
11389 (File_read::reopen_descriptor): New function.
11390 (File_read::release): Release descriptor.
11391 (File_read::do_read): Make non-const. Reopen descriptor.
11392 (File_read::read): Make non-const.
11393 (File_read::make_view): Reopen descriptor.
11394 (File_read::do_readv): Likewise.
11395 * fileread.h (class File_read): Add is_descriptor_opened_ field.
11396 Update declarations.
11397 * layout.cc: Include "descriptors.h".
11398 (Layout::create_build_id): Use open_descriptor rather than open.
11399 * output.cc: Include "descriptors.h".
11400 (Output_file::open): Use open_descriptor rather than open.
11401 * archive.cc (Archive::const_iterator): Change Archive to be
11402 non-const.
11403 (Archive::begin, Archive::end): Make non-const.
11404 (Archive::count_members): Likewise.
11405 * archive.h (class Archive): Update declarations.
11406 * object.h (Object::read): Make non-const.
11407 * Makefile.am (CCFILES): Add descriptors.cc.
11408 (HFILES): Add descriptors.h.
11409 * Makefile.in: Rebuild.
11410
801647d1
ILT
11411 PR 6716
11412 * gold.h: Always include <clocale>. Add Solaris workarounds
11413 following code in binutils/sysdep.h.
11414
5edd166e
ILT
11415 PR 6048
11416 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
11417 this->eh_frame_hdr_ is NULL before using it.
11418
c89ad728
ILT
11419 * dynobj.cc (Versions::Versions): Update comment.
11420
aa86f06b
ILT
11421 * dynobj.cc (Versions::Versions): If there is an soname, use it as
11422 the base version name.
11423
5778530e
ILT
11424 * stringpool.cc (Stringpool_template::add_with_length): Set key to
11425 array size plus one.
11426 (Stringpool_template::set_string_offsets): Subtract one from key
11427 before using it as an array index.
11428 (Stringpool_template::get_offset_with_length): Likewise.
11429 (Stringpool_template::write_to_buffer): Likewise.
11430 * stringpool.h (Stringpool_template::get_offset_from_key):
11431 Likewise.
11432
057ead22
ILT
114332008-07-23 Ian Lance Taylor <[email protected]>
11434
7f649c59
ILT
11435 PR 6658
11436 * object.h (Merged_symbol_value::value): Do our best to handle a
11437 negative addend.
11438
057ead22
ILT
11439 PR 6647
11440 * script.cc (Version_script_info::get_versions): Don't add empty
11441 version tag to return value.
11442 (Version_script_info::get_symbol_version_helper): Change return
11443 type to bool. Add pversion parameter. Change all callers.
11444 (script_register_vers_node): Don't require a non-NULL tag.
11445 * script.h (class Version_script_info): Update declarations.
11446 (Version_script_info::get_symbol_version): Change return type to
11447 bool. Add version parameter. Change all callers.
11448 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
11449 handling. Handle an empty version from a version script.
11450 (Symbol_table::define_special_symbol): Likewise.
11451 * testsuite/ver_test_10.script: New file.
11452 * testsuite/ver_test_10.sh: New file.
11453 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
11454 (check_DATA): Add ver_test_10.syms.
11455 (ver_test_10.syms, ver_test_10.so): New target.
11456 * testsuite/Makefile.in: Rebuild.
11457
58e54ac2
CD
114582008-07-23 Simon Baldwin <[email protected]>
11459
11460 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
11461 to zero for undefined symbols from dynamic libraries.
11462
95d14cd3
ILT
114632008-07-23 Ian Lance Taylor <[email protected]>
11464
11465 * symtab.cc (Symbol_table::resolve): Remove version parameter.
11466 Change all callers.
11467 * symtab.h (class Symbol_table): Update declaration.
11468 * testsuite/ver_test_9.cc: New file.
11469 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
11470 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
11471 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
11472 (ver_test_9.so, ver_test_9.o): New targets.
11473 * testsuite/Makefile.in: Rebuild.
11474
92de84a6
ILT
114752008-07-22 Ian Lance Taylor <[email protected]>
11476
34810851
ILT
11477 * options.h (class General_options): Define --check-sections.
11478 * layout.cc (Layout::set_segment_offsets): Handle
11479 --check-sections.
11480
af6156ef
ILT
11481 * options.h (class General_options): Define -n/--nmagic and
11482 -N/--omagic.
11483 * options.cc (General_options::finalize): For -n/--nmagic or
11484 -N/--omagic, set -static.
11485 * layout.cc (Layout::attach_allocated_section_to_segment): If
11486 -N/--omagic, don't put read-only and read-write sections in
11487 different segments.
11488 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
11489 finding a read-only segment.
11490 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
11491 don't set the minimum segment alignment to the common page size,
11492 and don't set the file offset to the address modulo the page size.
11493 * script-sections.cc (Script_sections::create_segments): If
11494 -n/--omagic, don't put read-only and read-write sections in
11495 different segments.
11496
92de84a6
ILT
11497 * cref.cc: New file.
11498 * cref.h: New file.
11499 * options.h (class General_options): Add --print-symbol-counts.
11500 * main.cc (main): Issue defined symbol report if requested.
11501 * archive.cc (Archive::interpret_header): Make into a const member
11502 function.
11503 (Archive::add_symbols): Call Input_objects::archive_start and
11504 archive_stop.
11505 (Archive::const_iterator): Define new class.
11506 (Archive::begin, Archive::end): New functions.
11507 (Archive::include_all_members): Rewrite to use iterator.
11508 (Archive::count_members): New function.
11509 * archive.h (class Archive): Update declarations.
11510 (Archive::filename): New function.
11511 * object.cc: Include "cref.h".
11512 (Sized_relobj::Sized_relobj): Initialize defined_count_.
11513 (Sized_relobj::do_get_global_symbol_counts): New function.
11514 (Input_objects::add_object): Add object to cross-referencer.
11515 (Input_objects::archive_start): New function.
11516 (Input_objects::archive_stop): New function.
11517 (Input_objects::print_symbol_counts): New function.
11518 * object.h: Declare Cref and Archive.
11519 (Object::get_global_symbol_counts): New function.
11520 (Object::do_get_global_symbol_counts): New pure virtual function.
11521 (class Sized_relobj): Add defined_count_ field. Update
11522 declarations.
11523 (class Input_objects): Add cref_ field. Update constructor.
11524 Update declarations.
11525 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
11526 defined_count_.
11527 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
11528 symbol counts.
11529 (Sized_dynobj::do_get_global_symbol_counts): New function.
11530 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
11531 defined_count_. Update declarations. Define Symbols typedef.
11532 * symtab.cc (Symbol_table::add_from_relobj): Add defined
11533 parameter. Change all callers.
11534 (Symbol_table::add_from_dynobj): Add sympointers and defined
11535 parameters. Change all callers.
11536 * symtab.h (class Symbol_table): Update declarations.
11537 * Makefile.am (CCFILES): Add cref.cc.
11538 (HFILES): Add cref.h.
11539 * Makefile.in: Rebuild.
11540
3f7c5e1d
CD
115412008-07-22 Simon Baldwin <[email protected]>
11542
11543 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
11544 to zero when writing undefined symbols.
11545
e0b64032
ILT
115462008-07-22 Ian Lance Taylor <[email protected]>
11547
11548 * output.cc (Output_section::add_input_section): Don't try to
11549 merge empty merge sections.
11550
096b02cf
CS
115512008-07-21 Craig Silverstein <[email protected]>
11552
11553 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
11554 Include symbol version in error message.
cd536b21 11555
1d1f116d
CD
115562008-07-20 Chris Demetriou <[email protected]>
11557
cd536b21 11558 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
11559 (RANDOM_SEED_CFLAGS): New substituted variable.
11560 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
11561 * configure: Rebuild.
11562 * Makefile.in: Likewise.
11563 * testsuite/Makefile.in: Likewise.
11564
a18f591e
ILT
115652008-07-18 Ian Lance Taylor <[email protected]>
11566
11567 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
11568 where we see NAME/NULL and NAME/VERSION as separate symbols.
11569 * testsuite/ver_test_main.cc (main): Call t4.
11570 (t4, t4_2a): Define.
11571 * testsuite/ver_test_2.cc (t4_2): Define.
11572 * testsuite/ver_test_2.script: Put t4_2a in VER2.
11573 * testsuite/ver_test_4.cc (t4_2a): Define.
11574 * testsuite/ver_test_4.script: Put t4_2a in VER2.
11575 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
11576
c6e3f6ed
ILT
115772008-07-17 Ian Lance Taylor <[email protected]>
11578
11579 * dynobj.cc (Versions::add_def): If we give an error about a
11580 missing version, go ahead and create the version anyhow.
11581
ef9beddf
ILT
115822008-07-10 Ian Lance Taylor <[email protected]>
11583
11584 Handle output sections with more than 0x7fffffff bytes.
11585 * object.h (class Relobj): Change map_to_output_ to
11586 output_sections_, and just keep a section pointer. Change all
11587 uses. Move comdat group support to Sized_relobj.
11588 (Relobj::is_section_specially_mapped): Remove.
11589 (Relobj::output_section): Remove poff parameter. Change all
11590 callers.
11591 (Relobj::output_section_offset): New function.
11592 (Relobj::set_section_offset): Rewrite.
11593 (Relobj::map_to_output): Remove.
11594 (Relobj::output_sections): New function.
11595 (Relobj::do_output_section_offset): New pure virtual function.
11596 (Relobj::do_set_section_offset): Likewise.
11597 (class Sized_relobj): Add section_offsets_ field. Add comdat
11598 group support from Relobj. Update declarations.
11599 (Sized_relobj::get_output_section_offset): New function.
11600 (Sized_relobj::do_output_section_offset): New function.
11601 (Sized_relobj::do_set_section_offset): New function.
11602 * object.cc (Relobj::output_section_address): Remove.
11603 (Sized_relobj::Sized_relobj): Initialize new fields.
11604 (Sized_relobj::include_section_group): Cast find_kept_object to
11605 Sized_relobj.
11606 (Sized_relobj::include_linkonce_section): Likewise.
11607 (Sized_relobj::do_layout): Use separate arrays for output section
11608 and output offset.
11609 (Sized_relobj::do_count_local_symbols): Change map_to_output to
11610 output_sections.
11611 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
11612 output_sections and section_offsets.
11613 (Sized_relobj::write_local_symbols): Likewise.
11614 (map_to_kept_section): Compute output address directly.
11615 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
11616 output_sections and section_offsets.
11617 (Sized_relobj::write_sections): Likewise.
11618 (Sized_relobj::relocate_sections): Likewise.
11619 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
11620 * output.h (class Output_reloc): Update declarations. Change
11621 u2_.relobj to Sized_relobj*.
11622 (class Output_data_reloc): Change add functions to use
11623 Sized_relobj*.
11624 * output.cc (Output_reloc::Output_reloc): Change relobj to
11625 Sized_relobj*.
11626 (Output_reloc::local_section_offset): Change return type to
11627 Elf_Addr. Use get_output_section_offset.
11628 (Output_reloc::get_address): Likewise.
11629 (Output_section::is_input_address_mapped): Don't call
11630 is_section_specially_mapped.
11631 (Output_section::output_offset): Likewise.
11632 (Output_section::output_address): Likewise.
11633 (Output_section::starting_output_address): Likewise.
11634 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
11635 parameter to Sized_relobj*.
11636 (Copy_relocs::need_copy_reloc): Likewise.
11637 (Copy_relocs::save): Likewise.
11638 * copy-relocs.h (class Copy_relocs): Update declarations.
11639 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
11640 Sized_relobj*. Change relobj_ field to Sized_relobj*.
11641 * target-reloc.h (relocate_for_relocatable): Change
11642 offset_in_output_section type to Elf_Addr. Change code that uses
11643 it as well.
11644 * layout.cc (Layout::layout): Always set *off.
11645 * mapfile.cc (Mapfile::print_input_section): Use
11646 output_section_offset.
11647 * i386.cc (Target_i386::copy_reloc): Change object parameter to
11648 Sized_relobj*.
11649 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
11650 * sparc.cc (Target_sparc::copy_reloc): Likewise.
11651 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
11652
5cb66f97
ILT
116532008-07-03 Ian Lance Taylor <[email protected]>
11654
11655 * layout.cc (Layout::include_section): Do not discard unrecognized
11656 SHT_STRTAB sections.
11657
afe47622
CS
116582008-06-30 Craig Silverstein <[email protected]>
11659
11660 * script.cc (Lex::can_continue_name): Make '?' allowable in
11661 version-script names.
11662 * testsuite/version_script.map: Change glob pattern to use '?'
11663
5adf9721
ILT
116642008-06-30 Manish Singh <[email protected]>
11665
11666 PR 6585
11667 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
11668 Correct typo.
11669
e6fde208
ILT
116702008-06-30 Ian Lance Taylor <[email protected]>
11671
11672 PR 6660
11673 PR 6682
11674 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
11675 versions]: Don't try to read the value in the contents, since we
11676 don't use it. Use the template endianness when writing.
11677
3f2e6a2d
CC
116782008-06-25 Cary Coutant <[email protected]>
11679
11680 * fileread.cc (File_read::make_view): Assert on zero-length view.
11681 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
11682 symbol table when there are no symbols to read.
11683
c43d3a48
CS
116842008-06-23 Craig Silverstein <[email protected]>
11685
11686 * version.cc (version_string): Bump to 1.7
11687
5f494ea0
CS
116882008-06-18 Craig Silverstein <[email protected]>
11689
11690 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
11691 constant 0xFFFF to type Valtype.
11692 (Powerpc_relocate_functions::rel16_ha): Likewise.
11693
c42e122e
ILT
116942008-06-17 Ian Lance Taylor <[email protected]>
11695
f34787f8
ILT
11696 * output.h (Output_section::Input_section): Initialize p2align_ to
11697 zero for Output_section_data constructors.
11698 (Output_section::Input_section::addralign): If not an input
11699 section, return the alignment of the Output_section_data.
11700 * testsuite/copy_test.cc: New file.
11701 * testsuite/copy_test_1.cc: New file.
11702 * testsuite/copy_test_2.cc: New file.
11703 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
11704 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
11705 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
11706 (copy_test_1_pic.o, copy_test_1.so): New targets.
11707 (copy_test_2_pic.o, copy_test_2.so): New targets.
11708 * testsuite/Makefile.in: Rebuild.
11709
c42e122e
ILT
11710 * script-sections.cc (Script_sections::place_orphan): Initialize
11711 local variable exact.
11712
ce3ac18a
DE
117132008-06-13 David Edelsohn <[email protected]>
11714
11715 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
11716
42cacb20
DE
117172008-06-12 David Edelsohn <[email protected]>
11718 David S. Miller <[email protected]>
11719
11720 * powerpc.cc: New file.
11721 * Makefile.am (TARGETSOURCES): Add powerpc.cc
11722 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
11723 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
11724 * Makefile.in: Rebuild.
11725
7b308235
ILT
117262008-06-09 Ian Lance Taylor <[email protected]>
11727
11728 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
11729 <exception>.
11730 (throwing, orig_terminate): New static variables.
11731 (terminate_handler): New static function.
11732 (t2): Set terminate handler.
11733
f0b886e3
ILT
117342008-06-05 Kris Van Hees <[email protected]>
11735
11736 PR 6584
cd536b21 11737 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
11738 alignment.
11739
3e90f135
CC
117402008-05-30 Cary Coutant <[email protected]>
11741
11742 * archive.cc (Archive::include_all_members) Correct to step
11743 over symbol table and extended name table in thin archives.
11744
e09ad04a
ILT
117452008-05-29 Kris Van Hees <[email protected]>
11746
11747 PR 6407
11748 * target-reloc.h (relocate_for_relocatable): Fix new_offset
11749 calculation.
11750
62b01cb5
ILT
117512008-05-28 Caleb Howe <[email protected]>
11752
11753 * reduced_debug_output.cc: New file.
11754 * reduced_debug_output.h: New file.
92de84a6 11755 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
11756 * options.cc (General_options::finalize): Add strip_debug_non_line
11757 to the strip heirarchy.
11758 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
11759 fields.
11760 * layout.cc: Include "reduced_debug_output.h".
11761 (Layout::Layout): Initialize new fields.
11762 (line_only_debug_sections): New static array.
11763 (is_lines_only_debug_sections): New static inline function.
11764 (Layout::include_section): Handle --strip-debug-non-line.
11765 (Layout::make_output_section): If --strip-debug-non-line, build
11766 new output sections for .debug_abbrev and .debug_info.
11767 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
11768 gold. Warn about possible overflow.
11769 (read_signed_LEB_128): Likewise.
11770 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
11771 (read_signed_LEB_128): Declare.
11772 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
11773 (HFILES): Add reduced_debug_output.h.
11774 * Makefile.in: Rebuild.
11775
7d9e3d98
ILT
117762008-05-21 Ian Lance Taylor <[email protected]>
11777
11778 * mapfile.cc: New file.
11779 * mapfile.h: New file.
11780 * options.h (class General_options): Add -M/--print-map and -Map.
11781 * options.cc (General_options::finalize): Make -M equivalent to
11782 -Map -.
11783 * main.cc: Include <cstdio> and "mapfile.h".
11784 (main): Open mapfile if requested.
11785 * gold.cc (class Middle_runner): Add mapfile_ field. Update
11786 constructor. Change caller.
11787 (queue_initial_tasks): Add mapfile parameter. Change caller.
11788 (queue_middle_tasks): Likewise.
11789 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
11790 declarations.
11791 * archive.cc: Include "mapfile.h".
11792 (Archive::add_symbols): Add mapfile parameter. Change all
11793 callers. Pass mapfile, symbol, and reason to include_member.
11794 (Archive::include_all_members): Add mapfile parameter. Change all
11795 callers.
11796 (Archive::include_member): Add mapfile, sym, and why parameters.
11797 Change all callers. Report inclusion to map file.
11798 * archive.h: Include "fileread.h".
11799 (class Archive): Update declarations.
11800 (Archive::file): New const method.
11801 (class Add_archive_symbols): Add mapfile_ field. Update
11802 constructor. Change all callers.
11803 * readsyms.h (class Read_symbols): Likewise.
11804 (class Finish_group): Likewise.
11805 (class Read_script): Likewise.
11806 * common.cc: Include "mapfile.h".
11807 (Symbol_table::allocate_commons): Add mapfile parameter. Change
11808 all callers.
11809 (Symbol_table::do_allocate_commons): Likewise.
11810 (Symbol_table::do_allocate_commons_list): Likewise. Report common
11811 symbol allocation to mapfile.
11812 * common.h (class Allocate_commons_task): Add mapfile_ field.
11813 Update constructor. Change all callers.
11814 * symtab.h (class Symbol_table): Update declarations.
11815 * layout.cc: Include "mapfile.h".
11816 (Layout_task_runner::run): Print information to mapfile.
11817 (Layout::create_gold_note): Change Output_data_fixed_space to
11818 Output_data_zero_fill.
11819 (Layout::create_build_id): Likewise.
11820 (Layout::print_to_mapfile): New function.
11821 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
11822 constructor. Change caller.
11823 (class Layout): Declare print_to_mapfile.
11824 * output.cc (Output_section::Input_section::print_to_mapfile): New
11825 function.
11826 (Output_section::add_input_section): If producing a map, always
11827 add to input_sections_ list.
11828 (Output_section::do_print_to_mapfile): New function.
11829 (Output_segment::print_sections_to_mapfile): New function.
11830 (Output_segment::print_section_list_to_mapfile): New function.
11831 * output.h: Include "mapfile.h".
11832 (Output_data::print_to_mapfile): New function.
11833 (Output_data::do_print_to_mapfile): New virtual function.
11834 (Output_segment_headers::do_print_to_mapfile): New function.
11835 (Output_file_header::do_print_to_mapfile): New function.
11836 (Output_data_const::do_print_to_mapfile): New function.
11837 (class Output_data_const_buffer): Add map_name_ field. Update
11838 constructor. Change all callers. Add do_print_to_mapfile
11839 function.
11840 (class Output_data_fixed_space): Likewise.
11841 (class Output_data_space): Likewise.
11842 (class Output_data_zero_fill): New class.
11843 (Output_data_strtab::do_print_to_mapfile): New function.
11844 (Output_data_reloc_base::do_print_to_mapfile): New function.
11845 (Output_relocatable_relocs::do_print_to_mapfile): New function.
11846 (Output_data_group::do_print_to_mapfile): New function.
11847 (Output_data_got::do_print_to_mapfile): New function.
11848 (Output_data_dynamic::do_print_to_mapfile): New function.
11849 (Output_symtab_xindex::do_print_to_mapfile): New function.
11850 (class Output_section): Declare do_print_to_mapflie. Declare
11851 print_to_mapfile in Input_section.
11852 (class Output_segment): Declare new functions.
11853 * object.h (Sized_relobj::symbol_count): New function.
11854 * script-sections.cc
11855 (Output_section_element_dot_assignment::set_section_addresses):
11856 Change Output_data_fixed_space to Output_data_zero_fill.
11857 (Output_data_expression::do_print_to_mapfile): New function.
11858 * script.cc (read_input_script): Add mapfile parameter. Change
11859 all callers.
11860 * script.h (read_input_script): Update declaration.
11861 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
11862 (Eh_frame::do_print_to_mapfile): New function.
11863 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
11864 (Output_merge_string::do_print_to_mapfile): New function.
11865 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
11866 function.
11867 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
11868 function.
11869 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
11870 function.
11871 * Makefile.am (CCFILES): Add mapfile.cc.
11872 (HFILES): Add mapfile.h.
11873 * Makefile.in: Rebuild.
11874
9f1d377b
ILT
118752008-05-19 Ian Lance Taylor <[email protected]>
11876
11877 * options.h (class General_options): Add -z relro.
11878 * layout.cc (Layout::Layout): Initialize relro_segment_.
11879 (Layout::add_output_section_data): Return the output section.
11880 (Layout::make_output_section): Rcognize relro sections and mark
11881 them appropriately.
11882 (Layout::attach_allocated_section_to_segment): Put relro sections
11883 in a PT_GNU_RELRO segment.
11884 (Layout::create_initial_dynamic_sections): Mark the .dynamic
11885 section as relro.
11886 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
11887 PT_TLS segments.
11888 (Layout::linkonce_mapping): Map d.rel.ro.local to
11889 .data.rel.ro.local.
11890 (Layout::output_section_name): Us .data.rel.ro.local for any
11891 section which begins with that.
11892 * layout.h (class Layout): Update add_output_section_data
11893 declaration. Add relro_segment_ field.
11894 * output.cc (Output_section::Output_section): Initialize is_relro_
11895 and is_relro_local_ fields.
11896 (Output_segment::add_output_section): Group relro sections.
11897 (Output_segment::is_first_section_relro): New function.
11898 (Output_segment::maximum_alignment): If there is a relro section,
11899 align the segment to the common page size.
11900 (Output_segment::set_section_addresses): Track whether we are
11901 looking at relro sections. If the last section is a relro
11902 section, align to the common page size.
11903 (Output_segment::set_section_list_addresses): Add in_relro
11904 parameter. Change all callers. Align to the page size when
11905 moving from relro to non-relro section.
11906 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
11907 segment.
11908 * output.h (class Output_section): Add is_relro_ and
11909 is_relro_local_ fields.
11910 (Output_section::is_relro): New function.
11911 (Output_section::set_is_relro): New function.
11912 (Output_section::is_relro_local): New function.
11913 (Output_section::set_is_relro_local): New function.
11914 (class Output_segment): Update declarations.
11915 * i386.cc (Target_i386::got_section): Mark .got section as relro.
11916 * sparc.cc (Target_sparc::got_section): Likewise.
11917 * x86_64.cc (Target_x86_64::got_section): Likewise.
11918 * testsuite/relro_test_main.cc: New file.
11919 * testsuite/relro_test.cc: New file.
11920 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
11921 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
11922 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
11923 (relro_test.so, relro_test_pic.o): New targets.
11924 * testsuite/Makefile.in: Rebuild.
11925
a984ee1d
ILT
119262008-05-16 Ian Lance Taylor <[email protected]>
11927
01676dcd
ILT
11928 * output.cc (Output_segment::add_output_section): Remove front
11929 parameter.
11930 * output.h (class Output_segment): Remove
11931 add_initial_output_section and overloaded add_output_section.
11932 Update declaration of remaining add_output_section.
11933 * layout.cc (Layout::create_interp): Call add_output_section
11934 rather than add_initial_output_section.
11935 (Layout::finish_dynamic_section): Likewise.
11936
497897f9
ILT
11937 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
11938 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
11939 know the dynamic type.
11940 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
11941 field. Initialize it in constructor.
11942 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
11943 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
11944 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
11945 reloc.
11946
a984ee1d
ILT
11947 * output.cc (Output_reloc::get_address): Change return type to
11948 Elf_Addr.
11949 * output.h (class Output_reloc): Update get_address declaration.
11950 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
11951 for section addresses.
11952
55ba0940
ILT
119532008-05-09 Ian Lance Taylor <[email protected]>
11954
11955 PR 6493
11956 * gold.cc (gold_nomem): Use return value of write.
11957
75517b77
ILT
119582008-05-08 Ian Lance Taylor <[email protected]>
11959
11960 * symtab.c (Symbol::init_base_output_data): Add version
11961 parameter. Change all callers.
11962 (Symbol::init_base_output_segment): Likewise.
11963 (Symbol::init_base_constant): Likewise.
11964 (Symbol::init_base_undefined): Likewise.
11965 (Sized_symbol::init_output_data): Likewise.
11966 (Sized_symbol::init_output_segment): Likewise.
11967 (Sized_symbol::init_constant): Likewise.
11968 (Sized_symbol::init_undefined): Likewise.
11969 (Symbol_table::do_define_in_output_data): If the new symbol has a
11970 version, mark it as the default.
11971 (Symbol_table::do_define_in_output_segment): Likewise.
11972 (Symbol_table::do_define_as_constant): Likewise.
11973 * symtab.h (class Symbol): Update declarations.
11974 (class Sized_symbol): Likewise.
11975 * resolve.cc (Symbol::override_version): New function.
c42e122e 11976 (Symbol::override_base): Call override_version.
75517b77
ILT
11977 (Symbol::override_base_with_special): Likewise.
11978 * testsuite/ver_script_8.script: New file.
11979 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
11980 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
11981 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
11982 (ver_test_8_1.so, ver_test_8_2.so): New targets.
11983
f1f70eae
ILT
119842008-05-06 Ian Lance Taylor <[email protected]>
11985
f3e9c5c5
ILT
11986 PR 6049
11987 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
11988 functions.
11989 (class General_options): Remove existing --undefined, and add
11990 --no-undefined instead. Add new --undefined as synonym for -u.
11991 * archive.cc (Archive::add_symbols): Check whether symbol was
11992 named with -u.
11993 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
11994 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
11995 all uses. Add IS_UNDEFINED. Update declarations to split
11996 different versions of init_base. Declare init_base_undefined.
11997 (Symbol::is_defined): Handle IS_UNDEFINED.
11998 (Symbol::is_undefined): Likewise.
11999 (Symbol::is_weak_undefined): Call is_undefined.
12000 (Symbol::is_absolute): Handle IS_CONSTANT.
12001 (class Sized_symbol): Update declarations to split different
12002 versions of init. Declare init_undefined.
12003 (class Symbol_table): Declare new functions.
12004 * symtab.cc (Symbol::init_base_object): Rename from init_base.
12005 Change all callers.
12006 (Symbol::init_base_output_data): Likewise.
12007 (Symbol::init_base_output_segment): Likewise.
12008 (Symbol::init_base_constant): Likewise.
12009 (Symbol::init_base_undefined): New function.
12010 (Sized_symbol::init_object): Rename from init. Change all
12011 callers.
12012 (Sized_symbol::init_output_data): Likewise.
12013 (Sized_symbol::init_output_segment): Likewise.
12014 (Sized_symbol::init_constant): Likewise.
12015 (Sized_symbol::init_undefined): New function.
12016 (Symbol_table::add_undefined_symbols_from_command_line): New
12017 function.
12018 (Symbol_table::do_add_undefined_symbols_from_command_line): New
12019 function.
12020 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
12021 (Symbol::output_section): Likewise.
12022 (Symbol::set_output_section): Likewise.
12023 (Symbol_table::sized_finalize_symbol): Likewise.
12024 (Symbol_table::sized_write_globals): Likewise.
12025 * resolve.cc (Symbol_table::should_override): Likewise.
12026 (Symbol::override_base_with_special): Likewise.
12027
8bdcdf2c
ILT
12028 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
12029 symbol, change it to have default visibility.
12030 * testsuite/protected_1.cc: New file.
12031 * testsuite/protected_2.cc: New file.
12032 * testsuite/protected_3.cc: New file.
12033 * testsuite/protected_main_1.cc: New file.
12034 * testsuite/protected_main_2.cc: New file.
12035 * testsuite/protected_main_3.cc: New file.
12036 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
12037 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
12038 (protected_1_LDFLAGS, protected_1_LDADD): Define.
12039 (protected_1.so): New target.
12040 (protected_1_pic.o, protected_2_pic.o): New targets.
12041 (protected_3_pic.o): New target.
12042 (check_PROGRAMS): Add protected_2.
12043 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
12044 (protected_2_LDFLAGS, protected_2_LDADD): Define.
12045 * testsuite/Makefile.in: Rebuild.
12046
2b706932
ILT
12047 * options.h (DEFINE_var): Add set_user_set_##varname__.
12048 (DEFINE_bool_alias): New macro.
12049 (class General_options): Define -Bstatic using DEFINE_bool_alias
12050 rather than DEFINE_special. Add --undefined as an alias for -z
12051 defs.
12052 * options.cc (General_options::parse_Bstatic): Remove.
12053
d82a5bcc
ILT
12054 * options.h (class General_options): Add --fatal-warnings.
12055 * main.cc (main): Implement --fatal-warnings.
12056 * errors.h (Errors::warning_count): New function.
12057
f1f70eae
ILT
12058 * options.h (class General_options): Add -Bsymbolic-functions.
12059 * symtab.h (Symbol::is_preemptible): Check for
12060 -Bsymbolic-functions.
12061
8825ac63
ILT
120622008-05-05 Ian Lance Taylor <[email protected]>
12063
d98bc257
ILT
12064 * options.h (DEFINE_bool): For DASH_Z, create the negative option
12065 as noVARNAME rather than no-VARNAME.
12066 (class General_options): Add option -z combreloc.
12067 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
12068 get_address.
12069 (Output_reloc::sort_before) [SHT_REL]: New function.
12070 (Output_reloc::sort_before) [SHT_RELA]: New function.
12071 (class Output_data_reloc_base): Add sort_relocs_ field. Define
12072 Sort_relocs_comparison.
12073 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
12074 parameter. Change all callers.
12075 (Output_data_reloc::Output_data_reloc) [both versions]: Add
12076 sort_relocs parameter. Change all callers.
12077 * output.cc (Output_reloc::get_address): New function, broken out
12078 of write_rel.
12079 (Output_reloc::write_rel): Call it.
12080 (Output_reloc::compare): New function.
12081 (Output_data_reloc_base::do_write): Optionally sort relocs.
12082
60b2b4e7
ILT
12083 * configure.ac: If targ_extra_obj is set, link it in.
12084 * configure.tgt: Initialize all variables.
12085 (x86_64*): Set targ_extra_obj and targ_extra_size.
12086 * configure: Rebuild.
12087
8825ac63
ILT
12088 * object.cc (Sized_relobj::include_section_group): Adjust section
12089 indexes read from group data. Build vector to pass to
12090 layout_group.
12091 * layout.cc (Layout::layout_group): Add flags and shndxes
12092 parameters. Remove contents parameter. Change caller. Update
12093 explicit instantiations.
12094 * layout.h (class Layout): Update layout_group declaration.
12095 * output.cc (Output_data_group::Output_data_group): Add flags and
12096 input_shndxes parameters. Remove contents parameter. Change
12097 caller.
12098 (Output_data_group::do_write): Change input_sections_ to
12099 input_shndxes_.
12100 * output.h (class Output_data_group): Update constructor
12101 declaration. Rename input_sections_ to input_shndxes_.
12102 * testsuite/many_sections_test.cc: Add template.
12103
e94cf127
CC
121042008-04-30 Cary Coutant <[email protected]>
12105
4418b2d5
CC
12106 * target-reloc.h (relocate_section): Fix dead-pointer bug.
12107
e94cf127
CC
12108 * layout.cc (Layout::include_section): Refactored check for debug
12109 info section.
12110 (Layout::add_comdat): Add new parameters. Change type
12111 of signature parameter. Add object and shndx to signatures table.
12112 (Layout::find_kept_object): New function.
12113 * layout.h: Include <cstring>.
12114 (Layout::is_debug_info_section): New function.
12115 (Layout::add_comdat): Add new parameters.
12116 (Layout::find_kept_object): New function.
12117 (Layout::Kept_section): New struct.
12118 (Layout::Signatures): Change type of map range.
12119 * object.cc (Relobj::output_section_address): New function.
12120 (Sized_relobj::include_section_group): Add new parameters. Change
12121 calls to Layout::add_comdat. Change to build table of kept comdat
12122 groups and table mapping discarded sections to kept sections.
12123 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
12124 (Sized_relobj::do_layout): Change calls to include_section_group and
12125 include_linkonce_section.
12126 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
12127 value to zero when section is discarded.
12128 (Sized_relobj::map_to_kept_section): New function.
12129 * object.h (Relobj::output_section_address): New function.
12130 (Relobj::Comdat_group): New type.
12131 (Relobj::find_comdat_group): New function.
12132 (Relobj::Comdat_group_table): New type.
12133 (Relobj::Kept_comdat_section): New type.
12134 (Relobj::Kept_comdat_section_table): New type.
12135 (Relobj::add_comdat_group): New function.
12136 (Relobj::set_kept_comdat_section): New function.
12137 (Relobj::get_kept_comdat_section): New function.
12138 (Relobj::comdat_groups_): New field.
12139 (Relobj::kept_comdat_sections_): New field.
12140 (Symbol_value::input_value): Update comment.
12141 (Sized_relobj::map_to_kept_section) New function.
12142 (Sized_relobj::include_linkonce_section): Add new parameter.
12143 * target-reloc.h (Comdat_behavior): New type.
12144 (get_comdat_behavior): New function.
12145 (relocate_section): Add code to map a discarded section to the
12146 corresponding kept section when applying a relocation.
12147
e4e5049b
CS
121482008-04-30 Craig Silverstein <[email protected]>
12149
12150 * dwarf_reader.cc (next_generation_count): New static var.
12151 (Addr2line_cache_entry): New struct.
12152 (addr2line_cache): New static var.
12153 (Dwarf_line_info::one_addr2line): Added caching.
12154 (Dwarf_line_info::clear_addr2line_cache): New function.
12155 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
12156 cache-size parameter.
12157 (Dwarf_line_info::one_addr2line_cache): New function.
12158 * symtab.cc (Symbol_table::detect_odr_violations): Pass
12159 new cache-size argument to one_addr2line(), and clear cache.
12160
d09e9154
CC
121612008-04-28 Cary Coutant <[email protected]>
12162
12163 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
12164 R_386_PC8 relocations.
12165
7ef73768
ILT
121662008-04-23 Ian Lance Taylor <[email protected]>
12167
55438702
ILT
12168 * object.cc (Sized_relobj::include_section_group): Check for
12169 invalid section group.
12170
c165fb93
ILT
12171 * object.cc (make_elf_object): Correct test for 64-bit ELF file
12172 header size.
12173
7ef73768
ILT
12174 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
12175 than read for file header.
12176 * archive.cc (Archive::include_member): Likewise.
12177
6194aaab
L
121782008-04-23 Paolo Bonzini <[email protected]>
12179
12180 * aclocal.m4: Regenerate.
12181 * configure: Regenerate.
12182
d491d34e
ILT
121832008-04-19 Ian Lance Taylor <[email protected]>
12184
5ea2bac6
ILT
12185 * version.cc (version_string): Bump to 1.6.
12186
7bc3e21a
ILT
12187 * testsuite/Makefile.am (many_sections_r_test): New target.
12188 (many_sections_r_test_SOURCES): Remove.
12189 (many_sections_r_test_DEPENDENCIES): Remove.
12190 (many_sections_r_test_LDFLAGS): Remove.
12191 (many_sections_r_test_LDADD): Remove.
12192
7fcd3aa9
ILT
12193 * object.cc (Sized_relobj::do_add_symbols): Always pass
12194 local_symbol_count_ to add_from_relobj.
12195
4c94d6ae
ILT
12196 * testsuite/Makefile.am (many_sections_check.h): Only check one in
12197 every thousand variables.
12198 * testsuite/Makefile.in: Rebuild.
12199
d491d34e
ILT
12200 * object.cc (Xindex::initialize_symtab_xindex): New function.
12201 (Xindex::read_symtab_xindex): New function.
12202 (Xindex::sym_xindex_to_shndx): New function.
12203 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
12204 available.
12205 (Sized_relobj::do_initialize_xindex): New function.
12206 (Sized_relobj::do_read_symbols): Adjust section links.
12207 (Sized_relobj::symbol_section_and_value): Add is_ordinary
12208 parameter. Change all callers.
12209 (Sized_relobj::include_section_group): Adjust section links and
12210 symbol section indexes.
12211 (Sized_relobj::do_layout): Adjust section links.
12212 (Sized_relobj::do_count_local_symbols): Adjust section links and
12213 symbol section indexes.
12214 (Sized_relobj::do_finalize_local_symbols): Distinguish between
12215 ordinary and special symbols.
12216 (Sized_relobj::write_local_symbols): Add symtab_xindex and
12217 dynsym_xindex parameters. Change all callers. Adjust section
12218 links. Use SHN_XINDEX when needed.
12219 (Sized_relobj::get_symbol_location_info): Adjust section links.
12220 Don't get fooled by special symbols.
12221 * object.h (class Xindex): Define.
12222 (class Object): Add xindex_ parameter. Declare virtual functoin
12223 do_initialize_xindex.
12224 (Object::adjust_sym_shndx): New function.
12225 (Object::set_xindex): New protected function.
12226 (class Symbol_value): Add is_ordinary_shndx_ field.
12227 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
12228 (Symbol_value::value): Assert ordinary section.
12229 (Symbol_value::initialize_input_to_output_map): Likewise.
12230 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
12231 Change all callers.
12232 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
12233 all callers.
12234 (class Sized_relobj): Update declarations.
12235 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
12236 parameter. Change all callers.
12237 (Sized_relobj::adjust_shndx): New function.
12238 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
12239 field.
12240 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
12241 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
12242 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
12243 (Sized_dynobj::read_dynsym_section): Adjust section links.
12244 (Sized_dynobj::read_dynamic): Likewise.
12245 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
12246 section links.
12247 (Sized_dynobj::do_initialize_xindex): New function.
12248 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
12249 do_initialize_xindex.
12250 (Sized_dynobj::adjust_shndx): New function.
12251 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
12252 dynsym_xindex_ fields.
12253 (Layout::finalize): Add a call to set_section_indexes before
12254 creating the symtab sections.
12255 (Layout::set_section_indexes): Don't do anything if the section
12256 already has a section index.
12257 (Layout::create_symtab_sections): Add shnum parameter. Change
12258 caller. Create .symtab_shndx section if needed.
12259 (Layout::create_shdrs): Add shstrtab_section parameter. Change
12260 caller.
12261 (Layout::allocated_output_section_count): New function.
12262 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
12263 needed.
12264 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
12265 fields. Update declarations.
12266 (Layout::symtab_xindex): New function.
12267 (Layout::dynsym_xindex): New function.
12268 (class Write_symbols_task): Add layout_ field.
12269 (Write_symbols_task::Write_symbols_task): Add layout parameter.
12270 Change caller.
12271 * output.cc (Output_section_headers::Output_section_headers): Add
12272 shstrtab_section parameter. Change all callers.
12273 (Output_section_headers::do_sized_write): Store overflow values
12274 for section count and section string table section index in
12275 section header zero.
12276 (Output_file_header::do_sized_write): Check for overflow of
12277 section count and section string table section index.
12278 (Output_symtab_xindex::do_write): New function.
12279 (Output_symtab_xindex::endian_do_write): New function.
12280 * output.h (class Output_section_headers): Add shstrtab_section_.
12281 Update declarations.
12282 (class Output_symtab_xindex): Define.
12283 (Output_section::has_out_shndx): New function.
12284 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
12285 field.
12286 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
12287 Change all callers.
12288 (Sized_symbol::init): Likewise.
12289 (Symbol::output_section): Check for ordinary symbol.
12290 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
12291 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
12292 callers.
12293 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
12294 Change all callers. Simplify handling of symbols from sections
12295 not included in the link.
12296 (Symbol_table::add_from_dynobj): Handle ordinary symbol
12297 distinction.
12298 (Weak_alias_sorter::operator()): Assert that symbols are
12299 ordinary.
12300 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
12301 distinction.
12302 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
12303 parameters. Change all callers.
12304 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
12305 symbol distinction. Use SHN_XINDEX when needed.
12306 (Symbol_table::write_section_symbol): Add symtab_xindex
12307 parameter. Change all callers.
12308 (Symbol_table::sized_write_section_symbol): Likewise. Use
12309 SHN_XINDEX when needed.
12310 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
12311 declarations.
12312 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
12313 (Symbol::is_defined): Check is_ordinary.
12314 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
12315 (Symbol::is_absolute, Symbol::is_common): Likewise.
12316 (class Sized_symbol): Update declarations.
12317 (class Symbol_table): Update declarations.
12318 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
12319 parameters. Change all callers.
12320 (Sized_symbol::override): Likewise.
12321 (Symbol_table::override): Likewise.
12322 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
12323 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
12324 is_ordinary, and orig_st_shndx parameters. Change all callers.
12325 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
12326 to be in an ordinary section.
12327 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
12328 object and is_ordinary parameters. Change all callers.
12329 (Sized_dwarf_line_info::read_relocs): Add object parameter.
12330 Change all callers. Don't add undefined or non-ordinary symbols
12331 to reloc_map_.
12332 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
12333 Change all callers.
12334 * dwarf_reader.h (class Sized_dwarf_line_info): Update
12335 declarations.
12336 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
12337 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
12338 (Sized_relobj::relocate_sections): Likewise.
12339 * target-reloc.h (scan_relocs): Adjust section symbol index.
12340 (scan_relocatable_relocs): Likewise.
12341 * i386.cc (Scan::local): Check for ordinary symbols.
12342 * sparc.cc (Scan::local): Likewise.
12343 * x86_64.cc (Scan::local): Likewise.
12344 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
12345 to symbol_section_and_value.
12346 * testsuite/many_sections_test.cc: New file.
12347 * testsuite/Makefile.am (BUILT_SOURCES): Define.
12348 (check_PROGRAMS): Add many_sections_test.
12349 (many_sections_test_SOURCES): Define.
12350 (many_sections_test_DEPENDENCIES): Define.
12351 (many_sections_test_LDFLAGS): Define.
12352 (BUILT_SOURCES): Add many_sections_define.h.
12353 (many_sections_define.h): New target.
12354 (BUILT_SOURCES): Add many_sections_check.h.
12355 (many_sections_check.h): New target.
12356 (check_PROGRAMS): Add many_sections_r_test.
12357 (many_sections_r_test_SOURCES): Define.
12358 (many_sections_r_test_DEPENDENCIES): Define.
12359 (many_sections_r_test_LDFLAGS): Define.
12360 (many_sections_r_test_LDADD): Define.
12361 (many_sections_r_test.o): New target.
12362 * testsuite/Makefile.in: Rebuild.
12363
c5818ff1
CC
123642008-04-17 Cary Coutant <[email protected]>
12365
12366 * errors.cc (Errors::info): New function.
12367 (gold_info): New function.
12368 * errors.h (Errors::info): New function.
12369 * gold.h (gold_info): New function.
12370 * object.cc (Input_objects::add_object): Print trace output.
12371 * options.cc (options::parse_set): New function.
12372 (General_options::parse_wrap): Deleted.
12373 (General_options::General_options): Deleted initializer.
12374 * options.h (options::String_set): New typedef.
12375 (options::parse_set): New function.
12376 (DEFINE_set): New macro.
12377 (General_options::wrap): Changed to use DEFINE_set. Changed
12378 callers of any_wrap_symbols and is_wrap_symbol.
12379 (General_options::trace, General_options::trace_symbol):
12380 New options.
12381 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
12382 (General_options::wrap_symbols_): Deleted.
12383 * symtab.cc (Symbol_table::add_from_object): Print trace output.
12384
b5be4a7c
DM
123852008-04-17 David S. Miller <[email protected]>
12386
12387 * options.cc (General_options::parse_V): New function.
12388 * options.h: Add entries for -V and -Qy.
12389
155a0dd7
ILT
123902008-04-17 Ian Lance Taylor <[email protected]>
12391
12392 * common.cc (Symbol_table::allocate_commons): Remove options
12393 parameter. Change caller.
12394 (Symbol_table::do_allocate_commons): Remove options parameter.
12395 Change caller. Just call do_allocate_commons_list twice.
12396 (Symbol_table::do_allocate_commons_list): New function, broken out
12397 of do_allocate_commons.
12398 * common.h (class Allocate_commons_task): Remove options_ field.
12399 Update constructor.
12400 * symtab.cc (Symbol_table::Symbol_table): Initialize
12401 tls_commons_.
12402 (Symbol_table::add_from_object): Put TLS common symbols on
12403 tls_commons_ list.
12404 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
12405 which are IN_OUTPUT_DATA.
12406 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
12407 allocate_commons and do_allocate_commons declarations. Declare
12408 do_allocate_commons_list.
12409 * gold.cc (queue_middle_tasks): Update creation of
12410 Allocate_commons_task to not pass options.
12411 * testsuite/Makefile.am (INCLUDES): Add -I.. .
12412 (TLS_TEST_C_FLAGS): New variable.
12413 (tls_test_c_pic.o): New target.
12414 (tls_test_shared.so): Link in tls_test_c_pic.o.
12415 (tls_test_c_pic_ie.o): New target.
12416 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
12417 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
12418 (tls_test_c.o): New target.
12419 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
12420 (tls_pic_test_LDADD): Likewise.
12421 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
12422 (tls_shared_gd_to_ie_test_LDADD): Likewise.
12423 (tls_test_c_gnu2.o): New target.
12424 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
12425 tls_test_c_gnu2.o.
12426 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
12427 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
12428 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
12429 * testsuite/tls_test.cc: Include "config.h".
12430 (t_last): Call t11_last.
12431 * testsuite/tls_test.h (t11, t11_last): Declare.
12432 * testsuite/tls_test_c.c: New file.
12433 * testsuite/tls_test_main.cc (thread_routine): Call t11.
12434 * configure.ac: Check for OpenMP support.
12435 * configure, config.in, Makefile.in: Rebuild.
12436 * testsuite/Makefile.in: Rebuild.
12437
edfbb029
CC
124382008-04-16 Cary Coutant <[email protected]>
12439
12440 * i386.cc (Target_i386::define_tls_base_symbol): New function.
12441 (Target_i386::tls_base_symbol_defined_): New field.
12442 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12443 (Target_i386::Scan::global): Likewise.
12444 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
12445 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
12446 (Target_x86_64::tls_base_symbol_defined_): New field.
12447 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12448 (Target_x86_64::Scan::global): Likewise.
12449
f3c69fca
CC
124502008-04-16 Cary Coutant <[email protected]>
12451
12452 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
12453 (Symbol::needs_plt_entry): Allow weak undefined symbols.
12454 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
12455 building shared libraries.
12456 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
12457 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
12458 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
12459 * testsuite/Makefile.in: Rebuild.
12460 * testsuite/weak_undef.h: New file.
12461 * testsuite/weak_undef_file1.cc: Add extra test cases.
12462 * testsuite/weak_undef_file2.cc: Likewise.
12463 * testsuite/weak_undef_test.cc: Likewise.
12464
7c414435
DM
124652008-04-16 David S. Miller <[email protected]>
12466
32b769e1
DM
12467 * sparc.cc (Target_sparc::Scan): Change from struct to class.
12468 Add issued_non_pic_error_ field. Declare check_non_pic.
12469 (Target_sparc::Scan::check_non_pic): New function.
12470 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
12471 (Target_sparc::Scan::global): Likewise.
12472
11936fb1
DM
12473 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
12474 * configure: Rebuild.
12475
7c414435
DM
12476 * options.h (DEFINE_enable): New macro.
12477 (new_dtags): New enable option.
12478 (initfirst, interpose, loadfltr, nodefaultlib,
12479 nodelete, nodlopen, nodump): New -z options.
12480 * layout.cc (Layout:finish_dynamic_section): If new
12481 dtags enabled, emit DT_RUNPATH. Also, emit a
12482 DT_FLAGS_1 containing any specified -z flags.
12483
85c7bf8b
ILT
124842008-04-16 Ian Lance Taylor <[email protected]>
12485
12c0daef
ILT
12486 * copy-relocs.cc: New file.
12487 * copy-relocs.h: New file.
12488 * reloc.cc: Remove Copy_relocs code.
12489 * reloc.h: Likewise.
12490 * reloc-types.h (struct Reloc_types) [both versions]: Add
12491 get_reloc_addend_noerror.
12492 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
12493 variants of add_global which take an addend which must be zero.
12494 * i386.cc: Include "copy-relocs.h".
12495 (class Target_i386): Change type of copy_relocs_ to variable,
12496 update initializer.
12497 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
12498 Change all callers.
12499 (Target_i386::do_finalize_sections): Change handling of
12500 copy_relocs_.
12501 * sparc.cc: Include "copy-relocs.h".
12502 (class Target_sparc): Change type of copy_relocs_ to variable,
12503 update initializer.
12504 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
12505 Change all callers.
12506 (Target_sparc::do_finalize_sections): Change handling of
12507 copy_relocs_.
12508 * x86_64.cc: Include "copy-relocs.h".
12509 (class Target_x86_64): Change type of copy_relocs_ to variable,
12510 update initializer.
12511 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
12512 class. Change all callers.
12513 (Target_x86_64::do_finalize_sections): Change handling of
12514 copy_relocs_.
12515 * Makefile.am (CCFILES): Add copy-relocs.cc.
12516 (HFILES): Add copy-relocs.h.
12517
4f4995b6
ILT
12518 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
12519
85c7bf8b
ILT
12520 * testsuite/script_test_4.sh: Permit leading zeroes.
12521
4f2a9edd
ILT
125222008-04-15 Ian Lance Taylor <[email protected]>
12523
e6188289
ILT
12524 * script-sections.cc (Script_sections::create_segments): Use
12525 header_size_adjustment even when there is enough room for the
12526 headers.
12527 * testsuite/script_test_4.sh: New file.
12528 * testsuite/script_test_4.t: New file.
12529 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
12530 (check_DATA): Add script_test_4.stdout.
12531 (MOSTLYCLEANFILES): Likewise.
12532 (script_test_4): New target.
12533 (script_test_4.stdout): New target.
12534 * testsuite/Makefile.in: Rebuild.
12535
4f2a9edd
ILT
12536 * sparc.cc: Add definitions for Output_data_plt_sparc class
12537 constants.
12538
f5314dd5
DM
125392008-04-14 David S. Miller <[email protected]>
12540
12541 * sparc.cc: New file.
12542 * Makefile.am (TARGETSOURCES): Add sparc.cc
12543 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
12544 * configure.tgt: Document targ_extra_size and
12545 targ_extra_big_endian. Add entries for sparc-* and
12546 sparc64-*.
12547 * configure.ac: Handle targ_extra_size and
12548 targ_extra_big_endian.
12549 * Makefile.in: Rebuild.
12550 * configure: Likewise.
12551 * po/POTFILES.in: Likewise.
12552 * po/gold.pot: Likewise.
12553
154e0e9a
ILT
125542008-04-14 Ian Lance Taylor <[email protected]>
12555
12556 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
12557 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
12558 in the name/type/flags to section mapping. Don't call
12559 allocate_output_section.
12560 (Layout::choose_output_section): Change parameter from adjust_name
12561 to is_input_section. Don't permit input sections after sections
12562 are attached to segments. Don't call allocate_output_section.
12563 (Layout::layout_eh_frame): Call update_flags_for_input_section,
12564 not write_enable_output_section.
12565 (Layout::make_output_section): Don't push to
12566 unattached_section_list_ nor call attach_to_segment. Call
12567 attach_section_to_segment if sections are attached.
12568 (Layout::attach_sections_to_segments): New function.
12569 (Layout::attach_section_to_segment): New function.
12570 (Layout::attach_allocated_section_to_segment): Rename from
12571 attach_to_segment. Remove flags parameter.
12572 (Layout::allocate_output_section): Remove function.
12573 (Layout::write_enable_output_section): Remove function.
12574 * layout.h (class Layout): Update for above changes. Add new
12575 field sections_are_attached_.
12576 * output.h (Output_section::update_flags_for_input_section): New
12577 function.
12578 * output.cc (Output_section::add_input_section): Call
12579 update_flags_for_input_section.
12580 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
12581
009a67a2
CC
125822008-04-11 Cary Coutant <[email protected]>
12583
12584 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
12585 thought unnecessary.
12586 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
12587
759b1a24
ILT
125882008-04-11 Ian Lance Taylor <[email protected]>
12589
12590 * output.h (class Output_section_data): Remove inline definition
12591 of set_addralign.
12592 * output.cc (Output_section_data::set_addralign): New function.
12593
c2b45e22
CC
125942008-04-11 Cary Coutant <[email protected]>
12595
12596 Add support for TLS descriptors for i386 and x86_64.
12597 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
12598 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
12599 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
12600 GOT_TYPE_TLS_DESC.
12601 (Target_i386::got_mod_index_entry): Remove unnecessary code.
12602 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
12603 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
12604 relocations.
12605 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
12606 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
12607 Fix problem with initial-exec relocations.
12608 (Target_i386::Relocate::relocate_tls): Likewise.
12609 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
12610 relaxation.
12611 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
12612 support for section-plus-offset dynamic table entries.
12613 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
12614 (Output_data_dynamic::Dynamic_entry): Add support for
12615 section-plus-offset dynamic table entries.
12616 (Output_data_dynamic::Classification): Likewise.
12617 (Output_data_dynamic::classification_): Renamed offset_.
12618 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
12619 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
12620 (Target_x86_64::make_plt_section): New function.
12621 (Target_x86_64::reserve_tlsdesc_entries): New function.
12622 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
12623 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
12624 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
12625 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
12626 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
12627 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
12628 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
12629 add extra PLT entry for TLS descriptors.
12630 (Output_data_plt_x86_64::got_): New field.
12631 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
12632 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
12633 fields.
12634 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
12635 descriptors.
12636 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
12637 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
12638 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
12639 R_386_TLS_DESC_CALL relocations.
12640 (Target_x86_64::Scan::global): Likewise.
12641 (Target_x86_64::do_finalize_sections): Add dynamic table entries
12642 for TLS descriptors.
12643 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
12644 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
12645 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
12646 GD-to-IE relaxation.
12647 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
12648 and TLS_DESCRIPTORS.
12649 * Makefile.in: Rebuild.
12650 * configure: Rebuild.
12651 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
12652 (tls_test_shared2.so): New target.
12653 (tls_shared_gd_to_ie_test_SOURCES): New variable.
12654 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
12655 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
12656 (tls_shared_gd_to_ie_test_LDADD): New variable.
12657 (tls_shared_gnu2_gd_to_ie_test): New target.
12658 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
12659 New targets.
12660 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
12661 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
12662 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
12663 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
12664 (tls_shared_gnu2_test): New target.
12665 (tls_test_gnu2_shared.so): New target.
12666 (tls_shared_gnu2_test_SOURCES): New variable.
12667 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
12668 (tls_shared_gnu2_test_LDFLAGS): New variable.
12669 (tls_shared_gnu2_test_LDADD): New variable.
12670 * testsuite/Makefile.in: Rebuild.
12671 * testsuite/Makefile.
12672
83bfb6b7
ILT
126732008-04-11 Ian Lance Taylor <[email protected]>
12674
12675 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
12676 justsyms.t.
12677 * testsuite/Makefile.in: Rebuild.
12678
12679 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
12680 long.
12681 * testsuite/script_test_2.cc (main): Adjust test.
12682
706e1f5e
ILT
126832008-04-11 David S. Miller <[email protected]>
12684 Ian Lance Taylor <[email protected]>
12685
12686 * options.h (General_options): Add entries for '-Y' and
12687 '-relax'.
12688 * options.cc (General_options:finalize): If -Y was used, add those
12689 entries to the library path instead of the default "/lib" and
12690 "/usr/lib".
12691
7c98e6bb
DM
126922008-04-11 David S. Miller <[email protected]>
12693
12694 * testsuite/justsyms.t: Start at 0x100.
12695 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
12696 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
12697 long.
12698 * testsuite/script_test_2.cc: Adjust string and section length
12699 checks.
7c98e6bb 12700
99a37bfd
ILT
127012008-04-09 Ian Lance Taylor <[email protected]>
12702
2cefc357
ILT
12703 PR gold/5996
12704 * script-sections.cc (Sections_element::allocate_to_segment): Add
12705 orphan parameter.
12706 (Output_section_definition::allocate_to_segment): Likewise.
12707 (Orphan_output_section::allocate_to_segment): Likewise.
12708 (Script_sections::attach_sections_using_phdrs_clause): Don't
12709 propagate non-PT_LOAD segments to orphan sections.
12710 * testsuite/Makefile.am (script_test_3.stdout): Generate using
12711 readelf rather than objdump.
12712 * testsuite/script_test_3.sh: Adjust accordingly. Test that
12713 .interp section and PT_INTERP segment are the same size.
12714 * testsuite/Makefile.in: Rebuild.
12715
99a37bfd
ILT
12716 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
12717 aliases for symbols defined in the same object.
12718 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
12719 (weak_alias_test_SOURCES): New variable.
12720 (weak_alias_test_DEPENDENCIES): New variable.
12721 (weak_alias_test_LDFLAGS): New variable.
12722 (weak_alias_test_LDADD): New variable.
12723 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
12724 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
12725 (weak_alias_test_3.o): New target.
12726 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
12727 * testsuite/weak_alias_test_main.cc: New file.
12728 * testsuite/weak_alias_test_1.cc: New file.
12729 * testsuite/weak_alias_test_2.cc: New file.
12730 * testsuite/weak_alias_test_3.cc: New file.
12731
780e49c5
ILT
127322008-04-08 Ian Lance Taylor <[email protected]>
12733
cdb0b8f5
ILT
12734 * options.h (class General_options): Add --noinhibit-exec option.
12735 * main.cc (main): Check --noinhibit-exec.
12736
0864d551
ILT
12737 * options.h (class General_options): Define --wrap as a special
12738 option. Add wrap_symbols_ field.
12739 (General_options::any_wrap_symbols): New function.
12740 (General_options::is_wrap_symbol): New function.
12741 * options.cc (General_options::parse_wrap): New function.
12742 (General_options::General_options): Initialize wrap_symbols_.
12743 * symtab.cc (Symbol_table::wrap_symbol): New function.
12744 (Symbol_table::add_from_object): Handle --wrap.
12745 * symtab.h (class Symbol_table): Declare wrap_symbol.
12746 * target.h (Target::wrap_char): New function.
12747 (Target::Target_info): Add wrap_char field.
12748 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
12749 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12750 * testsuite/testfile.cc (Target_test::test_target_info):
12751 Likewise.
12752
789aa6de
ILT
12753 * errors.cc (Errors::undefined_symbol): Mention symbol version if
12754 there is one.
12755
2c38906f
ILT
12756 * layout.h (class Layout): Add added_eh_frame_data_ field.
12757 * layout.cc (Layout::Layout): Initialize new field.
12758 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
12759 output section until we find a section we merged successfully.
12760 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
12761 that the size be non-zero.
12762
780e49c5
ILT
12763 * merge.cc (Object_merge_map::get_output_offset): Remove inline
12764 qualifier.
12765
7fcd0256
ILT
127662008-04-08 Craig Silverstein <[email protected]>
12767
12768 * configure.ac: Export new conditional variable HAVE_ZLIB.
12769 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
12770 on HAVE_ZLIB.
12771 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
12772 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12773
6835af53
ILT
127742008-04-07 Ian Lance Taylor <[email protected]>
12775
e24f324c
ILT
12776 * version.cc (version_string): Set to "1.5".
12777
a036edd8
ILT
12778 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
12779 Add issued_non_pic_error_ field. Declare check_non_pic.
12780 (Target_x86_64::Scan::check_non_pic): New function.
12781 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
12782 (Target_x86_64::Scan::global): Likewise.
12783
624f8810
ILT
12784 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
12785 addend parameter. Change caller. Handle merge sections.
12786 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
12787 Address to Addend. Don't add in the result of
12788 local_section_offset, pass down the addend and use the returned
12789 value.
12790 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
12791 Update declarations of local_section_offset and symbol_value.
12792 * testsuite/two_file_test_1.cc (t18): New function.
12793 * testsuite/two_file_test_2.cc (f18): New function.
12794 * testsuite/two_file_test_main.cc (main): Call t18.
12795 * testsuite/two_file_test.h (t18, f18): Declare.
12796
6835af53
ILT
12797 * configure.ac: Don't test for objdump, c++filt, or readelf.
12798 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
12799 conditionals.
12800 (TEST_READELF): New variable.
12801 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
12802 (check_PROGRAMS): Add two_file_strip_test.
12803 (two_file_strip_test): New target.
12804 (check_PROGRAMS): Add two_file_same_shared_strip_test.
12805 (two_file_same_shared_strip_test_SOURCES): New variable.
12806 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
12807 (two_file_same_shared_strip_test_LDFLAGS): New variable.
12808 (two_file_same_shared_strip_test_LDADD): New variable.
12809 (two_file_shared_strip.so): New target.
12810 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
12811 (ver_test_5.syms, ver_test_7.syms): Likewise.
12812 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
12813 (strip_test_3.stdout): Use TEST_OBJDUMP.
12814 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12815
86925eef
CC
128162008-04-04 Cary Coutant <[email protected]>
12817
12818 * symtab.h (Symbol::is_weak_undefined): New function.
12819 (Symbol::is_strong_undefined): New function.
12820 (Symbol::is_absolute): New function.
12821 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
12822 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
12823 absolute symbols.
12824 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
12825 (weak_undef_test): New target.
12826 * testsuite/Makefile.in: Rebuild.
12827 * testsuite/weak_undef_file1.cc: New file.
12828 * testsuite/weak_undef_file2.cc: New file.
12829 * testsuite/weak_undef_test.cc: New file.
12830
126f3ece
ILT
128312008-04-03 Craig Silverstein <[email protected]>
12832
12833 * compressed_output.h (class Output_compressed_section): Use
12834 unsigned buffer.
12835 * compressed_output.cc (zlib_compress): Use unsigned buffers,
12836 add zlib header.
12837 (zlib_compressed_suffix): Removed.
12838 (Output_compressed_section::set_final_data_size): Use unsigned
12839 buffers.
12840 * testsuite/Makefile.am (flagstest_compress_debug_sections):
12841 Fix linker invocation.
12842 (flagstest_o_specialfile_and_compress_debug_sections):
12843 Likewise.
12844 * testsuite/Makefile.in: Regenerated.
12845
deae2a14
DM
128462008-04-02 David S. Miller <[email protected]>
12847
12848 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
12849 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
12850
70752818
ILT
128512008-04-02 Craig Silverstein <[email protected]>
12852
12853 * TODO: New file.
12854
39d0cb0e
ILT
128552008-04-02 Ian Lance Taylor <[email protected]>
12856
12857 * fileread.cc (File_read::find_view): Add byteshift and vshifted
12858 parameters. Update for new key type to views_. Change all
12859 callers.
12860 (File_read::read): Adjust for byteshift in returned view.
12861 (File_read::add_view): New function, broken out of
12862 find_and_make_view.
12863 (File_read::make_view): New function, broken out of
12864 find_and_make_view.
12865 (File_read::find_or_make_view): Add offset and aligned
12866 parameters. Rewrite accordingly. Change all callers.
12867 (File_read::get_view): Add offset and aligned parameters. Adjust
12868 for byteshift in return value.
12869 (File_read::get_lasting_view): Likewise.
12870 * fileread.h (class File_read): Update declarations.
12871 (class File_read::View): Add byteshift_ field. Add byteshift to
12872 constructor. Add byteshift method.
12873 * archive.h (Archive::clear_uncached_views): New function.
12874 (Archive::get_view): Add aligned parameter. Change all callers.
12875 * object.h (Object::get_view): Add aligned parameter. Change all
12876 callers.
12877 (Object::get_lasting_view): Likewise.
12878
12879 * fileread.cc (File_read::release): Don't call clear_views if
12880 there are multiple objects.
12881 * fileread.h (File_read::clear_uncached_views): New function.
12882 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
12883 on the archive.
12884
a1207466
CC
128852008-03-31 Cary Coutant <[email protected]>
12886
12887 Add thin archive support.
12888 * archive.cc (Archive::armagt): New const.
12889 (Archive::setup): Remove task parameter and calls to unlock.
12890 (Archive::unlock_nested_archives): New function.
12891 (Archive::read_header): Add nested_off parameter. Change
12892 all callers.
12893 (Archive::interpret_header): Likewise.
12894 (Archive::include_all_members): Change to handle thin
12895 archives.
12896 (Archive::include_member): Likewise.
12897 * archive.h (Archive::Archive): Add new parameters and
12898 initializers.
12899 (Archive::armagt): New const.
12900 (Archive::setup): Remove task parameter.
12901 (Archive::unlock_nested_archives): New function.
12902 (Archive::read_header): Add nested_off parameter.
12903 (Archive::interpret_header): Likewise.
12904 (Archive::Nested_archive_table): New typedef.
12905 (Archive::is_thin_archive_): New field.
12906 (Archive::nested_archives_): New field.
12907 (Archive::options_): New field.
12908 (Archive::dirpath_): New field.
12909 (Archive::task_): New field.
12910 * readsyms.cc (Read_symbols::do_read_symbols): Add check
12911 for thin archives. Pass additional parameters to
12912 Archive::Archive. Unlock the archive file after calling
12913 Archive::setup.
cd536b21 12914
479f6503
ILT
129152008-03-29 Ian Lance Taylor <[email protected]>
12916
686c8caf
ILT
12917 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
12918 version symbol to be local.
12919 * testsuite/ver_test_4.sh: New file.
12920 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
12921 (check_DATA): Add ver_test_4.syms.
12922 (ver_test_4.syms): New target.
12923 * testsuite/Makefile.in: Rebuild.
12924
ab794b6b
ILT
12925 * output.cc
12926 (Output_section::Input_section_sort_entry::has_priority): New
12927 function.
12928 (Output_section::Input_section_sort_entry::match_file_name): New
12929 function.
12930 (Output_section::Input_section_sort_entry::match_section_name):
12931 Remove.
12932 (Output_section::Input_section_sort_entry::match_section_name_prefix):
12933 Remove.
12934 (Output_section::Input_section_sort_entry::match_section_file):
12935 Remove.
12936 (Output_section::Input_section_sort_compare::operator()): Rewrite
12937 using new Input_section_sort_entry functions. Sort crtbegin and
12938 crtend first. Sort sections with no priority before sections with
12939 a priority.
12940 * testsuite/initpri1.c (d3): Check j != 4.
12941 (cd5): New constructor/destructor function.
12942 (main): Check j != 2.
12943
479f6503
ILT
12944 * symtab.cc (Symbol_table::add_from_object): If we don't use the
12945 new symbol when resolving, don't call set_is_default.
12946 * testsuite/ver_test_7.cc: New file.
12947 * testsuite/ver_test_7.sh: New file.
12948 * testsuite/Makefile.am (ver_test_7.so): New target.
12949 (ver_test_7.o): New target.
12950 (check_SCRIPTS): Add ver_test_7.sh.
12951 (check_DATA): Add ver_test_7.syms.
12952 (ver_test_7.syms): New target.
12953
2fd32231
ILT
129542008-03-28 Ian Lance Taylor <[email protected]>
12955
12956 * layout.cc (Layout::layout): If we see an input section with a
12957 name that needs sorting, set the must_sort flag for the output
12958 section.
12959 (Layout::make_output_section): If the name of the output section
12960 indicates that it might require sorting, set the may_sort flag.
12961 * output.h (Output_section::may_sort_attached_input_sections): New
12962 function.
12963 (Output_section::set_may_sort_attached_input_sections): New
12964 function.
12965 (Output_section::must_sort_attached_input_sections): New
12966 function.
12967 (Output_section::set_must_sort_attached_input_sections): New
12968 function.
12969 (class Output_section): Declare Input_section_sort_entry. Define
12970 Input_section_sort_compare. Declare
12971 sort_attached_input_sections. Add new fields:
12972 may_sort_attached_input_sections_,
12973 must_sort_attached_input_sections_,
12974 attached_input_sections_are_sorted_.
12975 * output.cc (Output_section::Output_section): Initialize new
12976 fields.
12977 (Output_section::add_input_section): Add an entry to
12978 input_sections_ if may_sort or must_sort are true.
12979 (Output_section::set_final_data_size): Call
12980 sort_attached_input_sections if necessary.
12981 (Output_section::Input_section_sort_entry): Define new class.
12982 (Output_section::Input_section_sort_compare::operator()): New
12983 function.
12984 (Output_section::sort_attached_input_sections): New function.
12985 * configure.ac: Check whether the compiler supports constructor
12986 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
12987 * testsuite/initpri1.c: New file.
12988 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
12989 CONSTRUCTOR_PRIORITY.
12990 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
12991 (initpri1_LDFLAGS): New variable.
12992 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12993
18e6b24e
ILT
129942008-03-27 Ian Lance Taylor <[email protected]>
12995
49bdd526
ILT
12996 * common.cc (Sort_commons::operator): Correct sorting algorithm.
12997 * testsuite/common_test_1.c: New file.
12998 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
12999 (common_test_1_SOURCES): New variable.
13000 (common_test_1_DEPENDENCIES): New variable.
13001 (common_test_1_LDFLAGS): New variable.
13002
18e6b24e
ILT
13003 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
13004 and commons_ correctly when NAME/VERSION does not override
13005 NAME/NULL.
13006 * testsuite/ver_test_6.c: New file.
13007 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
13008 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
13009 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
13010
04bf7072
ILT
130112008-03-26 Ian Lance Taylor <[email protected]>
13012
5871526f
ILT
13013 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
13014 of an undefined symbol from a version script.
13015 * testsuite/Makefile.am (ver_test_5.so): New target.
13016 (ver_test_5.o): New target.
13017 (check_SCRIPTS): Add ver_test_5.sh.
13018 (check_DATA): Add ver_test_5.syms.
13019 (ver_test_5.syms): New target.
13020 * testsuite/ver_test_5.cc: New file.
13021 * testsuite/ver_test_5.script: New file.
13022 * testsuite/ver_test_5.sh: New file.
13023 * Makefile.in, testsuite/Makefile.in: Rebuild.
13024
04bf7072
ILT
13025 PR gold/5986
13026 Fix problems building gold with gcc 4.3.0.
13027 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
13028 (gold_error_at_location, gold_warning_at_location): Use it.
13029 * configure.ac: Check whether we can compile and use a template
13030 function with a printf attribute.
13031 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
13032 when jumping over bytes.
13033 * object.cc: Instantiate Object::read_section_data.
13034 * debug.h: Include <cstring>
13035 * dwarf_reader.cc: Include <algorithm>
13036 * main.cc: Include <cstring>.
13037 * options.cc: Include <cstring>.
13038 * output.cc: Include <cstring>.
13039 * script.cc: Include <cstring>.
13040 * script.h: Include <string>.
13041 * symtab.cc: Include <cstring> and <algorithm>.
13042 * target-select.cc: Include <cstring>.
13043 * version.cc: Include <string>.
13044 * testsuite/testmain.cc: Include <cstdlib>.
13045 * configure, config.in: Rebuild.
13046
874c5b28
ILT
130472008-03-25 Ian Lance Taylor <[email protected]>
13048
819d6c3a
ILT
13049 * options.cc: Include "../bfd/bfdver.h".
13050 (options::help): Print bug reporting address.
13051
f4b2c6f5
ILT
13052 * version.cc (print_version): Adjust output for current value of
13053 BFD_VERSION_STRING.
13054
13055 * NEWS: New file.
13056
e96caa79
ILT
13057 * options.cc (options::help): Print list of supported targets.
13058 * target-select.h: Include <vector>.
13059 (class Target_selector): Make machine_, size_, and is_big_endian_
13060 fields const. Add bfd_name_ and instantiated_target_ fields.
13061 (Target_selector::Target_selector): Add bfd_name parameter.
13062 (Target_selector::recognize): Make non-virtual, call
13063 do_recognize.
13064 (Target_selector::recognize_by_name): Make non-virtual, call
13065 do_recognize_by_name.
13066 (Target_selector::supported_names): New function.
13067 (Target_selector::bfd_name): New function.
13068 (Target_selector::do_instantiate_target): New pure virtual
13069 function.
13070 (Target_selector::do_recognize): New virtual function.
13071 (Target_selector::do_recognize_by_name): New virtual function.
13072 (Target_selector::instantiate_target): New private function.
13073 (supported_target_names): Declare.
13074 * target-select.cc (Target_selector::Target_selector): Update for
13075 new parameter and fields.
13076 (select_target_by_name): Check that the name matches before
13077 calling recognize_by_name.
13078 (supported_target_names): New function.
13079 * i386.cc (class Target_selector_i386): Update Target_selector
13080 constructor call. Remove recognize and recognize_by_name. Add
13081 do_instantiate_target.
13082 * x86_64.cc (class Target_selector_x86_64): Likewise.
13083 * testsuite/testfile.cc (class Target_selector_test): Update for
13084 changes to Target_selector.
13085
874c5b28
ILT
13086 * README: Rewrite, with some notes on unsupported features.
13087
0a65a3a7
CC
130882008-03-24 Cary Coutant <[email protected]>
13089
13090 * i386.cc (Target_i386::Got_type): New enum declaration.
13091 (Target_i386::Scan::local): Updated callers of Output_data_got
13092 member functions.
13093 (Target_i386::Scan::global): Likewise.
13094 (Target_i386::Relocate::relocate): Likewise.
13095 (Target_i386::Relocate::relocate_tls): Likewise.
13096 * object.h (Got_offset_list): New class.
13097 (Sized_relobj::local_has_got_offset): Added got_type parameter.
13098 (Sized_relobj::local_got_offset): Likewise.
13099 (Sized_relobj::set_local_got_offset): Likewise.
13100 (Sized_relobj::local_has_tls_got_offset): Removed.
13101 (Sized_relobj::local_tls_got_offset): Removed.
13102 (Sized_relobj::set_local_tls_got_offset): Removed.
13103 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
13104 * output.cc (Output_data_got::add_global): Added got_type parameter.
13105 (Output_data_got::add_global_with_rel): Likewise.
13106 (Output_data_got::add_global_with_rela): Likewise.
13107 (Output_data_got::add_global_pair_with_rel): New function.
13108 (Output_data_got::add_global_pair_with_rela): New function.
13109 (Output_data_got::add_local): Added got_type parameter.
13110 (Output_data_got::add_local_with_rel): Likewise.
13111 (Output_data_got::add_local_with_rela): Likewise.
13112 (Output_data_got::add_local_pair_with_rel): New function.
13113 (Output_data_got::add_local_pair_with_rela): New function.
13114 (Output_data_got::add_global_tls): Removed.
13115 (Output_data_got::add_global_tls_with_rel): Removed.
13116 (Output_data_got::add_global_tls_with_rela): Removed.
13117 (Output_data_got::add_local_tls): Removed.
13118 (Output_data_got::add_local_tls_with_rel): Removed.
13119 (Output_data_got::add_local_tls_with_rela): Removed.
13120 * output.h (Output_data_got::add_global): Added got_type parameter.
13121 (Output_data_got::add_global_with_rel): Likewise.
13122 (Output_data_got::add_global_with_rela): Likewise.
13123 (Output_data_got::add_global_pair_with_rel): New function.
13124 (Output_data_got::add_global_pair_with_rela): New function.
13125 (Output_data_got::add_local): Added got_type parameter.
13126 (Output_data_got::add_local_with_rel): Likewise.
13127 (Output_data_got::add_local_with_rela): Likewise.
13128 (Output_data_got::add_local_pair_with_rel): New function.
13129 (Output_data_got::add_local_pair_with_rela): New function.
13130 (Output_data_got::add_global_tls): Removed.
13131 (Output_data_got::add_global_tls_with_rel): Removed.
13132 (Output_data_got::add_global_tls_with_rela): Removed.
13133 (Output_data_got::add_local_tls): Removed.
13134 (Output_data_got::add_local_tls_with_rel): Removed.
13135 (Output_data_got::add_local_tls_with_rela): Removed.
13136 * resolve.cc (Symbol::override_base_with_special): Removed
13137 reference to has_got_offset_ field.
13138 * symtab.cc (Symbol::init_fields): Replaced initialization
13139 of got_offset_ with got_offsets_. Removed initialization
13140 of has_got_offset_
53fcba31 13141 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
13142 (Symbol::got_offset): Likewise.
13143 (Symbol::set_got_offset): Likewise.
13144 (Symbol::has_tls_got_offset): Removed.
13145 (Symbol::tls_got_offset): Removed.
13146 (Symbol::set_tls_got_offset): Removed.
13147 (Symbol::got_offset_): Removed.
13148 (Symbol::tls_mod_got_offset_): Removed.
13149 (Symbol::tls_pair_got_offset_): Removed.
13150 (Symbol::got_offsets_): New field.
13151 (Symbol::has_got_offset): Removed.
13152 (Symbol::has_tls_mod_got_offset): Removed.
13153 (Symbol::has_tls_pair_got_offset): Removed.
13154 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
13155 (Target_x86_64::Scan::local): Updated callers of Output_data_got
13156 member functions.
13157 (Target_x86_64::Scan::global): Likewise.
13158 (Target_x86_64::Relocate::relocate): Likewise.
13159 (Target_x86_64::Relocate::relocate_tls): Likewise.
13160
bd52eafb
BE
131612008-03-25 Ben Elliston <[email protected]>
13162
13163 * yyscript.y: Fix spelling error in comment.
13164
8b105e34
ILT
131652008-03-24 Ian Lance Taylor <[email protected]>
13166
8ed814a9
ILT
13167 * options.h (class General_options): Define build_id option.
13168 * layout.h (class Layout): Declare write_build_id, create_note,
13169 create_build_id. Add build_id_note_ member.
13170 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
13171 "libiberty.h", "md5.h", "sha1.h".
13172 (Layout::Layout): Initialize eh_frame_data_,
13173 eh_frame_hdr_section_, and build_id_note_.
13174 (Layout::finalize): Call create_build_id.
13175 (Layout::create_note): New function, broken out of
13176 Layout::create_gold_note.
13177 (Layout::create_gold_note): Call create_note.
13178 (Layout::create_build_id): New function.
13179 (Layout::write_build_id): New function.
13180 (Close_task_runner::run): Call write_build_id.
13181
8b105e34
ILT
13182 * x86_64.cc: Correct license to GPLv3.
13183
086a1841
ILT
131842008-03-23 Ian Lance Taylor <[email protected]>
13185
13186 * options.cc: Include "demangle.h".
13187 (parse_optional_string): New function.
13188 (parse_long_option): Handle takes_optional_argument.
13189 (parse_short_option): Update dash_z initializer. Handle
13190 takes_optional_argument.
13191 (General_options::General_options): Initialize do_demangle_.
13192 (General_options::finalize): Set do_demangle_. Handle demangling
13193 style.
13194 * options.h (parse_optional_string): Declare.
13195 (struct One_option): Add optional_arg field. Update constructor.
13196 Update call constructor calls. Add takes_optional_argument
13197 function.
13198 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
13199 (DEFINE_optional_string): Define.
13200 (General_options::demangle): Change from DEFINE_bool to
13201 DEFINE_optional_string.
13202 (General_options::no_demangle): New function.
13203 (General_options::do_demangle): New function.
13204 (General_options::set_do_demangle): New function.
13205 (General_options::execstack_status_): Move definition to end of
13206 class definition.
13207 (General_options::static_): Likewise.
13208 (General_options::do_demangle_): New field.
13209 * object.cc (big_endian>::get_symbol_location_info): Call
13210 Options::do_demangle, not Options::demangle.
13211 * symtab.cc (demangle): Likewise.
13212
cbb93e63
ILT
132132008-03-22 Ian Lance Taylor <[email protected]>
13214
13215 * gold.h: Include <cstddef> and <sys/types.h>
13216 * options.h: Include <cstring>.
13217
ec531623
ILT
132182008-03-21 Ian Lance Taylor <[email protected]>
13219
13220 * Added source code to GNU binutils.
This page took 2.052372 seconds and 4 git commands to generate.