* lib/gdb.exp (standard_testfile): Unset output variables from
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
eabc84f4
RM
12012-06-22 Roland McGrath <mcgrathr@google.com>
2
3 * layout.cc (finalize): Define __ehdr_start symbol if applicable.
4
370e30b6
RÁE
52012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
6
7 * plugin.cc (Plugin::load): Handle position independent executables.
8
fb1b895d
CC
92012-06-06 Cary Coutant <ccoutant@google.com>
10
11 * layout.cc (gdb_sections): Remove ".debug_" prefixes,
12 add .debug_macro.
13 (lines_only_debug_sections): Likewise.
14 (gdb_fast_lookup_sections): New static array.
15 (is_gdb_debug_section): Rename formal parameter.
16 (is_lines_only_debug_section): Likewise.
17 (is_gdb_fast_lookup_section): New function.
18 (Layout::include_section): Check for ".zdebug_" prefix; pass
19 section name suffix to is_gdb_debug_section, et al.; check for
20 fast-lookup sections when building .gdb_index.
21 * options.h (--strip-debug-gdb): Update GDB version number.
22
7c0640fa
CC
232012-06-06 Cary Coutant <ccoutant@google.com>
24
25 * configure.ac: Add check for fallocate.
26 * configure: Regenerate.
27 * config.in: Regenerate.
28
29 * options.h (class General_options): Add --mmap-output-file and
30 --posix-fallocate options.
31 * output.cc: (posix_fallocate): Remove; replace with...
32 (gold_fallocate): New function.
33 (Output_file::map_no_anonymous): Call gold_fallocate.
34 (Output_file::map): Check --mmap-output-file option.
35
2a49eb69
DK
362012-06-05 Jing Yu <jingyu@google.com>
37
38 * gold.h (textdomain): Add do {} to empty while(0).
39 (bindtextdomain): Likewise.
40
fad072ac
CC
412012-06-04 Cary Coutant <ccoutant@google.com>
42
43 * dynobj.cc (Sized_dynobj::do_get_global_symbol_counts): Call
44 has_dynsym_index.
45
8cc69fb6
ST
462012-05-25 Sriraman Tallam <tmsriram@google.com>
47
48 * symtab.cc (Symbol_table::define_special_symbol):
49 Initialize *poldsym to prevent uninitialized variable errors.
50
1be75daa
CC
512012-05-23 Cary Coutant <ccoutant@google.com>
52
53 * layout.cc (Layout::section_name_mapping): Add rules to handle
54 exact match on .data.rel.ro.local or .data.rel.ro.
55 (Layout::output_section_name): Check for exact matches.
56
9b689de0
CC
572012-05-23 Cary Coutant <ccoutant@google.com>
58
59 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
60 more carefully.
61
b24fdbf5
CC
622012-05-22 Cary Coutant <ccoutant@google.com>
63
64 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
65 object before exporting symbol.
66
e550e1a2
L
672012-05-21 H.J. Lu <hongjiu.lu@intel.com>
68
69 * testsuite/tls_test.cc: Include "config.h" first.
70 * testsuite/tls_test_c.c: Likewise.
71
df7b86aa
NC
722012-05-17 Daniel Richard G. <skunk@iskunk.org>
73 Nick Clifton <nickc@redhat.com>
74
75 PR 14072
76 * configure.in: Add check that sysdep.h has been included before
77 any system header files.
78 * configure: Regenerate.
79 * config.in: Regenerate.
80
1007b503
CC
812012-05-14 Cary Coutant <ccoutant@google.com>
82
83 * layout.cc (Layout::make_output_section): Mark .tdata section
84 as RELRO.
85 * testsuite/relro_test.cc: Add a TLS variable.
86
fd885f3a
L
872012-05-10 H.J. Lu <hongjiu.lu@intel.com>
88
89 PR gold/14091
90 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
91 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
92 R_X86_64_64.
93
80f5885c
CC
942012-05-08 Cary Coutant <ccoutant@google.com>
95
96 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
97 (lines_only_debug_sections): Likewise.
98
2e702c99
RM
992012-05-02 Roland McGrath <mcgrathr@google.com>
100
101 * nacl.cc: New file.
102 * nacl.h: New file.
103 * Makefile.am (CCFILES, HFILES): Add them.
104 * Makefile.in: Regenerate.
105 * i386.cc (Output_data_plt_i386_nacl): New class.
106 (Output_data_plt_i386_nacl_exec): New class.
107 (Output_data_plt_i386_nacl_dyn): New class.
108 (Target_i386_nacl): New class.
109 (Target_selector_i386_nacl): New class.
110 (target_selector_i386): Use it instead of Target_selector_i386.
111 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
112 (Target_x86_64_nacl): New class.
113 (Target_selector_x86_64_nacl): New class.
114 (target_selector_x86_64, target_selector_x32): Use it instead of
115 Target_selector_x86_64.
116 * arm.cc (Output_data_plt_arm_nacl): New class.
117 (Target_arm_nacl): New class.
118 (Target_selector_arm_nacl): New class.
119 (target_selector_arm, target_selector_armbe): Use it instead of
120 Target_selector_arm.
121
122 * target-select.cc (select_target): Take new Input_file* and off_t
123 arguments, pass them on to recognize method of selector.
124 * object.cc (make_elf_sized_object): Update caller.
125 * parameters.cc (parameters_force_valid_target): Likewise.
126 * incremental.cc (make_sized_incremental_binary): Likewise.
127 * target-select.h: Update decl.
128 (Target_selector::recognize): Take new Input_file* argument,
129 pass it on to do_recognize.
130 (Target_selector::do_recognize): Take new Input_file* argument.
131 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
132 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
133 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
134 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
135
136 * target.h (Target::Target_info): New members isolate_execinstr
137 and rosegment_gap.
138 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
139 * arm.cc (Target_arm::arm_info): Update initializer.
140 * i386.cc (Target_i386::i386_info): Likewise.
141 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
142 * sparc.cc (Target_sparc::sparc_info): Likewise.
143 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
144 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
145 * layout.cc (Layout::attach_allocated_section_to_segment):
146 Take new const Target* argument. If target->isolate_execinstr(), act
147 like --rosegment.
148 (Layout::find_first_load_seg): Take new const Target* argument;
149 if target->isolate_execinstr(), reject PF_X segments.
150 (Layout::relaxation_loop_body): Update caller.
151 (Layout::set_segment_offsets): If target->isolate_execinstr(),
152 reset file offset to zero when we hit LOAD_SEG, and then do a second
153 loop over the segments before LOAD_SEG to reassign offsets after
154 addresses have been determined. Handle target->rosegment_gap().
155 (Layout::attach_section_to_segment): Take new const Target* argument;
156 pass it to attach_allocated_section_to_segment.
157 (Layout::make_output_section): Update caller.
158 (Layout::attach_sections_to_segments): Take new const Target* argument;
159 pass it to attach_section_to_segment.
160 * gold.cc (queue_middle_tasks): Update caller.
161 * layout.h (Layout): Update method decls with new arguments.
162
163 * arm.cc (Target_arm::Target_arm): Take optional argument for the
164 Target_info pointer to use.
165 (Target_arm::do_make_data_plt): New virtual method.
166 (Target_arm::make_data_plt): New method that calls it.
167 (Target_arm::make_plt_entry): Use it.
168 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
169 for the section alignment.
170 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
171 method.
172 (Output_data_plt_arm::first_plt_entry_offset): Call it.
173 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
174 method.
175 (Output_data_plt_arm::get_plt_entry_size): Call it.
176 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
177 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
178 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
179 method.
180 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
181 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
182 method instead of sizeof(plt_entry).
183 (Output_data_plt_arm::add_entry): Likewise.
184 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
185 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
186 than static method.
187 (Target_arm::plt_entry_size): Likewise.
188 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
189 Move to ...
190 (Output_data_plt_arm_standard): ... here, new class.
191 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
192 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
193 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
194
195 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
196 Take additional argument for the PLT entry size.
197 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
198 Use get_plt_entry_size method rather than plt_entry_size variable.
199 (Output_data_plt_x86_64::reserve_slot): Likewise.
200 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
201 (Output_data_plt_x86_64::add_entry): Likewise.
202 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
203 (Output_data_plt_x86_64::address_for_global): Likewise.
204 (Output_data_plt_x86_64::address_for_local): Likewise.
205 (Output_data_plt_x86_64::set_final_data_size): Likewise.
206 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
207 Make method non-static.
208 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
209 method.
210 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
211 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
212 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
213 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
214 virtual method.
215 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
216 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
217 virtual method.
218 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
219 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
220 virtual method.
221 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
222 (Output_data_plt_x86_64::plt_entry_size)
223 (Output_data_plt_x86_64::first_plt_entry)
224 (Output_data_plt_x86_64::plt_entry)
225 (Output_data_plt_x86_64::tlsdesc_plt_entry)
226 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
227 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
228 (Output_data_plt_x86_64_standard): ... here, new class.
229 (Target_x86_64::Target_x86_64): Take optional argument for the
230 Target_info pointer to use.
231 (Target_x86_64::do_make_data_plt): New virtual method.
232 (Target_x86_64::make_data_plt): New method to call it.
233 (Target_x86_64::init_got_plt_for_update): Use that.
234 Call this->plt_->add_eh_frame method here.
235 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
236 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
237 rather than static method.
238 (Target_x86_64::plt_entry_size): Likewise.
239 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
240 rather than plt_entry_size variable. Move guts of PLT filling to...
241 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
242 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
243 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
244
245 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
246 additional argument for the section alignment.
247 Don't do add_eh_frame_for_plt here.
248 (Output_data_plt_i386::first_plt_entry_offset): Make the method
249 non-static. Use get_plt_entry_size method rather than plt_entry_size
250 variable.
251 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
252 method.
253 (Output_data_plt_i386::get_plt_entry_size): Call it.
254 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
255 (Output_data_plt_i386::add_eh_frame): New method to call it.
256 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
257 method.
258 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
259 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
260 method.
261 (Output_data_plt_i386::fill_plt_entry): New method to call it.
262 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
263 method instead of plt_entry_size.
264 (Output_data_plt_i386::plt_entry_size)
265 (Output_data_plt_i386::plt_eh_frame_fde_size)
266 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
267 (Output_data_plt_i386_standard): ... here, new class.
268 (Output_data_plt_i386_exec): New class.
269 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
270 (Output_data_plt_i386_exec::first_plt_entry): ... here.
271 (Output_data_plt_i386::exec_plt_entry): Move to ...
272 (Output_data_plt_i386_exec::plt_entry): ... here.
273 (Output_data_plt_i386_dyn): New class.
274 (Output_data_plt_i386::first_plt_entry): Move to ...
275 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
276 (Output_data_plt_i386::dyn_plt_entry): Move to ...
277 (Output_data_plt_i386_dyn::plt_entry): ... here.
278 (Target_i386::Target_i386): Take optional argument for the Target_info
279 pointer to use.
280 (Target_i386::do_make_data_plt): New virtual method.
281 (Target_i386::make_data_plt): New method to call it.
282 (Target_i386::make_plt_section): Use that.
283 Call this->plt_->add_eh_frame method here.
284 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
285 rather than plt_entry_size variable.
286 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
287 (Output_data_plt_i386::address_for_local): Likewise.
288 (Output_data_plt_i386::do_write): Likewise.
289 Move guts of PLT filling to...
290 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
291 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
292 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
293 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
294
b9b9f2ee
CC
2952012-05-01 Cary Coutant <ccoutant@google.com>
296
297 * dwarf_reader.cc (Dwarf_die::read_attributes)
298 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
299 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
300 * reduced_debug_output.cc
301 (Output_reduced_debug_info_section::get_die_end): Remove
302 DW_FORM_GNU_ref_index. Add default case.
303
57923f48
MW
3042012-04-26 Mark Wielaard <mjw@redhat.com>
305
306 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
307 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
308 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
309 DW_AT_high_pc as offset from DW_AT_low_pc.
310
311 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
312 * testsuite/Makefile.in: Regenerate.
313 * testsuite/gdb_index_test_3.c: New test source file.
314 * testsuite/gdb_index_test_3.sh: New test source file.
315
2c54b4f4
ILT
3162012-04-25 Ian Lance Taylor <iant@google.com>
317
318 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
319 pointer.
320 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
321 as a class, not a struct.
322 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
323 (Target_arm::apply_cortex_a8_workaround): Likewise.
324 * gc.h: Declare Reloc_types as a struct, not a class.
325 * object.h: Declare Symbols_data as a struct.
326 * reloc.h: Declare Read_relocs_data as a struct.
327 * target.h: Declare Relocate_info as a struct.
328
a5a5f7a3
DM
3292012-04-24 David S. Miller <davem@davemloft.net>
330
331 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
332 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
333 and R_SPARC_WPLT30.
334
f038d496
CC
3352012-04-24 Cary Coutant <ccoutant@google.com>
336
337 * incremental-dump.cc (find_input_containing_global): Replace
338 magic number with symbolic constant.
339 (dump_incremental_inputs): Update version number.
340 * incremental.cc (Output_section_incremental_inputs): Update version
341 number; import symbolic constants from Incremental_inputs_reader.
342 (Incremental_inputs::create_data_sections): Align relocations
343 section correctly for 64-bit targets.
344 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
345 constants; add padding.
346 (Output_section_incremental_inputs::write_header): Add assert for
347 header_size.
348 (Output_section_incremental_inputs::write_input_files): Add assert
349 for input_entry_size.
350 (Output_section_incremental_inputs::write_info_blocks): Add padding;
351 add assert for object_info_size, input_section_entry_size,
352 global_sym_entry_size.
353 * incremental.h (Incremental_inputs_reader): Add symbolic constants
354 for data structure sizes; use them.
355 (Incremental_input_entry_reader): Import symbolic constants from
356 Incremental_inputs_reader; use them.
357
a4d85145
DM
3582012-04-23 David S. Miller <davem@davemloft.net>
359
360 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
361 and elf_flags_set_.
362 (Target_sparc::Target_sparc): Initialize new fields.
363 (Target_sparc::do_make_elf_object): New function.
364 (Target_sparc::do_adjust_elf_header): New function.
365
1d509098
CC
3662012-04-23 Cary Coutant <ccoutant@google.com>
367
368 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
369 CU range table of gdb index.
370
7ebeff7f
DM
3712012-04-20 David S. Miller <davem@davemloft.net>
372
373 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
374 instead of false.
375
13cf9988
DM
3762012-04-16 David S. Miller <davem@davemloft.net>
377
2a1079e8
DM
378 * sparc.cc (Target_sparc::got_address): New function.
379 (Sparc_relocate_functions::gdop_hix22): New function.
380 (Sparc_relocate_functions::gdop_lox10): New function.
381 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
382 relocs.
383 (Target_sparc::Scan::local): Likewise if the global symbol is not
384 preemptible and is not IFUNC.
385 (Target_sparc::Relocate::relocate): Perform GOTDATA code
386 transformations for local and non-preemptible non-IFUNC global
387 symbols.
388
0bc964fc
DM
389 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
390 writing out 64-bit part of ranges.
391
661d7a80
DM
392 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
393 -fpic and -fpie respectively.
394 * Makefile.in: Regenerate.
395
8c2bf391
DM
396 * sparc.cc (class Target_sparc): Add rela_ifunc_.
397 (Target_sparc::Target_sparc): Initialize new field.
398 (Target_sparc::do_plt_section_for_global): New function.
399 (Target_sparc::do_plt_section_for_local): New function.
400 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
401 (Target_sparc::make_plt_section): New function, broken out of
402 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
403 (Target_sparc::make_plt_entry): Call make_plt_section.
404 (Target_sparc::make_local_ifunc_plt_entry): New function.
405 (Target_sparc::rela_ifunc_section): New function.
406 (Target_sparc::plt_section): Remove const.
407 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
408 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
409 and ifunc_count_ fields.
410 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
411 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
412 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
413 (Output_data_plt_sparc::rela_ifunc): New function.
414 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
415 (Output_data_plt_sparc::has_ifunc_section): New function.
416 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
417 (Output_data_plt_sparc::address_for_global): New function.
418 (Output_data_plt_sparc::address_for_local): New function.
419 (Output_data_plt_sparc::plt_index_to_offset): New function.
420 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
421 and entry_count.
422 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
423 entry_count.
424 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
425 R_SPARC_JMP_IREL to switch.
426 (Target_sparc::Scan::check_non_pic): Likewise.
427 (Target_sparc::Scan::local): Handle IFUNC symbols.
428 (Target_sparc::Scan::local): Likewise.
429 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
430 and plt_address_for_local.
431 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
432 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
433
13cf9988
DM
434 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
435 (class Output_data_reloc): Adjust calls to Output_reloc_type.
436 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
437 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
438 global relocs too.
439 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
440 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
441 calls.
442 * sparc.cc (Target_sparc::Scan::global): Likewise.
443 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
444
31821be0
CC
4452012-04-16 Cary Coutant <ccoutant@google.com>
446
447 * archive.cc (Library_base::should_include_member): Check for
448 --export-dynamic-symbol.
449 * options.h (class General_options): Add --export-dynamic-symbol.
450 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
451 --export-dynamic-symbol.
452 (Symbol_table::gc_mark_undef_symbols): Likewise.
453 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
454
2615994e
DM
4552012-04-12 David S. Miller <davem@davemloft.net>
456
457 * sparc.cc (Reloc::wdisp10): New relocation method.
458 (Reloc::h34): Likewise.
459 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
460 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
461 R_SPARC_WDISP10.
462 (Target_sparc::Scan::local): Likewise.
463 (Target_sparc::Scan::global): Likewise.
464 (Target_sparc::Relocate::relocate): Likewise.
465
6782735d
CC
4662012-04-09 Cary Coutant <ccoutant@google.com>
467
468 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
469 low_pc == 0.
470
8c7a0b00
ILT
4712012-04-06 Ian Lance Taylor <iant@google.com>
472
473 * timer.cc: #include <unistd.h>.
474
58797674
RM
4752012-04-06 Roland McGrath <mcgrathr@google.com>
476
477 * configure.in (AC_CHECK_HEADERS): Add locale.h.
478 * config.in: Regenerate.
479 * configure: Regenerate.
480
44350750
NC
4812012-04-05 Nick Clifton <nickc@redhat.com>
482
483 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
484 (AM_LC_MESSAGES): Add.
485 * aclocal.m4: Regenerate.
486 * config.in: Regenerate.
487 * configure: Regenerate.
488
c1027032
CC
4892012-03-21 Cary Coutant <ccoutant@google.com>
490
491 * Makefile.am: Add gdb-index.cc, gdb-index.h.
492 * Makefile.in: Regenerate.
493 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
494 (Sized_elf_reloc_mapper::symbol_section): New function.
495 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
496 (make_elf_reloc_mapper): New function.
497 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
498 (Dwarf_abbrev_table::do_read_abbrevs): New function.
499 (Dwarf_abbrev_table::do_get_abbrev): New function.
500 (Dwarf_ranges_table::read_ranges_table): New function.
501 (Dwarf_ranges_table::read_range_list): New function.
502 (Dwarf_pubnames_table::read_section): New function.
503 (Dwarf_pubnames_table::read_header): New function.
504 (Dwarf_pubnames_table::next_name): New function.
505 (Dwarf_die::Dwarf_die): New function.
506 (Dwarf_die::read_attributes): New function.
507 (Dwarf_die::skip_attributes): New function.
508 (Dwarf_die::set_name): New function.
509 (Dwarf_die::set_linkage_name): New function.
510 (Dwarf_die::attribute): New function.
511 (Dwarf_die::string_attribute): New function.
512 (Dwarf_die::int_attribute): New function.
513 (Dwarf_die::uint_attribute): New function.
514 (Dwarf_die::ref_attribute): New function.
515 (Dwarf_die::child_offset): New function.
516 (Dwarf_die::sibling_offset): New function.
517 (Dwarf_info_reader::check_buffer): New function.
518 (Dwarf_info_reader::parse): New function.
519 (Dwarf_info_reader::do_parse): New function.
520 (Dwarf_info_reader::do_read_string_table): New function.
521 (Dwarf_info_reader::lookup_reloc): New function.
522 (Dwarf_info_reader::get_string): New function.
523 (Dwarf_info_reader::visit_compilation_unit): New function.
524 (Dwarf_info_reader::visit_type_unit): New function.
525 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
526 Sized_elf_reloc_mapper.
527 (Sized_dwarf_line_info::symbol_section): Remove function.
528 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
529 (Sized_dwarf_line_info::read_line_mappings): Remove object
530 parameter, adjust callers.
531 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
532 * dwarf_reader.h: Include <sys/types.h>.
533 (class Track_relocs): Remove forward declaration.
534 (class Elf_reloc_mapper): New class.
535 (class Sized_elf_reloc_mapper): New class.
536 (class Dwarf_abbrev_table): New class.
537 (class Dwarf_range_list): New class.
538 (class Dwarf_ranges_table): New class.
539 (class Dwarf_pubnames_table): New class.
540 (class Dwarf_die): New class.
541 (class Dwarf_info_reader): New class.
542 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
543 (Sized_dwarf_line_info::symbol_section): Remove member function.
544 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
545 base class.
546 * gdb-index.cc: New source file.
547 * gdb-index.h: New source file.
548 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
549 and .debug_types sections, call Layout::add_to_gdb_index.
550 (Sized_relobj_incr::do_section_name): Implement.
551 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
552 return type; Implement.
553 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
554 return type.
555 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
556 parameter list and return type.
557 (Sized_incr_dynobj::do_section_contents): Likewise.
558 * layout.cc: Include gdb-index.h.
559 (Layout::Layout): Initialize gdb_index_data_.
560 (Layout::init_fixed_output_section): Check for .gdb_index section.
561 (Layout::add_to_gdb_index): New function. Instantiate.
562 * layout.h: Add forward declaration for class Gdb_index.
563 (Layout::add_to_gdb_index): New member function.
564 (Layout::gdb_index_data_): New data member.
565 * main.cc: Include gdb-index.h.
566 (main): Print statistics for gdb index.
567 * object.cc (Object::section_contents): Move code into
568 do_section_contents.
569 (need_decompressed_section): Check for sections needed when building
570 gdb index.
571 (build_compressed_section_map): Likewise.
572 (Sized_relobj_file::do_read_symbols): Need local symbols when building
573 gdb index.
574 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
575 sections; call Layout::add_to_gdb_index.
576 (Sized_relobj_file::do_decompressed_section_contents): Call
577 do_section_contents directly.
578 * object.h (Object::do_section_contents): Adjust parameter list and
579 return type.
580 (Object::do_decompressed_section_contents): Call do_section_contents
581 directly.
582 (Sized_relobj_file::do_section_contents): Adjust parameter list and
583 return type.
584 * options.h (class General_options): Add --gdb-index option.
585 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
586 list and return type.
587 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
588 * reloc.h (Track_relocs::checkpoint): New function.
589 (Track_relocs::reset): New function.
590
591 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
592 New test cases.
593 * testsuite/Makefile.in: Regenerate.
594 * testsuite/gdb_index_test.cc: New test source file.
595 * testsuite/gdb_index_test_1.sh: New test source file.
596 * testsuite/gdb_index_test_2.sh: New test source file.
597
647f1574
DK
5982012-03-19 Doug Kwan <dougkwan@google.com>
599
600 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 601 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
602 __exidx_start and __exidx_end. Make symbol table parameter
603 anonymous as it is not used.
604 * gold.cc (queue_middle_tasks): Call target hook to define any
605 target-specific symbols.
606 * target.h (Target::define_standard_symbols): New method.
607 (Target::do_define_standard_symbols): Same.
608 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
609 * testsuite/Makefile.in: Regenerate.
610 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
611 and __exidx_end.
612 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
613 relocations are generated for __exidx_start and __exidx_end.
614
7c6109da
DK
6152012-03-16 Doug Kwan <dougkwan@google.com>
616
617 * testsuite/Makefile.am: Disable test initpri3b.
618 * testsuite/Makefile.in: Regenerate.
619
7b8957f8
DK
6202012-03-15 Doug Kwan <dougkwan@google.com>
621
622 * arm.cc (Target_arm::got_section): Make .got section read-only
623 if -z now is given.
624
14dc9ef7
ILT
6252012-03-15 Ian Lance Taylor <iant@google.com>
626
627 PR gold/13850
628 * layout.cc (Layout::make_output_section): Correctly mark
629 SHT_INIT_ARRAY, et. al., as relro.
630
fa40b62a
DK
6312012-03-14 Doug Kwan <dougkwan@google.com>
632
633 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
634 dynamic relocations for protected symbols in shared objects.
635
fd325007
ILT
6362012-03-13 Ian Lance Taylor <iant@google.com>
637
638 * resolve.cc (Symbol_table::resolve): When merging common symbols,
639 keep the larger alignment.
640
e8dd54e1
CC
6412012-03-12 Cary Coutant <ccoutant@google.com>
642
643 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
644 handling of DW_LNE_define_file.
645
feb5f3b0
CC
6462012-03-12 Cary Coutant <ccoutant@google.com>
647
648 * reduced_debug_output.cc
649 (Output_reduced_debug_info_section::get_die_end): Add new FORM
650 codes to switch.
651
a1fb4256
CC
6522012-02-29 Cary Coutant <ccoutant@google.com>
653
654 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
655
5dd8762a
CC
6562012-02-29 Cary Coutant <ccoutant@google.com>
657
658 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
659 Call Object::decompressed_section_contents.
660 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
661 New dtor.
662 (Sized_dwarf_line_info::buffer_start_): New data member.
663 * merge.cc (Output_merge_data::do_add_input_section): Call
664 Object::decompressed_section_contents.
665 (Output_merge_string::do_add_input_section): Likewise.
666 * object.cc (need_decompressed_section): New function.
667 (build_compressed_section_map): Decompress sections needed later.
668 (Sized_relobj_file::do_decompressed_section_contents): New function.
669 (Sized_relobj_file::do_discard_decompressed_sections): New function.
670 * object.h (Object::decompressed_section_contents): New function.
671 (Object::discard_decompressed_sections): New function.
672 (Object::do_decompressed_section_contents): New function.
673 (Object::do_discard_decompressed_sections): New function.
674 (Compressed_section_info): New type.
675 (Compressed_section_map): Include decompressed section contents.
676 (Sized_relobj_file::do_decompressed_section_contents): New function.
677 (Sized_relobj_file::do_discard_decompressed_sections): New function.
678
7b5de7ee
CC
6792012-02-16 Cary Coutant <ccoutant@google.com>
680
681 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
682 * testsuite/Makefile.in: Regenerate.
683
f9fa4a63
CC
6842012-02-14 Cary Coutant <ccoutant@google.com>
685
686 * options.cc (General_options::finalize): Disallow -pie and -static.
687
2c175ebc
DK
6882012-02-03 Doug Kwan <dougkwan@google.com>
689
690 * arm.cc (Arm_relocate_functions::abs8,
691 Arm_relocate_functions::abs16): Use
692 Bits::has_signed_unsigned_overflow32.
693 (Arm_relocate_functions::thm_abs8): Correct range of
694 overflow check.
695 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
696 in assertions.
697
90cff06f
DK
6982012-02-02 Doug Kwan <dougkwan@google.com>
699
700 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
701 position independent outputs, not just shared objects.
702
63887f3d
L
7032012-01-30 H.J. Lu <hongjiu.lu@intel.com>
704
705 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
706 * configure: Regenerated.
707
bef2b434
ILT
7082012-01-27 Ian Lance Taylor <iant@google.com>
709
710 * reloc.h (Bits): New class with static functions, copied from
711 namespace utils in arm.cc.
712 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
713 instead.
714
c335b55d
L
7152012-01-27 H.J. Lu <hongjiu.lu@intel.com>
716
717 * incremental.cc (write_info_blocks): Correct relocation offset.
718
41194d9f
L
7192012-01-27 H.J. Lu <hongjiu.lu@intel.com>
720
721 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
722 (Relocate::tls_gd_to_le): Likewise.
723
1bae613c
L
7242012-01-27 H.J. Lu <hongjiu.lu@intel.com>
725
726 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
727
24482ca0
L
7282012-01-27 H.J. Lu <hongjiu.lu@intel.com>
729
730 * configure.ac: Check if -mcmodel=medium works.
731 * configure: Regenerated.
732
c2c7840a
CC
7332012-01-24 Cary Coutant <ccoutant@google.com>
734
735 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
736 definition and ...
737 (read_unsigned_LEB_128_x): ... this new function.
738 (read_signed_LEB_128): Replaced with inline definition and ...
739 (read_signed_LEB_128_x): ... this new function.
740 * int_encoding.h (read_unsigned_LEB_128_x): New function.
741 (read_unsigned_LEB_128): Add inline definition.
742 (read_signed_LEB_128_x): New function.
743 (read_signed_LEB_128): Add inline definition.
744 * testsuite/Makefile.am (leb128_unittest): New unit test.
745 * testsuite/Makefile.in: Regenerate.
746 * testsuite/leb128_unittest.cc: New unit test.
747
833de760 7482012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
749
750 PR gold/13617
751 * i386.cc (Target_i386::do_code_fill): When using a jmp
752 instruction, pad with nop instructions.
753 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
754
618d6666
L
7552012-01-22 H.J. Lu <hongjiu.lu@intel.com>
756
757 * x86_64.cc (gc_process_relocs): Add typename on types used in
758 template.
759 (scan_relocs): Likewise.
760 (relocate_section): Likewise.
761 (apply_relocation): Likewise.
762
3660ff06
L
7632012-01-10 H.J. Lu <hongjiu.lu@intel.com>
764
765 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
766 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
767 under x32.
768
fc51264f
L
7692012-01-09 H.J. Lu <hongjiu.lu@intel.com>
770
771 * x86_64.cc: Initial support for x32.
772
dd74ae06
CC
7732012-01-03 Cary Coutant <ccoutant@google.com>
774
775 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
776 Use abstract base class for GOT.
777 * gold/output.h (class Output_data_got_base): New abstract base class.
778 (class Output_data_got): Derive from new base class, adjust ctors.
779 (Output_data_got::reserve_slot): Make virtual; rename to
780 do_reserve_slot; Adjust callers.
781 * gold/target.h (Sized_target::init_got_plt_for_update): Return
782 pointer to abstract base class.
783 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
784
83896202
ILT
7852011-12-18 Ian Lance Taylor <iant@google.com>
786
787 * object.h (Relobj::local_symbol_value): New function.
788 (Relobj::local_plt_offset): New function.
789 (Relobj::local_has_got_offset): New function.
790 (Relobj::local_got_offset): New function.
791 (Relobj::set_local_got_offset): New function.
792 (Relobj::do_local_symbol_value): New pure virtual function.
793 (Relobj::do_local_plt_offset): Likewise.
794 (Relobj::do_local_has_got_offset): Likewise.
795 (Relobj::do_local_got_offset): Likewise.
796 (Relobj::do_set_local_got_offset): Likewise.
797 (Sized_relobj::do_local_has_got_offset): Rename from
798 local_has_got_offset.
799 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
800 (Sized_relobj::do_set_local_got_offset): Rename from
801 set_local_got_offset.
802 (Sized_relobj_file::do_local_plt_offset): Rename from
803 local_plt_offset.
804 (Sized_relobj_file::do_local_symbol_value): New function.
805 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
806 local_plt_offset.
807 * output.cc (Output_data_got::Got_entry::write): Change object to
808 Relobj. Use local_symbol_value.
809 (Output_data_got::add_global_with_rel): Change rel_dyn to
810 Output_data_reloc_generic*. Use add_global_generic.
811 (Output_data_got::add_global_with_rela): Remove. Change all
812 callers to use add_global_with_rel.
813 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
814 Output_data_reloc_generic*. Use add_global_generic.
815 (Output_data_got::add_global_pair_with_rela): Remove. Change all
816 callers to use add_global_pair_with_rel.
817 (Output_data_got::add_local): Change object to Relobj*.
818 (Output_data_got::add_local_plt): Likewise.
819 (Output_data_got::add_local_with_rel): Change object to Relobj*,
820 change rel_dyn to Output_data_reloc_generic*. Use
821 add_local_generic.
822 (Output_data_got::add_local_with_rela): Remove. Change all
823 callers to use all_local_with_rel.
824 (Output_data_got::add_local_pair_with_rel): Change object to
825 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
826 add_output_section_generic.
827 (Output_data_got::add_local_pair_with_rela): Remove. Change all
828 callers to use add_local_pair_with_rel.
829 (Output_data_got::reserve_local): Change object to Relobj*.
830 * output.h: (class Output_data_reloc_generic): Add pure virtual
831 declarations for add_global_generic, add_local_generic,
832 add_output_section_generic.
833 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
834 functions for Output_data_reloc_generic. Update declarations for
835 changes listed in output.cc.
836 (class Output_data_got): Change template parameter to got_size.
837 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
838 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
839 function.
840 (Sized_relobj_incr::do_local_plt_offset): New function.
841 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
842 add_global_generic.
843
76677ad0
CC
8442011-12-17 Cary Coutant <ccoutant@google.com>
845
846 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
847 * resolve.cc (Symbol_table::resolve): Likewise.
848 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
849 arrays.
850 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
851
8b8dd8d5
ILT
8522011-12-16 Ian Lance Taylor <iant@google.com>
853
854 * output.h (Output_data_reloc_generic::add): Only call
855 add_dynamic_reloc if this is a dynamic reloc section.
856
d55525b9
L
8572011-12-15 H.J. Lu <hongjiu.lu@intel.com>
858
859 PR gold/13505
860 * target-reloc.h (apply_relocation): Replace <64, false> with
861 <size, big_endian>.
862
ff81c7c1
NC
8632011-11-25 Nick Clifton <nickc@redhat.com>
864
865 * po/it.po: New Italian translation.
866
628f39be
SA
8672011-11-17 Sterling Augustine <saugustine@google.com>
868
869 * script.cc (script_include_directive): Implement.
870 (read_script_file): New local variables name and search_path. Update
871 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
872 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
873 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
874
98ef3ea4
SA
8752011-11-11 Sterling Augustine <saugustine@google.com>
876
877 * yyscript.y (section_cmd): Add support for INCLUDE directive.
878 (file_or_sections_cmd): Likewise.
879
f4a8b6d7
DK
8802011-11-11 Doug Kwan <dougkwan@google.com>
881
882 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
883 if --just-symbols is given.
884
29ab395d
DK
8852011-11-10 Doug Kwan <dougkwan@google.com>
886
887 PR gold/13362
888 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
889 when processing data relocs.
890 * reloc.h (Relocate_functions::rel_unaligned): New method.
891 (Relocate_functions::pcrel_unaligned): Ditto.
892 (Relocate_functions::rel32_unaligned): Ditto.
893 (Relocate_functions::pcrel32_unaligned): Ditto.
894
2c339f71
DK
8952011-11-09 Doug Kwan <dougkwan@google.com>
896
897 PR gold/13362
898 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
899 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
900 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
901 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
902 (Relocate_functions::rel_unaligned): New.
903 (Relocate_functions::rel32_unaligned): New.
904 * target-reloc.h (relocate_for_relocatable): Add code to handle
905 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
906 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
907 arm_unaligned_reloc_r): New targets.
908 * testsuite/Makefile.in: Regenerate.
909 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
910 linking.
911
3f3cddf1
ILT
9122011-11-02 Ian Lance Taylor <iant@google.com>
913
914 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
915 NATIVE_LINKER.
916 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
917 * options.cc (General_options::finalize): Use library search path
918 from configure script if specified. If not native and no sysroot,
919 only search TOOLLIBDIR.
920 * options.h (Search_directory::Search_directory): Change name to
921 const std::string&.
922 (General_options::add_to_library_path_with_sysroot): Change arg to
923 const std::string&.
924 * configure, Makefile.in, config.in: Rebuild.
925
a8e2273b
ILT
9262011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
927
928 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
929 we are working around the ARM1176 Erratum.
930 * options.h (General_options::fix_arm1176): Add option.
931 * testsuite/Makefile.am: Add testcases, and keep current ones
932 working.
933 * testsuite/Makefile.in: Regenerate.
934 * testsuite/arm_fix_1176.s: New file.
935 * testsuite/arm_fix_1176.sh: Likewise.
936
cd6eab1c
ILT
9372011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
938
939 * arm.cc (Target_arm::Target_arm): Remove initialisation of
940 may_use_blx_.
941 (Target_arm::may_use_blx): Remove method.
942 (Target_arm::set_may_use_blx): Likewise.
943 (Target_arm::may_use_v4t_interworking): New method.
944 (Target_arm::may_use_v5t_interworking): Likewise.
945 (Target_arm::may_use_blx_): Remove member variable.
946 (Arm_relocate_functions::arm_branch_common): Check for v5T
947 interworking.
948 (Arm_relocate_functions::thumb_branch_common): Likewise.
949 (Reloc_stub::stub_type_for_reloc): Likewise.
950 (Target_arm::do_finalize_sections): Correct interworking checks.
951 * testsuite/Makefile.am: Add new tests.
952 * testsuite/Makefile.in: Regenerate.
953 * testsuite/arm_farcall_arm_arm.s: New test.
954 * testsuite/arm_farcall_arm_arm.sh: Likewise.
955 * testsuite/arm_farcall_arm_thumb.s: Likewise.
956 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
957 * testsuite/arm_farcall_thumb_arm.s: Likewise.
958 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
959 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
960 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
961
286adcf4
CC
9622011-10-31 Cary Coutant <ccoutant@google.com>
963
964 PR gold/13023
965 * expression.cc (Expression::eval_with_dot): Add
966 is_section_dot_assignment parameter.
967 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
968 absolute and assigning to dot within a section.
969 * script-sections.cc
970 (Output_section_element_assignment::set_section_addresses): Pass
971 dot_section to set_if_absolute.
972 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
973 as is_section_dot_assignment flag to eval_with_dot.
974 (Output_section_element_dot_assignment::set_section_addresses):
975 Likewise.
976 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
977 parameter. Also set value if relative to dot_section; set the
978 symbol's output_section.
979 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
980 parameter. Adjust all callers.
981 (Expression::eval_maybe_dot): Likewise.
982 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
983 Adjust all callers.
984 * testsuite/script_test_2.t: Test assignment of an absolute value
985 to dot within an output section element.
986
9634ed06
CC
9872011-10-31 Cary Coutant <ccoutant@google.com>
988
989 * options.h (class General_options): Add --[no-]gnu-unique options.
990 * symtab.cc (Symbol_table::sized_write_globals): Convert
991 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
992
de4101c7
CC
9932011-10-31 Cary Coutant <ccoutant@google.com>
994
995 PR gold/13359
996 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
997 unnecessary assertion.
998 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
999
7257cc92
ST
10002011-10-31 Sriraman Tallam <tmsriram@google.com>
1001
1002 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1003 gc_mark_symbol.
1004 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
1005 gc_mark_symbol.
1006 Change to just keep the section associated with symbol.
1007 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
1008 they are externally visible and --export-dynamic is turned on.
1009 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
1010
bfc34b3f
ILT
10112011-10-19 Ian Lance Taylor <iant@google.com>
1012
1013 PR gold/13163
1014 * script-sections.cc
1015 (Output_section_element_dot_assignment::needs_output_section): New
1016 function.
1017
ea0d8c47
ILT
10182011-10-19 Ian Lance Taylor <iant@google.com>
1019
1020 PR gold/13204
1021 * layout.cc (Layout::segment_precedes): Don't assert failure if a
1022 --section-start option was seen.
1023 * options.h (General_options::any_section_start): New function.
1024
abd242a9
DM
10252011-10-18 David S. Miller <davem@davemloft.net>
1026
1027 PR binutils/13301
1028 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
1029 member to track relocation locations that have moved during TLS
1030 reloc optimizations.
1031 (Target_sparc::Relocate::Relocate): Initialize to NULL.
1032 (Target_sparc::Relocate::relocate): Adjust view down by 4
1033 bytes if it matches reloc_adjust_addr_.
1034 (Target_sparc::Relocate::relocate_tls): Always move the
1035 __tls_get_addr call delay slot instruction forward 4 bytes when
1036 performing relaxation.
1037
bab9090f
CC
10382011-10-18 Cary Coutant <ccoutant@google.com>
1039
1040 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
1041 (Output_file::map_no_anonymous): Check for non-zero
1042 return code from posix_fallocate.
1043
f7c5b166
CC
10442011-10-17 Cary Coutant <ccoutant@google.com>
1045
1046 PR gold/13245
1047 * plugin.cc (is_visible_from_outside): Check for symbols
1048 referenced from dynamic objects.
1049 * resolve.cc (Symbol_table::resolve): Don't count references
1050 from dynamic objects as references from real ELF files.
1051 * testsuite/plugin_test_2.sh: Adjust expected result.
1052
b490c0bb
CC
10532011-10-17 Cary Coutant <ccoutant@google.com>
1054
1055 * gold.cc: Include timer.h.
1056 (queue_middle_tasks): Stamp time.
1057 (queue_final_tasks): Likewise.
1058 * main.cc (main): Store timer in parameters. Print timers
1059 for each pass.
1060 * parameters.cc (Parameters::Parameters): Initialize timer_.
1061 (Parameters::set_timer): New function.
1062 (set_parameters_timer): New function.
1063 * parameters.h (Parameters::set_timer): New function.
1064 (Parameters::timer): New function.
1065 (Parameters::timer_): New data member.
1066 (set_parameters_timer): New function.
1067 * timer.cc (Timer::stamp): New function.
1068 (Timer::get_pass_time): New function.
1069 * timer.h (Timer::stamp): New function.
1070 (Timer::get_pass_time): New function.
1071 (Timer::pass_times_): New data member.
1072
f475cf7b
CC
10732011-10-17 Cary Coutant <ccoutant@google.com>
1074
1075 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
1076 task for members of lib groups.
1077
cdd7e244
CC
10782011-10-17 Cary Coutant <ccoutant@google.com>
1079
1080 PR gold/13288
4f95c8b4 1081 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
1082 (File_read::make_view): Move bounds check (replace with assert)...
1083 (File_read::find_or_make_view): ... to here.
1084
dfb45471
CC
10852011-10-12 Cary Coutant <ccoutant@google.com>
1086
4f95c8b4 1087 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
1088 ::read returns less than requested size.
1089
53bbcc1b
CC
10902011-10-10 Cary Coutant <ccoutant@google.com>
1091
4f95c8b4 1092 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
1093 Initialize defined_count_.
1094 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
1095 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
1096 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
1097 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
1098 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 1099 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
1100 member.
1101 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 1102 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
1103 Return zeroes instead of internal error.
1104
397b129b
CC
11052011-10-10 Cary Coutant <ccoutant@google.com>
1106
1107 PR gold/13249
4f95c8b4 1108 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 1109 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 1110 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
1111 (Output_reloc::type_): Adjust size of bit field.
1112 (Output_reloc::use_plt_offset_): New bit field.
1113 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
1114 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
1115 flag. Adjust all callers.
4f95c8b4 1116 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
1117 creating RELATIVE relocations.
1118
d5698657
NC
11192011-10-10 Nick Clifton <nickc@redhat.com>
1120
1121 * po/es.po: Updated Spanish translation.
1122 * po/fi.po: Updated Finnish translation.
1123
6a59a5c2
DN
11242011-10-03 Diego Novillo <dnovillo@google.com>
1125
1126 * options.cc (parse_uint): Fix dereference of RETVAL.
1127
f0558624
ST
11282011-09-29 Sriraman Tallam <tmsriram@google.com>
1129
1130 * layout.h (section_order_map_): New member.
1131 (get_section_order_map): New member function.
1132 * output.cc (Output_section::add_input_section): Check for patterns
1133 only when --section-ordering-file is specified.
1134 * gold.cc (queue_middle_tasks): Delay updating order of sections till
1135 output_sections have been formed.
1136 * layout.cc (Layout_Layout): Initialize section_order_map_.
1137 * plugin.cc (update_section_order): Store order in order_map. Do not
1138 update the order.
1139 * testsuite/Makefile.am: Add test case for plugin_final_layout.
1140 * testsuite/Makefile.in: Regenerate.
1141 * testsuite/plugin_section_order.c: New file.
1142 * testsuite/plugin_final_layout.cc: New file.
1143 * testsuite/plugin_final_layout.sh: New file.
1144
a7dac153
CC
11452011-09-29 Cary Coutant <ccoutant@google.com>
1146
4f95c8b4 1147 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 1148 Check for NULL.
4f95c8b4 1149 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
1150 symbols during incremental update.
1151 (Symbol_table::add_from_dynobj): Likewise.
1152
eebd87a5
ILT
11532011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1154 Ian Lance Taylor <iant@google.com>
1155
1156 * symtab.cc (Symbol_table::define_special_symbol): Always
1157 canonicalize version string.
1158
403a3331
CC
11592011-09-26 Cary Coutant <ccoutant@google.com>
1160
4f95c8b4
CC
1161 * gold.cc (queue_initial_tasks): Move option checks ...
1162 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
1163 some options; make others fatal.
1164
235061c2
CC
11652011-09-26 Cary Coutant <ccoutant@google.com>
1166
1167 gcc PR lto/47247
1168 * plugin.cc (get_symbols_v2): New function.
1169 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
1170 (is_referenced_from_outside): New function.
1171 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
1172 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
1173 (get_symbols): Pass version parameter.
1174 (get_symbols_v2): New function.
1175 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
1176 parameter.
1177 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
1178 (onload): Add LDPT_GET_SYMBOLS_V2.
1179 (all_symbols_read_hook): Use get_symbols_v2; check for
1180 LDPR_PREVAILING_DEF_IRONLY_EXP.
1181 * testsuite/plugin_test_3.sh: Update expected results.
1182
dc87f620
ILT
11832011-09-23 Simon Baldwin <simonb@google.com>
1184
1185 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
1186 configuration options.
1187 * configure: Regenerate.
1188 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
1189 * Makefile.in: Regenerate.
1190 * testsuite/Makefile.in: Regenerate.
1191
a8279f82
ST
11922011-09-19 Sriraman Tallam <tmsriram@google.com>
1193
1194 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
1195
0c9350c8
CC
11962011-09-19 Cary Coutant <ccoutant@google.com>
1197
1198 * incremental.cc (can_incremental_update): Fix typo in comment.
1199 * incremental.h (can_incremental_update): Likewise.
1200
aa06ae28
CC
12012011-09-18 Cary Coutant <ccoutant@google.com>
1202
1203 * incremental.cc (can_incremental_update): New function.
1204 * incremental.h (can_incremental_update): New function.
1205 * layout.cc (Layout::init_fixed_output_section): Call it.
1206 (Layout::make_output_section): Don't allow patch space in .eh_frame.
1207 * object.cc (Sized_relobj_file::do_layout): Call
1208 can_incremental_update.
1209
ebb300b2
CC
12102011-09-13 Cary Coutant <ccoutant@google.com>
1211
1212 * configure.ac: Check for glibc support for gnu_indirect_function
1213 support with static linking, setting automake conditional
1214 IFUNC_STATIC.
1215 * Makefile.in: Regenerate.
1216 * configure: Regenerate.
1217
1218 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
1219 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
1220 for IFUNC_STATIC.
1221 * testsuite/Makefile.in: Regenerate.
1222
1206d0d5
CC
12232011-09-13 Cary Coutant <ccoutant@google.com>
1224
1225 * incremental.cc (Sized_relobj_incr::do_layout): Call
1226 report_comdat_group for kept comdat sections.
1227 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
1228 * testsuite/Makefile.in: Regenerate.
1229 * testsuite/incr_comdat_test_1.cc: New source file.
1230 * testsuite/incr_comdat_test_2_v1.cc: New source file.
1231 * testsuite/incr_comdat_test_2_v2.cc: New source file.
1232 * testsuite/incr_comdat_test_2_v3.cc: New source file.
1233
40b29874
ILT
12342011-09-13 Ian Lance Taylor <iant@google.com>
1235
1236 * object.cc (Sized_relobj_file::do_layout): Remove unused local
1237 variable external_symbols_offset.
1238
1b045aac
ILT
12392011-09-12 Ian Lance Taylor <iant@google.com>
1240
1241 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
1242 triggered if object has no symbols.
1243
24c6c55a
DM
12442011-09-09 David S. Miller <davem@davemloft.net>
1245
1246 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
1247 (Output_fill_debug_line::do_write): Likewise.
1248
66570254
CC
12492011-08-29 Cary Coutant <ccoutant@google.com>
1250
1251 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
1252 casts to match formatting specs.
1253 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
1254
8ea8cd50
CC
12552011-08-26 Cary Coutant <ccoutant@google.com>
1256
1257 * layout.cc (Free_list::allocate): Provide guarantee of minimum
1258 remaining hole size when allocating.
1259 (Layout::make_output_section): Set fill methods for debug sections.
1260 * layout.h (Free_list::Free_list_node): Move from private to
1261 public.
1262 (Free_list::set_min_hole_size): New function.
1263 (Free_list::begin, Free_list::end): New functions.
1264 (Free_list::min_hole_): New data member.
1265 * output.cc: Include dwarf.h.
1266 (Output_fill_debug_info::do_minimum_hole_size): New function.
1267 (Output_fill_debug_info::do_write): New function.
1268 (Output_fill_debug_line::do_minimum_hole_size): New function.
1269 (Output_fill_debug_line::do_write): New function.
1270 (Output_section::Output_section): Initialize new data member.
1271 (Output_section::set_final_data_size): Ensure patch space is larger
1272 than minimum hole size.
1273 (Output_section::do_write): Fill holes in debug sections.
1274 * output.h (Output_fill): New class.
1275 (Output_fill_debug_info): New class.
1276 (Output_fill_debug_line): New class.
1277 (Output_section::set_free_space_fill): New function.
1278 (Output_section::free_space_fill_): New data member.
1279 * testsuite/Makefile.am (incremental_test_3): Add
1280 --incremental-patch option.
1281 (incremental_test_4): Likewise.
1282 (incremental_test_5): Likewise.
1283 (incremental_test_6): Likewise.
1284 (incremental_copy_test): Likewise.
1285 (incremental_common_test_1): Likewise.
1286 * testsuite/Makefile.in: Regenerate.
1287
7cf80422
NC
12882011-08-26 Nick Clifton <nickc@redhat.com>
1289
1290 * po/es.po: Updated Spanish translation.
1291
c3f7b0e5
CC
12922011-08-01 Cary Coutant <ccoutant@google.com>
1293
1294 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
1295 * gold/testsuite/Makefile.in: Regenerate.
1296 * gold/testsuite/justsyms_exec.c: New source file.
1297 * gold/testsuite/justsyms_lib.c: New source file.
1298
9590bf25
CC
12992011-08-01 Cary Coutant <ccoutant@google.com>
1300
1301 * layout.cc (Layout::set_segment_offsets): Don't realign text
1302 segment if -Ttext was specified.
1303 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
1304 file type.
1305 * object.h (Sized_relobj_file::e_type): New function.
1306 (Sized_relobj_file::e_type_): New data member.
1307 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
1308 base address for ET_EXEC files.
1309 * target.cc (Target::do_make_elf_object_implementation): Allow
1310 ET_EXEC files with --just-symbols option.
1311
dcd8d12e
CC
13122011-07-28 Cary Coutant <ccoutant@google.com>
1313
1314 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
1315 Add thread_number parameter.
1316 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
1317 * workqueue-threads.cc
1318 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
1319 current thread if its thread number is greater than desired thread
1320 count.
1321 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
1322 Add thread_number parameter.
1323 (Workqueue::should_cancel_thread): Likewise.
1324 (Workqueue::find_runnable_or_wait): Pass thread_number to
1325 should_cancel_thread.
1326 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
1327 parameter.
1328
804eb480
ST
13292011-07-22 Sriraman Tallam <tmsriram@google.com>
1330
1331 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
1332 only after checking if it cannot be forced local.
1333 * symtab.h (is_externally_visible): Check if the symbol is not forced
1334 local.
1335
f1ddb600
ILT
13362011-07-15 Ian Lance Taylor <iant@google.com>
1337
1338 * options.h (class General_options): Add --print-output-format.
1339 Move -EL next to -EB, for better --help output.
1340 * target-select.cc: Include <cstdio>, "options.h", and
1341 "parameters.h".
1342 (Target_selector::do_target_bfd_name): New function.
1343 (print_output_format): New function.
1344 * target-select.h (class Target_selector): Update declarations.
1345 (Target_selector::target_bfd_name): New function.
1346 (print_output_format): Declare.
1347 * main.cc: Include "target-select.h".
1348 (main): Handle --print-output-format.
1349 * gold.cc: Include "target-select.h".
1350 (queue_initial_tasks): Handle --print-output-format when there are
1351 no input files.
1352 * parameters.cc (parameters_force_valid_target): Give a better
1353 error message if -EB/-EL does not match target.
1354 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
1355 function.
1356
7d172687
ILT
13572011-07-15 Ian Lance Taylor <iant@google.com>
1358
1359 * i386.cc (class Output_data_plt_i386): Add layout_ field.
1360 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
1361 (Output_data_plt_i386::do_write): Write address of .dynamic
1362 section to first entry in .got.plt section.
1363 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
1364 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1365 Initialize layout_.
1366 (Output_data_plt_x86_64::do_write): Write address of .dynamic
1367 section to first entry in .got.plt section.
1368 * layout.h (Layout::dynamic_section): New function.
1369
e9552f7e
ST
13702011-07-13 Sriraman Tallam <tmsriram@google.com>
1371
1372 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
1373 to claim_file call.
1374 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
1375 input_section_position_, and input_section_glob_.
1376 (read_layout_from_file): Call function section_ordering_specified.
1377 * layout.h (is_section_ordering_specified): New function.
1378 (section_ordering_specified): New function.
1379 (section_ordering_specified_): New boolean member.
1380 * main.cc(main): Call load_plugins after layout object is defined.
1381 * output.cc (Output_section::add_input_section): Use
1382 function section_ordering_specified to check if section ordering is
1383 needed.
1384 * output.cc (Output_section::add_relaxed_input_section): Use
1385 function section_ordering_specified to check if section ordering is
1386 needed.
1387 (Output_section::update_section_layout): New function.
1388 (Output_section::sort_attached_input_sections): Check if input section
1389 must be reordered.
1390 * output.h (Output_section::update_section_layout): New function.
1391 * plugin.cc (get_section_count): New function.
1392 (get_section_type): New function.
1393 (get_section_name): New function.
1394 (get_section_contents): New function.
1395 (update_section_order): New function.
58797674 1396 (allow_section_ordering): New function.
e9552f7e
ST
1397 (Plugin::load): Add the new interfaces to the transfer vector.
1398 (Plugin_manager::load_plugins): New parameter.
1399 (Plugin_manager::all_symbols_read): New parameter.
1400 (Plugin_manager::claim_file): New parameter. Save the elf object for
1401 unclaimed objects.
1402 (Plugin_manager::get_elf_object): New function.
1403 (Plugin_manager::get_view): Change to directly use the bool to check
1404 if get_view is called from claim_file_hook.
1405 * plugin.h (input_objects): New function
1406 (Plugin__manager::load_plugins): New parameter.
1407 (Plugin_manager::claim_file): New parameter.
1408 (Plugin_manager::get_elf_object): New function.
1409 (Plugin_manager::in_claim_file_handler): New function.
1410 (Plugin_manager::in_claim_file_handler_): New member.
1411 (layout): New function.
1412 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
1413 handler with an extra parameter. Make the elf object before calling
1414 claim_file handler.
1415 * testsuite/plugin_test.c (get_section_count): New function pointer.
1416 (get_section_type): New function pointer.
1417 (get_section_name): New function pointer.
1418 (get_section_contents): New function pointer.
1419 (update_section_order): New function pointer.
1420 (allow_section_ordering): New function pointer.
1421 (onload): Check if the new interfaces exist.
1422
9446efde
ILT
14232011-07-13 Ian Lance Taylor <iant@google.com>
1424
1425 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
1426 relro section.
1427 * x86_64.cc (Target_x86_64::got_section): Likewise.
1428 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
1429 (relro_now_test_SOURCES): New variable.
1430 (relro_now_test_DEPENDENCIES): New variable.
1431 (relro_now_test_LDFLAGS): New variable.
1432 (relro_now_test_LDADD): New variable.
1433 (relro_now_test.so): New target.
1434 * testsuite/Makefile.in: Rebuild.
1435
07aa62f2
ILT
14362011-07-12 Ian Lance Taylor <iant@google.com>
1437
1438 PR gold/12980
1439 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
1440 GLOB_DAT relocation rather than a RELATIVE relocation for a
1441 protected symbol when creating a shared library.
1442 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
1443 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
1444 * testsuite/protected_main_1.cc (main): Test that protected
1445 function has same address.
1446
e2153196
ILT
14472011-07-11 Ian Lance Taylor <iant@google.com>
1448
1449 PR gold/12979
1450 * options.h (class General_options): Add -Bgroup.
1451 * options.cc (General_options::finalize): If -Bgroup is set,
1452 default to --unresolved-symbols=report-all.
1453 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
1454 * target-reloc.h (issue_undefined_symbol_error): Handle
1455 --unresolved-symbols=report-all.
1456
6daf5215
ILT
14572011-07-08 Ian Lance Taylor <iant@google.com>
1458
1459 PR gold/11985
1460 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
1461 if linker script discards key sections.
1462 (Layout::create_dynamic_symtab): Likewise.
1463 (Layout::assign_local_dynsym_offsets): Likewise.
1464 (Layout::sized_create_version_sections): Likewise.
1465 (Layout::create_interp): Likewise.
1466 (Layout::finish_dynamic_section): Likewise.
1467 (Layout::set_dynamic_symbol_size): Likewise.
1468
beabb2c6
ILT
14692011-07-08 Ian Lance Taylor <iant@google.com>
1470
1471 PR gold/12386
1472 * options.h (class General_options): Add --unresolved-symbols.
1473 * target-reloc.h (issue_undefined_symbol_error): Check
1474 --unresolved-symbols. Add comments.
1475
9c16daf1
ILT
14762011-07-08 Ian Lance Taylor <iant@google.com>
1477
1478 * testsuite/odr_violation2.cc (Ordering::operator()): Make
1479 expression more complex.
1480
191f1a2d
ILT
14812011-07-08 Ian Lance Taylor <iant@google.com>
1482
1483 PR gold/11317
1484 * target-reloc.h (issue_undefined_symbol_error): New inline
1485 function, broken out of relocate_section.
1486 (relocate_section): Call issue_undefined_symbol_error.
1487 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1488 there is no TLS segment if we are about to issue an undefined
1489 symbol error.
1490 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1491
62855347
ILT
14922011-07-08 Ian Lance Taylor <iant@google.com>
1493
1494 PR gold/12279
1495 * resolve.cc (Symbol_table::should_override): Add fromtype
1496 parameter. Change all callers. Give error when linking together
1497 TLS and non-TLS symbol.
1498 (Symbol_table::should_override_with_special): Add fromtype
1499 parameter. Change all callers.
1500 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1501 there is no TLS segment if we have reported some errors.
1502 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1503
67181c72
ILT
15042011-07-08 Ian Lance Taylor <iant@google.com>
1505
1506 PR gold/12372
1507 * target.h (Target::plt_address_for_global): New function.
1508 (Target::plt_address_for_local): New function.
1509 (Target::plt_section_for_global): Remove.
1510 (Target::plt_section_for_local): Remove.
1511 (Target::do_plt_address_for_global): New virtual function.
1512 (Target::do_plt_address_for_local): New virtual function.
1513 (Target::do_plt_section_for_global): Remove.
1514 (Target::do_plt_section_for_local): Remove.
1515 (Target::register_global_plt_entry): Add Symbol_table and Layout
1516 parameters.
1517 * output.cc (Output_data_got::Got_entry::write): Use
1518 plt_address_for_global and plt_address_for_local.
1519 * layout.cc (Layout::add_target_dynamic_tags): Use size and
1520 address of output section.
1521 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
1522 got_irelative_, and irelative_count_ fields. Update
1523 declarations.
1524 (Output_data_plt_i386::has_irelative_section): New function.
1525 (Output_data_plt_i386::entry_count): Add irelative_count_.
1526 (Output_data_plt_i386::set_final_data_size): Likewise.
1527 (class Target_i386): Add got_irelative_ and rel_irelative_
1528 fields. Update declarations.
1529 (Target_i386::Target_i386): Initialize new fields.
1530 (Target_i386::do_plt_address_for_global): New function replacing
1531 do_plt_section_for_global.
1532 (Target_i386::do_plt_address_for_local): New function replacing
1533 do_plt_section_for_local.
1534 (Target_i386::got_section): Create got_irelative_.
1535 (Target_i386::rel_irelative_section): New function.
1536 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
1537 fields. Don't define __rel_iplt_{start,end}.
1538 (Output_data_plt_i386::add_entry): Add symtab and layout
1539 parameters. Change all callers. Use different PLT and GOT for
1540 IFUNC symbols.
1541 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
1542 layout parameters. Change all callers. Use different PLT and
1543 GOT.
1544 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
1545 (Output_data_plt_i386::rel_irelative): New function.
1546 (Output_data_plt_i386::address_for_global): New function.
1547 (Output_data_plt_i386::address_for_local): New function.
1548 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
1549 IRELATIVE GOT when changing IFUNC GOT entries.
1550 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
1551 reloc.
1552 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
1553 if we didn't create an IRELATIVE GOT.
1554 (Target_i386::Relocate::relocate): Use plt_address_for_global and
1555 plt_address_for_local.
1556 (Target_i386::do_dynsym_value): Use plt_address_for_global.
1557 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
1558 got_irelative_, and irelative_count_ fields. Update
1559 declarations.
1560 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1561 Initialize new fields. Remove symtab parameter. Change all
1562 callers.
1563 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
1564 irelative_count_.
1565 (Output_data_plt_x86_64::has_irelative_section): New function.
1566 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
1567 (class Target_x86_64): Add got_irelative_ and rel_irelative_
1568 fields. Update declarations.
1569 (Target_x86_64::Target_x86_64): Initialize new fields.
1570 (Target_x86_64::do_plt_address_for_global): New function replacing
1571 do_plt_section_for_global.
1572 (Target_x86_64::do_plt_address_for_local): New function replacing
1573 do_plt_section_for_local.
1574 (Target_x86_64::got_section): Create got_irelative_.
1575 (Target_x86_64::rela_irelative_section): New function.
1576 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
1577 all callers. Don't create __rel_iplt_{start,end}.
1578 (Output_data_plt_x86_64::add_entry): Add symtab and layout
1579 parameters. Change all callers. Use different PLT and GOT for
1580 IFUNC symbols.
1581 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
1582 layout parameters. Change all callers. Use different PLT and
1583 GOT.
1584 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
1585 parameters. Change all callers. Use different PLT and GOT for
1586 IFUNC symbols.
1587 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
1588 (Output_data_plt_x86_64::rela_irelative): New function.
1589 (Output_data_plt_x86_64::address_for_global): New function.
1590 (Output_data_plt_x86_64::address_for_local): New function.
1591 (Output_data_plt_x86_64::set_final_data_size): Likewise.
1592 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
1593 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
1594 (Target_x86_64::register_global_plt_entry): Add symtab and layout
1595 parameters.
1596 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
1597 reloc.
1598 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
1599 symbols if we didn't create an IRELATIVE GOT.
1600 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
1601 plt_address_for_local.
1602 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
1603 * testsuite/ifuncvar1.c: New test file.
1604 * testsuite/ifuncvar2.c: New test file.
1605 * testsuite/ifuncvar3.c: New test file.
1606 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
1607 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
1608 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
1609 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
1610 * testsuite/Makefile.in: Rebuild.
1611
33c15b45
CC
16122011-07-07 Cary Coutant <ccoutant@google.com>
1613
1614 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
1615 (two_file_test_1_ndebug.o): Likewise.
1616 (two_file_test_1b_ndebug.o): Likewise.
1617 (two_file_test_2_ndebug.o): Likewise.
1618 (two_file_test_main_ndebug.o): Likewise.
1619 (incremental_test_2): Link with no-debug versions.
1620
f48b5fb7
CC
16212011-07-06 Cary Coutant <ccoutant@google.com>
1622
1623 * gold/incremental.cc
1624 (Output_section_incremental_inputs::write_info_blocks): Check for
1625 hidden and internal symbols.
1626
221597a5
CC
16272011-07-06 Cary Coutant <ccoutant@google.com>
1628
1629 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
1630 Check disposition for startup file.
1631 (Incremental_inputs::report_command_line): Ignore
1632 --incremental-startup-unchanged option.
1633 * options.cc (General_options::parse_incremental_startup_unchanged):
1634 New function.
1635 (General_options::General_options): Initialize new data member.
1636 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
1637 (General_options): Add --incremental-startup-unchanged option.
1638 (General_options::incremental_startup_disposition): New function.
1639 (General_options::incremental_startup_disposition_): New data member.
1640
e24719f6
CC
16412011-07-06 Cary Coutant <ccoutant@google.com>
1642
1643 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
1644 input file index to Script_info ctor.
1645 (Sized_incremental_binary::do_file_has_changed): Find the
1646 command-line argument for files named in scripts.
1647 * incremental.h (Script_info::Script_info): New ctor
1648 with input file index.
1649 (Script_info::input_file_index): New function.
1650 (Script_info::input_file_index_): New data member.
1651 (Incremental_binary::get_library): Add const.
1652 (Incremental_binary::get_script_info): Add const.
1653 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
1654 * testsuite/Makefile.am (incremental_test_5): New test case.
1655 (incremental_test_6): New test case.
1656 * testsuite/Makefile.in: Regenerate.
1657
8f7c81e8
CC
16582011-07-06 Cary Coutant <ccoutant@google.com>
1659
1660 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
1661 debug output when command lines differ.
1662
9fbd3822
CC
16632011-07-06 Cary Coutant <ccoutant@google.com>
1664
1665 * incremental.cc (Incremental_inputs::report_command_line): Ignore
1666 --incremental-patch option.
1667 * layout.cc (Free_list::allocate): Extend allocation beyond original
1668 end if enabled.
1669 (Layout::make_output_section): Mark sections that should get
1670 patch space.
1671 * options.cc (parse_percent): New function.
1672 * options.h (parse_percent): New function.
1673 (DEFINE_percent): New macro.
1674 (General_options): Add --incremental-patch option.
1675 * output.cc (Output_section::Output_section): Initialize new data
1676 members.
1677 (Output_section::add_input_section): Print section name when out
1678 of patch space.
1679 (Output_section::add_output_section_data): Likewise.
1680 (Output_section::set_final_data_size): Add patch space when
1681 doing --incremental-full.
1682 (Output_section::do_reset_address_and_file_offset): Remove patch
1683 space.
1684 (Output_segment::set_section_list_addresses): Print debug output
1685 only if --incremental-update.
1686 * output.h (Output_section::set_is_patch_space_allowed): New function.
1687 (Output_section::is_patch_space_allowed_): New data member.
1688 (Output_section::patch_space_): New data member.
1689 * parameters.cc (Parameters::incremental_full): New function.
1690 * parameters.h (Parameters::incremental_full): New function
1691 * testsuite/Makefile.am (incremental_test_2): Add test for
1692 --incremental-patch option.
1693 * testsuite/Makefile.in: Regenerate.
1694 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
1695 (t18): Remove function body.
1696
f6cccc2c
DK
16972011-07-05 Doug Kwan <dougkwan@google.com>
1698
1699 PR gold/12771
1700 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
1701 Arm_Address type for relocation result.
1702 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
1703 overflow check.
1704 (Arm_relocate_functions::abs32): Use unaligned access.
1705 (Arm_relocate_functions::rel32): Ditto.
1706 (Arm_relocate_functions::prel31): Ditto.
1707 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
1708 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
1709 static data relocations.
1710 * testsuite/Makefile.in: Regnerate.
1711 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
1712
28a13fec
ILT
17132011-07-05 Ian Lance Taylor <iant@google.com>
1714
1715 PR gold/12392
1716 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
1717 symbols if necessary.
1718 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
1719
24d47b34
ILT
17202011-07-05 Ian Lance Taylor <iant@google.com>
1721
1722 PR gold/12952
1723 * resolve.cc (Symbol::override_base_with_special): Simply override
1724 version with special symbol version, ignoring previous version.
1725
41f9cbbe
ILT
17262011-07-05 Ian Lance Taylor <iant@google.com>
1727
1728 * object.cc (Sized_relobj_file::include_section_group): Add
1729 information to comment about signature location.
1730
886288f1
ILT
17312011-07-02 Ian Lance Taylor <iant@google.com>
1732
1733 PR gold/12957
1734 * options.h (class General_options): Add -f and -F.
1735 * options.cc (General_options::finalize): Fatal error if -f/-F
1736 are used without -shared.
1737 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
1738
ae3a6d4f
ILT
17392011-07-02 Ian Lance Taylor <iant@google.com>
1740
1741 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
1742
21131061
ILT
17432011-07-01 Ian Lance Taylor <iant@google.com>
1744
1745 PR gold/12525
1746 PR gold/12952
1747 * resolve.cc (Symbol::override_base_with_special): Don't override
1748 the version if the overriding symbol has a different name.
1749 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
1750 all callers. If we give an error about an undefined version,
1751 define the base version if necessary.
1752 * dynobj.h (class Versions): Update declaration.
1753 * testsuite/weak_alias_test_5.cc: New file.
1754 * testsuite/weak_alias_test.script: New file.
1755 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
1756 and versioned_alias have the right value, and call t2.
1757 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
1758 weak_alias_test_5.so.
1759 (weak_alias_test_LDADD): Likewise.
1760 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
1761 * testsuite/Makefile.in: Rebuild.
1762
611062c0
ILT
17632011-07-01 Ian Lance Taylor <iant@google.com>
1764
1765 PR gold/12525
1766 * options.h (class General_options): Support -z notext.
1767 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
1768 -Wl,-z,notext.
1769 (two_file_shared_nonpic.so): Likewise.
1770 (two_file_shared_mixed.so): Likewise.
1771 (two_file_shared_mixed_1.so): Likewise.
1772 (weak_undef_lib_nonpic.so): Likewise.
1773 (alt/weak_undef_lib_nonpic.so): Likewise.
1774 (tls_test_shared_nonpic.so): Likewise.
1775 * testsuite/Makefile.in: Rebuild.
1776
328c7c2f
ILT
17772011-07-01 Ian Lance Taylor <iant@google.com>
1778
1779 PR gold/12525
1780 * configure.ac: Test whether static linking works, setting
1781 the automake conditional HAVE_STATIC.
1782 * testsuite/Makefile.am: Disable tests using -static if
1783 HAVE_STATIC is not true.
1784 * configure, testsuite/Makefile.in: Rebuild.
1785
02d7cd44
ILT
17862011-07-01 Ian Lance Taylor <iant@google.com>
1787
1788 PR gold/12525
1789 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
1790 Assert if we see DW_EH_PE_indirect.
1791 * target.h (Target::ehframe_datarel_base): New function.
1792 (Target::do_ehframe_datarel_base): New target function.
1793 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
1794 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
1795 function.
1796
07a60597
ILT
17972011-07-01 Ian Lance Taylor <iant@google.com>
1798
1799 PR gold/12571
1800 * options.h (class General_options): Add
1801 --ld-generated-unwind-info.
1802 * ehframe.cc (Fde::write): Add address parameter. Change all
1803 callers. If associated with PLT, fill in address and size.
1804 (Cie::set_output_offset): Only add merge mapping if there is an
1805 object.
1806 (Cie::write): Add address parameter. Change all callers.
1807 (Eh_frame::add_ehframe_for_plt): New function.
1808 * ehframe.h (class Fde): Update declarations. Move shndx_ and
1809 input_offset_ fields into union u_, with new plt field.
1810 (Fde::Fde): Adjust for new union field.
1811 (Fde::Fde) [Output_data version]: New constructor.
1812 (Fde::add_mapping): Only add merge mapping if there is an object.
1813 (class Cie): Update declarations.
1814 (class Eh_frame): Declare add_ehframe_for_plt.
1815 * layout.cc (Layout::layout_eh_frame): Break out code into
1816 make_eh_frame_section, and call it.
1817 (Layout::make_eh_frame_section): New function.
1818 (Layout::add_eh_frame_for_plt): New function.
1819 * layout.h (class Layout): Update declarations.
1820 * merge.cc (Merge_map::add_mapping): Add assertion.
1821 * i386.cc: Include "dwarf.h".
1822 (class Output_data_plt_i386): Make first_plt_entry,
1823 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
1824 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1825 and plt_eh_frame_fde.
1826 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
1827 boundary. Call add_eh_frame_for_plt if appropriate.
1828 * x86_64.cc: Include "dwarf.h".
1829 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
1830 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
1831 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1832 and plt_eh_frame_fde.
1833 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
1834 appropriate.
1835
14788a3f
ILT
18362011-06-29 Ian Lance Taylor <iant@google.com>
1837
1838 PR gold/12629
1839 * object.cc (Sized_relobj_file::layout_section): Change shdr
1840 parameter to be const.
1841 (Sized_relobj_file::layout_eh_frame_section): New function, broken
1842 out of do_layout.
1843 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
1844 appropriate. Call layout_eh_frame_section.
1845 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
1846 sections.
1847 * object.h (class Sized_relobj_file): Update declarations.
1848
6c21fce1
ILT
18492011-06-29 Ian Lance Taylor <iant@google.com>
1850
37e41b03 1851 PR gold/12652
6c21fce1
ILT
1852 * script.cc (Token::integer_value): Accept trailing M/m/K/k
1853 modifier.
1854 (Lex::gather_token): Accept trailing M/m/K/k for integers.
1855
4d5e4e62
ILT
18562011-06-29 Ian Lance Taylor <iant@google.com>
1857
1858 PR gold/12675
1859 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
1860 SHT_X86_64_UNWIND.
1861 * layout.cc (Layout::layout_eh_frame): Likewise.
1862
886f533a
ILT
18632011-06-29 Ian Lance Taylor <iant@google.com>
1864
1865 PR gold/12695
1866 * layout.cc (Layout::symtab_section_shndx): New function.
1867 * layout.h (class Layout): Declare symtab_section_shndx.
1868 * output.cc (Output_section::write_header): Call it.
1869
f3ae1b28
ILT
18702011-06-29 Ian Lance Taylor <iant@google.com>
1871
1872 PR gold/12818
1873 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
1874 symbols which are not used in a relocation.
1875
aecf301f
ILT
18762011-06-28 Ian Lance Taylor <iant@google.com>
1877
1878 PR gold/12898
1879 * layout.cc (Layout::segment_precedes): Don't crash if a linker
1880 script create indistinguishable segments.
1881 (Layout::set_segment_offsets): Use stable_sort when sorting
1882 segments. Pass this to Compare_segments constructor.
1883 * layout.h (class Layout): Make segment_precedes non-static.
1884 (class Compare_segments): Change from struct to class. Add
1885 layout_ field. Add constructor.
1886 * script-sections.cc
1887 (Script_sections::attach_sections_using_phdrs_clause): Rename
1888 local orphan to is_orphan. Don't report failure to put empty
1889 section in segment. On attachment failure, report name of
1890 section, and attach to first PT_LOAD segment.
1891
03ef7571
ILT
18922011-06-28 Ian Lance Taylor <iant@google.com>
1893
1894 PR gold/12934
1895 * target-select.cc (Target_selector::Target_selector): Add
1896 emulation parameter. Change all callers.
1897 (select_target_by_bfd_name): Rename from select_target_by_name.
1898 Change all callers.
1899 (select_target_by_emulation): New function.
1900 (supported_emulation_names): New function.
1901 * target-select.h (class Target_selector): Add emulation_ field.
1902 Update declarations.
1903 (Target_selector::recognize_by_bfd_name): Rename from
1904 recognize_by_name. Change all callers.
1905 (Target_selector::supported_bfd_names): Rename from
1906 supported_names. Change all callers.
1907 (Target_selector::recognize_by_emulation): New function.
1908 (Target_selector::supported_emulations): New function.
1909 (Target_selector::emulation): New function.
1910 (Target_selector::do_recognize_by_bfd_name): Rename from
1911 do_recognize_by_name. Change all callers.
1912 (Target_selector::do_supported_bfd_names): Rename from
1913 do_supported_names. Change all callers.
1914 (Target_selector::do_recognize_by_emulation): New function.
1915 (Target_selector::do_supported_emulations): New function.
1916 (select_target_by_bfd_name): Change name in declaration.
1917 (select_target_by_emulation): Declare.
1918 (supported_emulation_names): Declare.
1919 * parameters.cc (parameters_force_valid_target): Try to find
1920 target based on emulation from -m option.
1921 * options.h (class General_options): Change doc string for -m.
1922 * options.cc (help): Print emulations.
1923 (General_options::parse_V): Likewise.
1924 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
1925 Add emulation parameter. Change all callers.
1926
200b2bb9
ILT
19272011-06-28 Ian Lance Taylor <iant@google.com>
1928
1929 * target.h (class Target): Add osabi_ field.
1930 (Target::osabi): New function.
1931 (Target::set_osabi): New function.
1932 (Target::Target): Initialize osabi_.
1933 (Target::do_adjust_elf_header): Make pure virtual.
1934 (Sized_target::do_adjust_elf_header): Declare.
1935 * target.cc (Sized_target::do_adjust_elf_header): New function.
1936 (class Sized_target): Instantiate all versions.
1937 * freebsd.h (class Target_freebsd): Remove.
1938 (Target_selector_freebsd::do_recognize): Call set_osabi on
1939 Target.
1940 (Target_selector_freebsd::do_recognize_by_name): Likewise.
1941 (Target_selector_freebsd::set_osabi): Remove.
1942 * i386.cc (class Target_i386): Inherit from Sized_target rather
1943 than Target_freebsd.
1944 * x86_64.cc (class Target_x86_64): Likewise.
1945
b3ce541e
ILT
19462011-06-28 Ian Lance Taylor <iant@google.com>
1947
1948 * target.h (Target::can_check_for_function_pointers): Rewrite.
1949 Make non-virtual.
1950 (Target::can_icf_inline_merge_sections): Likewise.
1951 (Target::section_may_have_icf_unsafe_poineters): Likewise.
1952 (Target::Target_info): Add can_icf_inline_merge_sections field.
1953 (Target::do_can_check_for_function_pointers): New virtual
1954 function.
1955 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
1956 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
1957 from can_check_for_function_pointers, move in file.
1958 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
1959 section_may_have_icf_unsafe_poineters, move in file.
1960 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
1961 * i386.cc (Target_i386::do_can_check_for_function_pointers):
1962 Rename from can_check_for_function_pointers, move in file.
1963 (Target_i386::can_icf_inline_merge_sections): Remove.
1964 (Target_i386::i386_info): Initialize
1965 can_icf_inline_merge_sections.
1966 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
1967 Initialize can_icf_inline_merge_sections.
1968 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
1969 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
1970 Rename from can_check_for_function_pointers, move in file.
1971 (Target_x86_64::can_icf_inline_merge_sections): Remove.
1972 (Target_x86_64::x86_64_info): Initialize
1973 can_icf_inline_merge_sections.
1974 * testsuite/testfile.cc (Target_test::test_target_info):
1975 Likewise.
1976 * icf.cc (get_section_contents): Correct formatting.
1977
6d1c4efb
ILT
19782011-06-27 Ian Lance Taylor <iant@google.com>
1979
1980 * symtab.cc (Symbol::versioned_name): New function.
1981 (Symbol_table::add_to_final_symtab): Use versioned_name when
1982 appropriate.
1983 (Symbol_table::sized_write_symbol): Likewise.
1984 * symtab.h (class Symbol): Declare versioned_name.
1985 * stringpool.h (class Stringpool_template): Add variant of add
1986 which takes a std::basic_string.
1987 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
1988 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
1989 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
1990 (ver_test_12.o): New target.
1991 * testsuite/Makefile.in: Rebuild.
1992
57eb9b50
DK
19932011-06-27 Doug Kwan <dougkwan@google.com>
1994
1995 * arm.cc (Arm_relocate_functions::thm_jump8,
1996 Arm_relocate_functions::thm_jump11): Use a wider signed
1997 type to compute offset.
1998 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
1999 arm_thm_jump8.
2000 * testsuite/Makefile.in: Regenerate.
2001 * testsuite/arm_branch_in_range.sh: Check test results of
2002 arm_thm_jump11 and arm_thm_jump8.
2003 * testsuite/arm_thm_jump11.s: New test source file.
2004 * testsuite/arm_thm_jump11.t: New linker script.
2005 * testsuite/arm_thm_jump8.s: New test source file.
2006 * testsuite/arm_thm_jump8.t: New linker script.
2007
487b39df
ILT
20082011-06-24 Ian Lance Taylor <iant@google.com>
2009
2010 * layout.cc: Include "object.h".
2011 (ctors_sections_in_init_array): New static variable.
2012 (Layout::is_ctors_in_init_array): New function.
2013 (Layout::layout): Add entry to ctors_sections_in_init_array if
2014 appropriate.
2015 * layout.h (class Layout): Declare is_ctors_in_init_array.
2016 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
2017 is_ctors_reverse_view is set.
2018 (Sized_relobj_file::write_sections): Add layout parameter. Change
2019 all callers. Set is_ctors_reverse_view field of View_size.
2020 (Sized_relobj_file::reverse_words): New function.
2021 * object.h (Sized_relobj_file::View_size): Add
2022 is_ctors_reverse_view field.
2023 (class Sized_relobj_file): Update declarations.
2024 * testsuite/initpri3.c: New test.
2025 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
2026 initpri3b.
2027 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
2028 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
2029 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
2030 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
2031 * testsuite/Makefile.in: Rebuild.
2032
472076e4
CC
20332011-06-24 Cary Coutant <ccoutant@google.com>
2034
2035 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
2036 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
2037 (debug_msg_cdebug.err): New targets.
2038 * testsuite/Makefile.in: Regenerate.
2039 * testsuite/debug_msg.sh: Check output of link with compressed debug.
2040 Fix checks for link with shared library.
2041
a60af0db
DK
20422011-06-24 Doug Kwan <dougkwan@google.com>
2043
2044 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
2045 skip empty text sections.
2046 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
2047
5393d741
ILT
20482011-06-22 Ian Lance Taylor <iant@google.com>
2049
2050 PR gold/12910
2051 * options.h (class General_options): Add --ctors-in-init-array.
2052 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
2053 friends as SHT_PROGBITS for merging sections.
2054 (Layout::layout): Remove special handling of .init_array and
2055 friends. Don't sort if doing relocatable link. Sort for .ctors
2056 and .dtors if ctors_in_init_array.
2057 (Layout::make_output_section): Force correct section types for
2058 .init_array and friends. Don't sort if doing relocatable link,
2059 Don't sort .ctors and .dtors if ctors_in_init_array.
2060 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
2061 (Layout::output_section_name): Add relobj parameter. Change all
2062 callers. Handle .ctors. and .dtors. in code rather than table.
2063 Handle .ctors and .dtors if ctors_in_init_array.
2064 (Layout::match_file_name): New function, moved from output.cc.
2065 * layout.h (class Layout): Update declarations.
2066 * output.cc: Include "layout.h".
2067 (Input_section_sort_entry::get_priority): New function.
2068 (Input_section_sort_entry::match_file_name): Just call
2069 Layout::match_file_name.
2070 (Output_section::Input_section_sort_init_fini_compare::operator()):
2071 Handle .ctors and .dtors. Sort by explicit priority rather than
2072 by name.
2073 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
2074 * testsuite/initpri2.c: New test.
2075 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
2076 (check_PROGRAMS): Add initpri2.
2077 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
2078 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
2079 * configure, testsuite/Makefile.in: Rebuild.
2080
e1f74f98
ILT
20812011-06-19 Ian Lance Taylor <iant@google.com>
2082
2083 PR gold/12880
2084 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
2085 .interp section to a PT_INTERP segment even if we have seen a
2086 --dynamic-linker option. Don't do it if we have seen a PHDRS
2087 clause in a linker script.
2088 (Layout::finalize): Don't create a .interp section if we've
2089 already create a PT_INTERP segment.
2090 (Layout::create_interp): Always call choose_output_section (revert
2091 patch of 2011-06-17). Don't create PT_INTERP segment.
2092 * script-sections.cc
2093 (Script_sections::create_note_and_tls_segments): Add a .interp
2094 section to a PT_INTERP segment even if we have seen a
2095 --dynamic-linker option.
2096
766f91bb
ILT
20972011-06-18 Ian Lance Taylor <iant@google.com>
2098
2099 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
2100 merely because a non-PT_LOAD segment has a dynamic reloc.
2101
0d212c3a
ILT
21022011-06-18 Ian Lance Taylor <iant@google.com>
2103
2104 * layout.cc (Layout::finish_dynamic_section): Don't create
2105 DT_FLAGS entry if not needed.
2106
911a5072
ILT
21072011-06-18 Ian Lance Taylor <iant@google.com>
2108
2109 PR gold/12745
2110 * layout.cc (Layout::layout_eh_frame): Correct handling of
2111 writable .eh_frame section.
2112
534b4e5f
ILT
21132011-06-17 Ian Lance Taylor <iant@google.com>
2114
2115 PR gold/12893
2116 * resolve.cc (Symbol_table::resolve): Don't give an error if a
2117 symbol is redefined with the exact same object and value.
2118
10b4f102
ILT
21192011-06-17 Ian Lance Taylor <iant@google.com>
2120
2121 PR gold/12880
2122 * layout.h (class Layout): Add interp_segment_ field.
2123 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
2124 (Layout::attach_allocated_section_to_segment): If making shared
2125 library, put .interp section in PT_INTERP segment.
2126 (Layout::finalize): Also call create_interp if -dynamic-linker
2127 option was used.
2128 (Layout::create_interp): Assert that there is no PT_INTERP
2129 segment. If not using a SECTIONS clause, use make_output_section.
2130 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
2131 * script-sections.cc
2132 (Script_sections::create_note_and_tls_segments): If making shared
2133 library, put .interp section in PT_INTERP segment.
2134
a29b0dad
ILT
21352011-06-17 Ian Lance Taylor <iant@google.com>
2136
e588ea8d
ILT
2137 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
2138 when making a shared library.
2139
21402011-06-17 Ian Lance Taylor <iant@google.com>
2141
2142 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
2143 parameter. Change all callers. Don't issue warning about PC32
2144 against locally defined symbol.
a29b0dad 2145
9d3b0698
ILT
21462011-06-16 Ian Lance Taylor <iant@google.com>
2147
2148 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
2149 occurs in same object.
2150
85b0f90c
AM
21512011-06-14 Alan Modra <amodra@gmail.com>
2152
2153 * po/POTFILES.in: Regenerate.
2154
a94907d9
ILT
21552011-06-09 Ian Lance Taylor <iant@google.com>
2156
2157 * script-sections.cc
2158 (Orphan_output_section::set_section_addresses): For a relocatable
2159 link set address to 0.
2160
4fb3a1c3
CC
21612011-06-09 Cary Coutant <ccoutant@google.com>
2162
2163 PR gold/12804
2164 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
2165 used with --compress-debug-sections.
2166 * gold/object.cc (Sized_relobj_file::do_layout): Report
2167 uncompressed size of compressed input sections.
2168
61220854
CC
21692011-06-08 Cary Coutant <ccoutant@google.com>
2170
2171 PR gold/12804
2172 * testsuite/two_file_test_2_v1.cc: Change initialization of
2173 v2 to keep it in .data.
2174
e6455dfb
CC
21752011-06-07 Cary Coutant <ccoutant@google.com>
2176
2177 * common.cc (Symbol_table::do_allocate_commons_list): Call
2178 gold_fallback.
2179 * errors.cc (Errors::fatal): Adjust call to gold_exit.
2180 (Errors::fallback): New function.
2181 (gold_fallback): New function.
2182 * errors.h (Errors::fallback): New function.
2183 * gold.cc (gold_exit): Change status parameter to enum; adjust
2184 all callers.
2185 (queue_initial_tasks): Call gold_fallback.
2186 * gold.h: Include cstdlib.
2187 (Exit_status): New enum type.
2188 (gold_exit): Change status parameter to enum.
2189 (gold_fallback): New function.
2190 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
2191 (Layout::create_symtab_sections): Likewise.
2192 (Layout::create_shdrs): Likewise.
2193 * main.cc (main): Adjust call to gold_exit.
2194 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
2195 (Output_data_got::add_got_entry_pair): Likewise.
2196 (Output_section::add_input_section): Likewise.
2197 (Output_section::add_output_section_data): Likewise.
2198 (Output_segment::set_section_list_addresses): Likewise.
2199 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
2200
fb0e076f
CC
22012011-06-07 Cary Coutant <ccoutant@google.com>
2202
2203 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
2204 for incremental links.
2205 * output.cc (Output_segment::set_section_list_addresses): Remove
2206 FIXME and test for TLS or BSS.
2207
a5ee4d5d
CC
22082011-06-07 Cary Coutant <ccoutant@google.com>
2209
2210 * testsuite/Makefile.am: Add incremental_copy_test,
2211 incremental_common_test_1.
2212 * testsuite/Makefile.in: Regenerate.
2213 * testsuite/common_test_1_v1.c: New source file.
2214 * testsuite/common_test_1_v2.c: New source file.
2215 * testsuite/copy_test_v1.cc: New source file.
2216
5146f448
CC
22172011-06-07 Cary Coutant <ccoutant@google.com>
2218
2219 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
2220 update, allocate common from bss section's free list.
2221 * incremental-dump.cc (dump_incremental_inputs): Print flag for
2222 linker-defined symbols.
2223 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
2224 Skip GOT and PLT entries that are no longer referenced.
2225 (Output_section_incremental_inputs::write_info_blocks): Mark
2226 linker-defined symbols.
2227 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
2228 * output.cc (Output_section::allocate): New function.
2229 * output.h (Output_section::allocate): New function.
2230 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
2231 linker-defined symbols.
2232 (Symbol::override_base_with_special): Copy is_predefined_ flag.
2233 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
2234 (Symbol::init_base_output_data): Likewise.
2235 (Symbol::init_base_output_segment): Likewise.
2236 (Symbol::init_base_constant): Likewise.
2237 (Sized_symbol::init_output_data): Likewise.
2238 (Sized_symbol::init_output_segment): Likewise.
2239 (Sized_symbol::init_constant): Likewise.
2240 (Symbol_table::do_define_in_output_data): Likewise.
2241 (Symbol_table::do_define_in_output_segment): Likewise.
2242 (Symbol_table::do_define_as_constant): Likewise.
2243 * symtab.h (Symbol::is_predefined): New function.
2244 (Symbol::init_base_output_data): Add is_predefined parameter.
2245 (Symbol::init_base_output_segment): Likewise.
2246 (Symbol::init_base_constant): Likewise.
2247 (Symbol::is_predefined_): New data member.
2248 (Sized_symbol::init_output_data): Add is_predefined parameter.
2249 (Sized_symbol::init_output_segment): Likewise.
2250 (Sized_symbol::init_constant): Likewise.
2251 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
2252
26d3c67d
CC
22532011-06-07 Cary Coutant <ccoutant@google.com>
2254
2255 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
2256 instead of emit_copy_reloc.
2257 (Copy_relocs::emit_copy_reloc): Refactor.
2258 (Copy_relocs::make_copy_reloc): New function.
2259 (Copy_relocs::add_copy_reloc): Remove.
2260 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
2261 section.
2262 (Copy_relocs::make_copy_reloc): New function.
2263 (Copy_relocs::add_copy_reloc): Remove.
2264 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
2265 unchanged input files.
2266 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
2267 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
2268 Reserve BSS space for COPY relocations.
2269 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2270 (Output_section_incremental_inputs::write_info_blocks): Record
2271 whether a symbol is copied from a shared object.
2272 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
2273 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
2274 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
2275 (Incremental_input_entry_reader::get_output_symbol_index): Add
2276 is_copy parameter.
2277 (Incremental_binary::emit_copy_relocs): New function.
2278 (Incremental_binary::do_emit_copy_relocs): New function.
2279 (Sized_incremental_binary::Sized_incremental_binary): Initialize
2280 new data member.
2281 (Sized_incremental_binary::add_copy_reloc): New function.
2282 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2283 (Sized_incremental_binary::Copy_reloc): New struct.
2284 (Sized_incremental_binary::Copy_relocs): New typedef.
2285 (Sized_incremental_binary::copy_relocs_): New data member.
2286 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
2287 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
2288 * target.h (Sized_target::emit_copy_reloc): New function.
2289 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
2290
7cdb37d9
CC
22912011-06-02 Cary Coutant <ccoutant@google.com>
2292
2293 PR gold/12163
2294 * gold/archive.cc (Archive::Archive): Initialize new data member.
2295 (Archive::include_all_members): Return if archive has already been
2296 included.
2297 * gold/archive.h (Archive::include_all_members_): New data member.
2298
cc643b88
NC
22992011-06-02 Nick Clifton <nickc@redhat.com>
2300
2301 * dynobj.h: Fix spelling mistake in comment.
2302 * output.cc: Likewise.
2303
f62a3ca7 23042011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 2305 Asier Llano
f62a3ca7
DK
2306
2307 PR gold/12826
cc643b88 2308 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
2309 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
2310 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
2311 redundant arm_exidx_test.so.
2312 * testsuite/Makefile.in: Regenerate.
2313 (check_SCRIPTS): Add pr12826.sh
2314 (check_DATA): Add pr12826.stdout
2315 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
2316 * testsuite/pr12826.sh: New file.
2317 * testsuite/pr12826_1.s: Ditto.
2318 * testsuite/pr12826_1.s: Ditto.
2319
8dbe1edc
ILT
23202011-05-30 Ian Lance Taylor <iant@google.com>
2321
2322 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
2323 sections.
2324
c49875be
ILT
23252011-05-29 Ian Lance Taylor <iant@google.com>
2326
2327 PR gold/12804
2328 * testsuite/Makefile.am: Use different file name for two_file_test
2329 temporary file for each incremental test.
2330 * testsuite/Makefile.in: Rebuild.
2331
69d53f7a
ILT
23322011-05-29 Ian Lance Taylor <iant@google.com>
2333
2334 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
2335 binary input file is empty.
2336
41d0ab5f
ILT
23372011-05-27 Ian Lance Taylor <iant@google.com>
2338
2339 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
2340 (ver_test_9.so): Likewise.
2341 * testsuite/Makefile.in: Rebuild.
2342
89d8a36b
CC
23432011-05-26 Cary Coutant <ccoutant@google.com>
2344
2345 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
2346 * incremental.cc (Incremental_inputs::report_input_section): Fix
2347 comment, indentation.
2348 (Incremental_inputs::report_comdat_group): New function.
2349 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2350 of data for incremental input file entry.
2351 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
2352 group count, COMDAT group signatures.
2353 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
2354 an unchanged input file.
2355 * incremental.h (Incremental_object_entry::Incremental_object_entry):
2356 Initialize new data member.
2357 (Incremental_object_entry::add_comdat_group): New function.
2358 (Incremental_object_entry::get_comdat_group_count): New function.
2359 (Incremental_object_entry::get_comdat_signature_key): New function.
2360 (Incremental_object_entry::groups_): New data member.
2361 (Incremental_inputs::report_comdat_group): New function.
2362 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
2363 data for incremental input file entry.
2364 (Incremental_input_entry_reader::get_comdat_group_count): New function.
2365 (Incremental_input_entry_reader::get_input_section): Adjust size of
2366 data for incremental input file entry.
2367 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
2368 (Incremental_input_entry_reader::get_comdat_group_signature): New
2369 function.
2370 * object.cc (Sized_relobj::include_section_group): Report kept
2371 COMDAT groups for incremental links.
2372
1706a06f
ILT
23732011-05-24 David Meyer <pdox@google.com>
2374
2375 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
2376 with name parameter. Add found_name parameter.
2377 * fileread.cc (Input_file::find_file): Adjust code accordingly.
2378 * dirsearch.h (class Dirsearch): Update declaration.
2379
a10ae760
ILT
23802011-05-24 Ian Lance Taylor <iant@google.com>
2381
2382 * archive.cc (Library_base::should_include_member): Pull in object
2383 from archive if it defines the entry symbol.
2384 * parameters.cc (Parameters::entry): New function.
2385 * parameters.h (class Parameters): Declare entry.
2386 * output.h (class Output_file_header): Remove entry_ field.
2387 * output.cc (Output_file_header::Output_file_header): Remove entry
2388 parameter. Change all callers.
2389 (Output_file_header::entry): Use parameters->entry.
2390 * gold.cc (queue_middle_tasks): Likewise.
2391 * plugin.cc (Plugin_hook::run): Likewise.
2392
aa92d6ed
CC
23932011-05-24 Cary Coutant <ccoutant@google.com>
2394
2395 * gold.cc (queue_initial_tasks): Pass incremental base filename
2396 to Output_file::open_base_file; don't print error message.
2397 * incremental-dump.cc (main): Adjust call to
2398 Output_file::open_for_modification.
2399 * incremental-dump.cc (main): Likewise.
2400 * incremental.cc (Incremental_inputs::report_command_line):
2401 Ignore --incremental-base option when comparing command lines.
2402 Ignore parameter when given as separate argument.
2403 * options.h (class General_options): Add --incremental-base.
2404 * output.cc (Output_file::Output_file):
2405 (Output_file::open_base_file): Add base_name and writable parameters;
2406 read base file into new file; print error message here.
2407 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2408 callers.
2409 * output.h (Output_file::open_for_modification): Rename to...
2410 (Output_file::open_base_file): ...this; add base_name and
2411 writable parameters; adjust all callers.
2412 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2413 callers.
2414 * testsuite/Makefile.am (incremental_test_4): Test
2415 --incremental-base.
2416 * testsuite/Makefile.in: Regenerate.
2417
2eedd706
CC
24182011-05-24 Cary Coutant <ccoutant@google.com>
2419
2420 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
2421 incremental_test_4.
2422 * testsuite/Makefile.in: Regenerate.
2423 * testsuite/two_file_test_1_v1.cc: New test source file.
2424 * testsuite/two_file_test_1b_v1.cc: New test source file.
2425 * testsuite/two_file_test_2_v1.cc: New test source file.
2426
0f1c85a6
CC
24272011-05-24 Cary Coutant <ccoutant@google.com>
2428
2429 * dynobj.h (Dynobj::do_dynobj): New function.
2430 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
2431 flag and soname for shared objects.
2432 * incremental.cc (Incremental_inputs::report_object): Make
2433 either Incremental_object_entry or Incremental_dynobj_entry; add
2434 soname to string table.
2435 (Incremental_inputs::report_input_section): Add assertion.
2436 (Output_section_incremental_inputs::set_final_data_size): Adjust
2437 type of input file entry for shared libraries; adjust size of
2438 shared library info entry.
2439 (Output_section_incremental_inputs::write_input_files): Write
2440 as_needed flag for shared libraries.
2441 (Output_section_incremental_inputs::write_info_blocks): Adjust type
2442 of input file entry for shared libraries; write soname.
2443 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
2444 soname from incremental info.
2445 * incremental.h (enum Incremental_input_flags): Add
2446 INCREMENTAL_INPUT_AS_NEEDED.
2447 (Incremental_input_entry::Incremental_input_entry): Initialize new
2448 data member.
2449 (Incremental_input_entry::set_as_needed): New function.
2450 (Incremental_input_entry::as_needed): New function.
2451 (Incremental_input_entry::do_dynobj_entry): New function.
2452 (Incremental_input_entry::as_needed_): New data member.
2453 (Incremental_object_entry::Incremental_object_entry): Don't check
2454 for shared library.
2455 (Incremental_object_entry::do_type): Likewise.
2456 (class Incremental_dynobj_entry): New class.
2457 (Incremental_input_entry_reader::as_needed): New function.
2458 (Incremental_input_entry_reader::get_soname): New function.
2459 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
2460 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
2461 size of shared library info entry.
58797674 2462 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
2463 incremental link when adding DT_NEEDED entries.
2464 * object.h (Object::Object): Initialize new data member.
2465 (Object::dynobj): New function.
2466 (Object::set_as_needed): New function.
2467 (Object::as_needed): New function.
2468 (Object::do_dynobj): New function.
2469 (Object::as_needed_): New data member.
2470
6fa2a40b
CC
24712011-05-24 Cary Coutant <ccoutant@google.com>
2472
2473 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
2474 info; adjust display of GOT entries.
2475 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2476 vector of input objects; remove file_status_.
2477 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
2478 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
2479 got_plt reader; call target hooks to reserve GOT entries.
2480 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2481 of input file info header and GOT info entry.
2482 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
2483 relocation info.
2484 (Got_plt_view_info::got_descriptor): Remove.
2485 (Got_plt_view_info::sym_index): New data member.
2486 (Got_plt_view_info::input_index): New data member.
2487 (Local_got_offset_visitor::visit): Write input file index.
2488 (Global_got_offset_visitor::visit): Write 0 for input file index.
2489 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
2490 with sym_index and input_index.
2491 (Output_section_incremental_inputs::write_got_plt): Adjust size of
2492 incremental info GOT entry; replace got_descriptor with input_index.
2493 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
2494 map from input file index to object.
2495 (Sized_relobj_incr::do_layout): Replace direct data member reference
2496 with accessor function.
2497 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
2498 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
2499 Adjust size of input file info header.
2500 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
2501 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
2502 (Incremental_input_entry_reader::get_input_section): Adjust size of
2503 input file info header.
2504 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
2505 of incremental info GOT entry.
2506 (Incremental_got_plt_reader::get_got_desc): Remove.
2507 (Incremental_got_plt_reader::get_got_symndx): New function.
2508 (Incremental_got_plt_reader::get_got_input_index): New function.
2509 (Sized_incremental_binary::Sized_incremental_binary): Remove
2510 file_status_; add input_objects_.
2511 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
2512 (Sized_incremental_binary::set_file_is_unchanged): Remove.
2513 (Sized_incremental_binary::file_is_unchanged): Remove.
2514 (Sized_incremental_binary::set_input_object): New function.
2515 (Sized_incremental_binary::input_object): New function.
2516 (Sized_incremental_binary::file_status_): Remove.
2517 (Sized_incremental_binary::input_objects_): New data member.
2518 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
2519 references.
2520 (Sized_relobj_incr::invalid_address): Move to base class.
2521 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
2522 class.
2523 (Sized_relobj_incr::do_output_section_offset): Likewise.
2524 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
2525 (Sized_relobj_incr::section_offsets_): Likewise.
2526 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
2527 function.
2528 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
2529 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
2530 with accessor function.
2531 (Sized_relobj_file::do_layout): Likewise.
2532 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
2533 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
2534 (Sized_relobj_file::compute_final_local_value): Replace refs to
2535 section_offsets_ with accessor function.
2536 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
2537 * object.h (Relobj::Relobj): Initialize new data members.
2538 (Relobj::add_dyn_reloc): New function.
2539 (Relobj::first_dyn_reloc): New function.
2540 (Relobj::dyn_reloc_count): New function.
2541 (Relobj::first_dyn_reloc_): New data member.
2542 (Relobj::dyn_reloc_count_): New data member.
2543 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
2544 references.
2545 (Sized_relobj::Address): New typedef.
2546 (Sized_relobj::invalid_address): Move here from child class.
2547 (Sized_relobj::Sized_relobj): Initialize new data members.
2548 (Sized_relobj::sized_relobj): New function.
2549 (Sized_relobj::is_output_section_offset_invalid): Move here from
2550 child class.
2551 (Sized_relobj::get_output_section_offset): Likewise.
2552 (Sized_relobj::local_has_got_offset): Likewise.
2553 (Sized_relobj::local_got_offset): Likewise.
2554 (Sized_relobj::set_local_got_offset): Likewise.
2555 (Sized_relobj::do_for_all_local_got_entries): Likewise.
2556 (Sized_relobj::clear_got_offsets): New function.
2557 (Sized_relobj::section_offsets): Move here from child class.
2558 (Sized_relobj::do_output_section_offset): Likewise.
2559 (Sized_relobj::do_set_section_offset): Likewise.
2560 (Sized_relobj::Local_got_offsets): Likewise.
2561 (Sized_relobj::local_got_offsets_): Likewise.
2562 (Sized_relobj::section_offsets_): Likewise.
2563 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
2564 references.
2565 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
2566 class.
2567 (Sized_relobj_file::sized_relobj): New function
2568 (Sized_relobj_file::local_has_got_offset): Move to base class.
2569 (Sized_relobj_file::local_got_offset): Likewise.
2570 (Sized_relobj_file::set_local_got_offset): Likewise.
2571 (Sized_relobj_file::get_output_section_offset): Likewise.
2572 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
2573 (Sized_relobj_file::do_output_section_offset): Likewise.
2574 (Sized_relobj_file::do_set_section_offset): Likewise.
2575 (Sized_relobj_file::Local_got_offsets): Likewise.
2576 (Sized_relobj_file::local_got_offsets_): Likewise.
2577 (Sized_relobj_file::section_offsets_): Likewise.
2578 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
2579 (all constructors).
2580 (set_needs_dynsym_index): Convert relobj to derived class pointer.
2581 (Output_reloc::get_symbol_index): Likewise.
2582 (Output_reloc::local_section_offset): Likewise.
2583 (Output_reloc::get_address): Likewise.
2584 (Output_reloc::symbol_value): Likewise.
2585 (Output_data_got::reserve_slot): Move to class definition.
2586 (Output_data_got::reserve_local): New function.
2587 (Output_data_got::reserve_slot_for_global): Remove.
2588 (Output_data_got::reserve_global): New function.
2589 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
2590 (all constructors, two instantiations).
2591 (Output_reloc::get_relobj): New function (two instantiations).
2592 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
2593 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
2594 (Output_data_reloc::add_global): Adjust type of relobj.
2595 (Output_data_reloc::add_global_relative): Likewise.
2596 (Output_data_reloc::add_symbolless_global_addend): Likewise.
2597 (Output_data_reloc::add_local): Likewise.
2598 (Output_data_reloc::add_local_relative): Likewise.
2599 (Output_data_reloc::add_symbolless_local_addend): Likewise.
2600 (Output_data_reloc::add_local_section): Likewise.
2601 (Output_data_reloc::add_output_section): Likewise.
2602 (Output_data_reloc::add_absolute): Likewise.
2603 (Output_data_reloc::add_target_specific): Likewise.
2604 (Output_data_got::reserve_slot): Move definition here.
2605 (Output_data_got::reserve_local): New function.
2606 (Output_data_got::reserve_global): New function.
2607 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
2608 section_offsets_ with accessor function.
2609 (Sized_relobj_file::write_sections): Likewise.
2610 (Sized_relobj_file::do_relocate_sections): Likewise.
2611 * target.h (Sized_target::reserve_local_got_entry): New function.
2612 (Sized_target::reserve_global_got_entry): New function.
2613 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
2614 (Target_x86_64::reserve_global_got_entry): New function.
2615 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
2616
4829d394
CC
26172011-05-23 Cary Coutant <ccoutant@google.com>
2618
2619 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
2620 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
2621 bit when checking got_type.
2622 * incremental.cc (Sized_incremental_binary::setup_readers):
2623 Store symbol table and string table locations; initialize bit vector
2624 of file status flags.
2625 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
2626 unchanged files.
2627 (Sized_incremental_binary::do_process_got_plt): New function.
2628 (Sized_incremental_binary::get_symtab_view): Use stored locations.
2629 (Output_section_incremental_inputs::set_final_data_size): Record
2630 file index for each input file.
2631 (Output_section_incremental_inputs::write_got_plt): Store file index
2632 instead of input entry offset for each GOT entry.
2633 * incremental.h
2634 (Incremental_input_entry::Incremental_input_entry): Initialize new
2635 data member.
2636 (Incremental_input_entry::set_offset): Store file index.
2637 (Incremental_input_entry::get_file_index): New function.
2638 (Incremental_input_entry::file_index_): New data member.
2639 (Incremental_binary::process_got_plt): New function.
2640 (Incremental_binary::do_process_got_plt): New function.
2641 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2642 data members.
2643 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
2644 (Sized_incremental_binary::set_file_is_unchanged): New function.
2645 (Sized_incremental_binary::file_is_unchanged): New function.
2646 (Sized_incremental_binary::do_process_got_plt): New function.
2647 (Sized_incremental_binary::file_status_): New data member.
2648 (Sized_incremental_binary::main_symtab_loc_): New data member.
2649 (Sized_incremental_binary::main_strtab_loc_): New data member.
2650 * output.cc (Output_data_got::Got_entry::write): Add case
2651 RESERVED_CODE.
2652 (Output_data_got::add_global): Call add_got_entry.
2653 (Output_data_got::add_global_plt): Likewise.
2654 (Output_data_got::add_global_with_rel): Likewise.
2655 (Output_data_got::add_global_with_rela): Likewise.
2656 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
2657 (Output_data_got::add_global_pair_with_rela): Likewise.
2658 (Output_data_got::add_local): Call add_got_entry.
2659 (Output_data_got::add_local_plt): Likewise.
2660 (Output_data_got::add_local_with_rel): Likewise.
2661 (Output_data_got::add_local_with_rela): Likewise.
2662 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
2663 (Output_data_got::add_local_pair_with_rela): Likewise.
2664 (Output_data_got::reserve_slot): New function.
2665 (Output_data_got::reserve_slot_for_global): New function.
2666 (Output_data_got::add_got_entry): New function.
2667 (Output_data_got::add_got_entry_pair): New function.
2668 (Output_section::add_output_section_data): Edit FIXME.
2669 * output.h
2670 (Output_section_data_build::Output_section_data_build): New
2671 constructor with size parameter.
2672 (Output_data_space::Output_data_space): Likewise.
2673 (Output_data_got::Output_data_got): Initialize new data member; new
2674 constructor with size parameter.
2675 (Output_data_got::add_constant): Call add_got_entry.
2676 (Output_data_got::reserve_slot): New function.
2677 (Output_data_got::reserve_slot_for_global): New function.
2678 (class Output_data_got::Got_entry): Add RESERVED_CODE.
2679 (Output_data_got::add_got_entry): New function.
2680 (Output_data_got::add_got_entry_pair): New function.
2681 (Output_data_got::free_list_): New data member.
2682 * target.h (Sized_target::init_got_plt_for_update): New function.
2683 (Sized_target::register_global_plt_entry): New function.
2684 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
2685 Initialize new data member; call init; add constructor with PLT count.
2686 (Output_data_plt_x86_64::init): New function.
2687 (Output_data_plt_x86_64::add_relocation): New function.
2688 (Output_data_plt_x86_64::reserve_slot): New function.
2689 (Output_data_plt_x86_64::free_list_): New data member.
2690 (Target_x86_64::init_got_plt_for_update): New function.
2691 (Target_x86_64::register_global_plt_entry): New function.
2692 (Output_data_plt_x86_64::add_entry): Allocate from free list for
2693 incremental updates.
2694 (Output_data_plt_x86_64::add_relocation): New function.
2695 * testsuite/object_unittest.cc (Object_test): Set default options.
2696
ec69d6da
ILT
26972011-05-16 Ian Lance Taylor <iant@google.com>
2698
2699 * options.h (class General_options): Make -i a synonym for -r.
2700
732e31de
ILT
27012011-05-16 Ian Lance Taylor <iant@google.com>
2702
2703 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
2704
403676b5
CC
27052011-05-10 Cary Coutant <ccoutant@google.com>
2706
2707 * object.cc (Sized_relobj::do_count_local_symbols): Check for
2708 strip_all (-s).
2709
5b7b7d6e
ILT
27102011-05-06 Ian Lance Taylor <iant@google.com>
2711
2712 * layout.cc (Layout::layout): If the output section flags change,
2713 update the ordering.
2714
f0f9babf
CC
27152011-04-25 Cary Coutant <ccoutant@google.com>
2716
2717 * incremental-dump.cc (dump_incremental_inputs): Print local
2718 symbol info for each input file.
2719 * incremental.cc
2720 (Output_section_incremental_inputs::set_final_data_size): Add local
2721 symbol info to input file entries in incremental info.
2722 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2723 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
2724 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
2725 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
2726 implementation.
2727 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
2728 (Sized_incr_relobj::do_relocate): Write the local symbols.
2729 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
2730 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
2731 Adjust size of input file header.
2732 (Incremental_inputs_reader::get_local_symbol_offset): New function.
2733 (Incremental_inputs_reader::get_local_symbol_count): New function.
2734 (Incremental_inputs_reader::get_input_section): Adjust size of input
2735 file header.
2736 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
2737 (Sized_incr_relobj::This): New typedef.
2738 (Sized_incr_relobj::sym_size): New const data member.
2739 (Sized_incr_relobj::Local_symbol): New struct.
2740 (Sized_incr_relobj::do_output_local_symbol_count): New function.
2741 (Sized_incr_relobj::do_local_symbol_offset): New function.
2742 (Sized_incr_relobj::local_symbol_count_): New data member.
2743 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
2744 (Sized_incr_relobj::local_symbol_index_): New data member.
2745 (Sized_incr_relobj::local_symbol_offset_): New data member.
2746 (Sized_incr_relobj::local_dynsym_offset_): New data member.
2747 (Sized_incr_relobj::local_symbols_): New data member.
2748 * object.h (Relobj::output_local_symbol_count): New function.
2749 (Relobj::local_symbol_offset): New function.
2750 (Relobj::do_output_local_symbol_count): New function.
2751 (Relobj::do_local_symbol_offset): New function.
2752 (Sized_relobj::do_output_local_symbol_count): New function.
2753 (Sized_relobj::do_local_symbol_offset): New function.
2754
d0a9ace3
ILT
27552011-04-22 Vladimir Simonov <sv@sw.ru>
2756
2757 * descriptors.cc (set_close_on_exec): New function.
2758 (Descriptors::open): Use set_close_on_exec.
2759 * output.cc (S_ISLNK): Define if not defined.
2760
94a3fc8b
CC
27612011-04-22 Cary Coutant <ccoutant@google.com>
2762
2763 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2764 global symbol map.
2765 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2766 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
2767 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
2768 relocations.
2769 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
2770 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
2771 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
2772 * incremental.h
2773 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
2774 function.
2775 (Incremental_binary::apply_incremental_relocs): New function.
2776 (Incremental_binary::do_apply_incremental_relocs): New function.
2777 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2778 data member.
2779 (Sized_incremental_binary::add_global_symbol): New function.
2780 (Sized_incremental_binary::global_symbol): New function.
2781 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2782 (Sized_incremental_binary::symbol_map_): New data member.
2783 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
2784 * target.h (Sized_target::apply_relocation): New function.
2785 * target-reloc.h (apply_relocation): New function.
2786 * x86_64.cc (Target_x86_64::apply_relocation): New function.
2787
c87e4302
DK
27882011-04-22 Doug Kwan <dougkwan@google.com>
2789
2790 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
2791 flag of a SHT_ARM_EXIDX section.
2e702c99 2792 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
2793 * testsuite/Makefile.in: Regenerate.
2794 * testsuite/arm_exidx_test.s: New file.
2795 * testsuite/arm_exidx_test.sh: Same.
2796
e7782cf6
CC
27972011-04-20 Cary Coutant <ccoutant@google.com>
2798
2799 PR gold/12689
2800 * archive.h (Incremental_archive_entry::Archive_member):
2801 Initialize arg_serial_ (second constructor).
2802
308ecdc7
ILT
28032011-04-17 Ian Lance Taylor <iant@google.com>
2804
2805 * object.cc (Relocate_info::location): Simplify location string.
2806 * errors.cc (Errors::error_at_location): Don't print program
2807 name.
2808 (Errors::warning_at_location): Likewise.
2809 (Errors::undefined_symbol): Likewise.
2810 * testsuite/debug_msg.sh: Update accordingly.
2811
bec5b579
CC
28122011-04-14 Cary Coutant <ccoutant@google.com>
2813
2814 * gold/layout.cc (Layout::symtab_section_offset): New function.
2815 * gold/layout.h (Layout::symtab_section_offset): New function.
2816 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
2817
88597d34
ILT
28182011-04-12 Ian Lance Taylor <iant@google.com>
2819
2820 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
2821 with MREMAP_MAYMOVE.
2822 * output.h (class Output_file): Add map_is_allocated_ field.
2823 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
2824 not available, provide stubs. If mremap is not available, #define
2825 it to gold_mremap.
2826 (MREMAP_MAYMOVE): Define if not defined.
2827 (Output_file::Output_file): Initialize map_is_allocated_.
2828 (Output_file::resize): Check map_is_allocated_.
2829 (Output_file::map_anonymous): If mmap fails, use malloc.
2830 (Output_file::unmap): Don't do anything for an anonymous map.
2831 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
2832 is not available, provide stubs.
2833 (File_read::View::~View): Use free rather than delete[].
2834 (File_read::make_view): Use malloc rather than new[]. If mmap
2835 fails, use malloc.
2836 (File_read::find_or_make_view): Use malloc rather than new[].
2837 * gold.h: Remove HAVE_REMAP code.
2838 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
2839 exists. Rename mremap to gold_mremap. If mmap is not available
2840 don't do anything.
2841 * configure, config.in: Rebuild.
2842
11e361bc
ILT
28432011-04-11 Ian Lance Taylor <iant@google.com>
2844
2845 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
2846 initialize local variable v.
2847
cdc29364
CC
28482011-04-11 Cary Coutant <ccoutant@google.com>
2849
2850 * archive.cc (Archive::include_member): Adjust call to
2851 report_object.
2852 (Add_archive_symbols::run): Track argument serial numbers.
2853 (Lib_group::include_member): Likewise.
2854 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
2855 * archive.h (Incremental_archive_entry::Archive_member):
2856 Initialize arg_serial_.
2857 (Archive_member::arg_serial_): New data member.
2858 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
2859 (Sized_dynobj::do_add_symbols): Track symbols when doing an
2860 incremental link.
2861 (Sized_dynobj::do_for_all_local_got_entries): New function.
2862 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
2863 function.
2864 * fileread.cc (get_mtime): New function.
2865 * fileread.h (get_mtime): New function.
2866 * gold.cc (queue_initial_tasks): Check for incremental update.
2867 (process_incremental_input): New function.
2868 (queue_middle_tasks): Don't force valid target for incremental
2869 update.
2870 * incremental-dump.cc (find_input_containing_global): Adjust
2871 size of symbol info entry.
2872 (dump_incremental_inputs): Dump argument serial number and
2873 in_system_directory flag; bias shndx by 1; print symbol names
2874 when dumping per-file symbol lists; use new symbol info readers.
2875 * incremental.cc
2876 (Output_section_incremental_inputs:update_data_size): New function.
2877 (Sized_incremental_binary::setup_readers): Setup input readers
2878 for each input file; build maps for files added from libraries
2879 and scripts.
2880 (Sized_incremental_binary::check_input_args): New function.
2881 (Sized_incremental_binary::do_check_inputs): Build map of argument
2882 serial numbers to input arguments.
2883 (Sized_incremental_binary::do_file_has_changed): Rename
2884 do_file_is_unchanged to this; compare file modification times.
2885 (Sized_incremental_binary::do_init_layout): New function.
2886 (Sized_incremental_binary::do_reserve_layout): New function.
2887 (Sized_incremental_binary::do_get_input_reader): Remove.
2888 (Sized_incremental_binary::get_symtab_view): New function.
2889 (Incremental_checker::can_incrementally_link_output_file): Remove.
2890 (Incremental_inputs::report_command_line): Exclude --debug options.
2891 (Incremental_inputs::report_archive_begin): Add parameter; track
2892 argument serial numbers; don't put input file entry for archive
2893 before archive members.
2894 (Incremental_inputs::report_archive_end): Put input file entry
2895 for archive after archive members.
2896 (Incremental_inputs::report_object): Add parameter; track argument
2897 serial numbers and in_system_directory flag.
2898 (Incremental_inputs::report_script): Add parameter; track argument
2899 serial numbers.
2900 (Output_section_incremental_inputs::set_final_data_size): Adjust
2901 size of symbol info entry; check for forwarding symbols.
2902 (Output_section_incremental_inputs::write_input_files): Write
2903 in_system_directory flag and argument serial number.
2904 (Output_section_incremental_inputs::write_info_blocks): Map section
2905 indices between incremental info and original input file; store
2906 input section index for each symbol.
2907 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
2908 change operator() to visit().
2909 (class Global_got_offset_visitor): Likewise.
2910 (class Global_symbol_visitor_got_plt):
2911 (Output_section_incremental_inputs::write_got_plt): Use new visitor
2912 classes.
2913 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
2914 (Sized_incr_relobj::do_read_symbols): New function.
2915 (Sized_incr_relobj::do_layout): New function.
2916 (Sized_incr_relobj::do_layout_deferred_sections): New function.
2917 (Sized_incr_relobj::do_add_symbols): New function.
2918 (Sized_incr_relobj::do_should_include_member): New function.
2919 (Sized_incr_relobj::do_for_all_global_symbols): New function.
2920 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
2921 (Sized_incr_relobj::do_section_size): New function.
2922 (Sized_incr_relobj::do_section_name): New function.
2923 (Sized_incr_relobj::do_section_contents): New function.
2924 (Sized_incr_relobj::do_section_flags): New function.
2925 (Sized_incr_relobj::do_section_entsize): New function.
2926 (Sized_incr_relobj::do_section_address): New function.
2927 (Sized_incr_relobj::do_section_type): New function.
2928 (Sized_incr_relobj::do_section_link): New function.
2929 (Sized_incr_relobj::do_section_info): New function.
2930 (Sized_incr_relobj::do_section_addralign): New function.
2931 (Sized_incr_relobj::do_initialize_xindex): New function.
2932 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
2933 (Sized_incr_relobj::do_read_relocs): New function.
2934 (Sized_incr_relobj::do_gc_process_relocs): New function.
2935 (Sized_incr_relobj::do_scan_relocs): New function.
2936 (Sized_incr_relobj::do_count_local_symbols): New function.
2937 (Sized_incr_relobj::do_finalize_local_symbols): New function.
2938 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
2939 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
2940 (Sized_incr_relobj::do_relocate): New function.
2941 (Sized_incr_relobj::do_set_section_offset): New function.
2942 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
2943 (Sized_incr_dynobj::do_read_symbols): New function.
2944 (Sized_incr_dynobj::do_layout): New function.
2945 (Sized_incr_dynobj::do_add_symbols): New function.
2946 (Sized_incr_dynobj::do_should_include_member): New function.
2947 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
2948 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
2949 (Sized_incr_dynobj::do_section_size): New function.
2950 (Sized_incr_dynobj::do_section_name): New function.
2951 (Sized_incr_dynobj::do_section_contents): New function.
2952 (Sized_incr_dynobj::do_section_flags): New function.
2953 (Sized_incr_dynobj::do_section_entsize): New function.
2954 (Sized_incr_dynobj::do_section_address): New function.
2955 (Sized_incr_dynobj::do_section_type): New function.
2956 (Sized_incr_dynobj::do_section_link): New function.
2957 (Sized_incr_dynobj::do_section_info): New function.
2958 (Sized_incr_dynobj::do_section_addralign): New function.
2959 (Sized_incr_dynobj::do_initialize_xindex): New function.
2960 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
2961 (make_sized_incremental_object): New function.
2962 (Incremental_library::copy_unused_symbols): New function.
2963 (Incremental_library::do_for_all_unused_symbols): New function.
2964 * incremental.h (enum Incremental_input_flags): New type.
2965 (class Incremental_checker): Remove.
2966 (Incremental_input_entry::Incremental_input_entry): Add argument
2967 serial number.
2968 (Incremental_input_entry::arg_serial): New function.
2969 (Incremental_input_entry::set_is_in_system_directory): New function.
2970 (Incremental_input_entry::is_in_system_directory): New function.
2971 (Incremental_input_entry::arg_serial_): New data member.
2972 (Incremental_input_entry::is_in_system_directory_): New data member.
2973 (class Script_info): Move here from script.h.
2974 (Script_info::Script_info): Add filename parameter.
2975 (Script_info::filename): New function.
2976 (Script_info::filename_): New data member.
2977 (Incremental_script_entry::Incremental_script_entry): Add argument
2978 serial number.
2979 (Incremental_object_entry::Incremental_object_entry): Likewise.
2980 (Incremental_object_entry::add_input_section): Build list of input
2981 sections with map to original shndx.
2982 (Incremental_object_entry::get_input_section_index): New function.
2983 (Incremental_object_entry::shndx_): New data member.
2984 (Incremental_object_entry::name_key_): Rename; adjust all refs.
2985 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
2986 (Incremental_archive_entry::Incremental_archive_entry): Add argument
2987 serial number.
2988 (Incremental_inputs::report_archive_begin): Likewise.
2989 (Incremental_inputs::report_object): Likewise.
2990 (Incremental_inputs::report_script): Likewise.
2991 (class Incremental_global_symbol_reader): New class.
2992 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
2993 and store flags and input file type.
2994 (Incremental_input_entry_reader::arg_serial): New function.
2995 (Incremental_input_entry_reader::type): Extract type from flags.
2996 (Incremental_input_entry_reader::is_in_system_directory): New function.
2997 (Incremental_input_entry_reader::get_input_section_count): Call
2998 accessor function for type.
2999 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
3000 function for type; adjust size of global symbol entry.
3001 (Incremental_input_entry_reader::get_global_symbol_count): Call
3002 accessor function for type.
3003 (Incremental_input_entry_reader::get_object_count): Likewise.
3004 (Incremental_input_entry_reader::get_object_offset): Likewise.
3005 (Incremental_input_entry_reader::get_member_count): Likewise.
3006 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
3007 (Incremental_input_entry_reader::get_member_offset): Likewise.
3008 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
3009 (Incremental_input_entry_reader::Global_symbol_info): Remove.
3010 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
3011 (Incremental_input_entry_reader::get_global_symbol_reader): New
3012 function.
3013 (Incremental_input_entry_reader::get_output_symbol_index): New
3014 function.
3015 (Incremental_input_entry_reader::type_): Remove.
3016 (Incremental_input_entry_reader::flags_): New data member.
3017 (Incremental_inputs_reader::input_file_offset): New function.
3018 (Incremental_inputs_reader::input_file_index): New function.
3019 (Incremental_inputs_reader::input_file): Call input_file_offset.
3020 (Incremental_inputs_reader::input_file_at_offset): New function.
3021 (Incremental_relocs_reader::get_r_type): Reformat.
3022 (Incremental_relocs_reader::get_r_shndx): Reformat.
3023 (Incremental_relocs_reader::get_r_offset): Reformat.
3024 (Incremental_relocs_reader::data): New function.
3025 (Incremental_binary::Incremental_binary): Initialize new data members.
3026 (Incremental_binary::check_inputs): Add cmdline parameter.
3027 (Incremental_binary::file_is_unchanged): Remove.
3028 (Input_reader::arg_serial): New function.
3029 (Input_reader::get_unused_symbol_count): New function.
3030 (Input_reader::get_unused_symbol): New function.
3031 (Input_reader::do_arg_serial): New function.
3032 (Input_reader::do_get_unused_symbol_count): New function.
3033 (Input_reader::do_get_unused_symbol): New function.
3034 (Incremental_binary::input_file_count): New function.
3035 (Incremental_binary::get_input_reader): Change signature to use
3036 index instead of filename.
3037 (Incremental_binary::file_has_changed): New function.
3038 (Incremental_binary::get_input_argument): New function.
3039 (Incremental_binary::get_library): New function.
3040 (Incremental_binary::get_script_info): New function.
3041 (Incremental_binary::init_layout): New function.
3042 (Incremental_binary::reserve_layout): New function.
3043 (Incremental_binary::output_file): New function.
3044 (Incremental_binary::do_check_inputs): New function.
3045 (Incremental_binary::do_file_is_unchanged): Remove.
3046 (Incremental_binary::do_file_has_changed): New function.
3047 (Incremental_binary::do_init_layout): New function.
3048 (Incremental_binary::do_reserve_layout): New function.
3049 (Incremental_binary::do_input_file_count): New function.
3050 (Incremental_binary::do_get_input_reader): Change signature.
3051 (Incremental_binary::input_args_map_): New data member.
3052 (Incremental_binary::library_map_): New data member.
3053 (Incremental_binary::script_map_): New data member.
3054 (Sized_incremental_binary::Sized_incremental_binary): Initialize
3055 new data members.
3056 (Sized_incremental_binary::output_section): New function.
3057 (Sized_incremental_binary::inputs_reader): Add const.
3058 (Sized_incremental_binary::symtab_reader): Add const.
3059 (Sized_incremental_binary::relocs_reader): Add const.
3060 (Sized_incremental_binary::got_plt_reader): Add const.
3061 (Sized_incremental_binary::get_symtab_view): New function.
3062 (Sized_incremental_binary::Inputs_reader): New typedef.
3063 (Sized_incremental_binary::Input_entry_reader): New typedef.
3064 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
3065 (Sized_incremental_binary::do_file_is_unchanged): Remove.
3066 (Sized_incremental_binary::do_file_has_changed): New function.
3067 (Sized_incremental_binary::do_init_layout): New function.
3068 (Sized_incremental_binary::do_reserve_layout): New function.
3069 (Sized_input_reader::Inputs_reader): Remove.
3070 (Sized_input_reader::Input_entry_reader): Remove.
3071 (Sized_input_reader::do_arg_serial): New function.
3072 (Sized_input_reader::do_get_unused_symbol_count): New function.
3073 (Sized_input_reader::do_get_unused_symbol): New function.
3074 (Sized_incremental_binary::do_input_file_count): New function.
3075 (Sized_incremental_binary::do_get_input_reader): Change signature;
3076 use index instead of filename.
3077 (Sized_incremental_binary::section_map_): New data member.
3078 (Sized_incremental_binary::input_entry_readers_): New data member.
3079 (class Sized_incr_relobj): New class.
3080 (class Sized_incr_dynobj): New class.
3081 (make_sized_incremental_object): New function.
3082 (class Incremental_library): New class.
3083 * layout.cc (Free_list::num_lists): New static data member.
3084 (Free_list::num_nodes): New static data member.
3085 (Free_list::num_removes): New static data member.
3086 (Free_list::num_remove_visits): New static data member.
3087 (Free_list::num_allocates): New static data member.
3088 (Free_list::num_allocate_visits): New static data member.
3089 (Free_list::init): New function.
3090 (Free_list::remove): New function.
3091 (Free_list::allocate): New function.
3092 (Free_list::dump): New function.
3093 (Free_list::print_stats): New function.
3094 (Layout_task_runner::run): Resize output file for incremental updates.
3095 (Layout::Layout): Initialize new data members.
3096 (Layout::set_incremental_base): New function.
3097 (Layout::init_fixed_output_section): New function.
3098 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
3099 incremental updates.
3100 (Layout::create_gold_note): Do not create gold note section for
3101 incremental updates.
3102 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
3103 for incremental updates.
3104 (Layout::set_section_offsets): For incremental updates, allocate space
3105 from free list.
3106 (Layout::create_symtab_sections): Layout with offsets relative to
3107 start of section; for incremental updates, allocate space from free
3108 list.
3109 (Layout::create_shdrs): For incremental updates, allocate space from
3110 free list.
3111 (Layout::finish_dynamic_section): For incremental updates, do not
3112 check --as-needed (fixed in subsequent patch).
3113 * layout.h (class Free_list): New class.
3114 (Layout::set_incremental_base): New function.
3115 (Layout::incremental_base): New function.
3116 (Layout::init_fixed_output_section): New function.
3117 (Layout::allocate): New function.
3118 (Layout::incremental_base_): New data member.
3119 (Layout::free_list_): New data member.
3120 * main.cc (main): Print Free_list statistics.
3121 * object.cc (Relobj::finalize_incremental_relocs): Add
3122 clear_counts parameter; clear counts only when clear_counts is set.
3123 (Sized_relobj::Sized_relobj): Initialize new base class.
3124 (Sized_relobj::do_layout): Don't report special sections.
3125 (Sized_relobj::do_for_all_local_got_entries): New function.
3126 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
3127 symtab_off to all symbol table offsets.
3128 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
3129 * object.h (class Got_offset_list): Move to top of file.
3130 (Object::Object): Allow case where input_file == NULL.
3131 (Object::~Object): Likewise.
3132 (Object::input_file): Assert that input_file != NULL.
3133 (Object::lock): Allow case where input_file == NULL.
3134 (Object::unlock): Likewise.
3135 (Object::is_locked): Likewise.
3136 (Object::token): Likewise.
3137 (Object::release): Likewise.
3138 (Object::is_incremental): New function.
3139 (Object::get_mtime): New function.
3140 (Object::for_all_local_got_entries): New function.
3141 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
3142 (Object::set_is_in_system_directory): New function.
3143 (Object::is_in_system_directory): New function.
3144 (Object::do_is_incremental): New function.
3145 (Object::do_get_mtime): New function.
3146 (Object::do_for_all_local_got_entries): New function.
3147 (Object::is_in_system_directory_): New data member.
3148 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
3149 (class Sized_relobj_base): New class.
3150 (class Sized_relobj): Derive from Sized_relobj_base.
3151 (class Sized_relobj::Symbols): Redeclare from base class.
3152 (class Sized_relobj::local_got_offset_list): Remove.
3153 (class Sized_relobj::Output_sections): Redeclare from base class.
3154 (class Sized_relobj::do_for_all_local_got_entries): New function.
3155 (class Sized_relobj::write_local_symbols): Add offset parameter.
3156 (class Sized_relobj::local_symbol_offset_): Update comment.
3157 (class Sized_relobj::local_dynsym_offset_): Update comment.
3158 * options.cc (Input_arguments::add_file): Remove const.
3159 * options.h (Input_file_argument::Input_file_argument):
3160 Initialize arg_serial_ (all constructors).
3161 (Input_file_argument::set_arg_serial): New function.
3162 (Input_file_argument::arg_serial): New function.
3163 (Input_file_argument::arg_serial_): New data member.
3164 (Input_arguments::Input_arguments): Initialize file_count_.
3165 (Input_arguments::add_file): Remove const.
3166 (Input_arguments::number_of_input_files): New function.
3167 (Input_arguments::file_count_): New data member.
3168 (Command_line::number_of_input_files): Call
3169 Input_arguments::number_of_input_files.
3170 * output.cc (Output_segment_headers::Output_segment_headers):
3171 Set current size.
3172 (Output_section::Input_section::current_data_size): New function.
3173 (Output_section::Output_section): Initialize new data members.
3174 (Output_section::add_input_section): Don't do merge sections for
3175 an incremental link; allocate space from free list for an
3176 incremental update.
3177 (Output_section::add_output_section_data): Allocate space from
3178 free list for an incremental update.
3179 (Output_section::update_data_size): New function.
3180 (Output_section::set_fixed_layout): New function.
3181 (Output_section::reserve): New function.
3182 (Output_segment::set_section_addresses): Remove const.
3183 (Output_segment::set_section_list_addresses): Remove const; allocate
3184 space from free list for an incremental update.
3185 (Output_segment::set_offset): Adjust size of RELRO segment for an
3186 incremental update.
3187 * output.h (Output_data::current_data_size): Move here from
3188 child classes.
3189 (Output_data::pre_finalize_data_size): New function.
3190 (Output_data::update_data_size): New function.
3191 (Output_section_headers::update_data_size): new function.
3192 (Output_section_data_build::current_data_size): Move to Output_data.
3193 (Output_data_strtab::update_data_size): New function.
3194 (Output_section::current_data_size): Move to Output_data.
3195 (Output_section::set_fixed_layout): New function.
3196 (Output_section::has_fixed_layout): New function.
3197 (Output_section::reserve): New function.
3198 (Output_section::update_data_size): New function.
3199 (Output_section::has_fixed_layout_): New data member.
3200 (Output_section::free_list_): New data member.
3201 (Output_segment::set_section_addresses): Remove const.
3202 (Output_segment::set_section_list_addresses): Remove const.
3203 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
3204 New function.
3205 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
3206 New function.
3207 * readsyms.cc (Read_symbols::do_read_symbols): Add library
3208 parameter when calling Add_symbols constructor; store argument
3209 serial number for members of a lib group.
3210 (Add_symbols::locks): Allow case where token == NULL.
3211 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
3212 (Read_member::~Read_member): New function.
3213 (Read_member::is_runnable): New function.
3214 (Read_member::locks): New function.
3215 (Read_member::run): New function.
3216 (Check_script::~Check_script): New function.
3217 (Check_script::is_runnable): New function.
3218 (Check_script::locks): New function.
3219 (Check_script::run): New function.
3220 (Check_library::~Check_library): New function.
3221 (Check_library::is_runnable): New function.
3222 (Check_library::locks): New function.
3223 (Check_library::run): New function.
3224 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
3225 (Add_symbols::library_): New data member.
3226 (class Read_member): New class.
3227 (class Check_script): New class.
3228 (class Check_library): New class.
3229 * reloc.cc (Read_relocs::is_runnable): Allow case where
3230 token == NULL.
3231 (Read_relocs::locks): Likewise.
3232 (Scan_relocs::locks): Likewise.
3233 (Relocate_task::locks): Likewise.
3234 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
3235 to clear counters.
3236 (Sized_relobj::incremental_relocs_scan): Fix comment.
3237 (Sized_relobj::do_relocate): Pass output file offset to
3238 write_local_symbols.
3239 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
3240 from class declaration.
3241 * script.cc (read_input_script): Allocate Script_info; pass
3242 argument serial number to report_script.
3243 * script.h (class Script_info): Move to incremental.h.
3244 * symtab.cc (Symbol_table::add_from_incrobj): New function.
3245 * symtab.h (Symbol_table::add_from_incrobj): New function.
3246 (Symbol_table::set_file_offset): New function.
3247
b961d0d7
CC
32482011-04-05 Cary Coutant <ccoutant@google.com>
3249
3250 * incremental-dump.cc (dump_incremental_inputs): Change signature
3251 to take a Sized_incremental_binary; change caller. Use readers
3252 in Sized_incremental_binary.
3253 * incremental.cc
3254 (Sized_incremental_binary::find_incremental_inputs_sections):
3255 Rename do_find_incremental_inputs_sections to this.
3256 (Sized_incremental_binary::setup_readers): New function.
3257 (Sized_incremental_binary::do_check_inputs): Check
3258 has_incremental_info_ flag; move setup code to setup_readers;
3259 use input readers.
3260 (Sized_incremental_binary::do_file_is_unchanged): New function.
3261 (Sized_incremental_binary::do_get_input_reader): New function.
3262 * incremental.h (class Incremental_binary): Move to end of file.
3263 (Incremental_binary::file_is_unchanged): New function.
3264 (Incremental_binary::do_file_is_unchanged): New function.
3265 (Incremental_binary::Input_reader): New class.
3266 (Incremental_binary::get_input_reader): New function.
3267 (class Sized_incremental_binary): Move to end of file.
3268 (Sized_incremental_binary::Sized_incremental_binary): Setup the
3269 input section reader classes.
3270 (Sized_incremental_binary::has_incremental_info): New function.
3271 (Sized_incremental_binary::inputs_reader): New function.
3272 (Sized_incremental_binary::symtab_reader): New function.
3273 (Sized_incremental_binary::relocs_reader): New function.
3274 (Sized_incremental_binary::got_plt_reader): New function.
3275 (Sized_incremental_binary::do_file_is_unchanged): New function.
3276 (Sized_incremental_binary::Sized_input_reader): New class.
3277 (Sized_incremental_binary::get_input_reader): New function.
3278 (Sized_incremental_binary::find_incremental_inputs_sections):
3279 Rename do_find_incremental_inputs_sections to this.
3280 (Sized_incremental_binary::setup_readers): New function.
3281 (Sized_incremental_binary::has_incremental_info_): New data member.
3282 (Sized_incremental_binary::inputs_reader_): New data member.
3283 (Sized_incremental_binary::symtab_reader_): New data member.
3284 (Sized_incremental_binary::relocs_reader_): New data member.
3285 (Sized_incremental_binary::got_plt_reader_): New data member.
3286 (Sized_incremental_binary::current_input_file_): New data member.
3287
a869183f
PP
32882011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
3289
3290 PR gold/12640
3291 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
3292 violation.
3293
32942011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
3295
3296 * archive.cc (Archive::include_member): Adjust call to report_object.
3297 (Add_archive_symbols::run): Add script_info to call to
3298 report_archive_begin.
3299 (Lib_group::include_member): Adjust call to report_object.
3300 (Add_lib_group_symbols::run): Adjust call to report_object.
3301 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
3302 blocks. Add object count for script input files.
3303 * incremental.cc (Incremental_inputs::report_archive_begin): Add
3304 script_info parameter; change all callers.
3305 (Incremental_inputs::report_object): Add script_info parameter;
3306 change all callers.
3307 (Incremental_inputs::report_script): Store backpointer to
3308 incremental info entry.
3309 (Output_section_incremental_inputs::set_final_data_size): Record
3310 additional information for scripts.
3311 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3312 * incremental.h (Incremental_script_entry::add_object): New function.
3313 (Incremental_script_entry::get_object_count): New function.
3314 (Incremental_script_entry::get_object): New function.
3315 (Incremental_script_entry::objects_): New data member; adjust
3316 constructor.
3317 (Incremental_inputs::report_archive_begin): Add script_info parameter.
3318 (Incremental_inputs::report_object): Add script_info parameter.
3319 (Incremental_inputs_reader::get_object_count): New function.
3320 (Incremental_inputs_reader::get_object_offset): New function.
3321 * options.cc (Input_arguments::add_file): Return reference to
3322 new input argument.
3323 * options.h (Input_argument::set_script_info): New function.
3324 (Input_argument::script_info): New function.
3325 (Input_argument::script_info_): New data member; adjust all
3326 constructors.
3327 (Input_file_group::add_file): Return reference to new input argument.
3328 (Input_file_lib::add_file): Likewise.
3329 (Input_arguments::add_file): Likewise.
3330 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
3331 * script.cc (Parser_closure::Parser_closure): Add script_info
3332 parameter; adjust all callers.
3333 (Parser_closure::script_info): New function.
3334 (Parser_closure::script_info_): New data member.
3335 (read_input_script): Report scripts earlier to incremental info.
3336 (script_add_file): Set script_info in Input_argument.
3337 (script_add_library): Likewise.
3338 * script.h (Script_options::Script_info): Rewrite class.
3339
a869183f 33402011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
3341
3342 * archive.cc (Library_base::should_include_member): Move
3343 method here from class Archive.
3344 (Archive::Archive): Initialize base class.
3345 (Archive::should_include_member): Move to base class.
3346 (Archive::do_for_all_unused_symbols): New function.
3347 (Add_archive_symbols::run): Remove redundant access to
3348 incremental_inputs.
3349 (Lib_group::Lib_group): Initialize base class.
3350 (Lib_group::do_filename): New function.
3351 (Lib_group::include_member): Pass pointer to Lib_group to
3352 report_object.
3353 (Lib_group::do_for_all_unused_symbols): New function.
3354 (Add_lib_group_symbols::run): Report archive information for
3355 incremental links.
3356 * archive.h (class Library_base): New base class.
3357 (class Archive): Derive from Library_base.
3358 (Archive::filename): Move to base class.
3359 (Archive::set_incremental_info): Likewise.
3360 (Archive::incremental_info): Likewise.
3361 (Archive::Should_include): Likewise.
3362 (Archive::should_include_member): Likewise.
3363 (Archive::Armap_entry): Remove.
3364 (Archive::Unused_symbol_iterator): Remove.
3365 (Archive::unused_symbols_begin): Remove.
3366 (Archive::unused_symbols_end): Remove.
3367 (Archive::do_filename): New function.
3368 (Archive::do_get_mtime): New function.
3369 (Archive::do_for_all_unused_symbols): New function.
3370 (Archive::task_): Move to base class.
3371 (Archive::incremental_info_): Likewise.
3372 (class Lib_group): Derive from Library_base.
3373 (Lib_group::do_filename): New function.
3374 (Lib_group::do_get_mtime): New function.
3375 (Lib_group::do_for_all_unused_symbols): New function.
3376 (Lib_group::task_): Move to base class.
3377 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
3378 function.
3379 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
3380 function.
3381 * incremental.cc (Incremental_inputs::report_archive_begin):
3382 Use Library_base; call library's get_mtime; add incremental inputs
3383 entry before members.
3384 (class Unused_symbol_visitor): New class.
3385 (Incremental_inputs::report_archive_end): Use Library_base; use
3386 visitor class to record unused symbols; don't add incremental inputs
3387 entry after members.
3388 (Incremental_inputs::report_object): Use Library_base.
3389 * incremental.h
3390 (Incremental_archive_entry::Incremental_archive_entry): Remove
3391 unused Archive parameter.
3392 (Incremental_inputs::report_archive_begin): Use Library_base.
3393 (Incremental_inputs::report_archive_end): Likewise.
3394 (Incremental_inputs::report_object): Likewise.
3395 * object.cc (Sized_relobj::do_for_all_global_symbols): New
3396 function.
3397 * object.h (Object::for_all_global_symbols): New function.
3398 (Object::do_for_all_global_symbols): New function.
3399 (Sized_relobj::do_for_all_global_symbols): New function.
3400 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
3401 function.
3402 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
3403 function.
3404
61ab3e40
ILT
34052011-03-27 Ian Lance Taylor <iant@google.com>
3406
3407 * archive.cc (Archive::interpret_header): Return -1 if something
3408 goes wrong. Change callers accordingly.
3409
30e1f9e6
CC
34102011-03-25 Cary Coutant <ccoutant@google.com>
3411
3412 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
3413 * testsuite/Makefile.in: Regenerate.
3414
9370ce59 34152011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
3416
3417 * plugin.cc (get_view): New.
3418 (Plugin::load): Pass get_view to the plugin.
3419 (Plugin_manager::get_view): New.
3420
9312bb0a
ILT
34212011-03-21 Ian Lance Taylor <iant@google.com>
3422
3423 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 3424 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 3425
7e12ba9e
ST
34262011-03-21 Sriraman Tallam <tmsriram@google.com>
3427
3428 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
3429 Change == to -eq.
3430 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
3431 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
3432 Change == to -eq.
3433 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
3434 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
3435
fd7a005d
ILT
34362011-03-14 Ian Lance Taylor <iant@google.com>
3437
3438 * script-sections.cc (Sort_output_sections::script_compare):
3439 Rename from is_before, change return type.
3440 (Sort_output_sections::operator()): Adjust accordingly.
3441
ed16fd1b
ILT
34422011-03-11 Jeffrey Yasskin <jyasskin@google.com>
3443
3444 PR gold/12572
3445 * testsuite/odr_violation2.cc: Add comment to make all error line
3446 numbers double digits.
3447 * testsuite/debug_msg.sh: Adjust expected errors.
3448
71ff8986
ILT
34492011-03-09 Jeffrey Yasskin <jyasskin@google.com>
3450
3451 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
3452 but mark earlier ones as non-canonical
3453 (offset_to_iterator): Update search target and example
3454 (do_addr2line): Return extra lines in a vector*
3455 (format_file_lineno): Extract from do_addr2line
3456 (one_addr2line): Add vector* out-param
3457 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
3458 when a lineno entry appeared last for its instruction
3459 (Dwarf_line_info): Add vector* out-param
3460 * object.cc (Relocate_info): Pass NULL for the vector* out-param
3461 * symtab.cc (Odr_violation_compare): Include the lineno in the
3462 comparison again.
3463 (linenos_from_loc): New. Combine the canonical line for an
3464 address with its other lines.
3465 (True_if_intersect): New. Helper functor to make
3466 std::set_intersection a query.
3467 (detect_odr_violations): Compare sets of lines instead of just
3468 one line for each function. This became less deterministic, but
3469 has fewer false positives.
3470 * symtab.h: Declarations.
3471 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
3472 mix an optimized and non-optimized object in the same binary
3473 (odr_violation2.so): Same.
3474 * testsuite/Makefile.in: Regenerate from Makefile.am.
3475 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
3476 * testsuite/debug_msg.sh: Update line numbers and add
3477 assertions.
3478 * testsuite/odr_violation1.cc: Use OdrDerived, in a
3479 non-optimized context.
3480 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
3481 isn't inlined, and use OdrDerived in an optimized context.
3482 * testsuite/odr_header1.h: Defines OdrDerived, where
3483 optimization will change the
3484 first-instruction-in-the-destructor's file and line number.
3485 * testsuite/odr_header2.h: Defines OdrBase.
3486
a19fefdc
ILT
34872011-03-09 Ian Lance Taylor <iant@google.com>
3488
3489 * fileread.cc (File_read::clear_views): Don't delete the whole
3490 file view.
3491
ecb351e9
ILT
34922011-03-08 Ian Lance Taylor <iant@google.com>
3493
3494 PR gold/12525
3495 * fileread.cc: #include <climits>.
3496 (GOLD_IOV_MAX): Define.
3497 (File_read::read_multiple): Limit number of entries by iov_max.
3498 * fileread.h (class File_read): Always set max_readv_entries to
3499 128.
3500
b821d13c
ILT
35012011-03-07 Ian Lance Taylor <iant@google.com>
3502
3503 PR gold/12525
3504 * options.h (class General_options): Add -dy and -dn.
3505
89243142
CC
35062011-03-02 Cary Coutant <ccoutant@google.com>
3507
3508 * testsuite/script_test_9.t: Add TLS segment.
3509
d0773f31
ILT
35102011-03-02 Simon Baldwin <simonb@google.com>
3511
3512 * configure.ac: Add check for gnu_indirect_function support in
3513 the toolchain building binutils.
3514 * configure: Rebuild.
3515
9370ce59 35162011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
3517
3518 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
3519 plugin only symbols.
3520 (Symbol_table::sized_finalize_symbol) Mark symbol only present
3521 in plugin files as not needed in the symbol table.
3522
4cf7a849
ST
35232011-02-11 Sriraman Tallam <tmsriram@google.com>
3524
3525 * output.cc (Output_section::add_input_section): Delay fill
3526 generation for section ordering.
3527
b578bd7d
ILT
35282011-02-09 Ian Lance Taylor <iant@google.com>
3529
3530 PR gold/12316
3531 * object.h (class Sized_relobj): Remove clear_local_symbols.
3532 * reloc.cc (Sized_relobj::do_relocate): Don't call
3533 clear_local_symbols.
3534
9370ce59 35352011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
3536
3537 * plugin.cc (is_visible_from_outside): Return true for symbols
3538 in the -u option.
3539
55382fb7
ILT
35402011-02-04 Jeffrey Yasskin <jyasskin@google.com>
3541
3542 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
3543 filename.
3544
4e271fff
ST
35452011-02-02 Sriraman Tallam <tmsriram@google.com>
3546
3547 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 3548 to std::string.
4e271fff 3549 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 3550 section_name to be std::string.
4e271fff
ST
3551 (is_function_ctor_or_dtor): Change type of parameter to std::string.
3552
d433c3ac
ILT
35532011-01-25 Ian Lance Taylor <iant@google.com>
3554
3555 * script.cc (script_add_extern): Rewrite to use
3556 add_symbol_reference.
3557
880473a6
DK
35582011-01-25 Doug Kwan <dougkwan@google.com>
3559
d433c3ac 3560 * icf.cc (get_section_contents): Always lock section's object.
880473a6 3561
f30f86fa
ILT
35622011-01-24 Ian Lance Taylor <iant@google.com>
3563
3564 * options.h (class General_options): Accept
3565 --no-detect-odr-violations.
3566
8e51a0b9
ILT
35672011-01-24 Ian Lance Taylor <iant@google.com>
3568
3569 * version.cc (version_string): Bump to 1.11.
3570
0f3b89d8
ILT
35712011-01-24 Ian Lance Taylor <iant@google.com>
3572
3573 * plugin.cc (class Plugin_rescan): Define new class.
3574 (Plugin_manager::claim_file): Set any_claimed_.
3575 (Plugin_manager::save_archive): New function.
3576 (Plugin_manager::save_input_group): New function.
3577 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
3578 necessary.
3579 (Plugin_manager::new_undefined_symbol): New function.
3580 (Plugin_manager::rescan): New function.
3581 (Plugin_manager::rescannable_defines): New function.
3582 (Plugin_manager::add_input_file): Set any_added_.
3583 * plugin.h (class Plugin_manager): define new fields rescannable_,
3584 undefined_symbols_, any_claimed_, and any_added_. Declare
3585 Plugin_rescan as friend. Declare new functions.
3586 (Plugin_manager::Rescannable): Define type.
3587 (Plugin_manager::Rescannable_list): Define type.
3588 (Plugin_manager::Undefined_symbol_list): Define type.
3589 (Plugin_manager::Plugin_manager): Initialize new fields.
3590 * archive.cc (Archive::defines_symbol): New function.
3591 (Add_archive_symbols::run): Pass archive to plugins if any.
3592 * archive.h (class Archive): Declare defines_symbol.
3593 * readsyms.cc (Input_group::~Input_group): New function.
3594 (Finish_group::run): Pass input_group to plugins if any.
3595 * readsyms.h (class Input_group): Declare destructor.
3596 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
3597 any.
3598
3bb951e5
ILT
35992011-01-10 Ian Lance Taylor <iant@google.com>
3600
3601 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
3602 section as relro.
3603 (Layout::set_segment_offsets): Reset increase_relro before calling
3604 set_section_addresses a second time.
3605
0aa45fac
CC
36062011-01-04 Cary Coutant <ccoutant@google.com>
3607
3608 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
3609 sections before NOBITS sections.
3610
0db46eb4
L
36112011-01-01 H.J. Lu <hongjiu.lu@intel.com>
3612
3613 * version.cc (print_version): Update copyright to 2011.
3614
829c9745
CC
36152010-12-23 Cary Coutant <ccoutant@google.com>
3616
3617 * output.h (Output_data_reloc::add_output_section): Pass OD instead
3618 of OS to this->add. Add OD parameter to second form of the function.
3619
7500420b
ILT
36202010-12-20 Ian Lance Taylor <iant@google.com>
3621
3622 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
3623 second of two consecutive entries with same offset.
3624
f8e9a930
RW
36252010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3626
3627 * testsuite/Makefile.am (ifuncmain2static_LDADD)
3628 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
3629 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
3630 to avoid unneeded links against $(LDADD).
3631 * testsuite/Makefile.in: Regenerate.
3632
2fbb4320
ILT
36332010-12-15 Ian Lance Taylor <iant@google.com>
3634
3635 PR gold/12324
3636 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
3637 for R_X86_64_32 and R_X86_64_PC32.
3638 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
3639 ver_matching_def_pic.o.
3640 (ver_matching_def_pic.o): New target.
3641
fedb228d
RW
36422010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3643
3644 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
3645 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
3646 Move definition before File_read::View member definitions.
3647 (File_read::View::~View): Initialize and hold lock before
3648 updating current_mapped_bytes.
3649
9b547ce6
RW
36502010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3651
3652 * dwarf_reader.cc: Remove outdated comment.
3653 * gold-threads.cc: Fix typo in error message.
3654 * archive.cc: Fix typos in comments.
3655 * archive.h: Likewise.
3656 * arm-reloc-property.cc: Likewise.
3657 * arm-reloc-property.h: Likewise.
3658 * arm-reloc.def: Likewise.
3659 * arm.cc: Likewise.
3660 * attributes.h: Likewise.
3661 * cref.cc: Likewise.
3662 * ehframe.cc: Likewise.
3663 * fileread.h: Likewise.
3664 * gold.h: Likewise.
3665 * i386.cc: Likewise.
3666 * icf.cc: Likewise.
3667 * incremental.h: Likewise.
3668 * int_encoding.cc: Likewise.
3669 * layout.h: Likewise.
3670 * main.cc: Likewise.
3671 * merge.h: Likewise.
3672 * object.cc: Likewise.
3673 * object.h: Likewise.
3674 * options.cc: Likewise.
3675 * readsyms.cc: Likewise.
3676 * reduced_debug_output.cc: Likewise.
3677 * reloc.cc: Likewise.
3678 * script-sections.cc: Likewise.
3679 * sparc.cc: Likewise.
3680 * symtab.h: Likewise.
3681 * target-reloc.h: Likewise.
3682 * target.cc: Likewise.
3683 * target.h: Likewise.
3684 * timer.cc: Likewise.
3685 * timer.h: Likewise.
3686 * x86_64.cc: Likewise.
3687
83e17bd5
CC
36882010-12-09 Cary Coutant <ccoutant@google.com>
3689
3690 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
3691 stack.
3692 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
3693 parameter; change all callers.
3694 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
3695 * options.h (warn_execstack): New option.
3696
017257f8
DK
36972010-12-07 Doug Kwan <dougkwan@google.com>
3698
3699 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
3700 like function call relocations.
3701
c20cbc06
ILT
37022010-12-07 Ian Lance Taylor <iant@google.com>
3703
3704 * archive.cc (Archive::get_elf_object_for_member): Permit
3705 punconfigured to be NULL.
3706 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
3707 (Archive::include_member): Pass NULL to get_elf_object_for_member
3708 if we searched for the archive and this is the first included
3709 object.
3710
4dbfafcc
ILT
37112010-12-01 Ian Lance Taylor <iant@google.com>
3712
3713 * dwarf_reader.h (class Sized_dwarf_line_info): Add
3714 track_relocs_type_ field.
3715 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3716 Set track_relocs_type_.
3717 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
3718 contents when using RELA relocs.
3719 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
3720 reloc_map_.
3721 * reloc.cc (Track_relocs::next_addend): New function.
3722 * reloc.h (class Track_relocs): Declare next_addend.
3723
e5e19edd
ILT
37242010-12-01 Ian Lance Taylor <iant@google.com>
3725
3726 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
3727 virtual destructor.
3728
9a5ce24c
ILT
37292010-12-01 Ian Lance Taylor <iant@google.com>
3730
3731 * README: Update compilers known to work and fail.
3732
c7791212
NC
37332010-11-23 Matthias Klose <doko@ubuntu.com>
3734
3735 * configure.in: For --enable-gold, handle value `default' instead of
3736 `both*'. Always install ld as ld.bfd, install as ld if gold is
3737 not the default.
3738 * configure: Regenerate.
3739
0ad220c9
DK
37402010-11-18 Doug Kwan <dougkwan@google.com>
3741
3742 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
3743 and right_alignment to be zero. Store result alignment only if it is
3744 greater than existing alignment.
3745
ab8056e0
CC
37462010-11-16 Cary Coutant <ccoutant@google.com>
3747
3748 PR gold/12220
3749 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3750 Check for ".zdebug_line".
3751
fd064a5b
CC
37522010-11-16 Doug Kwan <dougkwan@google.com>
3753 Cary Coutant <ccoutant@google.com>
3754
3755 * output.h (Output_segment::set_section_addresses): Pass increase_relro
3756 by reference; adjust all callers.
3757 * output.cc (Output_segment::set_section_addresses): Adjust references
3758 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
3759 list is empty.
3760 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
3761 end at page boundary.
3762
6fc6ea19
CC
37632010-11-16 Cary Coutant <ccoutant@google.com>
3764
3765 PR gold/12220
3766 * layout.cc (Layout::choose_output_section): Transform names of
3767 compressed sections even when using a script with a SECTIONS clause.
3768 (Layout::output_section_name): Remove code to transform
3769 compressed debug section names.
3770 * output.cc (Output_section::add_input_section): Use uncompressed
3771 section size when tracking input sections.
3772
95a2c8d6
RS
37732010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
3774
3775 * symtab.h (Symbol::NON_PIC_REF): Remove.
3776 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
3777 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
3778 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
3779 (Symbol::use_plt_offset): Take a flags argument and pass it
3780 directly to needs_dynamic_reloc. Restrict check for undefined
3781 weak symbols to function calls.
3782 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
3783 (Target_arm::Scan::global): Use it.
3784 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
3785 (Target_arm::Relocate::relocate): Likewise.
3786 (Target_arm::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_arm::Relocate::relocate): Update accordingly.
3790 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
3791 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
3792 (Target_i386::Scan::global): Likewise.
3793 (Target_i386::Relocate::relocate): Likewise.
3794 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
3795 parameter with an r_type parameter. Use get_reference_flags
3796 to get the flags.
3797 (Target_i386::Relocate::relocate): Update accordingly.
3798 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
3799 (Target_powerpc::Scan::global): Use it.
3800 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
3801 (Target_powerpc::Relocate::relocate): Likewise.
3802 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
3803 (Target_sparc::Scan::global): Use it.
3804 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
3805 (Target_sparc::Relocate::relocate): Likewise.
3806 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
3807 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
3808 (Target_x86_64::Scan::global): Likewise.
3809 (Target_x86_64::Relocate::relocate): Likewise.
3810
f625ae50
DK
38112010-11-08 Doug Kwan <dougkwan@google.com>
3812 Cary Coutant <ccoutant@google.com>
3813
3814 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
3815 (Arm_exidx_merge_section::section_contents_): New data member.
3816 (Arm_input_section::Arm_input_section): Initialize original_contents_.
3817 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 3818 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
3819 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
3820 in parameters instead of calling Object::section_contents without
3821 locking.
3822 (Arm_output_section::group_section): New parameter TASK. Pass it
3823 to callees that need locking objects.
3824 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
3825 to lock EXIDX input sections. Fix a formatting issue. Call
3826 Arm_exidx_merged_section::build_contents to create merged section
3827 contents.
3828 (Arm_output_section::create_stub_group): New parameter TASK. Use it
3829 to lock object of stub table owner.
3830 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
3831 TEXT_SIZE to initialize data member TEXT_SIZE_.
3832 (Arm_exidx_input_section::addralign): Fix typo in comment.
3833 (Arm_exidx_input_section::text_size): New method.
3834 (Target_arm::do_relax): New parameter TASK. Pass it to callees
3835 that require locking objects. Lock objects before scanning for stubs
3836 and updating local symbols.
3837 (Arm_input_section<big_endian>::init): Copy contents of original
3838 input section.
2e702c99 3839 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
3840 original input section instead of calling Object::section_contents
3841 without locking.
3842 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
3843 size without calling Object::section_size().
3844 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
3845 for size. Allocate a buffer for merged EXIDX entries.
3846 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 3847 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
3848 building code to Arm_exidx_merged_section::build_contetns. Write
3849 out contetns in buffer instead of building it on the fly.
3850 (Arm_relobj::make_exidx_input_section): Also pass text section size
3851 to Arm_exidx_input_section constructor.
3852 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
3853 (Arm_dynobj::do_read_symbols): Fix memory leak.
3854 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
3855 * target.h: (class Task): Add forward declaration.
3856 (Target::relax): Add new parameter TASK and pass it to
3857 Target::do_relax().
3858 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
3859
5f9bcf58
CC
38602010-11-05 Cary Coutant <ccoutant@google.com>
3861
3862 PR gold/10708
3863 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
3864 object when reading from the file.
3865 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
3866 second layout pass.
3867 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
3868 when reading section contents.
3869 (get_section_contents): Likewise.
3870 (icf::find_identical_sections): Likewise.
3871 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
3872 object when reading from the file.
3873 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
3874 the object when doing deferred section layout.
3875
e597fa08
NC
38762010-11-03 Nick Clifton <nickc@redhat.com>
3877
3878 PR gold/12001
3879 * script.h (class Symbol_assignment: name): New member. Returns
3880 the name of the symbol.
3881 * scrfipt.cc (Script_options::is_pending_assignment): New member.
3882 Returns true if the given symbol name is on the list of
3883 assignments wating to be processed.
3884 * archive.cc (should_incldue_member): If the symbol is undefined,
3885 check to see if it is on the list of symbols pending assignment.
3886
3f9a3278
ILT
38872010-11-03 Ryan Mansfield <rmansfield@qnx.com>
3888
3889 * script-sections.cc (Script_sections::find_memory_region): Check
3890 for a NULL output section pointer.
3891
d06fb4d1
DK
38922010-10-29 Doug Kwan <dougkwan@google.com>
3893
3894 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
3895 Output_section::add_relaxed_input_section.
3896 * output.cc (Output_section::add_relaxed_input_section): Add new
3897 arguments LAYOUT and NAME. Set section order index.
3898 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
3899 Copy section order index.
3900 * output.h (Output_section::add_relaxed_input_section): Add new
3901 arguments LAYOUT and NAME.
3902
90e24de5
ILT
39032010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3904
3905 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 3906 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
3907 * testsuite/Makefile.in: Regenerate.
3908
c9484ea5
DK
39092010-10-20 Doug Kwan <dougkwan@google.com>
3910
3911 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
3912 without SHF_LINK_ORDER flags.
3913 * layout.cc (Layout::choose_output_section): Do not filter
3914 SHF_LINK_ORDER flag in a relocatable link.
3915
5bc2f5be
CC
39162010-10-17 Cary Coutant <ccoutant@google.com>
3917
3918 * output.h (Output_segment::set_section_addresses): Change function
3919 signature. Update all callers.
3920 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
3921 sections.
3922 (Output_segment::set_section_addresses): Align after last TLS
3923 section. Add padding before last relro section instead of after.
3924
0c91cf04
DK
39252010-10-17 Doug Kwan <dougkwan@google.com>
3926
3927 * gold/arm.cc (Target_arm::got_section): Use correct order and set
3928 GOT output section to be writable.
3929
8c21d9d3
CC
39302010-10-14 Cary Coutant <ccoutant@google.com>
3931
3932 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
3933 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
3934 * gold.cc (queue_initial_tasks): Check parameters for incremental link
3935 mode.
3936 * incremental.cc (report_command_line): Ignore all forms of
3937 --incremental.
3938 * layout.cc (Layout::Layout): Check parameters for incremental link
3939 mode.
3940 * options.cc (General_options::parse_incremental): New function.
3941 (General_options::parse_no_incremental): New function.
3942 (General_options::parse_incremental_full): New function.
3943 (General_options::parse_incremental_update): New function.
3944 (General_options::incremental_mode_): New data member.
3945 (General_options::finalize): Check incremental_mode_.
3946 * options.h (General_options): Update help text for --incremental.
3947 Add --no-incremental, --incremental-full, --incremental-update.
3948 (General_options::Incremental_mode): New enum type.
3949 (General_options::incremental_mode): New function.
3950 (General_options::incremental_mode_): New data member.
3951 * parameters.cc (Parameters::incremental_mode_): New data member.
3952 (Parameters::set_options): Set incremental_mode_.
3953 (Parameters::set_incremental_full): New function.
3954 (Parameters::incremental): New function.
3955 (Parameters::incremental_update): New function.
3956 (set_parameters_incremental_full): New function.
3957 * parameters.h (Parameters::set_incremental_full): New function.
3958 (Parameters::incremental): New function.
3959 (Parameters::incremental_update): New function.
3960 (Parameters::incremental_mode_): New data member.
3961 (set_parameters_incremental_full): New function.
3962 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
3963 incremental link mode.
3964 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
3965 (Sized_relobj::do_relocate_sections): Likewise.
3966 * testsuite/Makefile.am (incremental_test): Use --incremental-full
3967 option.
3968 * testsuite/Makefile.in: Regenerate.
3969 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 3970
bb32aa18 39712010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
3972
3973 * script-sections.h (class Script_sections): Make
3974 Sections_elements typedef public.
3975 * script-sections.cc (class Sort_output_sections): Add elements_
3976 field. Add constructor which sets it; change all callers.
3977 (Sort_output_sections::is_before): New function.
3978 (Sort_output_sections::operator()): Call is_before.
3979 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
3980 conditional.
3981 * testsuite/script_test_10.sh: New test. Test script section
3982 order.
3983 * testsuite/script_test_10.t: Likewise.
3984 * testsuite/script_test_10.s: Likewise.
3985 * testsuite/Makefile.am: Wrap the cross linker tests and the
3986 common tests into NATIVE_OR_CROSS_LINKER.
3987 (check_SCRIPTS): Add script_test_10.sh.
3988 (check_DATA): Add script_test_10.stdout.
3989 (script_test_10.o, script_test_10): New targets.
3990 (script_test_10.stdout): New target.
3991 * configure, testsuite/Makefile.in: Regenerate.
3992
3cef7179
ILT
39932010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3994
3995 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
3996 error for the deprecated relocations.
3997 (Target_arm::Scan::global): Likewise.
3998 (Target_arm::Relocate::relocate): Likewise.
3999
7411e9a8
RS
40002010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
4001
4002 * fileread.cc (Input_file::find_file): Initialize *found_name
4003 and *namep when using the fallback search for case 4.
4004
6a9da32a
CC
40052010-10-11 Cary Coutant <ccoutant@google.com>
4006
4007 * options.h (class General_options): Redefine -z lazy as an alias for
4008 the negation of -z now.
4009
ac897c20
ILT
40102010-10-11 Ian Lance Taylor <iant@google.com>
4011
4012 * resolve.cc (symbol_to_bits): Report the value of the unsupported
4013 binding.
4014
ea5cae92
NC
40152010-10-06 Nick Clifton <nickc@redhat.com>
4016
4017 * script-sections.cc(class Memory_region): Remove
4018 current_lma_offset_ field. Rename current_vma_offset_ to
4019 current_offset_. Add last_section_ field.
4020 (Memory_region::get_current_vma_address): Rename to
4021 get_current_address.
4022 (Memory_region::get_current_lma_address): Delete.
4023 (Memory_region::increment_vma_offset): Rename to
4024 increment_offset.
4025 (Memory_region::increment_lma_offset): Delete.
4026 (Memory_region::attributes_compatible): New method. Returns
4027 true if the provided section is compatible with the region.
4028 (Memory_region::get_last_section): New method. Returns the last
4029 section to use the region.
4030 (Memory_region::set_last_section): New method. Stores the last
4031 section to use the region.
4032 (Script_sections::block_in_region): New method. Returns true if
4033 a block of memory is contained within a region.
4034 (Script_sections::find_memory_region): New method. Locates a
4035 memory region to be used to set a VMA or LMA address.
4036 (Output_section_definition::set_section_addresses): Add code to
4037 check for addresses set by memory regions.
4038 (Output_segment::set_section_addresses): Remove memory region
4039 walking code.
4040 (Script_sections::create_segment): Add a warning if a header
4041 segment is created outside of any region.
4042 * script-sections.h (class Script_sections): Add prototypes for
4043 find_memory_region and block_in_region methods.
4044 * testsuite/memory_test.s: Use .long instead of .word.
4045 * testsuite/memory_test.t: Add some more output sections.
4046 * testsuite/memory_test.sh: Update expected output.
4047
a9bfd952
DK
40482010-10-02 Doug Kwan <dougkwan@google.com>
4049
4050 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
4051 defintion to symtab.h
4052 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
4053 declaration to defintion.
4054
bacff3ab
NC
40552010-10-01 Nick Clifton <nickc@redhat.com>
4056
4057 * expression.cc (eval): Replace dummy argument with NULL.
4058 (eval_maybe_dot): Check for a NULL result section pointer.
4059 (Symbol_expression::value): Likewise.
4060 (Dot_expression::value): Likewise.
4061 (BINARY_EXPRESSION): Likewise.
4062 (Max_expression::value): Likewise.
4063 (Min_expression::value): Likewise.
4064 (Absolute_expression::value): Likewise.
4065 (Addr_expression::value_from_output_section): Likewise.
4066 (Loaddddr_expression::value_from_output_section): Likewise.
4067 (Segment_start_expression::value): Likewise.
4068 * script-sections.cc
4069 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
4070 argument with NULL.
4071 (Sections_elememt_dot_assignment::set_section_addresses):
4072 Likewise.
4073 (Output_data_expression::do_write_to_buffer): Likewise.
4074 (Output_section_definition::finalize_symbols): Likewise.
4075 (Output_section_definition::set_section_addresses): Likewise.
4076
f81bc8b5
DK
40772010-09-30 Doug Kwan <dougkwan@google.com>
4078
4079 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
4080
c95e9f27
ST
40812010-09-28 Sriraman Tallam <tmsriram@google.com>
4082
4083 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 4084 function.
c95e9f27
ST
4085 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
4086 virtual function.
4087 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
4088 virtual function.
4089 * icf.cc (get_section_contents): Inline merge sections only when
4090 target allows it.
4091
3cac54d2
RW
40922010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4093
4094 * configure: Regenerate.
4095
2904037a
ILT
40962010-09-17 Ian Lance Taylor <iant@google.com>
4097
4098 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
4099 * testsuite/Makefile.am (memory_test.o): New target.
4100 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
4101 memory_test.t.
4102 * testsuite/Makefile.in: Rebuild.
2904037a 4103
bca7fb63
DK
41042010-09-17 Doug Kwan <dougkwan@google.com>
4105
4106 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
4107 defintion if relocation uses GOT entries of the symbol.
4108 * testsuite/icf_safe_test.sh: Fix test.
4109 * testsuite/icf_safe_so_test.sh: Fix test.
4110
4ef28648
CC
41112010-09-16 Cary Coutant <ccoutant@google.com>
4112
4113 * script_sections.cc (class Memory_region): Remove "NULL" from
4114 vector initializations.
4115
793990de
CC
41162010-09-15 Cary Coutant <ccoutant@google.com>
4117
4118 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
4119 Resolve forwarding symbols.
4120
81e015e2
DK
41212010-09-15 Doug Kwan <dougkwan@google.com>
4122
4123 * gold/testsuite/script_test_3.t: Add ARM special sections.
4124 * gold/testsuite/script_test_4.t: Same.
4125 * gold/testsuite/script_test_5.t: Same.
4126 * gold/testsuite/script_test_6.t: Same.
4127 * gold/testsuite/script_test_7.t: Same.
4128 * gold/testsuite/script_test_7.t: Same.
4129 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
4130
36171d64
CC
41312010-09-14 Cary Coutant <ccoutant@google.com>
4132
4133 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
4134 (Target_x86_64::Relocate::relocate_tls): Replace check for
4135 saw_tls_block_reloc_ with test for executable section.
4136
d89051bd
CC
41372010-09-12 Cary Coutant <ccoutant@google.com>
4138
4139 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
4140 position-independent executables to shared libraries need dynamic
4141 relocations.
4142 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
4143 position-independent executables.
4144 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
4145 * testsuite/Makefile.in: Regenerate.
4146
fca41f0f
NC
41472010-09-10 Nick Clifton <nickc@redhat.com>
4148
4149 PR gold/11997
4150 * testsuite/memory_test.t: Discard any sections that are not
4151 needed.
4152
6695e4b3
L
41532010-09-09 H.J. Lu <hongjiu.lu@intel.com>
4154
4155 PR gold/11996
4156 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
4157 "This::" to work around a bug in gcc 4.2.
4158
4159 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
4160
0f72bf6f
RÁE
41612010-09-09 Rafael Espindola <espindola@google.com>
4162
4163 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
4164 sections with different PF_X flags in the same segment.
4165 (Layout::find_first_load_seg): Search all segments to find the first
4166 one.
4167 * options.h (rosegment): New.
4168
41692010-09-08 Rafael Espindola <espindola@google.com>
a6577478 4170
05a79166 4171 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 4172
aa98ff75
DK
41732010-09-08 Doug Kwan <dougkwan@google.com>
4174
4175 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
4176 (Arm_relobj::do_relocate_sections): Add new parameter for output
4177 file to match the parent.
4178 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
4179 of local symbols instead of input values. Update code to track
4180 changes in gold::relocate_section.
4181 * object.cc (Sized_relobj::compute_final_local_value): New methods.
4182 (Sized_relobj::compute_final_local_value_internal): New methods.
4183 (Sized_relobj::do_finalize_local_symbols): Move code from loop
4184 body into private version of Sized_relobj::compute_final_local_value.
4185 Call the inline method.
4186 * object.h (Symbol_value::Symbol_value): Define destructor. Free
4187 merged symbol value if there is one.
4188 (Symbol_value::has_output_value): New method defintiion.
4189 (Sized_relobj::Compute_final_local_value_status): New enum type.
4190 (Sized_relobj::compute_final_local_value): New methods.
4191 (Sized_relobj::compute_final_local_value_internal): New methods.
4192 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
4193 and arm_cortex_a8.sh.
4194 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
4195 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
4196 New tests.
4197 * Makefile.in: Regenerate.
4198 * testsuite/arm_bl_out_of_range.s: Update test.
4199 * testsuite/thumb_bl_out_of_range.s: Ditto.
4200 * testsuite/thumb_blx_out_of_range.s: Ditto.
4201 * testsuite/arm_branch_out_of_range.sh: New file.
4202 * testsuite/arm_cortex_a8.sh: Ditto.
4203 * testsuite/arm_cortex_a8_b.s: Ditto.
4204 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
4205 * testsuite/arm_cortex_a8_b_local.s: Ditto.
4206 * testsuite/arm_cortex_a8_bl.s: Ditto.
4207 * testsuite/arm_cortex_a8_blx.s: Ditto.
4208 * testsuite/arm_cortex_a8_local.s: Ditto.
4209 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
4210 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
4211
05a79166
L
42122010-09-08 Rafael Espindola <espindola@google.com>
4213
4214 * Makefile.am (memory_test.stdout): Run readelf with -W.
4215 * Makefile.in: Regenerate.
4216 * testsuite/memory_test.sh: Make the regexps accept both 32 and
4217 64 bit output.
4218
33dbc701
RÁE
42192010-09-08 Rafael Espindola <espindola@google.com>
4220
4221 * script-sections.cc (Script_sections::add_memory_region): Convert
4222 field precision to int.
4223 * script.cc (script_set_section_region, script_set_section_region):
4224 Convert field precision to int.
4225
731ca54a
RÁE
42262010-09-08 Rafael Espindola <espindola@google.com>
4227
4228 * arm.cc (do_finalize_sections): Create the __exidx_start and
4229 __exdix_end symbols even when the section is missing.
4230
7f8cd844
NC
42312010-09-08 Nick Clifton <nickc@redhat.com>
4232
4233 * README: Remove claim that MEMORY is not supported.
4234 * expression.cc (script_exp_function_origin)
4235 (script_exp_function_length): Move from here to ...
4236 * script.cc: ... here.
4237 (script_set_section_region, script_add_memory)
4238 (script_parse_memory_attr, script_include_directive): New
4239 functions.
4240 * script-sections.cc
4241 (class Memory_region): New class.
4242 (class Output_section_definition): Add set_memory_region,
4243 set_section_vma, set_section_lma and get_section_name methods.
4244 (class Script_Sections): Add add_memory_region,
4245 find_memory_region, find_memory_region_origin,
4246 find_memory_region_length and set_memory_region methods.
4247 Have set_section_addresses method walk the list of set memory
4248 regions.
4249 Extend the print methos to display memory regions.
4250 * script-sections.h: Add prototypes for new methods.
4251 Add enum for MEMORY region attributes.
4252 * yyscript.y: Add support for parsing MEMORY regions.
4253 * script-c.h: Add prototypes for new functions.
4254 * testsuite/Makefile.am: Add test of MEMORY region functionality.
4255 * testsuite/Makefile.in: Regenerate.
4256 * testsuite/memory_test.sh: New script.
4257 * testsuite/memory_test.s: New assembler source file.
4258 * testsuite/memory_test.t: New linker script.
4259
a4649286
DK
42602010-08-27 Doug Kwan <dougkwan@google.com>
4261
4262 * gold/resolve.cc (Symbol_table::should_override): Let a weak
4263 reference override an existing dynamic weak reference.
4264 * testsuite/Makefile.am: Add new test dyn_weak_ref.
4265 * testsuite/Makefile.in: Regenerate.
4266 * testsuite/dyn_weak_ref.sh: New file.
4267 * testsuite/dyn_weak_ref_1.c: Ditto.
4268 * testsuite/dyn_weak_ref_2.c: Ditto.
4269
b56648ad
ILT
42702010-08-27 Ian Lance Taylor <iant@google.com>
4271
4272 * incremental.h (class Incremental_input_entry): Add virtual
4273 destructor.
4274
809313cb
ILT
42752010-08-27 Ian Lance Taylor <iant@google.com>
4276
4277 * testsuite/start_lib_test_3.c: Mark t3 as used.
4278
11e32464
NC
42792010-08-27 Nick Clifton <nickc@redhat.com>
4280
4281 * options.cc (version_script): Fix small typo in previous
4282 whitespace tidyup.
4283
ca09d69a
NC
42842010-08-25 Nick Clifton <nickc@redhat.com>
4285
4286 * archive.cc: Formatting fixes: Remove whitespace between
4287 typename and following asterisk. Remove whitespace between
4288 function name and opening parenthesis.
4289 * archive.h: Likewise.
4290 * arm.cc: Likewise.
4291 * attributes.cc: Likewise.
4292 * attributes.h: Likewise.
4293 * common.cc: Likewise.
4294 * copy-relocs.cc: Likewise.
4295 * dirsearch.h: Likewise.
4296 * dynobj.cc: Likewise.
4297 * ehframe.cc: Likewise.
4298 * ehframe.h: Likewise.
4299 * expression.cc: Likewise.
4300 * fileread.cc: Likewise.
4301 * fileread.h: Likewise.
4302 * gc.h: Likewise.
4303 * gold-threads.cc: Likewise.
4304 * gold.cc: Likewise.
4305 * i386.cc: Likewise.
4306 * icf.h: Likewise.
4307 * incremental-dump.cc: Likewise.
4308 * incremental.cc: Likewise.
4309 * layout.cc: Likewise.
4310 * layout.h: Likewise.
4311 * main.cc: Likewise.
4312 * merge.cc: Likewise.
4313 * merge.h: Likewise.
4314 * object.cc: Likewise.
4315 * object.h: Likewise.
4316 * options.cc: Likewise.
4317 * options.h: Likewise.
4318 * output.cc: Likewise.
4319 * output.h: Likewise.
4320 * plugin.cc: Likewise.
4321 * plugin.h: Likewise.
4322 * powerpc.cc: Likewise.
4323 * reloc.cc: Likewise.
4324 * script-c.h: Likewise.
4325 * script-sections.cc: Likewise.
4326 * script.cc: Likewise.
4327 * stringpool.cc: Likewise.
4328 * symtab.cc: Likewise.
4329 * symtab.h: Likewise.
4330 * target.cc: Likewise.
4331 * timer.cc: Likewise.
4332 * timer.h: Likewise.
4333 * version.cc: Likewise.
4334 * x86_64.cc: Likewise.
4335
b8fa8750
NC
43362010-08-24 Nick Clifton <nickc@redhat.com>
4337
4338 PR 11899
4339 * layout.cc (segment_precedes): Sort segments by their physical
4340 addresses, if they have been set.
4341
9919d93b
CC
43422010-08-23 Cary Coutant <ccoutant@google.com>
4343
4344 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
4345 symbols data.
4346 (Lib_group::include_member): Unlock object after deleting its
4347 symbols data.
4348 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
4349 the bug fixed here.
4350
97b4be1c
CC
43512010-08-19 Neil Vachharajani <nvachhar@google.com>
4352 Cary Coutant <ccoutant@google.com>
4353
4354 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
4355 constructor, and set_blocker.
4356 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
4357 readsyms_blocker_.
4358 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
4359 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
4360 * testsuite/Makefile.am (start_lib_test): New test case.
4361 * testsuite/Makefile.in: Regenerate.
4362 * testsuite/start_lib_test_main.c: New file.
4363 * testsuite/start_lib_test_1.c: New file.
4364 * testsuite/start_lib_test_2.c: New file.
4365 * testsuite/start_lib_test_3.c: New file.
4366
dd0b1884
ILT
43672010-08-19 Ian Lance Taylor <iant@google.com>
4368
4369 * Makefile.in: Rebuild with automake 1.11.1.
4370 * aclocal.m4: Likewise.
4371 * testsuite/Makefile.in: Likewise.
4372
7223e9ca
ILT
43732010-08-19 Ian Lance Taylor <iant@google.com>
4374
4375 PR 10893
4376 * i386.cc (class Output_data_plt_i386): Update declarations.
4377 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
4378 local_ifuncs_ fields.
4379 (Target_i386::do_plt_section_for_global): New function.
4380 (Target_i386::do_plt_section_for_local): New function.
4381 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
4382 parameter; change all callers. Initialize global_ifuncs_ and
4383 local_ifuncs_. If doing a static link define __rel_iplt_start and
4384 __rel_iplt_end.
4385 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
4386 (Output_data_plt_i386::add_local_ifunc_entry): New function.
4387 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
4388 symbols.
4389 (Target_i386::make_plt_section): New function, broken out of
4390 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
4391 (Target_i386::make_plt_entry): Call make_plt_section.
4392 (Target_i386::make_local_ifunc_plt_entry): New function.
4393 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
4394 (Target_i386::Scan::local): Handle IFUNC symbols. Add
4395 R_386_IRELATIVE to switch.
4396 (Target_i386::Scan::global): Likewise.
4397 (Target_i386::Relocate::relocate): Likewise.
4398 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
4399 switch.
4400 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
4401 (Target_x86_64::do_plt_section_for_global): New function.
4402 (Target_x86_64::do_plt_section_for_local): New function.
4403 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
4404 parameter; change all callers. If doing a static link define
4405 __rela_iplt_start and __rela_iplt_end.
4406 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
4407 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
4408 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
4409 to point to .plt.
4410 (Target_x86_64::make_local_ifunc_plt_entry): New function.
4411 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
4412 switch.
4413 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
4414 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
4415 R_X86_64_IRELATIVE to switch.
4416 (Target_x86_64::Scan::global): Likewise.
4417 (Target_x86_64::Relocate::relocate): Likewise.
4418 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
4419 switch.
4420 * target.h (class Target): Add plt_section_for_global and
4421 plt_section_for_local functions. Add do_plt_section_for_global
4422 and do_plt_section_for_local virtual functions.
4423 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
4424 clarifying comments.
4425 (Symbol::use_plt_offset): Handle IFUNC symbol.
4426 * object.cc (Sized_relobj::Sized_relobj): Initialize
4427 local_plt_offsets_.
4428 (Sized_relobj::local_has_plt_offset): New function.
4429 (Sized_relobj::local_plt_offset): New function.
4430 (Sized_relobj::set_local_plt_offset): New function.
4431 (Sized_relobj::do_count): Handle IFUNC symbol.
4432 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
4433 a bit away from input_shndx_ field. Add set_is_func_symbol and
4434 is_ifunc_symbol functions.
4435 (class Sized_relobj): Update declarations. Remove Tls_got_entry
4436 and Local_tls_got_offsets. Define Local_plt_offsets. Add
4437 local_plt_offsets_ field.
4438 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
4439 * output.h (class Output_section_data): Add non-const
4440 output_section function.
4441 (class Output_data_got): Update declarations.
4442 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
4443 Add use_plt_offset parameter to global and local constructors.
4444 Change all callers. Change local_sym_index_ field to 31 bits.
4445 Change GSYM_CODE and CONSTANT_CODE accordingly.
4446 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
4447 doing a static link don't set sh_link field.
4448 (Output_data_got::Got_entry::write): Use PLT offset if
4449 appropriate.
4450 (Output_data_got::add_global_plt): New function.
4451 (Output_data_got::add_local_plt): New function.
4452 * target-reloc.h (relocate_section): Handle IFUNC symbol.
4453 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
4454 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
4455 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
4456 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
4457 IFUNC conditional.
4458 * testsuite/ifunc-sel.h: New file.
4459 * testsuite/ifuncmain1.c: New file.
4460 * testsuite/ifuncmain1vis.c: New file.
4461 * testsuite/ifuncmod1.c: New file.
4462 * testsuite/ifuncdep2.c: New file.
4463 * testsuite/ifuncmain2.c: New file.
4464 * testsuite/ifuncmain3.c: New file.
4465 * testsuite/ifuncmod3.c: New file.
4466 * testsuite/ifuncmain4.c: New file.
4467 * testsuite/ifuncmain5.c: New file.
4468 * testsuite/ifuncmod5.c: New file.
4469 * testsuite/ifuncmain6pie.c: New file.
4470 * testsuite/ifuncmod6.c: New file.
4471 * testsuite/ifuncmain7.c: New file.
4472 * configure, testsuite/Makefile.in: Rebuild.
4473
56f75c03
ILT
44742010-08-18 Ian Lance Taylor <iant@google.com>
4475
4476 * incremental.cc
4477 (Output_section_incremental_inputs::write_input_files): Add cast
4478 to avoid signed/unsigned comparison warning.
4479 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4480
55455f89
CC
44812010-08-12 Cary Coutant <ccoutant@google.com>
4482
4483 * common.cc (Sort_commons::operator()): Remove unnecessary code.
4484
e2054bcb
ILT
44852010-08-13 Ian Lance Taylor <iant@google.com>
4486
4487 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
4488
74f67560
DK
44892010-08-12 Cary Coutant <ccoutant@google.com>
4490 Doug Kwan <dougkwan@google.com>
4491
4492 * resolve.cc (Symbol_table::should_override): When a weak dynamic
4493 defintion overrides non-weak undef, remember that the original undef
4494 is not weak.
4495 * symtab.cc (Symbol_table::sized_write_global): For undef without
4496 an original weak binding, set binding to global in output.
4497 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
4498 * testsuite/Makefile.in: Regenerate.
4499 * testsuite/strong_ref_weak_def.sh: New file.
4500 * testsuite/strong_ref_weak_def_1.c: Ditto.
4501 * testsuite/strong_ref_weak_def_2.c: Ditto.
4502
d1238d12
CC
45032010-08-12 Cary Coutant <ccoutant@google.com>
4504
4505 * testsuite/incremental_test.sh: Rewrite.
4506 * testsuite/incremental_test_1.c: Rewrite.
4507 * testsuite/incremental_test_2.c: Rewrite.
4508
0e70b911
CC
45092010-08-12 Cary Coutant <ccoutant@google.com>
4510
4511 * arm.cc (Target_arm::got_size): Add const.
4512 (Target_arm::got_entry_count): New function.
4513 (Target_arm::plt_entry_count): New function.
4514 (Target_arm::first_plt_entry_offset): New function.
4515 (Target_arm::plt_entry_size): New function.
4516 (Output_data_plt_arm::entry_count): New function.
4517 (Output_data_plt_arm::first_plt_entry_offset): New function.
4518 (Output_data_plt_arm::get_plt_entry_size): New function.
4519 * i386.cc (Target_i386::got_size): Add const.
4520 (Target_i386::got_entry_count): New function.
4521 (Target_i386::plt_entry_count): New function.
4522 (Target_i386::first_plt_entry_offset): New function.
4523 (Target_i386::plt_entry_size): New function.
4524 (Output_data_plt_i386::entry_count): New function.
4525 (Output_data_plt_i386::first_plt_entry_offset): New function.
4526 (Output_data_plt_i386::get_plt_entry_size): New function.
4527 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
4528 find_incremental_inputs_sections. Dump incremental_got_plt section.
4529 * incremental.cc: Include target.h.
4530 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
4531 parameter. Adjust all callers. Find incremental_got_plt section.
4532 (Incremental_inputs::create_data_sections): Create incremental_got_plt
4533 section.
4534 (Output_section_incremental_inputs::set_final_data_size): Calculate
4535 size of incremental_got_plt section.
4536 (Output_section_incremental_inputs::do_write): Write the
4537 incremental_got_plt section.
4538 (Got_plt_view_info): New struct.
4539 (Local_got_offset_visitor): New class.
4540 (Global_got_offset_visitor): New class.
4541 (Global_symbol_visitor_got_plt): New class.
4542 (Output_section_incremental_inputs::write_got_plt): New function.
4543 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
4544 Add parameter. Adjust all callers.
4545 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4546 (Incremental_inputs::got_plt_section): New function.
4547 (Incremental_inputs::got_plt_section_): New data member.
4548 (Incremental_got_plt_reader): New class.
4549 * layout.cc (Layout::create_incremental_info_sections): Add the
4550 incremental_got_plt section.
4551 * object.h (Got_offset_list::get_list): New function.
4552 (Got offset_list::for_all_got_offsets): New function.
4553 (Sized_relobj::local_got_offset_list): New function.
4554 * powerpc.cc (Target_powerpc::got_size): Add const.
4555 (Target_powerpc::got_entry_count): New function.
4556 (Target_powerpc::plt_entry_count): New function.
4557 (Target_powerpc::first_plt_entry_offset): New function.
4558 (Target_powerpc::plt_entry_size): New function.
4559 (Output_data_plt_powerpc::entry_count): New function.
4560 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
4561 (Output_data_plt_powerpc::get_plt_entry_size): New function.
4562 * sparc.cc (Target_sparc::got_size): Add const.
4563 (Target_sparc::got_entry_count): New function.
4564 (Target_sparc::plt_entry_count): New function.
4565 (Target_sparc::first_plt_entry_offset): New function.
4566 (Target_sparc::plt_entry_size): New function.
4567 (Output_data_plt_sparc::entry_count): New function.
4568 (Output_data_plt_sparc::first_plt_entry_offset): New function.
4569 (Output_data_plt_sparc::get_plt_entry_size): New function.
4570 * symtab.h (Symbol::got_offset_list): New function.
4571 (Symbol_table::for_all_symbols): New function.
4572 * target.h (Sized_target::got_entry_count): New function.
4573 (Sized_target::plt_entry_count): New function.
4574 (Sized_target::plt_entry_size): New function.
4575 * x86_64.cc (Target_x86_64::got_size): Add const.
4576 (Target_x86_64::got_entry_count): New function.
4577 (Target_x86_64::plt_entry_count): New function.
4578 (Target_x86_64::first_plt_entry_offset): New function.
4579 (Target_x86_64::plt_entry_size): New function.
4580 (Output_data_plt_x86_64::entry_count): New function.
4581 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
4582 (Output_data_plt_x86_64::get_plt_entry_size): New function.
4583
09ec0418
CC
45842010-08-12 Cary Coutant <ccoutant@google.com>
4585
4586 * archive.cc: Include incremental.h.
4587 (Archive::Archive): Initialize incremental_info_.
4588 (Archive::include_member): Record archive members in incremental info.
4589 (Add_archive_symbols::run): Record begin and end of an archive in
4590 incremental info.
4591 (Lib_group::include_member): Record objects in incremental info.
4592 * archive.h (Incremental_archive_entry): Forward declaration.
4593 (Archive::set_incremental_info): New member function.
4594 (Archive::incremental_info): New member function.
4595 (Archive::Unused_symbol_iterator): New class.
4596 (Archive::unused_symbols_begin): New member function.
4597 (Archive::unused_symbols_end): New member function.
4598 (Archive::incremental_info_): New data member.
4599 * incremental-dump.cc (find_input_containing_global): New function.
4600 (dump_incremental_inputs): Dump new incremental info sections.
4601 * incremental.cc: Include symtab.h.
4602 (Output_section_incremental_inputs): New class.
4603 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
4604 new incremental info sections.
4605 (Sized_incremental_binary::do_check_inputs): Likewise.
4606 (Incremental_inputs::report_archive): Remove.
4607 (Incremental_inputs::report_archive_begin): New function.
4608 (Incremental_inputs::report_archive_end): New function.
4609 (Incremental_inputs::report_object): New function.
4610 (Incremental_inputs::finalize_inputs): Remove.
4611 (Incremental_inputs::report_input_section): New function.
4612 (Incremental_inputs::report_script): Rewrite.
4613 (Incremental_inputs::finalize): Do nothing but finalize string table.
4614 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
4615 (Incremental_inputs::sized_create_inputs_section_data): Remove.
4616 (Incremental_inputs::create_data_sections): New function.
4617 (Incremental_inputs::relocs_entsize): New function.
4618 (Output_section_incremental_inputs::set_final_data_size): New function.
4619 (Output_section_incremental_inputs::do_write): New function.
4620 (Output_section_incremental_inputs::write_header): New function.
4621 (Output_section_incremental_inputs::write_input_files): New function.
4622 (Output_section_incremental_inputs::write_info_blocks): New function.
4623 (Output_section_incremental_inputs::write_symtab): New function.
4624 * incremental.h (Incremental_script_entry): Forward declaration.
4625 (Incremental_object_entry): Forward declaration.
4626 (Incremental_archive_entry): Forward declaration.
4627 (Incremental_inputs): Forward declaration.
4628 (Incremental_inputs_header_data): Remove.
4629 (Incremental_inputs_header): Remove.
4630 (Incremental_inputs_header_write): Remove.
4631 (Incremental_inputs_entry_data): Remove.
4632 (Incremental_inputs_entry): Remove.
4633 (Incremental_inputs_entry_write): Remove.
4634 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
4635 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
4636 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4637 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
4638 Likewise.
4639 (Incremental_input_entry): New class.
4640 (Incremental_script_entry): New class.
4641 (Incremental_object_entry): New class.
4642 (Incremental_archive_entry): New class.
4643 (Incremental_inputs::Incremental_inputs): Initialize new data members.
4644 (Incremental_inputs::report_inputs): Remove.
4645 (Incremental_inputs::report_archive): Remove.
4646 (Incremental_inputs::report_archive_begin): New function.
4647 (Incremental_inputs::report_archive_end): New function.
4648 (Incremental_inputs::report_object): Change prototype.
4649 (Incremental_inputs::report_input_section): New function.
4650 (Incremental_inputs::report_script): Change prototype.
4651 (Incremental_inputs::get_reloc_count): New function.
4652 (Incremental_inputs::set_reloc_count): New function.
4653 (Incremental_inputs::create_data_sections): New function.
4654 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
4655 (Incremental_inputs::inputs_section): New function.
4656 (Incremental_inputs::symtab_section): New function.
4657 (Incremental_inputs::relocs_section): New function.
4658 (Incremental_inputs::get_stringpool): Add const.
4659 (Incremental_inputs::command_line): Add const.
4660 (Incremental_inputs::inputs): Remove.
4661 (Incremental_inputs::command_line_key): New function.
4662 (Incremental_inputs::input_file_count): New function.
4663 (Incremental_inputs::input_files): New function.
4664 (Incremental_inputs::relocs_entsize): New function.
4665 (Incremental_inputs::sized_create_inputs_section_data): Remove.
4666 (Incremental_inputs::finalize_inputs): Remove.
4667 (Incremental_inputs::Input_info): Remove.
4668 (Incremental_inputs::lock_): Remove.
4669 (Incremental_inputs::inputs_): Change type.
4670 (Incremental_inputs::inputs_map_): Remove.
4671 (Incremental_inputs::current_object_entry_): New data member.
4672 (Incremental_inputs::inputs_section_): New data member.
4673 (Incremental_inputs::symtab_section_): New data member.
4674 (Incremental_inputs::relocs_section_): New data member.
4675 (Incremental_inputs::reloc_count_): New data member.
4676 (Incremental_inputs_reader): New class.
4677 (Incremental_symtab_reader): New class.
4678 (Incremental_relocs_reader): New class.
4679 * layout.cc (Layout::finalize): Move finalization of incremental info
4680 and creation of incremental info sections to follow finalization of
4681 symbol table. Set offsets for postprocessing sections.
4682 (Layout::create_incremental_info_sections): Call
4683 Incremental_inputs::create_data_sections. Add incremental symtab
4684 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
4685 sections to layout after input sections.
4686 * layout.h (struct Timespec): Forward declaration.
4687 (Layout::incremental_inputs): Add const.
4688 (Layout::create_incremental_info_sections): Add parameter.
4689 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
4690 * object.cc: Include incremental.h.
4691 (Relobj::finalize_incremental_relocs): New function.
4692 (Sized_relobj::do_layout): Record input sections in incremental info.
4693 * object.h (Object::output_section): New function.
4694 (Object::output_section_offset): Moved from Relobj.
4695 (Object::get_incremental_reloc_base): New function.
4696 (Object::get_incremental_reloc_count): New function.
4697 (Object::do_output_section): New function.
4698 (Object::do_output_section_offset): Moved from Relobj.
4699 (Object::do_get_incremental_reloc_base): New function.
4700 (Object::do_get_incremental_reloc_count): New function.
4701 (Object::Object): Initialize new data members.
4702 (Relobj::output_section): Renamed do_output_section and moved to
4703 protected.
4704 (Relobj::output_section_offset): Moved to Object.
4705 (Relobj::do_get_incremental_reloc_base): New function.
4706 (Relobj::do_get_incremental_reloc_count): New function.
4707 (Relobj::allocate_incremental_reloc_counts): New function.
4708 (Relobj::count_incremental_reloc): New function.
4709 (Relobj::finalize_incremental_relocs): New function.
4710 (Relobj::next_incremental_reloc_index): New function.
4711 (Relobj::reloc_counts_): New data member.
4712 (Relobj::reloc_bases_): New data member.
4713 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
4714 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
4715 (Sized_relobj::incremental_relocs_scan): New function.
4716 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4717 (Sized_relobj::incremental_relocs_write): New function.
4718 (Sized_relobj::incremental_relocs_write_reltype): New function.
4719 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
4720 incremental link.
4721 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
4722 archives and object files elsewhere.
4723 (Add_symbols::run): Report object files here.
4724 (Finish_group::run): Report end of archive at end of group.
4725 * reloc.cc: Include layout.h, incremental.h.
4726 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
4727 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
4728 (Sized_relobj::incremental_relocs_scan): New function.
4729 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4730 (Sized_relobj::do_relocate_sections): Write incremental relocations.
4731 (Sized_relobj::incremental_relocs_write): New function.
4732 (Sized_relobj::incremental_relocs_write_reltype): New function.
4733 * script.cc (read_input_script): Rewrite test for incremental link.
4734 Change call to Incremental_inputs::report_script.
4735 * symtab.h (Symbol_table::first_global_index): New function.
4736 (Symbol_table::output_count): New function.
4737
ce0d1972
DK
47382010-08-12 Doug Kwan <dougkwan@google.com>
4739
4740 * arm.cc (Target_arm::merge_object_attributes): Check command line
4741 options --no-wchar-size-warning and --no-enum-size-warning.
4742 * options.h (General_options): Add ld-compatible options
4743 --no-enum-size-warning and --no-wchar-size-warning.
4744
6e5710ce
ILT
47452010-08-04 Ian Lance Taylor <iant@google.com>
4746
4747 * x86_64.cc (Target_x86_64::Scan::local): Use
4748 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
4749 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
4750 (Target_x86_64::Scan::global): Likewise.
4751 (Target_x86_64::Relocate::relocate): Likewise.
4752 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
4753 Likewise.
4754
fef830db
CC
47552010-08-03 Cary Coutant <ccoutant@google.com>
4756
4757 * merge.cc (Output_merge_string::do_add_input_section): Count strings
4758 to reserve space in merged_strings vector. Keep total input size
4759 for stats.
4760 (Output_merge_string::do_print_merge_stats): Print total input size.
4761 * merge.h (Output_merge_string): Add input_size_ field.
4762 * stringpool.cc (Stringpool_template::string_length): Move
4763 implementations out of Stringpool_template class and place in
4764 stringpool.h.
4765 * stringpool.h (string_length): Move out of Stringpool_template.
4766
1e3811b0
ILT
47672010-08-03 Ian Lance Taylor <iant@google.com>
4768
4769 PR 11712
4770 * layout.cc (relaxation_loop_body): If address of load segment is
4771 set, adjust address to include headers if possible.
4772
7af0c620
ILT
47732010-08-03 Ian Lance Taylor <iant@google.com>
4774
4775 * version.cc (version_string): Bump to 1.10.
4776
22f0da72
ILT
47772010-08-03 Ian Lance Taylor <iant@google.com>
4778
4779 PR 11805
4780 * layout.h (enum Output_section_order): Define.
4781 (class Layout): Update declarations.
4782 * layout.cc (Layout::get_output_section): Add order parameter.
4783 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
4784 is_first_non_relro parameters. Change all callers.
4785 (Layout::choose_output_section): Likewise.
4786 (Layout::add_output_section_data): Likewise.
4787 (Layout::make_output_section): Likewise. Set order.
4788 (Layout::default_section_order): New function.
4789 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
4790 * output.cc (Output_section::Output_section): Initialize order_.
4791 Don't initialize deleted fields.
4792 (Output_segment::Output_segment): Don't initialize deleted
4793 fields.
4794 (Output_segment::add_output_section_to_load): New function
4795 replacing add_output_section. Change all callers to call this or
4796 add_output_section_to_nonload.
4797 (Output_segment::add_output_section_to_nonload): New function.
4798 (Output_segment::remove_output_section): Rewrite.
4799 (Output_segment::add_initial_output_data): Likewise.
4800 (Output_segment::has_any_data_sections): Likewise.
4801 (Output_segment::is_first_section_relro): Likewise.
4802 (Output_segment::maximum_alignment): Likewise.
4803 (Output_segment::has_dynamic_reloc): New function replacing
4804 dynamic_reloc_count. Change all callers.
4805 (Output_segment::has_dynamic_reloc_list): New function replacing
4806 dynamic_reloc_count_list. Change all callers.
4807 (Output_segment::set_section_addresses): Rewrite.
4808 (Output_segment::set_offset): Rewrite.
4809 (Output_segment::find_first_and_last_list): Remove.
4810 (Output_segment::set_tls_offsets): Rewrite.
4811 (Output_segment::first_section_load_address): Likewise.
4812 (Output_segment::output_section_count): Likewise.
4813 (Output_segment::section_with_lowest_load_address): Likewise.
4814 (Output_segment::write_section_headers): Likewise.
4815 (Output_segment::print_sections_to_map): Likewise.
4816 * output.h (class Output_data): Remove dynamic_reloc_count_
4817 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
4818 (Output_data::add_dynamic_reloc): Rewrite.
4819 (Output_data::has_dynamic_reloc): New function.
4820 (Output_data::dynamic_reloc_count): Remove.
4821 (class Output_section): Add order_ field. Remvoe is_relro_local_,
4822 is_last_relro_, is_first_non_relro_, is_interp_,
4823 is_dynamic_linker_section_ fields. Add order and set_order
4824 functions. Remove is_relro_local, set_is_relro_local,
4825 is_last_relro, set_is_last_relro, is_first_non_relro,
4826 set_is_first_non_relro functions, is_interp, set_is_interp,
4827 is_dynamic_linker_section, and set_is_dynamic_linker_section
4828 functions.
4829 (class Output_segment): Change Output_data_list from std::list to
4830 std:;vector. Add output_lists_ field. Remove output_data_ and
4831 output_bss_ fields. Update declarations.
4832
3ff2ccb0
ILT
48332010-08-02 Ian Lance Taylor <iant@google.com>
4834
4835 * arm.cc (Target_arm::gc_process_relocs): Use typename.
4836 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
4837 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
4838
88a4108b
ILT
48392010-08-02 Ian Lance Taylor <iant@google.com>
4840
4841 PR 11855
4842 * script.cc (Script_options::Script_options): Initialize
4843 symbol_definitions_ and symbol_references_.
4844 (Script_options::add_symbol_assignment): Update
4845 symbol_definitions_ and symbol_references_.
4846 (Script_options::add_symbol_reference): New function.
4847 (script_symbol): New function.
4848 * script.h (class Script_options): Add symbol_definitions_ and
4849 symbol_references_ fields.
4850 (Script_options::referenced_const_iterator): New type.
4851 (Script_options::referenced_begin): New function.
4852 (Script_options::referenced_end): New function.
4853 (Script_options::is_referenced): New function.
4854 (Script_options::any_unreferenced): New function.
4855 * script-c.h (script_symbol): Declare.
4856 * yyscript.y (exp): Call script_symbol.
4857 * symtab.cc: Include "script.h".
4858 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
4859 Change all callers. Check symbols referenced by scripts.
4860 (Symbol_table::add_undefined_symbols_from_command_line): Add
4861 layout parameter. Change all callers.
4862 (Symbol_table::do_add_undefined_symbols_from_command_line):
4863 Likewise. Break out loop body. Check symbols referenced by
4864 scripts.
4865 (Symbol_table::add_undefined_symbol_from_command_line): New
4866 function broken out of
4867 do_add_undefined_symbols_from_command_line.
4868 * symtab.h (class Symbol_table): Update declarations.
4869 * archive.cc: Include "layout.h".
4870 (Archive::should_include_member): Add layout parameter. Change
4871 all callers. Check for symbol mentioned in expression.
4872 * archive.h (class Archive): Update declaration.
4873 * object.cc (Sized_relobj::do_should_include_member): Add layout
4874 parameter.
4875 * object.h (Object::should_include_member): Add layout parameter.
4876 Change all callers.
4877 (Object::do_should_include_member): Add layout parameter.
4878 (class Sized_relobj): Update declaration.
4879 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
4880 parameter.
4881 * dynobj.h (class Sized_dynobj): Update declaration.
4882 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
4883 layout parameter.
4884 * plugin.h (class Sized_pluginobj): Update declaration.
4885
5f1ab67a
ILT
48862010-08-02 Ian Lance Taylor <iant@google.com>
4887
4888 PR 11866
4889 * output.cc (Output_segment::set_offset): Search for the first and
4890 last sections rather than assuming that the list is in order.
4891 (Output_segment::find_first_and_last_list): New function.
4892 * output.h (class Output_segment): Update declarations.
4893 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
4894 (relro_strip_test_SOURCES): New variable.
4895 (relro_strip_test_DEPENDENCIES): New variable.
4896 (relro_strip_test_LDFLAGS): New variable.
4897 (relro_strip_test_LDADD): New variable.
4898 (relro_strip_test.so): New target.
4899
a8df5856
ILT
49002010-08-02 Ian Lance Taylor <iant@google.com>
4901
4902 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
4903 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
4904 (Target_i386::got_tlsdesc_section): New function.
4905 (Target_i386::got_section): Create space for GOT entries for
4906 TLSDESC relocations.
4907 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
4908 R_386_TLS_GOTDESC.
4909 (Target_i386::Scan::global): Likewise.
4910 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
4911 using TLSDESC GOT.
4912 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
4913 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
4914 (Target_x86_64::got_tlsdesc_section): New function.
4915 (Target_x86_64::got_section): Create space for GOT entries for
4916 TLSDESC relocations.
4917 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
4918 R_386_TLS_GOTDESC.
4919 (Target_x86_64::Scan::global): Likewise.
4920 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
4921 using TLSDESC GOT.
4922
0c10a0a6
ILT
49232010-08-02 Ian Lance Taylor <iant@google.com>
4924
4925 * testsuite/final_layout.sh: Use dc to convert from hex to
4926 decimal.
4927
41cbeecc
ST
49282010-07-29 Sriraman Tallam <tmsriram@google.com>
4929
4930 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
4931 paramter to the call to gold::gc_process_relocs.
4932 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
4933 paramter to the call to gold::gc_process_relocs.
4934 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
4935 parameter to the call to gold::gc_process_relocs.
4936 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
4937 template parameter to the call to gold::gc_process_relocs.
4938 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
4939 paramter to the call to gold::gc_process_relocs.
4940 * gc.h (get_embedded_addend_size): New function.
4941 (gc_process_relocs): Save the size of the reloc for use by ICF.
4942 * icf.cc (get_section_contents): Get the addend from the text section
4943 for SHT_REL relocation sections.
4944 * icf.h (Icf::Reloc_addend_size_info): New typedef.
4945 (Icf::Reloc_info): Add new member reloc_addend_size_info.
4946 * int_encoding.h (read_from_pointer): New overloaded function.
4947 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
4948 * testsuite/icf_sht_rel_addend_test.sh: New file.
4949 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
4950 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
4951
6ea55b82
RW
49522010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4953
4954 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
4955 * Makefile.in: Regenerate.
4956 * testsuite/Makefile.in: Regenerate.
4957
9691462b
ILT
49582010-07-27 Jeffrey Yasskin <jyasskin@google.com>
4959
4960 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
4961 * gold/testsuite/debug_msg.cc: Likewise.
4962 * gold/testsuite/odr_violation1.cc
4963 * gold/testsuite/odr_violation2.cc
4964
76897331
CC
49652010-07-21 Cary Coutant <ccoutant@google.com>
4966
4967 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
4968 string, and length fields.
4969 (Output_merge_string::Merged_strings_list): New type.
4970 (Output_merge_string::Merged_strings_lists): New typedef.
4971 (Output_merge_string): Replace merged_strings_ with
4972 merged_strings_lists_.
4973 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
4974 Merged_strings_list per input object and section. Don't store pointer
4975 to the string. Don't store length with each merged string entry.
4976 (Output_merge_string::finalize_merged_data): Loop over list of merged
4977 strings lists. Recompute length of each merged string.
4978
78384e8f
CC
49792010-07-15 Cary Coutant <ccoutant@google.com>
4980
4981 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
4982 here.
4983
783659f9
ILT
49842010-07-14 Ian Lance Taylor <iant@google.com>
4985
4986 * descriptors.cc (Descriptors::open): Report correct name in error
4987 message.
4988
131687b4
DK
49892010-07-13 Doug Kwan <dougkwan@google.com>
4990
4991 * arm.cc (Arm_input_section::Arm_input_section): For a
4992 SHT_ARM_EXIDX section, always keeps the input sections.
4993 (Arm_input_section::set_exidx_section_link): New method.
4994 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
4995 has_errors_ to false.
4996 (Arm_exidx_input_section::has_errors,
4997 Arm_exidx_input_section::set_has_errors): New methods.
4998 (Arm_exidx_input_section::has_errors_): New data member.
4999 (Arm_relobj::get_exidx_shndx_list): New method.
5000 (Arm_output_section::append_text_sections_to_list): Do not skip
5001 section without SHF_EXECINSTR.
5002 (Arm_output_section::fix_exidx_coverage): Skip input sections with
5003 errors.
2e702c99 5004 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
5005 section header. Make error messages more verbose. Check for
5006 a non-executable section linked to an EXIDX section.
5007 (Arm_relobj::do_read_symbols): Remove error checking, which has been
5008 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
5009 check that there is no deferred EXIDX section if we exit early.
5010 Instead of not making an EXIDX section in case of an error, make one
5011 and set the has_errors flag of it.
5012 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
5013 in a relocatable link.
5014 (Target_arm::do_relax): Look for the EXIDX output section instead of
5015 assuming that it is called .ARM.exidx.
2e702c99 5016 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
5017 section list. Do not check for SHF_EXECINSTR section flags but
5018 skip any input section with errors.
5019 * output.cc (Output_section::Output_section): Initialize
5020 always_keeps_input_sections_ to false.
5021 (Output_section::add_input_section): Check for
5022 always_keeps_input_sections_.
5023 * output.h (Output_section::always_keeps_input_sections,
5024 Output_section::set_always_keeps_input_sections): New methods.
5025 (Output_section::always_keeps_input_sections): New data member.
5026
69517287
RÁE
50272010-07-13 Rafael Espindola <espindola@google.com>
5028
5029 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
5030 * fileread.h (Input_file): Add try_extra_search_path and find_file.
5031
82742395
ILT
50322010-07-13 Philip Herron <herron.philip@googlemail.com>
5033 Ian Lance Taylor <iant@google.com>
5034
5035 * output.h (Output_section_lookup_maps::add_merge_section):
5036 Correct check of whether value was inserted.
5037 (Output_section_lookup_maps::add_merge_input_section): Likewise.
5038 (Output_section_lookup_maps::add_relaxed_input_section):
5039 Likewise.
5040 * arm.cc (Target_arm::got_section): Remove used local os.
5041 * i386.cc (Target_i386::got_section): Likewise.
5042 * x86_64.cc (Target_x86_64::got_section): Likewise.
5043 * sparc.cc (Target_sparc::got_section): Likewise.
5044 (Target_sparc::relocate): Remove unused local have_got_offset.
5045 * powerpc.cc (Target_powerpc::relocate): Likewise.
5046
f2d707b5
ILT
50472010-07-13 Ian Lance Taylor <iant@google.com>
5048
241531d6
ILT
5049 * compressed_output.cc (zlib_decompress): Fix signature in
5050 !HAVE_ZLIB_H case.
5051
f2d707b5
ILT
5052 * archive.cc (Archive::include_member): Unlock an external member
5053 of a thin archive. Don't bother to delete an object we know is
5054 NULL.
5055
a2e47362
CC
50562010-07-12 Cary Coutant <ccoutant@google.com>
5057
5058 * compressed_output.cc (zlib_decompress): New function.
5059 (get_uncompressed_size): New function.
5060 (decompress_input_section): New function.
5061 * compressed_output.h (get_uncompressed_size): New function.
5062 (decompress_input_section): New function.
5063 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
5064 Handle compressed debug sections.
5065 * layout.cc (is_compressed_debug_section): New function.
5066 (Layout::output_section_name): Map compressed section names to
5067 canonical names.
5068 * layout.h (is_compressed_debug_section): New function.
5069 (is_debug_info_section): Recognize compressed debug sections.
5070 * merge.cc: Include compressed_output.h.
5071 (Output_merge_data::do_add_input_section): Handle compressed
5072 debug sections.
5073 (Output_merge_string::do_add_input_section): Handle compressed
5074 debug sections.
5075 * object.cc: Include compressed_output.h.
5076 (Sized_relobj::Sized_relobj): Initialize new data members.
5077 (build_compressed_section_map): New function.
5078 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
5079 * object.h (Object::section_is_compressed): New method.
5080 (Object::do_section_is_compressed): New method.
5081 (Sized_relobj::Compressed_section_map): New type.
5082 (Sized_relobj::do_section_is_compressed): New method.
5083 (Sized_relobj::compressed_sections_): New data member.
5084 * output.cc (Output_section::add_input_section): Handle compressed
5085 debug sections.
5086 * reloc.cc: Include compressed_output.h.
5087 (Sized_relobj::write_sections): Handle compressed debug sections.
5088
ce279a62
CC
50892010-07-08 Cary Coutant <ccoutant@google.com>
5090
5091 * resolve.cc (Symbol_table::resolve): Remember whether undef was
5092 weak when resolving to a dynamic def.
5093 (Symbol_table::should_override): Add adjust_dyndef flag; set it
5094 for weak undef/dynamic def cases. Adjust callers.
5095 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
5096 undef_binding_weak_.
5097 (Symbol_table::sized_write_globals): Adjust symbol binding.
5098 (Symbol_table::sized_write_symbol): Add binding parameter.
5099 * symtab.h (Symbol::set_undef_binding): New method.
5100 (Symbol::is_undef_binding_weak): New method.
5101 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
5102 (Symbol_table::should_override): Add new parameter.
5103 (Symbol_table::sized_write_symbol): Add new parameter.
5104
5105 * testsuite/weak_undef_file1.cc: Add new test case.
5106 * testsuite/weak_undef_file2.cc: Fix header comment.
5107 * testsuite/weak_undef_test.cc: Add new test case.
5108
b2286c10
DK
51092010-06-29 Doug Kwan <dougkwan@google.com>
5110
5111 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
5112 Initialize USE_SYMBOL_.
5113 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
5114 definition.
5115 (Arm_reloc_property::uses_symbol_): New data member declaration.
5116 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
5117 uses symbol value and symbol is undefined but not weakly undefined.
5118
4802450a
RÁE
51192010-06-28 Rafael Espindola <espindola@google.com>
5120
5121 * plugin.cc (Plugin::load): Use dlerror.
5122
e5ca47ba
ILT
51232010-06-26 Jeffrey Yaskin <jyasskin@google.com>
5124
5125 * symtab.cc (detect_odr_violations): When reporting an ODR
5126 violation, report an object where the symbol is defined.
5127
8a75a161
DK
51282010-06-25 Doug Kwan <dougkwan@google.com>
5129
5130 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
5131 (Target_arm::section_may_have_icf_unsafe_pointers): New method
5132 definition.
5133 (Target_arm::Scan::local_reloc_may_be_function_pointer,
5134 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
5135 target hook to detect function points.
5136 (Target_arm::Scan::possible_function_pointer_reloc): New method.
5137 * icf.h (Icf::check_section_for_function_pointers): Change type of
5138 parameter SECTION_NAME to const reference to std::string. Use
5139 target hook to determine if section may have unsafe pointers.
5140 * target.h (Target::section_may_have_icf_unsafe_pointers): New
5141 method definition.
5142
42218b9f
RÁE
51432010-06-21 Rafael Espindola <espindola@google.com>
5144
5145 * fileread.cc (Input_file::find_fie): New
5146 (Input_file::open): Use Input_file::find_fie.
5147 * fileread.h (Input_file::find_fie): New
5148 * plugin.cc (set_extra_library_path): New.
5149 (Plugin::load): Add set_extra_library_path to the transfer vector.
5150 (Plugin_manager::set_extra_library_path): New.
5151 (Plugin_manager::add_input_file): Use the extra search path if set.
5152 (set_extra_library_path(): New.
5153 * plugin.h (Plugin_manager): Add set_extra_library_path and
5154 extra_search_path_.
5155
a0506cca
CC
51562010-06-19 Cary Coutant <ccoutant@google.com>
5157
5158 * layout.cc (gdb_sections): Add .debug_types.
5159 (lines_only_debug_sections): Likewise.
5160
6508b958
RÁE
51612010-06-18 Rafael Espindola <espindola@google.com>
5162
5163 * plugin.cc (add_input_file,add_input_library)
5164 (Plugin_manager::add_input_file): Make filename arguments const.
5165 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
5166 const.
5167
3e235302
DK
51682010-06-16 Doug Kwan <dougkwan@google.com>
5169
5170 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
5171 .ARM.attributes section if we have not merged any input
5172 attributes sections.
5173
106e8a6c
DK
51742010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5175
5176 * arm.cc: Allow combining objects with no EABI version
5177 information.
5178
91ff43fe
RÁE
51792010-06-15 Rafael Espindola <espindola@google.com>
5180
5181 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
5182
68ed838c
ILT
51832010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5184
5185 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
5186 (struct iovec): Correct !HAVE_READV definition.
5187
f3a2388f
CC
51882010-06-10 Cary Coutant <ccoutant@google.com>
5189
5190 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
5191 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
5192 reloc sections.
5193 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
5194
5195 PR 11683
5196 * symtab.h (Symbol::is_placeholder): New member function.
5197 * target-reloc.h (relocate_section): Check for placeholder symbols.
5198
5199 * testsuite/Makefile.am (plugin_test_8): New test.
5200 (plugin_test_9): New test.
5201 * testsuite/Makefile.in: Regenerate.
5202
e1df38aa
NC
52032010-06-09 Nick Clifton <nickc@redhat.com>
5204
5205 * yyscript.y (input_list_element): Allow strings prefixed with
5206 the '-' character. Treat these as libraries.
5207 * script.cc (script_add_library): New function. Adds a library
5208 specified by "-l<name>" found in an input script.
5209 * script-c.h: Add prototype for script_add_library.
5210
25bbe950
DK
52112010-06-07 Doug Kwan <dougkwan@google.com>
5212
5213 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
5214 Restrict stub-group size to be within long conditional branch
5215 range when working around cortex-A8 erratum.
5216
0f32ea4c
ILT
52172010-06-07 Damien Diederen <dd@crosstwine.com>
5218
5219 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
5220 #ifdef typo.
5221
8fe2a369
ST
52222010-06-03 Sriraman Tallam <tmsriram@google.com>
5223
5224 PR gold/11658
5225 * output.cc
5226 (Output_section::Input_section_sort_entry::compare_section_ordering):
5227 Change to return non-zero correctly.
5228 (Output_section::Input_section_sort_section_order_index_compare
5229 ::operator()): Change to fix ambiguity in comparisons.
5230
6e9ba2ca
ST
52312010-06-01 Sriraman Tallam <tmsriram@google.com>
5232
5233 * gold.h (is_wildcard_string): New function.
5234 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
5235 (Layout::layout_eh_frame): Ditto.
5236 (Layout::find_section_order_index): New method.
5237 (Layout::read_layout_from_file): New method.
5238 * layout.h (Layout::find_section_order_index): New method.
5239 (Layout::read_layout_from_file): New method.
5240 (Layout::input_section_position_): New private member.
5241 (Layout::input_section_glob_): New private member.
5242 * main.cc (main): Call read_layout_from_file here.
5243 * options.h (--section-ordering-file): New option.
5244 * output.cc (Output_section::input_section_order_specified_): New
5245 member.
5246 (Output_section::Output_section): Initialize new member.
5247 (Output_section::add_input_section): Add new parameter.
5248 Keep input sections when --section-ordering-file is used.
5249 (Output_section::set_final_data_size): Sort input sections when
5250 section ordering file is specified.
5251 (Output_section::Input_section_sort_entry): Add new parameter.
5252 Check sorting type.
5253 (Output_section::Input_section_sort_entry::compare_section_ordering):
5254 New method.
5255 (Output_section::Input_section_sort_compare::operator()): Change to
5256 consider section_order_index.
5257 (Output_section::Input_section_sort_init_fini_compare::operator()):
5258 Change to consider section_order_index.
5259 (Output_section::Input_section_sort_section_order_index_compare
5260 ::operator()): New method.
5261 (Output_section::sort_attached_input_sections): Change to sort
5262 according to section order when specified.
e1df38aa
NC
5263 (Output_section::add_input_section<32, true>): Add new parameter.
5264 (Output_section::add_input_section<64, true>): Add new parameter.
5265 (Output_section::add_input_section<32, false>): Add new parameter.
5266 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
5267 * output.h (Output_section::add_input_section): Add new parameter.
5268 (Output_section::input_section_order_specified): New
5269 method.
5270 (Output_section::set_input_section_order_specified): New method.
5271 (Input_section::Input_section): Initialize section_order_index_.
5272 (Input_section::section_order_index): New method.
5273 (Input_section::set_section_order_index): New method.
5274 (Input_section::section_order_index_): New member.
5275 (Input_section::Input_section_sort_section_order_index_compare): New
5276 struct.
5277 (Output_section::input_section_order_specified_): New member.
5278 * script-sections.cc (is_wildcard_string): Delete and move modified
5279 method to gold.h.
5280 (Output_section_element_input::Output_section_element_input): Modify
5281 call to is_wildcard_string.
5282 (Output_section_element_input::Input_section_pattern
5283 ::Input_section_pattern): Ditto.
5284 (Output_section_element_input::Output_section_element_input): Ditto.
5285 * testsuite/Makefile.am (final_layout): New test case.
5286 * testsuite/Makefile.in: Regenerate.
5287 * testsuite/final_layout.cc: New file.
5288 * testsuite/final_layout.sh: New file.
5289
3537c84b
RÁE
52902010-06-01 Rafael Espindola <espindola@google.com>
5291
5292 * plugin.cc (Plugin::load): Pass the output name to the plugin.
5293
105b6afd
RÁE
52942010-06-01 Rafael Espindola <espindola@google.com>
5295
5296 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
5297 visibility of symbols.
5298
29e11421
DK
52992010-05-27 Doug Kwan <dougkwan@google.com>
5300
5301 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
5302 from start of output section instead of address for a local symbol
5303 in a merged or relaxed section when doing a relocatable link.
5304
5e0f337e
RÁE
53052010-05-26 Rafael Espindola <espindola@google.com>
5306
5307 PR 11604
5308 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
5309 adding sections the garbage collector removed.
5310 * gold/testsuite/Makefile.am: Add test.
5311 * gold/testsuite/Makefile.in: Regenerate.
5312 * gold/testsuite/plugin_test_7.sh: New.
5313 * gold/testsuite/plugin_test_7_1.c: New.
5314 * gold/testsuite/plugin_test_7_2.c: New.
5315
f4187277
RÁE
53162010-05-26 Rafael Espindola <espindola@google.com>
5317
5318 * script-sections.cc (Output_section_definition::set_section_addresses):
5319 Check for --section-start.
5320
5c388529
DK
53212010-05-26 Doug Kwan <dougkwan@google.com>
5322
5323 * arm.cc (Arm_scan_relocatable_relocs): New class.
5324 (Target_arm::relocate_special_relocatable): New method.
5325 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
5326 (Arm_relocate_functions::thumb_branch_common): Same.
5327 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
5328 instead of Default_scan_relocatable_relocs.
5329 * target-reloc.h (relocate_for_relocatable): Let target handle
5330 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
5331 * target.h (Sized_target::relocate_special_relocatable): New method.
5332
bca1c3ae
ILT
53332010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5334
5335 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
5336
0439c796
DK
53372010-05-23 Doug Kwan <dougkwan@google.com>
5338
5339 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
5340 instead of a cast.
5341 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
5342 with a direct branch, not a conditional branch, to a stub.
5343 * merge.cc (Output_merge_base::record_input_section): New method
5344 defintion.
5345 (Output_merge_data::do_add_input_section): Record input section if
5346 keeps-input-sections flag is set.
5347 (Output_merge_string::do_add_input_section): Ditto.
5348 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
5349 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
5350 INPUT_SECTIONS_.
5351 (Output_merge_base::keeps_input_sections,
5352 Output_merge_base::set_keeps_input_sections,
5353 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
5354 method definitions.
5355 (Output_merge_base::Input_sections): New type declaration.
5356 (Output_merge_base::input_sections_begin,
5357 Output_merge_base::input_sections_end,
5358 Output_merge_base::do_set_keeps_input_sections): New method definitions.
5359 (Output_merge_base::bool keeps_input_sections_,
5360 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
5361 Output_merge_base::input_sections_): New data members.
5362 (Output_merge_data::do_set_keeps_input_sections): New method
5363 defintion.
5364 (Output_merge_string::do_set_keeps_input_sections): Ditto.
5365 * output.cc (Output_section::Input_section::relobj): Move method
5366 defintion from class declaration to here and handle merge sections.
5367 (Output_section::Input_section::shndx): Ditto.
5368 (Output_section::Output_section): Remove initializations of removed
5369 data members and initialize new data member LOOKUP_MAPS_.
5370 (Output_section::add_input_section): Set keeps-input-sections flag
5371 for a newly created merge output section as appropriate. Adjust code
5372 to use Output_section_lookup_maps class.
5373 (Output_section::add_relaxed_input_section): Adjst code for lookup
5374 maps code refactoring.
2e702c99 5375 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
5376 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
5377 class. If adding input section to a newly created merge output
5378 section fails, remove the new merge section.
5379 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 5380 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 5381 (Output_section::find_merge_section): Ditto.
0439c796 5382 (Output_section::build_lookup_maps): New method defintion.
2e702c99 5383 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
5384 Output_section_lookup_maps class.
5385 (Output_section::get_input_sections): Export merge sections. Adjust
5386 code to use Output_section_lookup_maps class.
5387 (Output_section:::add_script_input_section): Adjust code to use
5388 Output_section_lookup_maps class. Update lookup maps for merge
5389 sections also.
5390 (Output_section::discard_states): Use Output_section_lookup_maps.
5391 (Output_section::restore_states): Same.
5392 * output.h (Merge_section_properties): Move class defintion out of
5393 Output_section.
5394 (Output_section_lookup_maps): New class.
5395 (Output_section::Input_section::is_merge_section): New method
5396 defintion.
5397 (Output_section::Input_section::relobj): Move defintion out of class
5398 defintion. Declare method only.
5399 (Output_section::Input_section::shndx): Ditto.
5400 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 5401 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
5402 (Output_section::Merge_section_by_properties_map,
5403 Output_section::Output_section_data_by_input_section_map,
5404 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
5405 Remove types.
2e702c99 5406 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
5407 KEEPS_INPUT_SECTIONS.
5408 (Output_section::build_lookup_maps): New method declaration.
5409 (Output_section::merge_section_map_,
5410 Output_section::merge_section_by_properties_map_,
5411 Output_section::relaxed_input_section_map_,
5412 Output_section::is_relaxed_input_section_map_valid_): Remove data
5413 members.
5414 (Output_section::lookup_maps_): New data member.
5415
76295588
L
54162010-05-21 Doug Kwan <dougkwan@google.com>
5417
5418 PR gold/11619
5419 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
5420 avoid a compilation error.
5421
d103a984
RÁE
54222010-05-19 Rafael Espindola <espindola@google.com>
5423
5424 * script-sections.cc (Output_section_definition::allocate_to_segment):
5425 Update the phdrs_list even when the output section is NULL.
5426 * testsuite/Makefile.am: Add test.
5427 * testsuite/Makefile.in: Regenerate.
5428 * testsuite/script_test_9.cc: New.
5429 * testsuite/script_test_9.sh: New.
5430 * testsuite/script_test_9.t: New.
5431
6625d24e
DK
54322010-05-19 Doug Kwan <dougkwan@google.com>
5433
5434 * arm.cc (Arm_input_section::original_size): New method.
5435 (Arm_input_section::do_addralign): Add a cast.
5436 (Arm_input_section::do_output_offset): Remove static cast.
5437 (Arm_input_section::original_addralign,
5438 Arm_input_section::original_size_): Change type to uint32_t.
5439 (Arm_input_section::init): Add safe casts for section alignment
5440 and size.
5441 (Arm_input_section::set_final_data_size): Do not set address and
5442 offset of stub table.
5443 (Arm_output_section::fix_exidx_coverage): Change use of of
5444 Output_section::Simple_input_section to that of
5445 Output_section::Input_section.
5446 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
5447 except for the first pass.
5448 * output.cc (Output_section::get_input_sections): Change type of
5449 input_sections to std::list<Input_section>.
5450 (Output_section::add_script_input_section): Rename from
5451 Output_section::add_simple_input_section. Change type of SIS
5452 parameter from Simple_input_section to Input_section.
5453 * output.h (Output_section::Simple_input_section): Remove class.
5454 (Output_section::Input_section): Change class visibility to public.
5455 (Output_section::Input_section::addralign): Use stored alignments
5456 for special input sections if set.
5457 (Output_section::Input_section::set_addralign): New method.
5458 (Output_section::get_input_sections): Change parameter type from
5459 list of Simple_input_section to list of Input_section.
5460 (Output_section::add_script_input_section): Rename from
5461 Output_section::add_simple_input_section. Change first parameter's
5462 type from Simple_input_section to Input_section and remove the
5463 second and third parameters.
5464 * script-sections.cc (Input_section::Input_section_list): Change
5465 type to list of Output_section::Input_section/
5466 (Input_section_info::Input_section_info): Change parameter type of
5467 INPUT_SECTION to Output_section::Input_section.
5468 (Input_section_info::input_section): Change return type.
5469 (Input_section_info::input_section_): Change type to
5470 Output_section::Input_section.
5471 (Output_section_element_input::set_section_addresses): Adjust code
5472 to use Output_section::Input_section instead of
5473 Output_section::Simple_input_section. Adjust code for renaming
5474 of Output_section::add_simple_input_section.
5475 (Orphan_output_section::set_section_addresses): Ditto.
5476
e1e82ea4
RW
54772010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5478
5479 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
5480 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
5481
91e75c8a
RÁE
54822010-05-18 Rafael Espindola <espindola@google.com>
5483
5484 * options.cc (General_options::finalize): Handle -nostdlib.
5485 * options.h (nostdlib): New option.
5486 * script.cc (script_add_search_dir): Handle -nostdlib.
5487
da59ad79
DK
54882010-05-12 Doug Kwan <dougkwan@google.com>
5489
5490 * arm.cc (Target_arm::do_finalize_sections): Create an empty
5491 attributes section only if there no attributes section after merging.
5492 (Target_arm::merge_object_attributes): Move value of
e1df38aa 5493 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
5494 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
5495 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
5496 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
5497 and arm_attr_merge_7.stdout.
5498 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
5499 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
5500 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
5501 arm_attr_merge_7b.o): New rules.
5502 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
5503 arm_attr_merge_7
5504 * testsuite/Makefile.in: Regenerate.
5505 * testsuite/arm_attr_merge.sh: New file.
5506 * testsuite/arm_attr_merge_[67][ab].s: Same.
5507
3e01a7fd
NC
55082010-05-05 Nick Clifton <nickc@redhat.com>
5509
5510 * po/es.po: Updated Spanish translation.
5511
7ad2014a
L
55122010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5513
5514 * Makefile.am (install-exec-local): Properly install gold as
5515 default cross linker.
5516 * Makefile.in: Regenerated.
5517
4fda8867
NC
55182010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5519 Nick Clifton <nickc@redhat.com>
5520
5521 * configure.ac (install_as_default): Define and set to false
5522 unless --enable-gold or --enable-gold=both/gold has been
5523 specified.
5524 * configure: Regenerate.
5525
5526 * Makefile.am (install-exec-local): Install the executable as
5527 'ld.gold'. If install_as_default is true then also install it as
5528 'ld'.
5529 * Makefile.in: Regenerated.
5530
bd288ea2
ILT
55312010-04-24 Ian Lance Taylor <iant@google.com>
5532
5533 * layout.cc (Layout::layout_reloc): In relocatable link don't
5534 combine reloc sections for grouped sections.
5535
ef38fd8a
ST
55362010-04-23 Sriraman Tallam <tmsriram@google.com>
5537
5538 * gc.h (gc_process_relocs): Pass information on relocs pointing to
5539 sections that are not ordinary to icf.
5540 * icf.cc (get_section_contents): Handle relocation pointing to section
5541 with no object or shndx information.
5542 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
5543 * testsuite/Makefile.in: Regenerate.
5544 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
5545 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
5546
f6973bdc
ILT
55472010-04-22 Ian Lance Taylor <iant@google.com>
5548
5549 * expression.cc (Expression::Expression_eval_info): Add
5550 result_alignment_pointer field.
5551 (Expression::eval_with_dot): Add result_alignment_pointer
5552 parameter. Change all callers.
5553 (Expression::eval_maybe_dot): Likewise.
5554 (class Binary_expression): Add alignment_pointer parameter to
5555 left_value and right_value. Change all callers.
5556 (BINARY_EXPRESSION): Set result alignment.
5557 (class Trinary_expression): Add alignment_pointer parameter to
5558 arg2_value and arg3_value. Change all callers.
5559 (Trinary_cond::value): Set result alignment.
5560 (Max_expression::value, Min_expression::value): Likewise.
5561 (Align_expression::value): Likewise.
5562 * script-sections.cc (class Sections_element): Add dot_alignment
5563 parameter to set_section_addresses virtual function. Update
5564 instantiations.
5565 (class Output_section_element): Likewise.
5566 (Script_sections::create_segments): Add dot_alignment parameter.
5567 Change all callers.
5568 (Script_sections::create_segments_from_phdrs_clause): Likewise.
5569 (Script_sections::set_phdrs_clause_addresses): Likewise.
5570 * script-sections.h: Update declarations.
5571 * script.h: Update declarations.
5572 * output.h (Output_segment::set_minimum_p_align): Don't decrease
5573 min_p_align.
5574 * testsuite/script_test_3.t: Set large alignment.
5575 * testsuite/script_test_3.sh: Make sure that at least one LOAD
5576 segment has expected alignment.
5577
9c9c98a5
NC
55782010-04-22 Nick Clifton <nickc@redhat.com>
5579
5580 * po/gold.pot: Updated by the Translation project.
5581 * po/vi.po: Updated Vietnamese translation.
5582
2253bfba
L
55832010-04-22 H.J. Lu <hongjiu.lu@intel.com>
5584
5585 * testsuite/Makefile.am (check_PROGRAMS): Add
5586 icf_virtual_function_folding_test.
5587 * testsuite/Makefile.in: Regenerated.
5588
85fdf906
AH
55892010-04-15 Andrew Haley <aph@redhat.com>
5590
5591 * options.h (merge_exidx_entries): New option.
5592 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
5593 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
5594 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
5595 (Target_arm::merge_exidx_entries): New function.
5596 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
5597 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
5598 to Arm_exidx_fixup constructor.
5599 Add new arg, merge_exidx_entries.
5600 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
5601 Arm_output_section::fix_exidx_coverage.
5602
ce97fa81
ST
56032010-04-18 Sriraman Tallam <tmsriram@google.com>
5604
5605 * icf.cc (get_section_contents): Check for preemptible functions.
5606 Ignore addend when appropriate.
5607 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
5608 section folded.
5609 (add_from_relobj): Check for section folded.
5610 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
5611 * symtab.h (should_add_dynsym_entry): Add new parameter.
5612 * target-reloc.h (scan_relocs): Check for section folded.
5613 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
5614 Check reloc types for function pointers in shared objects.
5615 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
5616 case.
5617 (icf_preemptible_functions_test): New test case.
5618 (icf_string_merge_test): New test case.
5619 * testsuite.Makefile.in: Regenerate.
5620 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
5621 bar_glob. Refactor code.
5622 * testsuite/icf_preemptible_functions_test.cc: New file.
5623 * testsuite/icf_preemptible_functions_test.sh: New file.
5624 * testsuite/icf_string_merge_test.cc: New file.
5625 * testsuite/icf_string_merge_test.sh: New file.
5626 * testsuite/icf_virtual_function_folding_test.cc: New file.
5627 * testsuite/icf_virtual_function_folding_test.sh: New file.
5628
04ceb17c
DK
56292010-04-14 Doug Kwan <dougkwan@google.com>
5630
5631 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
5632 for local symbol recounting if we remove a section due to ICF.
5633 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
5634 there are no regular objects in input.
5635
153e7da4
DK
56362010-04-13 Doug Kwan <dougkwan@google.com>
5637
5638 * arm.cc (Arm_input_section::set_final_data_size): Compute
5639 accurate final data size instead of using current data size.
5640
4dbd9faf
DK
56412010-04-09 Doug Kwan <dougkwan@google.com>
5642
5643 * layout.cc (Layout::choose_output_section): Handle script section
5644 types.
5645 (Layout::make_output_section_for_script): Add section type parameter.
5646 Handle script section types.
5647 * layout.h (Layout::make_output_section_for_script): Add section
5648 type parameter.
5649 * output.cc (Output_section::Output_section): Initialize data member
5650 is_noload_.
5651 (Output_section::do_reset_address_and_file_offset): Do not set address
5652 to 0 if section is a NOLOAD section.
5653 * output.h (Output_section::is_noload): New method.
5654 (Output_section::set_is_noload): Ditto.
5655 (Output_section::is_noload_): New data member.
5656 * script-c.h (Script_section_type): New enum type.
5657 (struct Parser_output_section_header): Add new file section_type.
5658 * script-sections.cc (Sections_element::output_section_name): Add
5659 parameter for returning script section type.
5660 (Output_section_definition::output_section_name): Ditto.
5661 (Output_section_definition::section_type)P; New method.
5662 (Output_section_definiton::script_section_type_name): Ditto.
5663 (Output_section_definition::script_section_type_): New data member.
5664 (Output_section_definition::Output_section_definition): Initialize
5665 data member Output_section_definition::script_section_type_.
5666 (Output_section_definition::create_sections): Pass script section type
5667 to Layout::make_output_section_for_script.
5668 (Output_section_definition::output_section_name): Return script
5669 section type to caller.
5670 (Output_section_definition::set_section_address): Do not advance
5671 dot value and load address if section type is NOLOAD. Set address
5672 of NOLOAD sections regardless of section flags.
5673 (Output_section_definition::print): Print section type if it is
5674 not SCRIPT_SECTION_TYPE_NONE.
5675 (Output_section_definition::section_type): New method.
5676 (Output_section_definition::script_section_type_name): Ditto.
5677 (Script_sections::output_section_name): Add new parameter
5678 PSECTION_TYPE for returning script section type. Pass it to
5679 section elements. Handle discard sections.
5680 (Sort_output_sections::operator()): Handle NOLOAD sections.
5681 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 5682 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
5683 returning script section type.
5684 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
5685 INFO and NOLOAD.
5686 * yyscript.y (union): Add new field SECTION_TYPE.
5687 (COPY, DSECT, INFO, NOLOAD): New tokens.
5688 (opt_address_and_section_type): Change type to output_section_header.
5689 (section_type): New non-terminal
5690 (section_header): Handle section type.
2253bfba 5691 (opt_address_and_section_type): Return section type value.
4dbd9faf 5692
721ea635
L
56932010-04-09 H.J. Lu <hongjiu.lu@intel.com>
5694
5695 * testsuite/plugin_common_test_1.c (foo): Add prototype.
5696 * testsuite/plugin_common_test_2.c (foo): Likewise.
5697
6bf924b0
DK
56982010-04-08 Doug Kwan <dougkwan@google.com>
5699
5700 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
5701 Output_merge_data.
5702 * output.cc (Output_section::add_merge_input_section): Simplify
5703 code and return status of Output_merge_base::add_input_section.
e1df38aa 5704 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
5705 returns true.
5706
24af6f92
DK
57072010-04-07 Doug Kwan <dougkwan@google.com>
5708
5709 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
5710 if section is marked as containing instructions but has no mapping
5711 symbols.
5712 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
5713 correct section index.
5714 (Arm_relobj::find_linked_text_section): Ditto.
5715
00698fc5
CC
57162010-04-07 Cary Coutant <ccoutant@google.com>
5717
5718 * archive.cc (include_member): Destroy Read_symbols_data object before
5719 releasing file.
5720 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
5721 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
5722 (Read_symbols_data::~Read_symbols_data) New destructor.
5723 (Section_relocs::Section_relocs) New constructor.
5724 (Section_relocs::~Section_relocs) New destructor.
5725 (Read_relocs_data::Read_relocs_data) New constructor.
5726 (Read_relocs_data::~Read_relocs_data) New destructor.
5727 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
5728 pointers to NULL after deleting.
5729
7296d933
DK
57302010-04-07 Doug Kwan <dougkwan@google.com>
5731
5732 * arm.cc: Replace "endianity" with "endianness" in comments.
5733 (Arm_exidx_cantunwind): Ditto.
5734 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
5735 (Arm_relobj::merge_flags_and_attributes): New method.
5736 (Arm_relobj::merge_flags_and_attributes_): New data member.
5737 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
5738 (Arm_relobj::scan_sections_for_stubs): Ditto.
5739 (Arm_relobj::do_read_symbols): Check to see if we really want to
5740 merge processor-specific flags and attributes. Exit early if
5741 an object is empty except for section names and the undefined symbol.
5742 (Target_arm::do_finalize_sections): Move check for ELF format to
5743 Arm_relobj::do_read_symbols. Merge processor specific flags and
5744 attributes from a regular object only when we have determined that
5745 it is aapropriate. Do not create an .ARM.attributes section in
5746 output if there is no regular input object.
5747 (Target_arm::merge_processor_specific_flags): Check
5748 --warn-mismatch before printing any error.
5749 (Target_arm::merge_object_attributes): Ditto.
5750 * gold.cc (queue_middle_tasks): Handle the case in which there is
5751 no regular object in input.
5752 * options.cc (General_options::parse_EB): New method.
5753 (General_options::parse_EL): Same.
5754 (General_options::General_options): Initialize endianness_.
5755 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
5756 New options.
5757 (General_options::Endianness): New enum.
5758 (General_options::endianness): New method.
5759 (General_options::endianness_): New data member.
5760 * parameters.cc (Parameters::set_options): Check target endianness.
5761 (Parameters::set_target_once): Ditto.
5762 (Parameters::check_target_endianness): New method.
5763 (parameters_force_valid_target): If either -EL or -EB is specified,
5764 use it to define endianness of default target.
5765 * parameters.h (Parameters::check_target_endianness): New method
5766 declaration.
5767 * target.h (class Target): Change "endianity" to "endianness"
5768 in comments.
5769
efc8d4f2
RW
57702010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5771
5772 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
5773 * configure: Regenerate.
5774 * Makefile.in: Regenerate.
5775 * testsuite/Makefile.in: Regenerate.
5776
be234d88
CC
57772010-04-06 Cary Coutant <ccoutant@google.com>
5778
5779 gcc PR lto/42757
5780 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
5781 prevailing definitions of common symbols.
5782 * testsuite/plugin_test_6.sh: New test case.
5783 * testsuite/plugin_common_test_1.c: New test case.
5784 * testsuite/plugin_common_test_2.c: New test case.
5785 * testsuite/Makefile.am (plugin_test_6): New test case.
5786 * testsuite/Makefile.in: Regenerate.
5787
bd32c6bd
NC
57882010-04-06 Nick Clifton <nickc@redhat.com>
5789
5790 * po/vi.po: New Vietnamese translation.
5791
323c532f
DK
57922010-03-30 Doug Kwan <dougkwan@google.com>
5793
5794 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
5795
4fcd97eb
DK
57962010-03-25 Doug Kwan <dougkwan@google.com>
5797
5798 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
5799 to avoid a conversion warning on a 32-bit host.
5800
4ebf39db
ILT
58012010-03-24 Ian Lance Taylor <iant@google.com>
5802
5803 * testsuite/script_test_3.t: Add a TLS segment.
5804 * testsuite/Makefile.am (check_PROGRAMS): Add
5805 tls_phdrs_script_test.
5806 (tls_phdrs_script_test_SOURCES): Define.
5807 (tls_phdrs_script_test_DEPENDENCIES): Define.
5808 (tls_phdrs_script_test_LDFLAGS): Define.
5809 (tls_phdrs_script_test_LDADD): Define.
5810 * testsuite/Makefile.in: Rebuild.
5811
4a599bdd
CC
58122010-03-23 Cary Coutant <ccoutant@google.com>
5813
5814 * fileread.cc (find_or_make_view): Fix comment.
5815
6c93b22c
ILT
58162010-03-23 Ian Lance Taylor <iant@google.com>
5817
5818 * script-sections.cc (class Orphan_section_placement): Define
5819 PLACE_TLS and PLACE_TLS_BSS.
5820 (Orphan_section_placement::Orphan_section_placement): Initialize
5821 new places.
5822 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
5823 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
5824 (tls_script_test_SOURCES): Define.
5825 (tls_script_test_DEPENDENCIES): Define.
5826 (tls_script_test_LDFLAGS): Define.
5827 (tls_script_test_LDADD): Define.
5828 * testsuite/Makefile.in: Rebuild.
5829
a2c7281b
DK
58302010-03-22 Doug Kwan <dougkwan@google.com>
5831
5832 * arm.cc (Arm_relocate_functions::abs8,
5833 Arm_relocate_functions::abs16): Use correct check for overflow
5834 specified in the ARM ELF specs.
5835 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
5836 target of a BLX instruction specially.
5837 (Reloc_stub::stub_type_for_reloc): Ditto.
5838 (Relocate::relocate): Use symbolic names instead of numeric relocation
5839 codes to report error.
5840 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
5841 workaround.
5842 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
5843 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
5844 thumb2_blx_out_of_range.stdout
5845 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
5846 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
5847 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
5848 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
5849 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
5850 thumb2_blx_in_range, thumb2_blx_in_range.o,
5851 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
5852 thumb2_blx_out_of_range.o): New rules.
2e702c99 5853 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
5854 thumb2_blx_in_range and thumb2_blx_out_of_range.
5855 * testsuite/Makefile.in: Regenerate.
5856 * arm_branch_in_range.sh: Add tests for THUMB BLX.
5857 * testsuite/thumb_blx_in_range.s: New file.
5858 * testsuite/thumb_blx_out_of_range.s: New file.
5859
b0193076
RÁE
58602010-03-22 Rafael Espindola <espindola@google.com>
5861
5862 * archive.cc (Should_include): Move to archive.h.
5863 (should_include_member): Make it a member of Archive.
5864 (Lib_group): New.
5865 (Add_lib_group_symbols): New.
5866 * archive.h: Include options.h.
5867 (Archive_member): Moved from Archive.
5868 (Should_include): Moved from archive.cc.
5869 (Lib_group): New.
5870 (Add_lib_group_symbols): New.
5871 * dynobj.cc (do_should_include_member): New.
5872 * dynobj.h (do_should_include_member): New.
5873 * gold.cc (queue_initial_tasks): Update call to queue.
5874 * main.cc (main): Print lib group stats.
5875 * object.cc (do_should_include_member): New.
5876 * object.h: Include archive.h.
5877 (Object::should_include_member): New.
5878 (Object::do_should_include_member): New.
5879 (Sized_relobj::do_should_include_member): New.
5880 * options.cc (General_options::parse_start_lib): New.
5881 (General_options::parse_end_lib): New.
5882 (Input_arguments::add_file): Handle lib groups.
5883 (Input_arguments::start_group): Check we are not in a lib.
5884 (Input_arguments::start_lib): New.
5885 (Input_arguments::end_lib): New.
5886 * options.h (General_options): Add start_lib and end_lib.
5887 (Input_argument::lib_): New.
5888 (Input_argument::lib): New.
5889 (Input_argument::is_lib): New.
5890 (Input_file_lib): New.
5891 (Input_arguments::in_lib_): New.
5892 (Input_arguments::in_lib): New.
5893 (Input_arguments::start_lib): New.
5894 (Input_arguments::end_lib_): New.
5895 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
5896 in unused members as preempted.
5897 (Sized_pluginobj::do_should_include_member): New.
5898 * plugin.h (Sized_pluginobj::do_should_include_member): New.
5899 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
5900 return the blocker.
5901 (Read_symbols::do_whole_lib_group): New.
5902 (Read_symbols::do_lib_group): New.
5903 (Read_symbols::do_read_symbols): Handle lib groups.
5904 (Read_symbols::get_name): Handle lib groups.
5905 * readsyms.h (Read_symbols): Add an archive member pointer.
5906 (Read_symbols::do_whole_lib_group): New.
5907 (Read_symbols::do_lib_group): New.
5908 (Read_symbols::member_): New.
5909 * script.cc (read_input_script): Update call to queue_soon.
5910
d099120c
DK
59112010-03-19 Doug Kwan <dougkwan@google.com>
5912
5913 * arm.cc (Stub_table::Stub_table): Initialize new data members
5914 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
5915 (Stub_table::add_reloc_stub): Assign stub offset and update
5916 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
5917 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
5918 New data members.
2e702c99 5919 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
5920 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
5921 instead of going over all reloc stubs.
2e702c99 5922 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
5923 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
5924 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 5925 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
5926 Stringpool_template::offset_.
5927 * stringpool.h (Stringpool_template::set_no_zero_null): Set
5928 Stringpool_template::offset_ to zero.
5929
1aa37384
DK
59302010-03-15 Doug Kwan <dougkwan@google.com>
5931
5932 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
5933 offset_.
5934 (Stringpool_template::new_key_offset): New method.
5935 (Stringpool_template::add_string): Assign offsets when adding new
5936 strings.
5937 (Stringpool_template::set_string_offsets): Do not set string offsets
5938 when not optimizing.
5939 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
5940 member size_.
2e702c99
RM
5941 (Chunked_vector::clear): Clear size_.
5942 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
5943 (Chunked_vector::size): Return size_.
5944 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 5945 (Chunked_vector::size_): New data member.
1aa37384
DK
5946 (Stringpool_template::set_no_zero_null): Assert string set is empty.
5947 (Stringpool_template::new_key_offset): New method declaration.
5948 (Stringpool_template::offset_): New data member.
5949
b672b057
RÁE
59502010-03-15 Rafael Espindola <espindola@google.com>
5951
5952 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
5953 Add_symbols' constructor.
5954 * readsyms.h (Add_symbols): Remove the input_group member.
5955
b6848d3c
ILT
59562010-03-10 Ian Lance Taylor <iant@google.com>
5957
5958 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
5959 target to ask whether a reference to a symbol requires a stack
5960 split.
5961 * target.h (Target::is_call_to_non_split): New function.
5962 (Target::do_is_call_to_non_split): Declare virtual function.
5963 * target.cc: Include "symtab.h".
5964 (Target::do_is_call_to_non_split): New function.
5965 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
5966
a2a5469e
CC
59672010-03-10 Cary Coutant <ccoutant@google.com>
5968
5969 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
5970 (File_read::open[1]): Remove initial mapping of whole_file_view_.
5971 (File_read::open[2]): Add whole_file_view_ to list of views.
5972 (File_read::make_view): Remove test of whole_file_view_.
5973 (File_read::find_or_make_view): Create whole_file_view_ if
5974 necessary.
5975 (File_read::clear_views): Replace bool parameter with enum;
5976 adjust all callers. Don't delete views with permanent data;
5977 do delete cached views and views from archives if
5978 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
5979 if clearing the corresponding view.
5980 * fileread.h (File_read::Clear_views_mode): New enum.
5981 (File_read::View::is_permanent_view): New method.
5982 (File_read::clear_views): Replace bool parameter
5983 with enum; adjust all callers.
5984 * options.h (General_options): Change keep_files_mapped option;
5985 add map_whole_files.
5986 * readsyms.cc (Add_symbols::run): Delete sd_ object before
5987 releasing the file.
5988 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
5989 the file.
5990
8861f32b
DM
59912010-03-10 David S. Miller <davem@davemloft.net>
5992
5993 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
5994
d62d0f5f
ST
59952010-03-09 Sriraman Tallam <tmsriram@google.com>
5996
5997 * icf.cc (get_section_contents): Add '@' marker after processing the
5998 merge reloc.
5999
9177756d
DK
60002010-03-08 Doug Kwan <dougkwan@google.com>
6001
6002 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
6003 due to a conversion warning.
6004 (Arm_relobj::update_output_local_symbol_count): Check for local
6005 symbol with unset output index.
6006
9e9e071b
ILT
60072010-03-05 Ian Lance Taylor <iant@google.com>
6008
6009 * options.h (class General_options): Add --spare-dynamic-tags.
6010 * output.cc (Output_data_dynamic::set_final_data_size): Implement
6011 --spare-dynamic-tags.
6012
a81ee015
ILT
60132010-03-05 Ian Lance Taylor <iant@google.com>
6014
6015 * incremental.cc: Include "libiberty.h".
6016
44ec90b9
RO
60172010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
6018
6019 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
6020 function, is_info_ member.
6021 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
6022 (Versions::Versions): Update caller.
6023 (Versions::define_base_version): Likewise.
6024 (Versions::add_def): Likewise.
6025
0897ed3b
ST
60262010-03-03 Sriraman Tallam <tmsriram@google.com>
6027
6028 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
6029 (Scan::possible_function_pointer_reloc): New function.
6030 (Scan::local_reloc_may_be_function_pointer): Change to call
6031 possible_function_pointer_reloc.
6032 (Scan::global_reloc_may_be_function_pointer): Ditto.
6033 * icf.h (Icf::check_section_for_function_pointers): Change to reject
6034 relocations in ".data.rel.ro._ZTV" section.
6035 * testsuite/icf_safe_so_test.sh: Change to pass i386.
6036 * testsuite/icf_safe_so_test.cc: Ditto.
6037 * testsuite/icf_safe_test.cc: Ditto.
6038 * testsuite/icf_safe_test.sh: Ditto.
6039
d3bbad62
ILT
60402010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6041 Ian Lance Taylor <iant@google.com>
6042
6043 * target-reloc.h (relocate_section): Check the symbol table index
6044 for -1U before setting the local symbol index.
6045 (scan_relocatable_relocs): If copying the relocation, record that
6046 the local symbol is required.
6047 * object.h (Symbol_value::is_output_symtab_index_set): New
6048 function.
6049 (Symbol_value::may_be_discarded_from_output_symtab): New
6050 function.
6051 (Symbol_value::has_output_symtab_entry): New function.
6052 (Symbol_value::needs_output_symtab_entry): Remove.
6053 (Symbol_value::output_symtab_index): Make sure the symbol index is
6054 set.
6055 (Symbol_value::set_output_symtab_index): Make sure the symbol
6056 index is not set. Make sure the new index is valid.
6057 (Symbol_value::set_must_have_output_symtab_entry): New function.
6058 (Symbol_value::has_output_dynsym_entry): New function.
6059 (Symbol_value::set_output_dynsym_index): Make sure the new index
6060 is valid.
6061 (Sized_relobj::set_must_have_output_symtab_entry): New function.
6062 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
6063 local symbol if permitted.
6064 (Sized_relobj::do_finalize_local_symbols): Call
6065 is_output_symtab_index_set rather than needs_output_symtab_entry.
6066 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
6067 rather than needs_output_symtab_entry. Call
6068 has_output_dynsym_entry rather than needs_output_dynsym_entry.
6069 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
6070 is_output_symtab_index_set rather than needs_output_symtab_entry.
6071 * testsuite/discard_locals_relocatable_test.c: New file.
6072 * testsuite/discard_locals_test.sh: Test -r.
6073 * testsuite/Makefile.am (check_DATA): Add
6074 discard_locals_relocatable_test1.syms,
6075 discard_local_relocatable_test2.syms.
6076 (MOSTLYCLEANFILES): Likewise. Also add
6077 discard_locals_relocatable_test1.lout and
6078 discard_locals_relocatable_test2.out.
6079 (discard_locals_relocatable_test1.syms): New target.
6080 (discard_locals_relocatable_test.o): New target.
6081 (discard_locals_relocatable_test1.out): New target.
6082 (discard_locals_relocatable_test2.syms): New target.
6083 (discard_locals_relocatable_test2.out): New target.
6084 (various): Add missing ../ld-new dependencies.
6085 * testsuite/Makefile.in: Rebuild.
6086
7e8ccf26
NC
60872010-03-03 Nick Clifton <nickc@redhat.com>
6088
6089 * po/fi.po: New Finnish translation.
6090
2a0ff005
DK
60912010-03-01 Doug Kwan <dougkwan@google.com>
6092
6093 * layout.cc (Layout::Layout): Force section types of .init_array*,
6094 .preinit_array* and .fini_array* sections.
6095 * output.cc (Output_section::Input_section_sort_entry::has_priority):
6096 Fix check of return value of std::string::find.().
6097 (Output_section::Input_section_sort_compare::operator()): Remove
6098 comment about .init_array.
6099 (Output_section::Input_section_sort_init_fini_compare::operator()):
6100 New method.
6101 (Output_section::sort_attached_input_sections): Handle .init_array
6102 and .fini_array specially.
6103 * output.h (Output_section::Inut_section_sort_compare): Update
6104 comment.
6105 (Output_section::Input_section_sort_init_fini_compare): New struct.
6106
c3e4ae29
DK
61072010-02-26 Doug Kwan <dougkwan@google.com>
6108
6109 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
6110 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
6111 * testsuite/debug_msg.sh: Avoid matching source line number for
6112 use of global variable undef_int.
6113
2fd9ae7a
DK
61142010-02-26 Doug Kwan <dougkwan@google.com>
6115
6116 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
6117 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
6118 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
6119 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
6120 * options.cc (General_options::General_options): Initialize member
6121 fix_v4bx_.
6122 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
6123 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
6124 and rm_no_fix_v4bx.stdout
6125 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
6126 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
6127 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
6128 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
6129 and arm_no_fix_v4bx.
6130 * Makefile.in: Regenerate.
6131 * testsuite/arm_fix_v4bx.s: New file.
6132 * testsuite/arm_fix_v4bx.sh: Ditto.
6133
67ec7d0b
DK
61342010-02-24 Doug Kwan <dougkwan@google.com>
6135
6136 * arm.cc (Target_arm::got_section): Make the .got section the first
6137 non RELRO section in the data segment.
6138 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
6139 suffixes of section names.
6140
10165461
DK
61412010-02-24 Doug Kwan <dougkwan@google.com>
6142
6143 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
6144 flags and attributes merging if an input file is a binary file.
6145 * fileread.cc (Input_file::open): Record format of original file.
6146 * fileread.h (Input_file::Format): New enum type.
2e702c99 6147 (Input_file::Input_file): Initialize data member format_.
10165461
DK
6148 (Input_file::format): New method definition.
6149 (Input_file::format_):: New data member.
6150
4a54abbb
DK
61512010-02-24 Doug Kwan <dougkwan@google.com>
6152
6153 * arm.cc (Arm_output_data_got): New class.
6154 (ARM_TCB_SIZE): New constant
6155 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
6156 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
6157 If user uses a script with a SECTIONS clause, issue only a warning
6158 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 6159 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
6160 garbage collection.
6161 (Target_arm::got_mode_index_entry): Handle static linking.
6162 (Target_arm::Scan::local): Ditto.
6163 (Target_arm::Scan::global): Ditto.
6164 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
6165 all incorrectly implemented relocations.
e1df38aa 6166 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
6167 Arm_output_section::fix_exidx_coverage.
6168 * layout.cc (Layout::section_name_mapping): Remove trailing dots
6169 from ".ARM.exidx." and ".ARM.extab.".
6170
ca419a6f
ILT
61712010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6172
6173 * arm.cc (Target_arm::do_finalize_sections): Create attribute
6174 section if it does not already exist.
6175 * attributes.cc (Attributes_section_data::Attributes_section_data):
6176 Don't crash if size is zero.
6177
135b9c78
ILT
61782010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6179 Ian Lance Taylor <iant@google.com>
6180
6181 * gold.cc (queue_middle_tasks): If no input files were opened,
6182 exit.
6183 * workqueue.h (Task_function::Task_function): Assert that there is
6184 a blocker.
6185
bb0bfe4f
DK
61862010-02-22 Doug Kwan <dougkwan@google.com>
6187
6188 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
6189 * icf.cc (get_section_contents): Cast snprintf arguments to long long
6190 types to avoid warnings due to different uint64_t implementations
6191 on different hosts.
6192
2a2b6d42
DK
61932010-02-21 Doug Kwan <dougkwan@google.com>
6194
6195 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
6196 handling of the maximum backward branch offset.
2e702c99 6197 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
6198 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
6199 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 6200 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
6201 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
6202 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
6203 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
6204 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
6205 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
6206 thumb_bl_out_of_range thumb_bl_out_of_range.o,
6207 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
6208 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
6209 thumb2_bl_out_of_range.o): New rules.
6210 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
6211 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
6212 thumb2_bl_out_of_range
6213 * testsuite/Makefile.in: Regenerate.
6214 * testsuite/arm_bl_in_range.s: New file.
6215 * testsuite/arm_bl_out_of_range.s: Ditto.
6216 * testsuite/arm_branch_in_range.sh: Ditto.
6217 * testsuite/arm_branch_range.t: Ditto.
6218 * testsuite/thumb2_branch_range.t: Ditto.
6219 * testsuite/thumb_bl_in_range.s: Ditto.
6220 * testsuite/thumb_bl_out_of_range.s: Ditto.
6221 * testsuite/thumb_branch_range.t: Ditto.
6222
b487ad64
ST
62232010-02-20 Sriraman Tallam <tmsriram@google.com>
6224
6225 * gc.h (gc_process_relocs): Change vectors to point to the new list.
6226 Add reloc offset information.
6227 * icf.cc (get_section_contents): Change iterators to point to the new
6228 vectors. Add reloc offset information to the contents.
6229 * icf.h (Icf::Sections_reachable_info): New typedef.
6230 (Icf::Sections_reachable_list): New typedef.
6231 (Icf::Offset_info): New typedef.
6232 (Icf::Reloc_info): New struct typedef.
6233 (Icf::Reloc_info_list): New typedef.
6234 (Icf::symbol_reloc_list): Delete method.
6235 (Icf::addend_reloc_list): Delete method.
6236 (Icf::section_reloc_list): Delete method.
6237 (Icf::reloc_info_list): New method.
6238 (Icf::reloc_info_list_): New member.
6239
f96accdf
DK
62402010-02-19 Doug Kwan <dougkwan@google.com>
6241
6242 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
6243 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
6244 * arm.cc (Arm_relocation_functions): New forward declaration.
6245 (Target_arm::Target_arm): Initialize new data members
6246 got_mod_index_offset_ and tls_base_symbol_defined_.
6247 (Target_arm::Relocate::relocate_tls): New method.
6248 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
6249 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
6250 New methods.
2e702c99 6251 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
6252 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
6253 (Target_arm::got_mod_index_offset_,
6254 Target_arm::tls_base_symbol_defined_): New data members.
6255 (Target_arm::Scan::local, Target::Scan::global,
6256 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
6257 relocations.
6258
c8761b9a
DK
62592010-02-18 Doug Kwan <dougkwan@google.com>
6260
6261 * arm.cc (Arm_relobj::find_linked_text_section): New method.
6262 (Arm_relobj::make_exidx_input_section): Pass section index of linked
6263 text section as a parameter becuase some broken tools may not set
6264 the link in section header.
6265 (Target_arm::has_got_section): New method.
6266 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
6267 without any mapping symbol as data only. Remove warning.
6268 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
6269 link in its section header, try to discover the link by inspecting the
6270 REL31 relocation at the beginning of the section.
6271 (Target_arm::Scan::check_non_pic): Report name of offending relocation
6272 in error message.
6273 (Target_arm::Scan::global): Treat any reference to the symbol
6274 _GLOBAL_OFFSET_TABLE_ as a GOT access.
6275
21bb3914
ST
62762010-02-12 Sriraman Tallam <tmsriram@google.com>
6277
6278 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
6279 (Scan::global_reloc_may_be_function_pointer): New function.
6280 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6281 (Scan::global_reloc_may_be_function_pointer): New function.
6282 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6283 (Scan::global_reloc_may_be_function_pointer): New function.
6284 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
6285 (Scan::global_reloc_may_be_function_pointer): New function.
6286 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
6287 (Scan::global_reloc_may_be_function_pointer): New function.
6288 (Scan::possible_function_pointer_reloc): New function.
6289 (Target_x86_64::can_check_for_function_pointers): New function.
6290 * gc.h (gc_process_relocs): Scan relocation types to determine if
6291 function pointers were taken for targets that support it.
6292 * icf.cc (Icf::find_identical_sections): Include functions for
6293 folding in safe ICF whose pointer is not taken.
6294 * icf.h (Secn_fptr_taken_set): New typedef.
6295 (fptr_section_id_): New member.
6296 (section_has_function_pointers): New function.
6297 (set_section_has_function_pointers): New function.
6298 (check_section_for_function_pointers): New function.
6299 * options.h: Fix comment for safe ICF option.
6300 * target.h (can_check_for_function_pointers): New function.
6301 * testsuite/Makefile.am: Add icf_safe_so_test test case.
6302 Modify icf_safe_test for X86-64.
6303 * testsuite/Makefile.in: Regenerate.
6304 * testsuite/icf_safe_so_test.cc: New file.
6305 * testsuite/icf_safe_so_test.sh: New file.
6306 * testsuite/icf_safe_test.cc (kept_func_3): New function.
6307 (main): Change to take pointer to function kept_func_3.
6308 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
6309 folding is done correctly for X86-64.
6310
0da6fa6c
DM
63112010-02-12 David S. Miller <davem@davemloft.net>
6312
6313 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
6314 is_symbolless parameter.
6315 (Output_reloc<SHT_REL>::is_symbolless): New.
6316 (Output_reloc<SHT_REL>::is_symbolless_): New.
6317 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
6318 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
6319 (Output_reloc<SHT_RELA>::is_symbolless): New.
6320 (Output_data_reloc::add_global): Handle is_symbolless.
6321 (Output_data_reloc::add_global_relative): Likewise.
6322 (Output_data_reloc::add_local): Likewise.
6323 (Output_data_reloc::add_local_relative): Likewise.
6324 (Output_data_reloc::add_symbolless_global_addend): New.
6325 (Output_data_reloc::add_symbolless_local_addend): New.
6326 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
6327 is_symbolless.
6328 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
6329 instead of ->is_relative_
6330 (Output_reloc::write): Likewise.
6331 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
6332 (Output_reloc::write_rel): Simplify.
6333
6334 * sparc.cc (Target_sparc::Scan::local): Use
6335 ->add_symbolless_local_addend as needed.
6336 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
6337 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
6338 based upon relocation offset.
6339
e4782e83
DK
63402010-02-11 Doug Kwan <dougkwan@google.com>
6341
6342 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
6343 (Target_arm::Scan::global): Ditto. Also remove a comment before the
6344 beginning of function.
6345 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
6346 and MOVT_ABS relocations. Those are non issued in scanning. Fix
6347 parameter is_32bit in calls to should_apply_static_reloc.
6348 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
6349 (check_DATA): Add arm_abs_global.stdout.
6350 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
6351 arm_abs_global.stdout): New rules.
6352 (MOSTLLYCLEANFILES): Add arm_abs_global
6353 * Makefile.in: Regenerate.
6354 * testsuite/arm_abs_global.s: New file.
6355 * testsuite/arm_abs_global.sh: Ditto.
6356 * testsuite/arm_abs_lib.s: Ditto.
6357
93ceb764
ILT
63582010-02-11 Ian Lance Taylor <iant@google.com>
6359
6360 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
6361 Read_relocs task.
6362 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
6363 Allocate_commons_task first.
6364 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
6365 task, rather than symtab_lock_.
6366 (Gc_process_relocs::~Gc_process_relocs): New function.
6367 (Gc_process_relocs::is_runnable): Check this_blocker_.
6368 (Gc_process_relocs::locks): Use next_blocker_ rather than
6369 blocker_.
6370 (Scan_relocs::~Scan_relocs): New function.
6371 (Scan_relocs::is_runnable): Check this_blocker_ rather than
6372 symtab_lock_.
6373 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
6374 next_blocker_.
6375 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
6376 fields. Add this_blocker_ and next_blocker_ fields. Adjust
6377 constructor accordingly.
6378 (class Gc_process_relocs): Likewise.
6379 (class Scan_relocs): Likewise.
6380 * common.h (class Allocate_commons_task): Remove symtab_lock_
6381 field, and corresponding constructor parameter.
6382 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
6383 symtab_lock_.
6384 (Allocate_commons_task::locks): Likewise.
6385
114dfbe1
ILT
63862010-02-11 Ian Lance Taylor <iant@google.com>
6387
6388 * gold-threads.h (class Once): Define.
6389 (class Initialize_lock): Rewrite as child of Once.
6390 * gold-threads.cc (class Once_initialize): Define.
6391 (once_pointer_control): New static variable.
6392 (once_pointer, once_arg): New static variables.
6393 (c_run_once): New static function.
6394 (Once::Once, Once::run_once, Once::internal_run): New functions.
6395 (class Initialize_lock_once): Remove.
6396 (initialize_lock_control): Remove.
6397 (initialize_lock_pointer): Remove.
6398 (initialize_lock_once): Remove.
6399 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
6400 (Initialize_lock::initialize): Rewrite.
6401 (Initialize_lock::do_run_once): New function.
6402 * archive.cc (Archive::interpret_header): Only clear name if it is
6403 not already empty.
6404 * fileread.cc: Include "gold-threads.h"
6405 (file_counts_lock): New static variable.
6406 (file_counts_initialize_lock): Likewise.
6407 (File_read::release): Only increment counts when using --stats.
6408 Use a lock around the increment.
6409 * parameters.cc (class Set_parameters_target_once): Define.
6410 (set_parameters_target_once): New static variable.
6411 (Parameters::Parameters): Move here from parameters.h.
6412 (Parameters::set_target): Rewrite.
6413 (Parameters::set_target_once): New function.
6414 (Parameters::clear_target): Move here and rewrite.
6415 * parameters.h (class Parameters): Update declarations. Add
6416 set_parameters_target_once_ field.
6417 (Parameters::Parameters): Move to parameters.cc.
6418 (Parameters::clear_target): Likewise.
6419 * readsyms.cc (Read_symbols::do_group): Create a Start_group
6420 task.
6421 (Start_group::~Start_group): New function.
6422 (Start_group::is_runnable): New function.
6423 (Start_group::locks, Start_group::run): New functions.
6424 (Finish_group::run): Change saw_undefined to size_t.
6425 * readsyms.h (class Start_group): Define.
6426 (class Finish_group): Change saw_undefined_ field to size_t.
6427 (Finish_group::Finish_group): Remove saw_undefined and
6428 this_blocker parameters. Change all callers.
6429 (Finish_group::set_saw_undefined): New function.
6430 (Finish_group::set_blocker): New function.
6431 * symtab.h (class Symbol_table): Change saw_undefined to return
6432 size_t. Change saw_undefined_ field to size_t.
6433 * target-select.cc (Set_target_once::do_run_once): New function.
6434 (Target_selector::Target_selector): Initialize set_target_once_
6435 field. Don't initialize lock_ and initialize_lock_ fields.
6436 (Target_selector::instantiate_target): Rewrite.
6437 (Target_selector::set_target): New function.
6438 * target-select.h (class Set_target_once): Define.
6439 (class Target_selector): Update declarations. Make
6440 Set_target_once a friend. Remove lock_ and initialize_lock_
6441 fields. Add set_target_once_ field.
6442
fa17a3f4
ILT
64432010-02-10 Ian Lance Taylor <iant@google.com>
6444
6445 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
6446 queueing any tasks.
6447 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
6448 (queue_middle_tasks): Add all blockers before queueing any tasks.
6449 (queue_final_tasks): Likewise.
6450 * token.h (Task_token::add_blockers): New function.
6451 * object.h (Input_objects::number_of_relobjs): New function.
6452
c7177d31
ILT
64532010-02-10 Ian Lance Taylor <iant@google.com>
6454
5de0e392
ILT
6455 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
6456 shared, not if not position independent.
6457 * x86_64.cc (Relocate::relocate_tls): Likewise.
6458 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
6459 (tls_pie_pic_test): New target.
6460 * testsuite/Makefile.in: Rebuild.
6461
c7177d31
ILT
6462 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
6463 (tls_test_main_pie.o, tls_test_pie.o): New targets.
6464 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
6465 * testsuite/Makefile.in: Rebuild.
6466
684b268a
DM
64672010-02-09 David S. Miller <davem@davemloft.net>
6468
6469 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
6470 R_SPARC_RELATIVE using ->add_local_relative().
6471 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
6472
612a8d3d
DM
6473 * output.h (Output_data_dynamic::add_section_size): New method
6474 that takes two Output_data objects.
6475 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
6476 entry param. Handle it in initializers.
6477 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
6478 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
6479 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
6480 arg.
6481 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
6482 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
6483 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
6484 for dynrel_includes_plt.
6485 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6486 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6487 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
6488 before .rela.plt
6489 (Target_sparc::do_finalize_sections): Update to pass true for
6490 dynrel_includes_plt.
6491 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
6492 output before .rela.plt
6493 (Target_powerpc::do_finalize_sections): Update to pass true for
6494 dynrel_includes_plt when 32-bit.
6495
cb1be87e
DK
64962010-02-08 Doug Kwan <dougkwan@google.com>
6497
6498 * arm.cc (Arm_relobj::simple_input_section_output_address): New
6499 method.
6500 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
6501 Arm_relobj::scan_section_for_cortex_a8_stubs,
6502 Arm_relobj::do_relocation_section): Instead of calling
6503 Output_section::output_address, use faster
6504 Arm_relobj::simple_input_section_output_address.
6505
705b5121
DM
65062010-02-08 David S. Miller <davem@davemloft.net>
6507
6508 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
6509 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
6510 relocation helper function.
6511
024c4466
DM
6512 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
6513 just like R_SPARC_GOT{10,13,22}.
6514 (Target_sparc::Scan::local): Likewise.
6515 (Target_sparc::Relocate:relocate): Likewise.
6516
9109c078
ILT
65172010-02-06 Ian Lance Taylor <iant@google.com>
6518
6519 * configure.ac: Rewrite targetobjs duplicate removal code to use
6520 only shell constructs.
6521 * configure: Rebuild.
6522
cf846138
DK
65232010-02-05 Doug Kwan <dougkwan@google.com>
6524
6525 PR 11247
6526 * arm.cc (Arm_relobj::section_is_scannable): New method.
6527 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
6528 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
6529
6cfaf60b
DK
65302010-02-04 Doug Kwan <dougkwan@google.com>
6531
6532 PR 11247
6533 * arm-reloc-property.cc (cstdio): Include.
6534 * configure.ac (targetobjs): Remove duplicates.
6535 * configure: Regenerate.
6536 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
6537 big and little endian version for a given address size.
6538
5c57f1be
DK
65392010-02-03 Doug Kwan <dougkwan@google.com>
6540
6541 * arm-reloc-property.cc
6542 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6543 definition.
6544 * arm-reloc-property.h
6545 (Arm_reloc_property_table::get_implemented_static_reloc_property):
6546 New method definition.
6547 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6548 declaration.
6549 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
6550 overflow to N.
6551 (GOT_PREL): Change implemented to Y.
6552 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
6553 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
6554 (Arm_relocate_functions::movw_abs_nc): Remove method.
6555 (Arm_relocate_functions::movt_abs): Ditto.
6556 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
6557 (Arm_relocate_functions::thm_movt_abs): Ditto.
6558 (Arm_relocate_functions::movw_rel_nc): Ditto.
6559 (Arm_relocate_functions::movw_rel): Ditto.
6560 (Arm_relocate_functions::movt_rel): Ditto.
6561 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
6562 (Arm_relocate_functions:thm_movw_rel): Ditto.
6563 (Arm_relocate_functions:thm_movt_rel): Ditto.
6564 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
6565 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
6566 New method definitions.
6567 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
6568 (Arm_relocation_functions::arm_grp_ldr): Ditto.
6569 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
6570 (Arm_relocation_functions::arm_grp_ldc): Ditto.
6571 (Target_arm::Relocate::relocate): Check for non-static or
6572 unimplemented relocation code and exit early. Change calls to
6573 Target_arm::reloc_uses_thumb_bit and
6574 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
6575 instead. Refactor code to handle similar relocations to increase
6576 code sharing. Remove check for unsupported relocation code in switch
6577 statement.
6578 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
6579 relocation property table to find out size. Change error message to
6580 print out the name of a relocation code instead of the numeric value.
6581 (Target_arm::scan_reloc_for_stub): Use relocation property table
6582 instead of calling Target_arm::reloc_uses_thumb_bit().
6583
218c5831
DK
65842010-02-02 Doug Kwan <dougkwan@google.com>
6585
6586 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
6587 types of relaxed input section.
6588
0d31c79d
DK
65892010-02-02 Doug Kwan <dougkwan@google.com>
6590
6591 * Makefile.am (HFILES): Add arm-reloc-property.h.
6592 (DEFFILES): New.
2e702c99
RM
6593 (TARGETSOURCES): Add arm-reloc-property.cc
6594 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
6595 (libgold_a_SOURCES): $(DEFFILES)
6596 * Makefile.in: Regenerate.
6597 * arm-reloc-property.cc: New file.
6598 * arm-reloc-property.h: New file.
6599 * arm-reloc.def: New file.
6600 * arm.cc: Update comments.
6601 (arm-reloc-property.h): New included header.
6602 (arm_reloc_property_table): New global variable.
6603 (Target_arm::do_select_as_default_target): New method definition.
6604 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
6605 arm-reloc-property to targ_extra_obj.
6606 * parameters.cc (set_parameters_target): Call
6607 Target::select_as_default_target().
6608 * target.h (Target::select_as_default_target): New method definition.
6609 (Target::do_select_as_default_target): Same.
6610
546c7457
DK
66112010-02-01 Doug Kwan <dougkwan@google.com>
6612
6613 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
6614 first_output_text_section_.
6615 (Arm_exidx_fixup::first_output_text_section): New method definition.
6616 (Arm_exidx_fixup::first_output_text_section_): New data member.
6617 (Arm_exidx_fixup::process_exidx_section): Record the first text
6618 output section seen.
6619 (Arm_output_section::fix_exidx_coverage): Set correct linked section
6620 and entsize in output section header.
6621
11b861d5
DK
66222010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6623
6624 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
6625 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
6626 (Arm_relocate_functions::thm_alu11): New Method.
6627 (Arm_relocate_functions::thm_pc8): New Method.
6628 (Arm_relocate_functions::thm_pc12): New Method.
6629 (Target_arm::Scan::local): Handle the relocations.
6630 (Target_arm::Scan::global): Likewise.
6631 (Target_arm::Relocate::relocate): Likewise.
6632 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6633
c9a2c125
DK
66342010-01-29 Doug Kwan <dougkwan@google.com>
6635
6636 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
6637 of relocation types as ld.
6638
1521477a
DK
66392010-01-29 Doug Kwan <dougkwan@google.com>
6640
6641 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
6642 to public.
6643 (Arm_relocate_functions::thumb_branch_common): Ditto.
6644 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
6645 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
6646 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
6647 Arm_relocate_functions::jump24): Remove.
6648 (Target_arm::Relocate::relocate): Adjust code to call
6649 Arm_relocation_functions::arm_branch_common and
6650 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 6651 wrappers. Merge switch-cases together to reduce source code size.
1521477a 6652
e7eca48c
DK
66532010-01-29 Doug Kwan <dougkwan@google.com>
6654
6655 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
6656 output_local_symbol_count_needs_update_.
6657 (Arm_relobj::output_local_symbol_count_needs_update,
6658 Arm_relobj::set_output_local_symbol_count_needs_update,
6659 Arm_relobj::update_output_local_symbol_count): New methods.
6660 (Arm_relobj::output_local_symbol_count_needs_update_): New data
6661 member.
6662 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
6663 of pointed function as in a R_ARM_PREL31 relocation.
6664 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
6665 for output local symbol count updating.
6666 (Target_arm::do_relax): Update output local symbol counts in objects
6667 if necessary.
6668 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
6669
02961d7e
ILT
66702010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6671
6672 * arm.cc: Added support for the ARM relocations:
6673 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
6674 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
6675 (Arm_relocate_functions::movw_rel_nc): Renamed (was
6676 movw_prel_nc).
6677 (Arm_relocate_functions::movw_rel): New method.
6678 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
6679 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
6680 thm_movw_prel_nc).
6681 (Arm_relocate_functions::thm_movw_rel): New method.
6682 (Arm_relocate_functions::thm_movt_rel): Renamed (was
6683 thm_movt_prel).
6684 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
6685 relocations.
6686 (Target_arm::Scan::global): Likewise.
6687 (Target_arm::Relocate::relocate): Likewise.
6688 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6689 Likewise.
6690
b10d2873
ILT
66912010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6692
6693 * arm.cc: Added support for ARM group relocations.
6694 (Target_arm::reloc_needs_sym_origin): New method.
6695 (Arm_relocate_functions::calc_grp_kn): New method.
6696 (Arm_relocate_functions::calc_grp_residual): New method.
6697 (Arm_relocate_functions::calc_grp_gn): New method.
6698 (Arm_relocate_functions::arm_grp_alu): New Method.
6699 (Arm_relocate_functions::arm_grp_ldr): New Method.
6700 (Arm_relocate_functions::arm_grp_ldrs): New Method.
6701 (Arm_relocate_functions::arm_grp_ldc): New Method.
6702 (Target_arm::Scan::local): Handle the ARM group relocations.
6703 (Target_arm::Scan::global): Likewise.
6704 (Target_arm::Relocate::relocate): Likewise.
6705 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6706 Likewise.
6707
2b328d4e
DK
67082010-01-26 Doug Kwan <dougkwan@google.com>
6709
6710 * arm.cc (set): Include.
6711 (class Arm_exidx_fixup): Change type of last_input_section_ to const
6712 pointer type.
2e702c99 6713 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
6714 (Arm_output_section::append_text_sections_to_list): New method.
6715 (Arm_output_section::fix_exidx_coverage): Ditto.
6716 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 6717 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
6718 Relobj::set_section_offset() instead of
6719 Sized_relobj::invalidate_section_offset().
2e702c99 6720 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
6721 parameter for section headers. Ignore relocation sections for
6722 unallocated sections and EXIDX sections.
6723 (Target_arm::fix_exidx_coverage): New method.
6724 (Target_arm::output_section_address_less_than): New type.
6725 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
6726 linked text section instead of the EXIDX section.
6727 (Arm_output_section::create_stub_group): Add an assertion to check
6728 that this is not an EXIDX output section.
6729 (Arm_output_section::append_text_sections_to_list): New method.
6730 (Arm_output_section::fix_exidx_coverage): Ditto.
6731 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 6732 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
6733 (Target_arm::do_relax): Fix EXIDX output section coverage in the
6734 first pass.
6735 (Target_arm::fix_exidx_coverage): New method.
6736 * object.h (Relobj::set_output_section): New method.
6737 (Sized_relobj::invalidate_section_offset): Remove method.
6738 (Sized_relobj::do_invalidate_section_offset): Remove method.
6739 (Sized_relobj::do_set_section_offset): Handle offset value -1.
6740
c7f3c371
DK
67412010-01-25 Doug Kwan <dougkwan@google.com>
6742
6743 * arm.cc (Arm_exidx_merged_section::do_output_offset):
6744 Fix warning due to signed and unsigned comparison on a 32-bit host.
6745
8923b24c
DK
67462010-01-22 Doug Kwan <dougkwan@google.com>
6747
6748 * arm.cc (Target_arm::do_relax): Record an output section for section
6749 offset adjustment it contains any stub table that has changed.
6750 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
6751 offsets in an output section if necessary.
6752 * output.cc (Output_section::Output_section): Initialize
6753 section_offsets_need_adjustments_.
6754 (Output_section::add_input_section_for_script): Renamed to
6755 Output_section::add_simple_input_section.
6756 (Output_section::save_states): Add a comment.
6757 (Output_section::discard_states): New method defintion.
6758 (Output_section::adjust_section_offsets): Same.
6759 * output.h (Output_section::add_input_section_for_script): Renamed to
6760 Output_section::add_simple_input_section.
6761 (Output_section::discard_states): New method declaration.
6762 (Output_section::adjust_section_offsets): Same.
6763 (Output_section::section_offsets_need_adjustment,
6764 Output_section::set_section_offsets_need_adjustment): New method
6765 definitions.
6766 (Output_section::section_offsets_need_adjustment_): New data member.
6767 * script-sections.cc
6768 (Output_section_element_input::set_section_address): Adjust code for
6769 renaming of Output_section::add_input_section_for_script.
6770 (Orphan_output_section::set_section_address): Same.
6771
9b2fd367
DK
67722010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6773
6774 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
6775 Fix_v4bx enum values .
6776 * gold/options.h (General_options): New option definitions.
6777 (General_options::fix_v4bx): New method.
6778 (General_options::Fix_v4bx): New enum.
6779 * gold/options.cc (General_options::parse_fix_v4bx): New method.
6780 (General_options::parse_fix_v4bx_interworking): New method.
6781
80d0d023
DK
67822010-01-22 Doug Kwan <dougkwan@google.com>
6783
6784 * arm.cc (Arm_exidx_fixup): New class.
6785
af2cdeae
DK
67862010-01-21 Doug Kwan <dougkwan@google.com>
6787
6788 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
6789 classes.
6790 (Arm_exidx_section_offset_map): New type.
6791
993d07c1
DK
67922010-01-21 Doug Kwan <dougkwan@google.com>
6793
6794 * arm.cc (Arm_exidx_input_section): New class.
6795 (Arm_relobj::exidx_input_section_by_link,
6796 Arm_relobj::exidx_input_section_by_shndx,
6797 Arm_relobj::make_exidx_input_section): New methods.
6798 (read_arm_attributes_section): Remove.
6799 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
6800 information about them.
6801 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
6802 to here.
6803
5ac169d4
DK
68042010-01-20 Doug Kwan <dougkwan@google.com>
6805
6806 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
6807 Input_section_specifier to Section_id.
6808 (Target_arm::new_arm_input_section: Adjust code for change of key
6809 type.
6810 (Target_arm::find_arm_input_section): Ditto.
6811 * gc.h (object.h): Include for Section_id nand Section_id_hash.
6812 (Section_id): Remove.
6813 (Garbage_collection::Section_id_hash): Remove.
6814 * icf.h (object.h): Include for Section_id nand Section_id_hash.
6815 (Section_id): Remove.
6816 (Icf::Section_id_hash): Remove.
6817 * object.h (Section_id, Const_section_id, Section_id_hash,
6818 Const_section_id_hash): New type definitions.
6819 * output.cc (Output_section::add_relaxed_input_section): Change to
6820 use Const_section_id instead of Input_section_specifier as key type.
6821 (Output_section::add_merge_input_section): Ditto.
6822 (Output_section::build_relaxation_map): Change to use Section_id
6823 instead of Input_section_specifier as key type.
2e702c99 6824 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
6825 Ditto.
6826 (Output_section::convert_input_sections_to_relaxed_sections): Change
6827 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 6828 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
6829 (Output_section::find_relaxed_input_section): Ditto.
6830 * output.h (Input_section_specifier): Remove class.
6831 (Output_section::Output_section_data_by_input_section_map): Change
6832 key type to Const_section_id.
6833 (Output_section::Output_relaxed_input_section_by_input_section_map):
6834 Ditto.
6835 (Output_section::Relaxation_map): Change key type to Section_id.
6836
a2162063
ILT
68372010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6838
6839 * gold/arm.cc: Added support for R_ARM_V4BX relocation
6840 (class Arm_v4bx_stub): New class.
6841 (DEF_STUBS): Updated definition to support v4_veneer_bx.
6842 (Stub_factory::make_arm_v4bx_stub): New method.
6843 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
6844 (Stub_table::empty): Handle v4bx stubs.
6845 (Stub_table::add_arm_v4bx_stub): New method.
6846 (Stub_table::find_arm_v4bx_stub): New method.
6847 (Arm_relocate_functions::v4bx): New method.
6848 (Target_arm::fix_v4bx): New method.
6849 (Target_arm::Target_arm): Handle R_ARM_V4BX.
6850 (Stub_table::relocate_stubs): Likewise.
6851 (Stub_table::do_write): Likewise.
6852 (Stub_table::update_data_size_and_addralign): Likewise.
6853 (Stub_table::finalize_stubs): Likewise.
6854 (Target_arm::Scan::local): Likewise.
6855 (Target_arm::Scan::global): Likewise.
6856 (Target_arm::do_finalize_sections): Likewise.
6857 (Target_arm::Relocate::relocate): Likewise.
6858 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6859 Likewise.
6860 (Target_arm::scan_reloc_for_stub): Likewise.
6861 (Target_arm::scan_reloc_section_for_stubs): Likewise.
6862
5696ab0b
ILT
68632010-01-19 Ian Lance Taylor <iant@google.com>
6864
6865 * output.cc (Output_section_headers::do_sized_write): Write large
6866 segment count to sh_info field.
6867 (Output_file_header::do_sized_write): For large segment count,
6868 write PN_XNUM to e_phnum field.
6869
800d0f56
ILT
68702010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6871
6872 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
6873 (Arm_relocate_functions::thm_jump8): New function.
6874 (Arm_relocate_functions::thm_jump11): New function.
6875 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
6876 R_ARM_THM_JUMP11.
6877 (Target_arm::Scan::global): Likewise.
6878 (Target_arm::Relocate::relocate): Likewise.
6879 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6880 Likewise.
6881
41263c05
DK
68822010-01-14 Doug Kwan <dougkwan@google.com>
6883
6884 * arm.cc (map, utility): Include headers.
6885 (Target_arm::apply_cortex_a8_workaround): New method.
6886 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
6887 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
6888 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
6889 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
6890 the --[no-]fix-cortex-a8 command line options.
6891 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
6892 (Target_arm::relocate_stub): Use addend in instruction template.
6893 * options.h (DEFINE_bool): Set the user-set flag.
6894 (General_options): Add --[no-]-fix-cortex options.
6895 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 6896 : Update fast look-up map after conversion.
41263c05 6897
459e9b03
ST
68982010-01-14 Sriraman Tallam <tmsriram@google.com>
6899
6900 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
6901 in the first pass of do_layout.
6902
b521dfe4
DK
69032010-01-13 Doug Kwan <dougkwan@google.com>
6904
6905 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
6906 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
6907 apparent compiler problem of not folding static constant integral
6908 data members of elfcpp::Elf_sizes<32>.
6909
44272192
DK
69102010-01-13 Doug Kwan <dougkwan@google.com>
6911
6912 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
6913 Arm_relobj::section_needs_cortex_a8_stub_scanning,
6914 Arm_relobj::scan_section_for_cortex_a8_erratum,
6915 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
6916 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
6917 sections to scan for relocation stubs into a new method
6918 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
6919 relocation and Cortex-A8 stub scanning.
6920 (Target_arm::do_relax): Force stubs to be after stubbed sections
6921 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 6922 the beginning of a new relaxation pass. Update a comment.
44272192
DK
6923 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
6924
44b71ece
ILT
69252010-01-12 Ian Lance Taylor <iant@google.com>
6926
6927 * target-reloc.h (visibility_error): New inline function.
6928 (relocate_section): Call visibility_error.
6929 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
6930 (MOSTLYCLEANFILES): Likewise.
6931 (protected_4_pic.o, protected_3.err): New targets.
6932 * testsuite/protected_4.cc: New file.
6933
a120bc7f
DK
69342010-01-12 Doug Kwan <dougkwan@google.com>
6935
6936 * arm.cc (Cortex_a8_reloc): New class.
6937 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
6938 and cortex_a8_relocs_info_.
6939 (Target_arm::fix_cortex_a8): New method definition.
6940 (Target_arm::Cortex_a8_relocs_info): New type.
6941 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
6942 New data member declarations.
6943 (Target_arm::scan_reloc_for_stub): Record information about
6944 relocations for THUMB branches that might be exempted from the
6945 Cortex-A8 workaround.
6946 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
6947 at the beginning of a relaxation pass.
6948
20138696
DK
69492010-01-12 Doug Kwan <dougkwan@google.com>
6950
6951 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
6952 (Arm_relobj::Mapping_symbol_position,
6953 Arm_reloj::Mapping_symbol_position_less,
6954 Arm_relobj::Mapping_symbols_info): New types.
6955 (Target_arm::is_mapping_symbol_name): New method definition.
6956 (Arm_relobj::do_count_local_symbols): Save information about mapping
6957 symbols.
6958
089d69dc
DK
69592010-01-11 Doug Kwan <dougkwan@google.com>
6960
6961 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
6962 Arm_relocate_functions::thumb32_branch_upper,
6963 Arm_relocate_functions::thumb32_branch_lower,
6964 Arm_relocate_functions::thumb32_cond_branch_offset,
6965 Arm_relocate_functions::thumb32_cond_branch_upper,
6966 Arm_relocate_functions::thumb32_cond_branch_lower,
6967 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
6968 branch offset encoding.
6969 (Arm_relocate_functions::thumb_branch_common): Use new branch
6970 offset encoding methods to avoid code duplication.
6971 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
6972 (Stub_addend_reader::operator()): Use new branch encoding method
6973 to avoid code duplication.
6974
99e5bff2
DK
69752010-01-11 Doug Kwan <dougkwan@google.com>
6976
6977 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
6978 (Target_arm::do_finalize_sections): Define special EXIDX section
6979 symbols only if referenced.
6980 * gc.h (Garbage_collection::add_reference): New method.
6981 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
6982 code duplication.
6983
98e090bd
ILT
69842010-01-11 Ian Lance Taylor <iant@google.com>
6985
d0a91bd8
ILT
6986 * script.cc (Version_script_info::build_expression_list_lookup):
6987 Change complaing about duplicate wildcard match from error to
6988 warning.
6989
98e090bd
ILT
6990 * script.cc (class Lazy_demangler): Recreate--revert part of patch
6991 of 2009-12-30.
6992 (Version_script_info::Version_script_info): Initialize globs_,
6993 default_version_, default_is_global_, and exact_. Don't
6994 initialize globals_ or locals_.
6995 (Version_script_info::build_lookup_tables): Build local symbols
6996 first.
6997 (Version_script_info::unquote): New function.
6998 (Version_script_info::add_exact_match): New function.
6999 (Version_script_info::build_expression_list_lookup): Remove lookup
7000 parameter. Add is_global parameter. Change all callers. Handle
7001 wildcard pattern specially. Unquote pattern. Call
7002 add_exact_match.
7003 (Version_script_info::get_name_to_match): New function.
7004 (Version_script_info::get_symbol_version): New function.
7005 (Version_script_info::get_symbol_version_helper): Remove.
7006 (Version_script_info::check_unmatched_names): Call unquote.
7007 * script.h (class Version_script_info): Change get_symbol_version
7008 to be non-inline and add is_global parameter; change all callers.
7009 Rewrite symbol_is_local. Update declarations. Define struct
7010 Version_tree_match, Exact, Globs. Don't define struct Lookup.
7011 Remove globals_ and locals_ members. Add exact_, globs_,
7012 default_version_, is_global_.
7013 (Version_script_info::Glob): Remove pattern, add expression and
7014 is_global. Update constructor. Change all callers.
7015 * dynobj.cc (Versions::finalize): Mark the version symbol as the
7016 default version.
7017 (Versions::symbol_section_contents): If a symbol is undefined, or
7018 defined in a dynamic object, set the version index to
7019 VER_NDX_LOCAL.
7020 * symtab.cc (Symbol_table::add_from_relobj): Don't call
7021 symbol_is_local.
7022 (Symbol_table::add_from_pluginobj): Likewise.
7023 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
7024
d56962d3
DK
70252010-01-11 Doug Kwan <dougkwan@google.com>
7026
7027 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
7028 (incremental_dump_LDADD): Add linking option for libintl.
7029 * Makefile.in: Regenerate.
7030
94e6ee91
L
70312010-01-11 H.J. Lu <hongjiu.lu@intel.com>
7032
7033 PR gold/11144
7034 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
7035 instead of -Ds.
7036 * testsuite/Makefile.in: Regenerated.
7037
e96c574b
DK
70382010-01-10 Doug Kwan <dougkwan@google.com>
7039
7040 * options.h (DEFINE_var): Use parentheses around argument varname__
7041 in macro body to avoid any unintended subsequent substitutions.
7042
7198066b
ILT
70432010-01-10 Ian Lance Taylor <iant@google.com>
7044
ba4d53bf
ILT
7045 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
7046 candidates before doing symbol resolution.
7047
7198066b
ILT
7048 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
7049 ODR candidates if only one is weak.
7050
a2beed37
ILT
70512010-01-08 Ian Lance Taylor <iant@google.com>
7052
7053 * script.cc (Version_script_info::build_expression_list_lookup):
7054 Don't warn about ambiguous version, just record the ambiguity.
7055 (Version_script_info::get_symbol_version_helper): Give error if
7056 version is ambiguous.
7057
2fb7225c
DK
70582010-01-08 Doug Kwan <dougkwan@google.com>
7059
7060 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
7061 prev_data_size_ and prev_addralign_. Remove initializer for
7062 deleted data member has_been_changed_.
7063 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
7064 to determine if the table is empty.
7065 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
7066 Remove.
7067 (Stub_table::add_reloc_stub): Define method in class definition
7068 instead of just declaring it there.
7069 (Stub_table::add_cortex_a8_stub): New method definition.
7070 (Stub_table::update_data_size_and_addralign): Ditto.
7071 (Stub_table::finalize_stubs): Ditto.
7072 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
7073 (Stub_table::do_addralign_): Return address alignment in the
7074 (Stub_table::do_reset_address_and_file_offset): Define method in
7075 class definition instead of declaring it there. Set current data
7076 size to be the data size of the previous pass.
7077 (Stub_table::set_final_data_size): Use current data size as the
7078 final data size.
7079 (Stub_table::relocate_stub): Change parameter type of stub from
7080 Reloc_stub pointer to Stub pointer.
7081 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
7082 (Stub_table::Cortex_a8_stub_list): New typedef.
7083 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
7084 Stub_table::prev_addralign_): New data member.
7085 (Arm_relobj::Arm_relobj): Initialize data member
7086 section_has_cortex_a8_workaround_.
7087 (Arm_relobj::section_has_cortex_a8_workaround,
7088 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
7089 definitions.
7090 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
7091 declarations.
7092 (Target_arm::relocate_stub): Change parameter type of stub from
7093 Reloc_stub pointer to Stub pointer.
7094 (Insn_template::size, Insn_template::alignment): Handle
7095 THUMB16_SPECIAL_TYPE.
7096 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
7097 Stub_table::update_data_size_and_addralign,
7098 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
7099 definitions.
2e702c99 7100 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
2fb7225c
DK
7101 (Stub_table::do_write): Ditto.
7102 (Target_arm::do_relax): Adjust code for changes in Stub_table.
7103
880cd20d
ILT
71042010-01-08 Ian Lance Taylor <iant@google.com>
7105
7106 PR 11108
7107 * symtab.h (class Symbol): Remove fields is_target_special_ and
7108 has_plt_offset_. Add field is_defined_in_discarded_section_.
7109 (Symbol::is_defined_in_discarded_section): New function.
7110 (Symbol::set_is_defined_in_discarded_section): New function.
7111 (Symbol::has_plt_offset): Rewrite.
7112 (Symbol::set_plt_offset): Verify that new offset is not -1U.
7113 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
7114 Don't initialize is_target_special_ or has_plt_offset_.
7115 Initialize is_defined_in_discarded_section_.
7116 (Symbol_table::add_from_relobj): If appropriate, set
7117 is_defined_in_discarded_section.
7118 * resolve.cc (Symbol::override_base_with_special): Don't test
7119 is_target_special_. Change has_plt_offset_ to has_plt_offset().
7120 * target-reloc.h (relocate_section): Do special handling for
7121 symbols defined in discarded sections for global symbols as well
7122 as local symbols.
7123
2703e3eb
ILT
71242010-01-08 Ian Lance Taylor <iant@google.com>
7125
7126 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
7127 the SHT_SYMTAB case.
7128
339d40a3
ILT
71292010-01-08 Ian Lance Taylor <iant@google.com>
7130
7131 * object.cc (Sized_relobj::do_layout): Don't get confused if
7132 layout_eh_frame returns NULL.
7133
abecea76
ILT
71342010-01-08 Ian Lance Taylor <iant@google.com>
7135
7136 PR 11084
7137 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
7138 dynamic symbol table, use the normal symbol table.
7139 (Sized_dynobj::do_read_symbols): Remove assertion about type of
7140 symbol table.
7141
6b7dd3f3
ILT
71422010-01-08 Ian Lance Taylor <iant@google.com>
7143
7144 PR 11072
7145 * layout.cc (Layout::include_section): Remove .gnu_debuglink
7146 sections.
7147
36c50e63
L
71482010-01-08 H.J. Lu <hongjiu.lu@intel.com>
7149
7150 * version.cc (print_version): Change to "Copyright 2010".
7151
e291e7b9
ILT
71522010-01-08 Ian Lance Taylor <iant@google.com>
7153
7154 PR 10287
7155 PR 11063
7156 * i386.cc (class Target_i386): Change return type of plt_section
7157 to be non-const.
7158 (class Output_data_plt_i386): Add tls_desc_rel_ field.
7159 (Output_data_plt_i386::Output_data_plt_i386): Initialize
7160 tls_desc_rel_ field.
7161 (Output_data_plt_i386::rel_tls_desc): New function.
7162 (Target_i386::rel_tls_desc_section): New function.
7163 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
7164 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
7165 R_386_TLS_DESC reloc in rel_tls_desc_section.
7166 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
7167 Define struct Tlsdesc_info.
7168 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
7169 (Target_x86_64::do_reloc_symbol_index): New function.
7170 (Target_x86_64::add_tlsdesc_info): New function.
7171 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
7172 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
7173 tlsdesc_rel_ field.
7174 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
7175 all callers.
7176 (Output_data_plt_x86_64::rela_tlsdesc): New function.
7177 (Target_x86_64::rela_tlsdesc_section): New function.
7178 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
7179 handling.
7180 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
7181 (Target_x86_64::do_reloc_addend): New function.
7182 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
7183 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
7184 declarations. Define TARGET_CODE. Add arg field to u1_ union.
7185 (Output_reloc::type): New function.
7186 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
7187 (Output_reloc::is_target_specific): New function.
7188 (Output_reloc::target_arg): New function.
7189 (class Output_reloc) [SHT_RELA]: Add four new constructors for
7190 absolute relocs and target specific relocs.
7191 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
7192 add_target_specific.
7193 (class Output_data_reloc) [SHT_RELA]: Likewise.
7194 * output.cc (Output_reloc::Output_reloc): Add four new versions
7195 for absolute relocs and target specific relocs.
7196 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
7197 (Output_reloc::get_symbol_index): Likewise.
7198 (Output_reloc::local_section_offset): Check that local_sym_index_
7199 is not TARGET_CODE or 0.
7200 (Output_reloc::symbol_value): Likewise.
7201 (Output_reloc::write) [SHT_RELA]: Call target for target specific
7202 reloc.
7203 * target.h (class Target): Add reloc_symbol_index and reloc_addend
7204 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
7205 functions.
7206 * layout.cc (add_target_dynamic_tags): Use output section for
7207 DT_PLTRELSZ and DT_JMPREL.
7208
3a44184e
ILT
72092010-01-07 Ian Lance Taylor <iant@google.com>
7210
7211 PR 11061
7212 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
7213 function.
7214 (class Output_data_reloc_generic): Define.
7215 (class Output_data_reloc_base): Change base class to
7216 Output_data_reloc_generic. Change add() method to call
7217 bump_relative_reloc_count for a relative reloc. Remove
7218 sort_relocs_ field.
7219 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
7220 to sort_relocs().
7221 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
7222 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
7223 appropriate.
7224 * layout.h (class Layout): Update declaration.
7225
ea715a34
ILT
72262010-01-07 Ian Lance Taylor <iant@google.com>
7227
7228 * output.h (class Output_data): Add const version of
7229 output_section and do_output_section.
7230 (class Output_section_data): Add const version of
7231 do_output_section.
7232 (class Output_section): Likewise.
7233 * layout.cc (Layout::add_target_dynamic_tags): New function.
7234 * layout.h (class Layout): Update declarations.
7235 * arm.cc (Target_arm::do_finalize_sections): Use
7236 add_target_dynamic_tags.
7237 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7238 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
7239 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
7240 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7241
659948a4
ILT
72422010-01-07 Ian Lance Taylor <iant@google.com>
7243
7244 PR 11042
7245 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
7246 object as needed.
7247
9d3b86f6
ILT
72482010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
7249 Ian Lance Taylor <iant@google.com>
7250
7251 PR 11019
7252 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
7253 Xindex::read_symtab_xindex.
7254
bb0d3eb0
DK
72552010-01-07 Doug Kwan <dougkwan@google.com>
7256
7257 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
7258 (Insn_template::thumb16_bcond_insn): New method declaration.
7259 (Insn_template): Fix spelling.
7260 (Stub::thumb16_special): New method declaration.
7261 (Stub::do_write): Define virtual method which was previously pure
7262 virtual.
7263 (Stub::do_thumb16_special): New method declaration.
7264 (Stub::do_fixed_endian_write): New template member.
7265 (Reloc_stub::do_write): Remove.
7266 (Reloc_stub::do_fixed_endian_write): Remove.
7267 (Cortex_a8_stub): New class definition.
7268 (Stub_factory::make_cortex_a8_stub): New method definition.
7269 (Stub_factory::Stub_factory): Add missing static storage class
7270 qualifier for elf32_arm_stub_a8_veneer_blx.
7271
ffeef7df
ILT
72722010-01-07 Ian Lance Taylor <iant@google.com>
7273
dc3f80fe
ILT
7274 PR 10980
7275 * options.h (class General_options): Add --warn-unresolved-symbols
7276 and --error-unresolved-symbols.
7277 * errors.cc (Errors::undefined_symbol): Implement
7278 --warn-unresolved-symbols.
7279
ffeef7df
ILT
7280 * options.h (class General_options): Add -z text and -z textoff.
7281 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
7282
f1ec9ded
ST
72832010-01-06 Sriraman Tallam <tmsriram@google.com>
7284
7285 * gc.h (Garbage_collection::Cident_section_map): New typedef.
7286 (Garbage_collection::cident_sections): New function.
7287 (Garbage_collection::add_cident_section): New function.
7288 (Garbage_collection::cident_sections_): New member.
7289 (gc_process_relocs): Add references to sections whose names are C
7290 identifiers.
7291 * gold.h (cident_section_start_prefix): New constant.
7292 (cident_section_stop_prefix): New constant.
7293 (is_cident): New function.
7294 * layout.cc (Layout::define_section_symbols): Replace string constants
7295 with the newly defined constants.
7296 * object.cc (Sized_relobj::do_layout): Track sections whose names are
7297 C identifiers.
7298 * testsuite/Makefile.am: Add gc_orphan_section_test.
7299 * testsuite/Makefile.in: Regenerate.
7300 * testsuite/gc_orphan_section_test.cc: New file.
7301 * testsuite/gc_orphan_section_test.sh: New file.
7302
6eda8c29
ILT
73032010-01-06 Ian Lance Taylor <iant@google.com>
7304
b9674e17
ILT
7305 PR 10980
7306 * options.h (class General_options): Add --warn-shared-textrel.
7307 * layout.cc (Layout::finish_dynamic_section): Implement
7308 --warn-shared-textrel.
7309
6eda8c29
ILT
7310 PR 10980
7311 * options.h (class General_options): Add --warn-multiple-gp.
7312
32dcd44e
ILT
73132010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7314
7315 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
7316 $(THREADSLIB) and $(LIBDL).
7317 * Makefile.in: Rebuild.
7318
a192ba05
ILT
73192010-01-06 Ian Lance Taylor <iant@google.com>
7320
7321 PR 10980
7322 * options.cc (General_options::parse_section_start): New function.
7323 (General_options::section_start): New function.
7324 (General_options::General_options): Initialize all members.
7325 * options.h: Include <map>
7326 (class General_options): Add --section-start. Add section_starts_
7327 member.
7328 * layout.cc (Layout::attach_allocated_section_to_segment): If
7329 --section-start was used, set the address of the segment. Remove
7330 local sort_sections.
7331 (Layout::relaxation_loop_body): If the address of the load segment
7332 has been set by --section-start, don't use it.
7333 * output.h (Output_segment::update_flags_for_output_section): New
7334 function.
7335 * output.cc (Output_segment::add_output_section): Call
7336 update_flags_for_output_section.
7337
dde3f402
ILT
73382010-01-05 Ian Lance Taylor <iant@google.com>
7339
62dfdd4d
ILT
7340 PR 10980
7341 * options.h (class General_options): Add --undefined-version.
7342 * script.cc (struct Version_expression): Add was_matched_by_symbol
7343 field.
7344 (Version_script_info::matched_symbol): New function.
7345 (Version_script_info::get_symbol_version_helper): Call
7346 matched_symbol.
7347 (Version_script_info::check_unmatched_names): New function.
7348 * script.h (class Version_script_info): Update declarations.
7349 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
7350
9c4ae156
ILT
7351 * options.h (class General_options): Use DEFINE_bool_alias for
7352 allow_multiple_definition.
7353 * resolve.cc (Symbol_table::should_override): Don't test
7354 allow_multiple_definition.
7355
dde3f402
ILT
7356 PR 10980
7357 * options.h (class General_options): Add --cref.
7358 * main.cc (main): Print cref table if --cref. Don't close mapfile
7359 until after printing cref table.
7360 * cref.cc: Include "symtab.h".
7361 (class Cref_inputs): Define Cref_table_compare and Cref_table.
7362 (Cref_table_compare::operator()): New function.
7363 (Cref_inputs::gather_cref): New function.
7364 (filecol): New static const.
7365 (Cref_inputs::print_cref): New function.
7366 (Cref::print_cref): New function.
7367 * cref.h: Include <cstdio>.
7368 (class Cref): Update declarations.
7369 * mapfile.h (Mapfile::file): New function.
7370 * object.h (class Object): Define Symbols. Declare virtual
7371 do_get_global_symbols.
7372 (Object::get_global_symbols): New function.
7373 * object.cc (Input_objects::add_object): Pass object to cref_ if
7374 --cref.
7375 (Input_objects::archive_start): Likewise.
7376 (Input_objects::archive_stop): Likewise.
7377 (Input_objects::print_cref): New function.
7378 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
7379 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
7380 --cref.
7381 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
7382 function.
7383 * plugin.h (class Sized_pluginobj): Update declarations.
7384
8781f709
ILT
73852010-01-05 Ian Lance Taylor <iant@google.com>
7386
7387 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
7388 to is_default_version. Rename insdef to insdefault.
7389 (Symbol_table::add_from_relobj): Rename def to is_default_version
7390 and local to is_forced_local.
7391 (Symbol_table::add_from_pluginobj): Likewise.
7392 (Symbol_table::add_from_dynobj): Likewise.
7393 (Symbol_table::define_special_symbol): Rename insdef to
7394 insdefault.
7395
fe35d28d
ILT
73962010-01-04 Ian Lance Taylor <iant@google.com>
7397
30bc8c46
ILT
7398 PR 10980
7399 * options.h (class General_options): Add
7400 --allow-multiple-definition and -z muldefs.
7401 * resolve.cc (Symbol_table::should_override): Don't warn about a
7402 multiple symbol definition if --allow-multiple-definition or -z
7403 muldefs.
7404
7eaea549
ILT
7405 PR 10980
7406 * options.h (class General_options): Add --add-needed and
7407 --copy-dt-needed-entries. Tweak --as-needed help entry.
7408 * object.cc (Input_objects::check_dynamic_dependencies): Give an
7409 error if --copy-dt-needed-entries aka --add-needed is used and
7410 would cause a change in behaviour.
7411
fe35d28d
ILT
7412 PR 10980
7413 * options.h (class General_options): Add -G as a short version of
7414 --shared. Add no-op options -assert, -g, and -i.
7415
55a2bb35
ST
74162010-01-04 Sriraman Tallam <tmsriram@google.com>
7417
7418 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
7419 check for .text or .gnu.linkonce.t sections.
7420 * icf.cc (Icf::find_identical_sections): Ditto.
7421 Change the detection for mangled function name within the section
7422 name.
7423 * icf.h (is_section_foldable_candidate): New function.
7424
719328e1
ILT
74252009-12-30 Ian Lance Taylor <iant@google.com>
7426
7427 PR 10980
7428 * options.h (class General_options): Permit two dashes with
7429 --retain-symbols-file.
7430
d7bb5745
ILT
74312009-12-30 Ian Lance Taylor <iant@google.com>
7432
403a15dd
ILT
7433 PR 10979
7434 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
7435 don't put the file header and segment headers in the text
7436 segment.
7437
eda294df
ILT
7438 PR 10979
7439 * common.cc (Sort_commons::operator()): Stabilize sort when both
7440 entries are NULL.
7441 (Symbol_table::do_allocate_commons_list): When allocating common
7442 symbols, skip a symbol which is no longer common.
7443 * symtab.h (Symbol::is_common): Test whether the symbol comes from
7444 an object before checking its type.
7445 * testsuite/common_test_2.c: New file.
7446 * testsuite/common_test_3.c: New file.
7447 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
7448 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
7449 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
7450 (common_test_2_pic.o, common_test_2.so): New targets.
7451 (common_test_3_pic.o, common_test_3.so): New targets.
7452 * testsuite/Makefile.in: Rebuild.
7453
d7bb5745
ILT
7454 PR 10979
7455 * script.cc (read_input_script): If we see a new SECTIONS clause,
7456 and we have added an input section, give an error.
7457 * layout.h (class Layout): Add have_added_input_section function.
7458 Add have_added_input_section_ field.
7459 * layout.cc (Layout::Layout): Initialize
7460 have_added_input_section_.
7461 (Layout::layout): Set have_added_input_section_.
7462 (Layout::layout_eh_frame): Likewise.
7463
fc59c572
ILT
74642009-12-30 Ian Lance Taylor <iant@google.com>
7465
7466 PR 10931
7467 * options.h (class General_options): Add --sort-common option.
7468 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
7469 * common.cc (Sort_common): Add sort_order parameter to
7470 constructor. Add sort_order_ field.
7471 (Sort_commons::operator): Check sort_order_.
7472 (Symbol_table::allocate_commons): Determine the sort order.
7473 (Symbol_table::do_allocate_commons): Add sort_order parameter.
7474 Change all callers.
7475 (Symbol_table::do_allocate_commons_list): Likewise.
7476
1c74fab0
ILT
74772009-12-30 Ian Lance Taylor <iant@google.com>
7478
7479 PR 10916
7480 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
7481 symbols from this object, don't change the visibility of an
7482 undefined symbol.
7483 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
7484
6affe781
ILT
74852009-12-30 Ian Lance Taylor <iant@google.com>
7486
7487 PR 10861
7488 * script.h (class Version_script_info): Define Language enum.
7489 Update declarations. Define Glob, Exact, and Lookup types. Add
7490 new fields globals_, locals_, and is_finalized_.
7491 * script.cc: Various formatting fixes.
7492 (class Parser_closure): Change language_stack_ from a vector of
7493 std::string to one of Version_script_info::Language. Adjust all
7494 uses accordingly.
7495 (class Lazy_demangler): Remove.
7496 (struct Version_expression): Change language from std::string to
7497 Version_script_info::Language.
7498 (Version_script_info::Version_script_info): New function.
7499 (Version_script_info::~Version_script_info): Don't call clear.
7500 (Version_script_info::finalize): New function.
7501 (Version_script_info::build_lookup_tables): New function.
7502 (Version_script_info::build_expression_list_lookup): New
7503 function.
7504 (Version_script_info::get_symbol_version_helper): Rewrite to use
7505 lookup tables.
7506 (Version_script_info::print_expression_list): Adjust to use
7507 Version_script_info::Language.
7508 (script_push_lex_into_version_mode): Check that the version script
7509 has not been finalized.
7510 (version_script_push_lang): Change language string to
7511 Version_script_info::Language.
7512 * options.cc (Command_line::version_script): New function.
7513 * options.h (class General_options): Add finalize_dynamic_list
7514 function. Change version_script from declaration to definition.
7515 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
7516 * testsuite/version_script.map: Remove duplicate def of foo.
7517 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
7518 version_script.map.
7519 * testsuite/Makefile.in: Rebuild.
7520
818bf354
ILT
75212009-12-30 Ian Lance Taylor <iant@google.com>
7522
7523 PR 10843
7524 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
7525 if the input symbol index is 0, make the output symbol index 0.
7526
ebcc8304
ILT
75272009-12-30 Ian Lance Taylor <iant@google.com>
7528
7529 PR 10670
7530 * options.h (class General_options): Add -x/--discard-all.
7531 * object.cc (Sized_relobj::do_count_local_symbols): Handle
7532 --discard-all. If the local symbol needs a dynamic entry, check
7533 that before handling --discard-locals.
7534
176fe33f
ILT
75352009-12-30 Ian Lance Taylor <iant@google.com>
7536
bb321bb1
ILT
7537 PR 10450
7538 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
7539 flags to PF_R.
7540 (Output_segment::add_output_section): Don't change the flags if
7541 the type is PT_TLS.
7542
176fe33f
ILT
7543 PR 10450
7544 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
7545 GNU hash table if they need a dynamic value. Otherwise, don't add
7546 them if they are defined in a dynamic object or are forced local.
7547
e8cd95c7
ILT
75482009-12-29 Ian Lance Taylor <iant@google.com>
7549
1b81fb71
ILT
7550 PR 10450
7551 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
7552 .gnu.hash table for a 32-bit target.
7553
8d6d383d
ILT
7554 PR 10450
7555 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
7556 regular and a dynamic object only needs a dynamic symbol table
7557 entry if it is externally visible.
7558
e785ec03
ILT
7559 PR 10450
7560 * i386.cc (class Target_i386): Initialize global_offset_table_ in
7561 constructor. Add global_offset_table_ field.
7562 (Target_i386::got_section): Set global_offset_table_.
7563 (Target_i386::do_finalize_sections): Set global_offset_table_
7564 size.
7565 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
7566 in constructor. Add global_offset_table_ field.
7567 (Target_x86_64::got_section): Set global_offset_table_.
7568 (Target_x86_64::do_finalize_sections): Set global_offset_table_
7569 size.
7570
1a2dff53
ILT
7571 * layout.cc (Layout::Layout): Initialize increase_relro_.
7572 (Layout::get_output_section): Add is_relro, is_last_relro, and
7573 is_first_non_relro parameters. Change all callers.
7574 (Layout::choose_output_section): Likewise.
7575 (Layout::add_output_section_data): Likewise.
7576 (Layout::make_output_section): Likewise.
7577 (Layout::set_segment_offsets): Clear increase_relro when using a
7578 linker script.
7579 * layout.h (class Layout): Add increase_relro method. Add
7580 increase_relro_ field. Update declarations.
7581 * output.cc (Output_section::Output_section): Initialize
7582 is_last_relro_ and is_first_non_relro_.
7583 (Output_segment::add_output_section): Group relro sections is
7584 do_sort is true. Handle is_last_relro and is_first_non_relro.
7585 (Output_segment::maximum_alignment): Remove relro handling.
7586 (Output_segment::set_section_addresses): Add increase_relro
7587 parameter. Change all callers. Add initial alignment to align
7588 relro sections on separate page. Remove old relro handling.
7589 (Output_segment::set_section_list_addresses): Remove in_relro
7590 parameter. Change all callers.
7591 (Output_segment::set_offset): Add increase parameter. Change all
7592 callers. Remove old relro handling.
7593 * output.h (class Output_section): Add new methods: is_last_relro,
7594 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
7595 Add is_last_relro_ and is_first_non_relro_ fields.
7596 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
7597 Create separate .got.plt section. Call increase_relro.
7598 * x86_64.cc (Target_x86_64::got_section): Likewise.
7599 * testsuite/relro_script_test.t: Add .got.plt.
7600
f0ba79e2
ILT
7601 PR 10450
7602 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
7603 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
7604 (Layout::finalize): Call set_dynamic_symbol_size.
7605 (Layout::set_dynamic_symbol_size): New function.
7606 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
7607 set_dynamic_symbol_size.
7608
e8cd95c7
ILT
7609 PR 10450
7610 * output.h (class Output_section): Add is_entsize_zero_ field.
7611 * output.cc (Output_section::Output_section): Initialize
7612 is_entsize_zero_.
7613 (Output_section::set_entsize): If two different entsizes are
7614 requested, force it to zero.
7615 (Output_section::add_input_section): Set flags for .debug_str
7616 before updating section flags. Set entsize.
7617 (Output_section::update_flags_for_input_section): Set SHF_MERGE
7618 and SHF_STRING if all input sections have those flags.
7619
3e1b9a8a
RÁE
76202009-12-29 Rafael Espindola <espindola@google.com>
7621
7622 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
7623 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
7624 reporting.
3e1b9a8a 7625
3dcad376
ST
76262009-12-29 Sriraman Tallam <tmsriram@google.com>
7627
7628 * options.cc (General_options::parse_version): Allow -v to exit
7629 without an error if there is nothing to link.
7630
084e2665
ILT
76312009-12-29 Ian Lance Taylor <iant@google.com>
7632
7633 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
7634 using a version of gcc before 4.1.
7635 * configure: Rebuild.
7636
250acde3
CD
76372009-12-28 Chris Demetriou <cgd@google.com>
7638
7639 * attributes.cc (Output_attributes_section_data::do_write): Use
7640 std::vector::front rather than std::vector::data.
7641
99fff23b
ILT
76422009-12-28 Ian Lance Taylor <iant@google.com>
7643
7644 * symtab.h (class Symbol_table): Add enum Defined.
7645 * resolve.cc (Symbol_table::should_override): Add defined
7646 parameter. Change all callers. Test whether object is NULL
7647 before calling a method on it.
7648 (Symbol_table::report_resolve_problem): Add defined parameter.
7649 Change all callers.
7650 (Symbol_table::should_override_with_special): Likewise.
7651 * symtab.cc (Symbol_table::define_in_output_data): Add defined
7652 parameter. Change all callers.
7653 (Symbol_table::do_define_in_output_data): Likewise.
7654 (Symbol_table::define_in_output_segment): Likewise.
7655 (Symbol_table::do_define_in_output_segment): Likewise.
7656 (Symbol_table::define_as_constant): Likewise.
7657 (Symbol_table::do_define_as_constant): Likewise.
7658 * script.h (class Symbol_assignment): Add is_defsym parameter to
7659 constructor; change all callers.
7660 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
7661 parameter. Change all callers. Add is_defsym_ field.
7662 (class Parser_closure): Add parsing_defsym parameter to
7663 constructor; change all callers. Add parsing_defsym accessor
7664 function. Add parsing_defsym_ field.
7665
556bd683
ILT
76662009-12-28 Ian Lance Taylor <iant@google.com>
7667
7668 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 7669 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 7670
1782c879
ILT
76712009-12-23 Ian Lance Taylor <iant@google.com>
7672
7673 * i386.cc (Target_i386::do_calls_non_split): Recognize
7674 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
7675 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
7676 -fsplit-stack prologue when using %r11.
1782c879 7677
329ca2b1
ST
76782009-12-21 Sriraman Tallam <tmsriram@google.com>
7679
7680 * options.cc (General_options::parse_version): Make -v continue and do
7681 the link like GNU ld does.
7682
d675ff46
RÁE
76832009-12-17 Rafael Avila de Espindola <espindola@google.com>
7684
7685 * Makefile.am (CCFILES): Add timer.cc.
7686 (HFILES): Add timer.h.
7687 * configure.ac: Check for sysconf and times.
7688 * main.cc: include timer.h.
7689 (main): Use Timer instead of get_run_time.
7690 * timer.cc: New.
7691 * timer.h: New.
7692 * workqueue.cc: include timer.h.
7693 (Workqueue::find_and_run_task):
7694 Report user, sys and wall time.
7695 * Makefile.in: Regenerate.
7696 * config.in: Regenerate.
7697 * configure: Regenerate.
7698
d6344fb5
DK
76992009-12-16 Doug Kwan <dougkwan@google.com>
7700
7701 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
7702 sections.
7703 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
7704 relaxed input sections.
7705 * output.cc (Output_section::find_relaxed_input_section): Change
7706 return type to Output_relaxed_input_section pointer. Adjust code
7707 for new type of relaxed_input_section_map_.
7708 * output.h (Output_section::find_relaxed_input_section): Change
7709 return type to Output_relaxed_input_section pointer.
7710 (Output_section::Output_relaxed_input_section_by_input_section_map):
7711 New type.
7712 (Output_section::relaxed_input_section_map_): Change type to
7713 Output_section::Output_relaxed_input_section_by_input_section_map.
7714 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
7715 input section.
7716
0e0d5469
ILT
77172009-12-15 Ian Lance Taylor <iant@google.com>
7718
7719 * layout.cc (Layout::create_shstrtab): Only write out after input
7720 sections if we are compressing debug sections.
7721
0649a889
ILT
77222009-12-15 Ian Lance Taylor <iant@google.com>
7723
7724 * archive.cc (Archive::add_symbols): Only look up a symbol without
7725 a version if there is, in fact, a version.
7726
2ea97941
ILT
77272009-12-14 Ian Lance Taylor <iant@google.com>
7728
7729 Revert -Wshadow changes, all changes from:
7730 2009-12-11 Doug Kwan <dougkwan@google.com>
7731 2009-12-11 Nick Clifton <nickc@redhat.com>
7732 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
7733
b0eec2cc
DK
77342009-12-11 Doug Kwan <dougkwan@google.com>
7735
7736 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
7737 due to -Wshadow.
7738 * attributes.cc (Object_attribute::size): Ditto.
7739 (Attributes_section_data::size): Ditto.
7740 (Attributes_section_data::Attributes_section_data): Ditto.
7741 (Output_attributes_section_data::do_write): Ditto.
7742 * attributes.h (Object_attribute::set_type): Ditto.
7743 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
7744
91d6fa6a
NC
77452009-12-11 Nick Clifton <nickc@redhat.com>
7746
7747 * archive.cc: Fix shadowed variable warnings.
7748 * arm.cc: Likewise.
7749 * compressed_output.cc: Likewise.
7750 * compressed_output.h: Likewise.
7751 * configure: Likewise.
7752 * dwarf_reader.cc: Likewise.
7753 * dynobj.cc: Likewise.
7754 * dynobj.h: Likewise.
7755 * ehframe.cc: Likewise.
7756 * ehframe.h: Likewise.
7757 * errors.cc: Likewise.
7758 * expression.cc: Likewise.
7759 * fileread.cc: Likewise.
7760 * fileread.h: Likewise.
7761 * freebsd.h: Likewise.
7762 * i386.cc: Likewise.
7763 * icf.cc: Likewise.
7764 * incremental.h: Likewise.
7765 * layout.cc: Likewise.
7766 * layout.h: Likewise.
7767 * mapfile.cc: Likewise.
7768 * merge.cc: Likewise.
7769 * merge.h: Likewise.
7770 * object.cc: Likewise.
7771 * object.h: Likewise.
7772 * options.h: Likewise.
7773 * output.cc: Likewise.
7774 * output.h: Likewise.
7775 * parameters.cc: Likewise.
7776 * plugin.cc: Likewise.
7777 * powerpc.cc: Likewise.
7778 * reduced_debug_output.cc: Likewise.
7779 * reduced_debug_output.h: Likewise.
7780 * reloc.cc: Likewise.
7781 * reloc.h: Likewise.
7782 * resolve.cc: Likewise.
7783 * script-sections.cc: Likewise.
7784 * script.cc: Likewise.
7785 * script.h: Likewise.
7786 * sparc.cc: Likewise.
7787 * symtab.cc: Likewise.
7788 * symtab.h: Likewise.
7789 * target-select.cc: Likewise.
7790 * target-select.h: Likewise.
7791 * token.h: Likewise.
7792 * workqueue.cc: Likewise.
7793 * workqueue.h: Likewise.
7794 * x86_64.cc: Likewise.
7795
a0351a69
DK
77962009-12-10 Doug Kwan <dougkwan@google.com>
7797
7798 * arm.cc (attributes.h): New include.
7799 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
7800 (Arm_relobj::~Arm_relobj): Delete object pointed by
7801 attributes_section_data_.
7802 (Arm_relobj::attributes_section_data): New method definition.
7803 (Arm_relobj::attributes_section_data_): New data member declaration.
7804 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
7805 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
7806 attributes_section_data_.
7807 (Arm_dynobj::attributes_section_data): New method definition.
7808 (Arm_dynobj::attributes_section_data_): New data member declaration.
7809 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
7810 initialization value of may_use_blx_ to false.
2e702c99 7811 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
7812 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
7813 object attributes to compute results instead of hard-coding.
7814 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
7815 Target_arm::get_secondary_compatible_arch,
7816 Target_arm::set_secondary_compatible_arch
7817 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7818 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
7819 New method declarations.
7820 (Target_arm::get_aeabi_object_attribute): New method definition.
7821 (Target_arm::attributes_section_data_): New data member declaration.
7822 (read_arm_attributes_section): New template definition.
7823 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
7824 (Arm_dynobj::do_read_symbols): Ditto.
7825 (Target_arm::do_finalize_sections): Merge attributes sections from
7826 input. Check for BLX use after attributes section merging.
7827 Fix __exidx_start and __exidx_end visibility. Create an
7828 .ARM.attributes section if necessary.
7829 (Target_arm::get_secondary_compatible_arch,
7830 Target_arm::set_secondary_compatible_arch,
7831 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7832 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 7833 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
7834 New method definitions.
7835
b59befec
ILT
78362009-12-09 Ian Lance Taylor <iant@google.com>
7837
7838 * plugin.cc (Plugin::load): Don't cast from void* to a function
7839 pointer.
7840
1276bc89
ILT
78412009-12-09 Ian Lance Taylor <iant@google.com>
7842
7843 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
7844 information fields.
7845
2f2de248
L
78462009-12-09 H.J. Lu <hongjiu.lu@intel.com>
7847
7848 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
7849 Replace two_file_shared_1.so with two_file_shared_2.so.
7850 * testsuite/Makefile.in: Regenerated.
7851
4f787271
DK
78522009-12-08 Doug Kwan <dougkwan@google.com>
7853
7854 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
7855 (HFILES): Add attributes.h and int_encoding.h.
7856 * Makefile.in: Regenerate.
7857 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
7858 function definitions to int_encoding.cc
7859 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
7860 prototypes to int_encoding.h
7861 * reduced_debug_output.cc (int_encoding.h): New include.
7862 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
7863 function definitions to int_encoding.cc
7864 (insert_into_vector, read_from_pointer): Move template definitions to
7865 int_encoding.h
7866 * attributes.cc: New file.
7867 * attributes.h: New file.
7868 * int_encoding.cc: New file.
7869 * int_encoding.h: New file.
7870
20b52f1a
RÁE
78712009-12-07 Rafael Avila de Espindola <espindola@google.com>
7872
7873 PR gold/11055
7874 * incremental-dump.cc (dump_incremental_inputs): New.
7875 (main): Use dump_incremental_inputs.
7876
53d7974c
L
78772009-12-07 H.J. Lu <hongjiu.lu@intel.com>
7878
7879 PR gold/10893
7880 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
7881 checking elfcpp::STT_FUNC.
7882 (Target_i386::Relocate::relocate): Likewise.
7883 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
7884
7885 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
7886 symbols from shared libraries into normal FUNC symbols.
7887
7888 * symtab.h (Symbol): Add is_func and use it.
7889
05a352e6
DK
78902009-12-05 Doug Kwan <dougkwan@google.com>
7891
7892 * arm.cc (Target_arm::arm_info): Initialize new fields
7893 attributes_section and attributes_vendor.
7894 * i386.cc (Target_i386::i386_info): Same.
7895 * object.cc (Sized_relobj::do_layout): Skip attribute section.
7896 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
7897 fields attributes_section and attributes_vendor.
53d7974c 7898 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
7899 * target.h (Target::attributes_section, Target::attributes_vendor,
7900 Target::is_attributes_section, Target::attribute_arg_type,
7901 Target::attributes_order): New method definitions.
7902 (Target::Target_info::attributes_section,
7903 Target::Target_info::attributes_vendor): New fields.
7904 (Target::do_attribute_arg_type, Target::do_attributes_order): New
7905 virtual method definitions.
7906 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
7907 attributes_section and attributes_vendor.
7908 * testsuite/testfile.cc (Target_test::test_target_info): Same.
7909
f4e5969c
DK
79102009-12-05 Doug Kwan <dougkwan@google.com>
7911
7912 * arm.cc: Update comments about interworking and stub generation.
7913 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
7914 considered as non-PIC.
7915 (Arm_relocate_functions::base_abs): Fix formatting.
7916 (Arm_relocate_functions::got_prel): Fix comment. Change interface
7917 of function to use GOT entry address instead of offset.
7918 (Target_arm::Scan::global): Issue an error if a symbol would need a
7919 PLT does not get one because it is untyped. Remove code to create
7920 dynamic symbols for relative branches.
7921 (Target_arm::Relocate::relocate: Use 0 instead of false since function
7922 takes unsigned integer instead of boolean.
7923
1abce4a6
L
79242009-12-05 H.J. Lu <hongjiu.lu@intel.com>
7925
7926 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
7927 (two_file_test_LDADD): Likewise.
7928 (common_test_1_LDADD): Likewise.
7929 (exception_test_LDADD) Likewise.
7930 (weak_test_LDADD): Likewise.
7931 (many_sections_test_LDADD): Likewise.
7932 (initpri1_LDADD): Likewise.
7933 (script_test_1_LDADD): Likewise.
7934 (script_test_2_LDADD): Likewise.
7935 (justsyms_LDADD): Likewise.
7936 (binary_test_LDADD): Likewise.
7937 (large_LDADD): Likewise.
7938 * testsuite/Makefile.in: Regenerated.
7939
adcf2816 79402009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 7941
adcf2816
L
7942 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
7943 (Symbol_table::override_with_special): Likewise.
7944 (Symbol_table::add_from_object): Likewise.
7945
28e67f5d
RÁE
79462009-12-04 Rafael Avila de Espindola <espindola@google.com>
7947
7948 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
7949 Don't set the data_offset twice.
7950
ae10a101
RÁE
79512009-12-04 Rafael Avila de Espindola <espindola@google.com>
7952
7953 * testsuite/Makefile.in: Regenerate.
7954
f59f41f3
DK
79552009-12-03 Doug Kwan <dougkwan@google.com>
7956
7957 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
7958 (Target_arm::do_finalize_sections): Add parameter for symbol table
7959 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
7960 * i386.cc (Target_i386::do_finalize_sections): Add an additional
7961 parameter for symbol table pointer.
7962 * layout.cc (Layout::finalize): Call Target::finalize_sections with
7963 an additional parameter for a pointer to symbol table.
7964 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
7965 parameter for a symbol table pointer.
7966 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
7967 * target.h (Target::finalize_sections, Target::do_finalize_sections):
7968 Ditto.
7969 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
7970 parameter for a symbol table pointer.
7971
ca55d848
RÁE
79722009-12-03 Rafael Avila de Espindola <espindola@google.com>
7973
7974 * incremental.cc (Incremental_inputs_header)
7975 (Incremental_inputs_header_write, Incremental_inputs_entry)
7976 (Incremental_inputs_entry_write): Move ...
7977 * incremental.h (Incremental_inputs_header)
7978 (Incremental_inputs_header_write, Incremental_inputs_entry)
7979 (Incremental_inputs_entry_write): here.
7980
3aec4f9c
RÁE
79812009-12-02 Rafael Avila de Espindola <espindola@google.com>
7982
7983 * incremental.cc (make_sized_incremental_binary): Set the target.
7984 Error if it is incompatible.
7985 * output.h (Output_file): Add filename method.
7986
9c0ae74d
RÁE
79872009-12-02 Rafael Avila de Espindola <espindola@google.com>
7988
7989 * incremental.cc (Incremental_inputs_entry): Remove unused argument
7990 from the get_* methods.
7991
a45500ae
RÁE
79922009-12-02 Rafael Avila de Espindola <espindola@google.com>
7993
7994 * incremental-dump.cc (main): Check that the offeset of a script is 0.
7995 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
7996 Write 0 for the data_offset of scripts.
7997
325e6408
RÁE
79982009-12-02 Rafael Avila de Espindola <espindola@google.com>
7999
8000 * testsuite/Makefile.am: Add the incremental_test.sh test.
8001 * testsuite/incremental_test.sh: New.
8002 * testsuite/incremental_test_1.c: New.
8003 * testsuite/incremental_test_2.c: New.
8004
954c3e2e
RÁE
80052009-12-01 Rafael Avila de Espindola <espindola@google.com>
8006
8007 * incremental-dump.cc (main): Fix typos.
8008
f8086623
RÁE
80092009-11-27 Rafael Avila de Espindola <espindola@google.com>
8010
8011 PR gold/11025
8012 * incremental-dump.cc (main): Use llu to print 64 bit values.
8013
3b0dd6ac
L
80142009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
8015 H.J. Lu <hongjiu.lu@intel.com>
8016
8017 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
8018 $(LIBDL).
8019 (incremental_dump_LDADD): Likewise.
8020 * Makefile.in: Regenerated.
8021
a6d1ef57 80222009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 8023
a6d1ef57
DK
8024 Revert:
8025
8026 2009-11-25 Doug Kwan <dougkwan@google.com>
8027
8028 * arm.cc (Target_arm::Target_arm): Move method definition
8029 outside of class definition. Add code to handle
8030 --target1-rel, --target1-abs and --target2= options.
8031 (Target_arm::get_reloc_reloc_type): Change method to be
8032 non-static and const.
8033 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
8034 New data member declaration.
8035 (Target_arm::Scan::local, Target_arm::Scan::global,
8036 Target_arm::Relocate::relocate,
8037 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
8038 Adjust call to Target_arm::get_real_reloc_type.
8039 (Target_arm::get_real_reloc_type): Use command line options
8040 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8041 * options.h (--target1-rel, --target1-abs, --target2): New
8042 ARM-only options.
8043
50aeb7d4
DK
80442009-11-25 Doug Kwan <dougkwan@google.com>
8045
8046 * arm.cc (Target_arm::Target_arm): Move method definition outside of
8047 class definition. Add code to handle --target1-rel, --target1-abs
8048 and --target2= options.
8049 (Target_arm::get_reloc_reloc_type): Change method to be non-static
8050 and const.
8051 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
8052 member declaration.
8053 (Target_arm::Scan::local, Target_arm::Scan::global,
8054 Target_arm::Relocate::relocate,
8055 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
8056 call to Target_arm::get_real_reloc_type.
8057 (Target_arm::get_real_reloc_type): Use command line options to
8058 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8059 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
8060 options.
8061
51938283
DK
80622009-11-25 Doug Kwan <dougkwan@google.com>
8063
8064 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
8065 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
8066 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
8067 formatting.
8068 (Arm_relocate_functions::thm_call): Replace body with a call to
8069 Arm_relocate_functions::thumb_branch_common.
8070 (Arm_relocate_functions::thm_jump24,
8071 Arm_relocate_functions::thm_xpc22): New method definitions.
8072 (Arm_relocate_functions::thumb_branch_common): New method definition.
8073 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
8074 operator.
8075 (Target_arm::Relocate::relocate): Adjust call to thm_call.
8076 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
8077
e2b8f3c4
RÁE
80782009-11-24 Rafael Avila de Espindola <espindola@google.com>
8079
8080 * Makefile.am: Build incremental-dump
8081 * Makefile.in: Regenerate.
8082 * incremental-dump.cc: New.
8083 * incremental.cc (Incremental_inputs_header_data,
8084 Incremental_inputs_entry_data): Move to incremental.h
8085 * incremental.h: (Incremental_inputs_header_data,
8086 Incremental_inputs_entry_data): Move from incremental.cc
8087
bcba9aec
RÁE
80882009-11-24 Rafael Avila de Espindola <espindola@google.com>
8089
8090 * incremental.cc (Incremental_inputs_header,
8091 Incremental_inputs_header_write, Incremental_inputs_entry,
8092 Incremental_inputs_entry_write): Add a typedef with the data type.
8093
7c3afe08
RÁE
80942009-11-24 Rafael Avila de Espindola <espindola@google.com>
8095
8096 * incremental.cc (Incremental_inputs_header,
8097 Incremental_inputs_header_write, Incremental_inputs_entry,
8098 Incremental_inputs_entry_write): Update comment about which
8099 type has the filed descriptions.
8100
d204b6e9
DK
81012009-11-15 Doug Kwan <dougkwan@google.com>
8102
8103 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
8104 (Arm_relocate_functions::arm_branch_common): Change method defintion
8105 in class definition to a method declaration and update list of formal
8106 parameters.
8107 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
8108 Arm_relocation_functions::jump24): Adjust call to
8109 Arm_relocate_functions::arm_branch_common. Update list of formal
8110 parameters.
8111 (Arm_relocate_functions::xpc25): New method definition.
8112 (Arm_relocate_functions::arm_branch_common): Move method defintion
8113 out from class definition. Use stubs for mode-switching and extending
8114 branch ranges.
8115 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
8116 specially. Change code to enable use of stubs in ARM branches.
8117
43d12afe
DK
81182009-11-10 Doug Kwan <dougkwan@google.com>
8119
8120 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
8121 in method declaration.
8122 (Target_arm::relocate_stub): New method declaration.
8123 (Target_arm::default_target): Change to return a pointer instead of
8124 a const reference.
8125 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
8126 Target_arm::default_target.
8127 (Arm_Relobj::do_relocate_sections): Remove options paramater in
8128 method definition.
8129 (Target_arm::relocate_section): Adjust view.
8130 (Target_arm::relocate_stub): New method definition.
8131
ac33a407
DK
81322009-11-10 Doug Kwan <dougkwan@google.com>
8133
8134 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
8135 a format warning.
8136 * incremental.cc (open_incremental_binary): Initialized local
8137 variables to avoid warnings.
8138 * object.cc (make_elf_object): Ditto.
8139 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
8140 a format warning.
e1df38aa 8141
88ee28e9
L
8142009-11-09 H.J. Lu <hongjiu.lu@intel.com>
8143
8144 PR gold/10930
8145 * testsuite/plugin_test.c: Include "config.h".
8146
2daedcd6
DK
81472009-11-09 Doug Kwan <dougkwan@google.com>
8148
8149 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
8150 (arm_symbol_value): Remove.
8151 (Arm_relocate_functions::arm_branch_common,
8152 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
8153 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
8154 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
8155 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
8156 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
8157 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
8158 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
8159 Arm_relocate_functions::thm_mobw_abs_nc,
8160 Arm_relocate_functions::thm_mov_abs,
8161 Arm_relocate_functions::movw_prel_nc,
8162 Arm_relocate_functions::thm_movt_abs,
8163 Arm_relocate_functions::movt_prel,
8164 Arm_relocate_functions::thm_movw_prel_nc,
8165 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
8166 (Target_arm::Relocate::relocate): Only decompose address into two
8167 parts if relocation type uses the thumb-bit and pass the actual
8168 bit instead of a flag indicating that the thumb-bit is used. Adjust
8169 calls to methods in Arm_relocate_functions for this change.
8170
1276bc89 81712009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
8172
8173 PR 10925
8174 * reloc.cc: Instantiate
8175 Sized_relobj::initialize_input_to_output_maps and
8176 Sized_relobj:free_input_to_output_maps.
8177
e53ad1b5
ILT
81782009-11-06 Ian Lance Taylor <iant@google.com>
8179
8180 PR 10876
8181 * defstd.cc (in_segment): Set only_if_ref true for "end".
8182
eb44217c
DK
81832009-11-06 Doug Kwan <dougkwan@google.com>
8184
8185 * arm.cc (class Reloc_stub): Correct a comment.
8186 (Target_arm::Target_arm): Initialize arm_input_section_map_.
8187 (Target_arm::scan_section_for_stubs): New method declaration.
8188 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
8189 Change methods from private to protected.
8190 (Target_arm::do_may_relax): New method definition.
8191 (Target_arm::do_relax, Target_arm::group_sections,
8192 Target_arm::scan_reloc_for_stub,
8193 Target_arm::scan_reloc_section_for_stubs): New method declarations.
8194 (Target_arm::arm_input_section_map_): New data member declaration.
8195 (Target_arm::scan_reloc_for_stub,
8196 Target_arm::scan_reloc_section_for_stubs,
8197 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
8198 Target_arm::do_relax): New method definitions.
8199
5d329b7d
ILT
82002009-11-06 Mikolaj Zalewski <mikolaj@google.com>
8201
8202 * configure.ac: Check for (struct stat)::st_mtim
8203 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
8204 * config.in: Regenerate.
8205 * configure: Regenerate.
8206
96a0d71b
ILT
82072009-11-05 Ian Lance Taylor <iant@google.com>
8208
8209 PR 10910
8210 * output.cc (Output_segment::add_output_section): Add missing
8211 return statement.
8212
594c8e5e
ILT
82132009-11-04 Ian Lance Taylor <iant@google.com>
8214
8215 PR 10880
8216 * object.h (class Object): Add is_needed and set_is_needed
8217 methods. Add is_needed_ field. Make bool fields into bitfields.
8218 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
8219 defined in a dynamic object and referenced by a regular object,
8220 set is_needed for the dynamic object.
8221 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
8222 if the file is marked with as_needed and it is not needed.
8223
22b127cc
ILT
82242009-11-04 Ian Lance Taylor <iant@google.com>
8225
8226 PR 10887
8227 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
8228 tags if data is discarded by linker script.
8229 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8230 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
8231 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
8232 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8233
f5c870d2
ILT
82342009-11-04 Ian Lance Taylor <iant@google.com>
8235
8236 * layout.cc (Layout::get_output_section): Add is_interp and
8237 is_dynamic_linker_section parameters. Change all callers.
8238 (Layout::choose_output_section): Likewise.
8239 (Layout::make_output_section): Likewise.
8240 (Layout::add_output_section_data): Add is_dynamic_linker_section
8241 parameter. Change all callers.
8242 * layout.h (class Layout): Update declarations.
8243 * output.h (class Output_section): Add is_interp, set_is_interp,
8244 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
8245 Add is_interp_, is_dynamic_linker_section_ fields. Change
8246 generate_code_fills_at_write_ to a bitfield.
8247 * output.cc (Output_section::Output_sections): Initialize new
8248 fields.
8249 (Output_segment::add_output_section): Add do_sort parameter.
8250 Change all callers.
8251
1ae4d23b
ILT
82522009-11-03 Ian Lance Taylor <iant@google.com>
8253
8254 PR 10860
8255 * options.h (class General_options): Add --warn-common.
8256 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
8257 merging two common symbols.
8258 (Symbol_table::should_override): Handle --warn-common when merging
8259 a common symbol with a defined symbol. Use report_resolve_problem
8260 for multiple definitions.
8261 (Symbol_table::report_resolve_problem): New function.
8262 * symtab.h (class Symbol_table): Declare report_resolve_problem.
8263
55da9579
DK
82642009-11-03 Doug Kwan <dougkwan@google.com>
8265
8266 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
8267 stub_factory_.
8268 (Target_arm::stub_factory): New method definition.
8269 (Target_arm::new_arm_input_section,
8270 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
8271 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 8272 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
8273 New type definitions.
8274 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
8275 member declarations.
8276 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
8277 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
8278 New method definitions.
8279
37a9ac43
ILT
82802009-11-03 Ian Lance Taylor <iant@google.com>
8281
8282 * options.h (class General_options): Add --warn_constructors.
8283
b3d6a3d4
ILT
82842009-11-03 Ian Lance Taylor <iant@google.com>
8285
8286 PR 10893
8287 * defstd.cc (in_section): Add entries for __rel_iplt_start,
8288 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
8289
934b01dd
ILT
82902009-11-03 Ian Lance Taylor <iant@google.com>
8291
8292 PR 10895
8293 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
8294 --msgid-bugs-address.
8295 (install-pdf): New target.
8296 (install-data_yes): Look up one directory to find mkinstalldirs.
8297
03c1939b
L
82982009-11-03 H.J. Lu <hongjiu.lu@intel.com>
8299
8300 * po/Make-in (.po.gmo): Don't generate .gmo files in source
8301 tree.
8302
ebd95253
DK
83032009-10-30 Doug Kwan <dougkwan@google.com>
8304
8305 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
8306
e9bbb538
DK
83072009-10-30 Doug Kwan <dougkwan@google.com>
8308
8309 * arm.cc (Stub_addend_reader): New struct template definition
8310 and partial specializations.
8311 (Stub_addend_reader::operator()): New method definition for a
8312 partially specialized template.
8313
d5b40221
DK
83142009-10-30 Doug Kwan <dougkwan@google.com>
8315
8316 * arm.cc (Arm_relobj::processor_specific_flags): New method
8317 definition.
8318 (Arm_relobj::do_read_symbols): New method declaration.
8319 (Arm_relobj::processor_specific_flags_): New data member declaration.
8320 (Arm_dynobj): New class definition.
8321 (Target_arm::do_finalize_sections): Add input_objects parameter.
8322 (Target_arm::do_adjust_elf_header): New method declaration.
8323 (Target_arm::are_eabi_versions_compatible,
8324 (Target_arm::merge_processor_specific_flags): New method declaration.
8325 (Target_arm::do_make_elf_object): New overloaded method definitions
8326 and declaration.
8327 (Arm_relobj::do_read_symbols): New method definition.
8328 (Arm_dynobj::do_read_symbols): Ditto.
8329 (Target_arm::do_finalize_sections): Add input_objects parameters.
8330 Merge processor-specific flags from all input objects.
8331 (Target_arm::are_eabi_versions_compatible,
8332 Target_arm::merge_processor_specific_flags,
8333 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
8334 New method definitions.
8335 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
8336 Input_objects pointer type parameter.
8337 * layout.cc (Layout::finalize): Pass input objects to target's.
8338 finalize_sections function.
8339 * output.cc (Output_file_header::do_sized_write): Set ELF file
8340 header's processor-specific flags.
8341 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
8342 Input_objects pointer type parameter.
8343 * sparc.cc (Target_sparc::do_finalize_sections): Same.
8344 * target.h (Input_objects): New forward class declaration.
8345 (Target::processor_specific_flags,
8346 Target::are_processor_specific_flags_sect): New method definitions.
8347 (Target::finalize_sections): Add input_objects parameter.
8348 (Target::Target): Initialize processor_specific_flags_ and
8349 are_processor_specific_flags_set_.
8350 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
8351 parameter.
8352 (Target::set_processor_specific_flags): New method definition.
8353 (Target::processor_specific_flags_,
8354 Target::are_processor_specific_flags_set_): New data member
8355 declarations.
8356 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
8357 Input_objects pointer type parameter.
8358
ebabffbd
DK
83592009-10-30 Doug Kwan <dougkwan@google.com>
8360
8361 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
8362
ad0f2072
ILT
83632009-10-28 Ian Lance Taylor <iant@google.com>
8364
8365 * object.h (class Relobj): Drop options parameter from
8366 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
8367 do_scan_relocs, do_relocate. Change all callers.
8368 (class Sized_relobj): Drop options parameters from
8369 do_gc_process_relocs, do_scan_relocs, do_relocate,
8370 do_relocate_sections, relocate_sections, emit_relocs_scan,
8371 emit_relocs_scan_reltype. Change all callers.
8372 (struct Relocate_info): Remove options field and all references to
8373 it.
8374 * reloc.h (class Read_relocs): Remove options constructor
8375 parameter and options_ field. Change all callers.
8376 (class Gc_process_relocs, class Scan_relocs): Likewise.
8377 (class Relocate_task): Likewise.
8378 * target-reloc.h (scan_relocs): Remove options parameter. Change
8379 all callers.
8380 (scan_relocatable_relocs): Likewise.
8381 * target.h (class Sized_target): Remove options parameter from
8382 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
8383 all callers.
8384 * gc.h (gc_process_relocs): Remove options parameter. Change all
8385 callers.
8386 * arm.cc: Update functions to remove options parameters.
8387 * i386.cc: Likewise.
8388 * powerpc.cc: Likewise.
8389 * sparc.cc: Likewise.
8390 * x86_64.cc: Likewise.
8391 * testsuite/testfile.cc: Likewise.
8392
8ffa3667
DK
83932009-10-28 Doug Kwan <dougkwan@google.com>
8394
8395 * arm.cc (Arm_relobj): New class definition.
e1df38aa 8396 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
8397 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
8398 New method definitions.
8399
40f36857
CC
84002009-10-28 Cary Coutant <ccoutant@google.com>
8401
8402 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
8403 (Plugin::cleanup_done_): New member.
8404 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
8405 (Plugin_manager::cleanup_done_): Remove.
8406 (Plugin_manager::add_input_file): Edit error message.
8407 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
8408 (Plugin_manager::cleanup): Remove use of cleanup_done_.
8409
2c849493
ILT
84102009-10-27 Mikolaj Zalewski <mikolajz@google.com>
8411
8412 * fileread.cc: (File_read::View::~View): Use the new
8413 data_ownership_ filed.
8414 (File_read::~File_read): Dispose the new whole_file_view_.
8415 (File_read::open): Mmap the whole file if needed.
8416 (File_read::open): Use whole_file_view_ instead of contents_.
8417 (File_read::find_view): Use whole_file_view_ if applicable.
8418 (File_read::do_read): Use whole_file_view_ instead of contents_.
8419 (File_read::make_view): Use whole_file_view_ instead of contents_,
8420 update File_read::View::View call.
8421 (File_read::find_or_make_view): Update File_read::View::View
8422 call.
8423 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
8424 remove contents_
8425 (File_read::View::Data_ownership): New enum.
8426 (File_read::View::View): Replace bool mapped_ with Data_ownership
8427 argument.
8428 (File_read::View::mapped_): Remove (replaced by data_ownership_).
8429 (File_read::View::data_ownership_): New field.
8430 (File_read::contents_): Remove (replaced by whole_file_view_).
8431 (File_read::whole_file_view_): New field.
8432 * options.h (class General_options): Add --keep-files-mapped.
8433
24998053
CC
84342009-10-27 Cary Coutant <ccoutant@google.com>
8435
8436 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
8437 * testsuite/Makefile.am (plugin_test_5): New test case.
8438 * testsuite/Makefile.in: Regenerate.
8439
72adc4fa
DK
84402009-10-25 Doug Kwan <dougkwan@google.com>
8441
8442 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
8443 from private to protected to allow access by child class.
8444 (Sized_relobj::do_relocate_sections): New method declaration.
8445 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 8446 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
8447 Sized_relobj::relocate_sections. Instantiate template explicitly
8448 for different target sizes and endianity.
8449
07f508a2
DK
84502009-10-24 Doug Kwan <dougkwan@google.com>
8451
8452 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
8453 (Arm_input_section::as_arm_input_section): New method.
8454 (Arm_output_section): New class definition.
8455 (Arm_output_section::create_stub_group,
8456 Arm_output_section::group_sections): New method definitions.
8457
10ad9fe5
DK
84582009-10-22 Doug Kwan <dougkwan@google.com>
8459
8460 * arm.cc (Arm_input_section): New class definition.
8461 (Arm_input_section::init, Arm_input_section:do_write,
8462 Arm_input_section::set_final_data_size,
8463 Arm_input_section::do_reset_address_and_file_offset): New method
8464 definitions.
8465
56ee5e00
DK
84662009-10-21 Doug Kwan <dougkwan@google.com>
8467
8468 * arm.cc (Stub_table, Arm_input_section): New forward class
8469 declarations.
8470 (Stub_table): New class defintion.
8471 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
8472 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
8473 New method definition.
8474
b569affa
DK
84752009-10-21 Doug Kwan <dougkwan@google.com>
8476
8477 * arm.cc: Update copyright comments.
8478 (Target_arm): New forward class template declaration.
8479 (Arm_address): New type.
8480 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
8481 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
8482 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
8483 constants.
8484 (Insn_template): Same.
8485 (DEF_STUBS): New macro.
8486 (Stub_type): New enum type.
8487 (Stub_template): New class definition.
8488 (Stub): Same.
8489 (Reloc_stub): Same.
8490 (Stub_factory): Same.
8491 (Target_arm::Target_arm): Initialize may_use_blx_ and
8492 should_force_pic_veneer_.
8493 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
8494 Target_arm::should_force_pic_veneer,
8495 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
8496 Target_arm::using_thumb_only, Target_arm:;default_target): New
8497 method defintions.
8498 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
8499 New data member declarations.
8500 (Insn_template::size, Insn_template::alignment): New method defintions.
8501 (Stub_template::Stub_template): New method definition.
8502 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
8503 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
8504 (Stub_factory::Stub_factory): New method definition.
8505 * gold.h (string_hash): New template.
8506 * output.h (Input_section_specifier::hash_value): Use
8507 gold::string_hash.
8508 (Input_section_specifier::string_hash): Remove.
8509 * stringpool.cc (Stringpool_template::string_hash): Use
8510 gold::string_hash.
8511
6c172549
DK
85122009-10-20 Doug Kwan <dougkwan@google.com>
8513
8514 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
8515 symbols of relaxed input sections.
8516 * output.h (Output_section::find_relaxed_input_section): Make
8517 method public.
8518
c5617f2f
DK
85192009-10-16 Doug Kwan <dougkwan@google.com>
8520
8521 * dynobj.cc (Versions::Versions): Initialize version_script_.
8522 Only insert base version symbol definition for a shared object
8523 if version script defines any version versions.
8524 (Versions::define_base_version): New method definition.
8525 (Versions::add_def): Check that base version is not needed.
8526 (Versions::add_need): Define base version lazily.
8527 * dynobj.h (Versions::define_base_version): New method declaration.
8528 (Versions::needs_base_version_): New data member declaration.
8529 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
8530 (check_DATA): Add no_version_test.stdout.
8531 (libno_version_test.so, no_version_test.o no_version_test.stdout):
8532 New make rules.
8533 * testsuite/Makefile.in: Regenerate.
8534 * testsuite/no_version_test.c: New file.
8535 * testsuite/no_version_test.sh: Ditto.
8536
3c12dcdb
DK
85372009-10-16 Doug Kwan <dougkwan@google.com>
8538
8539 * expression.cc (class Segment_start_expression): New class definition.
8540 (Segment_start_expression::value): New method definition.
8541 (script_exp_function_segment_start): Return a new
8542 Segment_start_expression.
8543 * gold/script-c.h (script_saw_segment_start_expression): New function
8544 prototype.
8545 * script-sections.cc (Script_sections::Script_sections): Initialize
8546 SAW_SEGMENT_START_EXPRESSION_ to false.
8547 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
8548 and -Tbbs options to specify section addresses if given in
8549 command line and no SEGMENT_START expression is seen in a script.
8550 * script-sections.h (Script_sections::saw_segment_start_expression,
8551 Script_sections::set_saw_segment_start_expression): New method
8552 definition.
8553 (Script_sections::saw_segment_start_expression_): New data member
8554 declaration.
8555 * script.cc (script_saw_segment_start_expression): New function.
8556 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
8557 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
8558 script_test_7.sh and script_test_8.sh.
8559 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
8560 script_test_8.stdout.
8561 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
8562 (script_test_6, script_test_6.stdout, script_test_7,
8563 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
8564 * Makefile.in: Regenerate.
8565 * testsuite/script_test_6.sh: New file.
8566 * testsuite/script_test_6.t: Same.
8567 * testsuite/script_test_7.sh: Same.
8568 * testsuite/script_test_7.t: Same.
8569 * testsuite/script_test_8.sh: Same.
8570
64b1ae37
DK
85712009-10-16 Doug Kwan <dougkwan@google.com>
8572
8573 * output.cc (Output_segment::set_section_list_address): Cast
8574 expressions to unsigned long long type to avoid format warnings.
8575
661be1e2
ILT
85762009-10-15 Ian Lance Taylor <iant@google.com>
8577
12edd763 8578 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 8579 dot assignment to script_sections_.
12edd763
ILT
8580 * script-sections.cc (Script_sections::add_dot_assignment):
8581 Initialize if necessary.
8582
68b6574b
ILT
8583 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
8584 program headers with no load segment if there is a linker script.
8585
661be1e2
ILT
8586 * layout.cc (Layout::set_segment_offsets): Align the file offset
8587 to the segment aligment for -N or -n with no load segment.
8588 * output.cc (Output_segment::add_output_section): Don't crash if
8589 the first section is a TLS section.
8590 (Output_segment::set_section_list_addresses): Print an error
8591 message if the address moves backward in a linker script.
8592 * script-sections.cc
8593 (Output_section_element_input::set_section_addresses): Don't
8594 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
8595 (Orphan_output_section::set_section_addresses): Likewise.
8596
f15f61a7
DK
85972009-10-15 Doug Kwan <dougkwan@google.com>
8598
8599 * layout.cc (Layout::finish_dynamic_section): Generate tags
8600 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
8601 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
8602 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
8603
82bb573a
ILT
86042009-10-14 Ian Lance Taylor <iant@google.com>
8605
8606 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
8607 fields.
8608 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
8609 data_shdr fields of relinfo.
8610 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
8611 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
8612 R_386_TLS_LDO_32, adjust based on section flags.
8613 (Target_i386::Relocate::fix_up_ldo): Remove.
8614
374ad285
ILT
86152009-10-13 Ian Lance Taylor <iant@google.com>
8616
8617 Add support for -pie.
8618 * options.h (class General_options): Add -pie and
8619 --pic-executable.
8620 (General_options::output_is_position_independent): Test -pie.
8621 (General_options::output_is_executable): Return true if not shared
8622 and not relocatable.
8623 (General_options::output_is_pie): Remove.
8624 * options.cc (General_options::finalize): Reject incompatible uses
8625 of -pie.
8626 * gold.cc (queue_middle_tasks): A -pie link is not static.
8627 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
8628 * symtab.cc (Symbol::final_value_is_known): Return false if
8629 output_is_position_independent.
8630 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
8631 output_is_position_independent.
8632 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
8633 output_is_position_independent.
8634 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
8635 output_is_position_independent.
8636 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
8637 two_file_pie_test.
8638 (basic_pie_test.o, basic_pie_test): New targets.
8639 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
8640 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
8641 (two_file_pie_test): New target.
8642 * testsuite/Makefile.in: Rebuild.
8643 * README: Remove note saying that -pie is not supported.
8644
c6585162
ILT
86452009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
8646
8647 * options.h (class General_options): Add -init and -fini.
8648 * layout.cc (Layout::finish_dynamic_section): Emit
8649 given init and fini functions.
8650
032ce4e9
ST
86512009-10-13 Sriraman Tallam <tmsriram@google.com>
8652
8653 * gc.h (gc_process_relocs): Check if icf is enabled using new
8654 function.
8655 * gold.cc (queue_initial_tasks): Likewise.
8656 (queue_middle_tasks): Likewise.
8657 * object.cc (do_layout): Likewise.
8658 * symtab.cc (is_section_folded): Likewise.
8659 * main.cc (main): Likewise.
8660 * reloc.cc (Read_relocs::run): Likewise.
8661 (Sized_relobj::do_scan_relocs): Likewise.
8662 * icf.cc (is_function_ctor_or_dtor): New function.
8663 (Icf::find_identical_sections): Check if function is ctor or dtor when
8664 safe icf is chosen.
8665 * options.h (General_options::icf): Change option to be an enum.
8666 (Icf_status): New enum.
8667 (icf_enabled): New method.
8668 (icf_safe_folding): New method.
8669 (set_icf_status): New method.
8670 (icf_status_): New variable.
8671 * (options.cc) (General_options::finalize): Set icf_status_.
8672 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
8673 icf_test and icf_keep_unique_test to use the --icf enum flag.
8674 * testsuite/icf_safe_test.sh: New file.
e1df38aa 8675 * testsuite/icf_safe_test.cc: New file.
032ce4e9 8676
f345227a
ST
86772009-10-12 Sriraman Tallam <tmsriram@google.com>
8678
8679 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
8680 includes to gc.h and icf.h.
8681 * arm.cc: Include gc.h.
8682 * gold.cc: Likewise.
8683 * i386.cc: Likewise.
8684 * powerpc.cc: Likewise.
8685 * sparc.cc: Likewise.
8686 * x86_64.cc: Likewise.
8687 * gc.h: Include icf.h.
8688
1c7814ed
ILT
86892009-10-11 Ian Lance Taylor <iant@google.com>
8690
8691 * plugin.cc: Include "gold.h" before other header files.
8692
ae3b5189
CD
86932009-10-10 Chris Demetriou <cgd@google.com>
8694
8695 * options.h (Input_file_argument::Input_file_type): New enum.
8696 (Input_file_argument::is_lib_): Replace with...
8697 (Input_file_argument::type_): New member.
8698 (Input_file_argument::Input_file_argument): Take Input_file_type
8699 'type' rather than boolean 'is_lib' as second argument.
8700 (Input_file_argument::is_lib): Use type_.
8701 (Input_file_argument::is_searched_file): New function.
8702 (Input_file_argument::may_need_search): Handle is_searched_file.
8703 * options.cc (General_options::parse_library): Support -l:filename.
8704 (General_options::parse_just_symbols): Update for Input_file_argument
8705 changes.
8706 (Command_line::process): Likewise.
8707 * archive.cc (Archive::get_file_and_offset): Likewise.
8708 * plugin.cc (Plugin_manager::release_input_file): Likewise.
8709 * script.cc (read_script_file, script_add_file): Likewise.
8710 * fileread.cc (Input_file::Input_file): Likewise.
8711 (Input_file::will_search_for): Handle is_searched_file.
8712 (Input_file::open): Likewise.
8713 * readsyms.cc (Read_symbols::get_name): Likewise.
8714 * testsuite/Makefile.am (searched_file_test): New test.
8715 * testsuite/Makefile.in: Regenerate.
8716 * testsuite/searched_file_test.cc: New file.
8717 * testsuite/searched_file_test_lib.cc: New file.
8718
f3048a1d
ILT
87192009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8720 Ian Lance Taylor <iant@google.com>
8721
8722 * descriptor.cc: Include <cstdio> and "binary-io.h".
8723 (Descriptors::open): Open the files in binary mode always.
8724 * script.cc (Lex::get_token): Treat \r as whitespace.
8725
d4780e57
ILT
87262009-10-09 Ian Lance Taylor <iant@google.com>
8727
8728 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
8729
d9a893b8
ILT
87302009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8731 Ian Lance Taylor <iant@google.com>
8732
8733 * configure.ac: Check for readv function also.
8734 * fileread.cc (readv): Define if not HAVE_READV.
8735 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
8736 does not exist.
8737 * config.in: Regenerate.
8738 * configure: Regenerate.
8739
c0a62865
DK
87402009-10-09 Doug Kwan <dougkwan@google.com>
8741
8742 * layout.cc (Layout::make_output_section): Call target hook to make
8743 ordinary output section.
8744 (Layout::finalize): Adjust parameter list of call the
8745 Target::may_relax().
8746 * layout.h (class Layout::section_list): New method.
8747 * merge.h (Output_merge_base::entsize): Change visibility to public.
8748 (Output_merge_base::is_string, Output_merge_base::do_is_string):
8749 New methods.
8750 (Output_merge_string::do_is_string): New method.
8751 * object.cc (Sized_relobj::do_setup): renamed from
8752 Sized_relobj::set_up.
8753 * object.h (Sized_relobj::adjust_shndx,
8754 Sized_relobj::initializ_input_to_output_maps,
8755 Sized_relobj::free_input_to_output_maps): Change visibilities to
8756 protected.
8757 (Sized_relobj::setup): Virtualize.
8758 (Sized_relobj::do_setup): New method declaration.
8759 (Sized_relobj::invalidate_section_offset,
8760 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
8761 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
8762 * options.cc (parse_int): New function.
8763 * options.h (parse_int): New declaration.
8764 (DEFINE_int): New macro.
8765 (stub_group_size): New option.
8766 * output.cc (Output_section::Output_section): Initialize memebers
8767 merge_section_map_, merge_section_by_properties_map_,
8768 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
8769 (Output_section::add_input_section): Handled deferred code-fill
8770 generation and remove an old comment.
8771 (Output_section::add_relaxed_input_section): New method definition.
8772 (Output_section::add_merge_input_section): Use merge section by
8773 properties map to speed to search. Update merge section maps
8774 as appropriate.
8775 (Output_section::build_relaxation_map): New method definition.
8776 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8777 Same.
8778 (Output_section::relax_input_section): Renamed to
8779 Output_section::convert_input_sections_to_relaxed_sections and change
8780 interface to take a vector of pointers to relaxed sections.
8781 (Output_section::find_merge_section,
8782 Output_section::find_relaxed_input_section): New method definitions.
8783 (Output_section::is_input_address_mapped,
8784 Output_section::output_offset, Output_section::output_address):
8785 Use output section data maps to speed up searching.
8786 (Output_section::find_starting_output_address): Add comments.
8787 (Output_section::do_write,
8788 Output_section::write_to_postprocessing_buffer): Do code-fill
8789 generation as appropriate.
8790 (Output_section::get_input_sections): Invalidate relaxed input section
8791 map.
8792 (Output_section::restore_states): Adjust type of checkpoint .
8793 Invalidate relaxed input section map.
8794 * output.h (Output_merge_base): New class declaration.
8795 (Input_section_specifier): New class defintion.
8796 (class Output_relaxed_input_section) Change base class to
8797 Output_section_data_build.
8798 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
8799 base class initializer.
8800 (Output_section::add_relaxed_input_section): New method declaration.
8801 (Output_section::Input_section): Change visibility to protected.
2e702c99 8802 (Output_section::Input_section::relobj,
c0a62865
DK
8803 Output_section::Input_section::shndx): Handle relaxed input sections.
8804 Output_section::input_sections) Change visibility to protected. Also
8805 define overload to return a non-const pointer.
8806 (Output_section::Merge_section_properties): New class defintion.
8807 (Output_section::Merge_section_by_properties_map,
8808 Output_section::Output_section_data_by_input_section_map,
8809 Output_section::Relaxation_map): New types.
8810 (Output_section::relax_input_section): Rename method to
8811 Output_section::convert_input_sections_to_relaxed_sections and change
8812 interface to take a vector of relaxed section pointers.
8813 (Output_section::find_merge_section,
8814 Output_section::find_relaxed_input_section,
8815 Output_section::build_relaxation_map,
8816 Output_section::convert_input_sections_in_list_to_relaxed_sections):
8817 New method declarations.
8818 (Output_section::merge_section_map_
8819 Output_section::merge_section_by_properties_map_,
8820 Output_section::relaxed_input_section_map_,
8821 Output_section::is_relaxed_input_section_map_valid_,
8822 Output_section::generate_code_fills_at_write_): New data members.
8823 * script-sections.cc
8824 (Output_section_element_input::set_section_addresses): Call
8825 current_data_size and addralign methods of relaxed input sections.
8826 (Orphan_output_section::set_section_addresses): Call current_data_size
8827 and addralign methods of relaxed input sections.
8828 * symtab.cc (Symbol_table::compute_final_value): Extract template
8829 from the body of Symbol_table::sized_finalize_symbol.
8830 (Symbol_table::sized_finalized_symbol): Call
8831 Symbol_table::compute_final_value.
8832 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
8833 (Symbol_table::compute_final_value): New templated method declaration.
8834 * target.cc (Target::do_make_output_section): New method defintion.
8835 * target.h (Target::make_output_section): New method declaration.
8836 (Target::relax): Add more parameters for input objects, symbol table
8837 and layout. Adjust call to do_relax.
8838 (Target::do_make_output_section): New method declaration.
8839 (Target::do_relax): Add parameters for input objects, symbol table
8840 and layout.
8841
d446d6c4
ILT
88422009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8843
8844 * pread.c: Include stdio.h.
8845
bc06c745
ILT
88462009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8847
8848 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
8849 defined.
8850
75aea3d0
ILT
88512009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8852
8853 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8854 Change read_shndx type to unsigned int.
8855 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
8856 int.
8857 (Sized_dwarf_line_info::read_line_mappings): Likewise.
8858 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
8859 Change read_shndx type to unsigned int.
8860 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
8861 int.
8862 (Sized_dwarf_line_info::read_line_mappings): Likewise.
8863 * layout.cc (Layout::create_symtab_sections): Cast the result of
8864 local_symcount * symsize to off_t in the gold_assert.
8865
be8fcb75
ILT
88662009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8867
8868 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
8869 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
8870 R_ARM_BASE_ABS.
8871 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
8872 (Arm_relocate_functions::thm_abs5): New function.
8873 (Arm_relocate_functions::abs12): New function.
8874 (Arm_relocate_functions::abs16): New function.
8875 (Arm_relocate_functions::base_abs): New function.
8876 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
8877 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
8878 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
8879 R_ARM_BASE_ABS.
8880 (Scan::global): Likewise.
8881 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
8882 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
8883 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
8884 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
8885 R_ARM_BASE_ABS.
8886
c2a122b6
ILT
88872009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8888
8889 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
8890 (Arm_relocate_functions::movt_prel): New function.
8891 (Arm_relocate_functions::thm_movw_prel_nc): New function.
8892 (Arm_relocate_functions::thm_movt_prel): New function.
8893 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
8894 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
8895 (Scan::global, Relocate::relocate): Likewise.
8896 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8897
c4aa1e2d
ILT
88982009-10-09 Mikolaj Zalewski <mikolajz@google.com>
8899
8900 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
8901 Incremental_checker.
8902 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
8903 unsigned int.
8904 (class Incremental_inputs_header): New class.
8905 (Incremental_inputs_header_writer): Edit comment.
8906 (Incremental_inputs_entry): New class.
8907 (Incremental_inputs_entry_writer): Edit comment.
8908 (Sized_incremental_binary::do_find_incremental_inputs_section):
8909 Add *strtab_shndx parameter, fill it.
8910 (Sized_incremental_binary::do_check_inputs): New method.
8911 (Incremental_checker::can_incrementally_link_output_file): Use
8912 Sized_incremental_binary::check_inputs.
8913 (Incremental_inputs::report_command_line): Save command line in
8914 command_line_.
8915 * incremental.h:
8916 (Incremental_binary::find_incremental_inputs_section): New
8917 method.
8918 (Incremental_binary::do_find_incremental_inputs_section): Add
8919 strtab_shndx parameter.
8920 (Incremental_binary::do_check_inputs): New pure virtual method.
8921 (Sized_incremental_binary::do_check_inputs): Declare.
8922 (Incremental_checker::Incremental_checker): Add incremental_inputs
8923 parameter, use it to initialize incremental_inputs_.
8924 (Incremental_checker::incremental_inputs_): New field.
8925 (Incremental_checker::command_line): New method.
8926 (Incremental_checker::inputs): New method.
8927 (Incremental_checker::command_line_): New field.
8928
c549a694
ILT
89292009-10-09 Mikolaj Zalewski <mikolajz@google.com>
8930
8931 * incremental.cc: Include <cstdarg> and "target-select.h".
8932 (vexplain_no_incremental): New function.
8933 (explain_no_incremental): New function.
8934 (Incremental_binary::error): New method.
8935 (Sized_incremental_binary::do_find_incremental_inputs_section): New
8936 method.
8937 (make_sized_incremental_binary): New function.
8938 (open_incremental_binary): New function.
8939 (can_incrementally_link_file): Add checks if output is ELF and has
8940 inputs section.
8941 * incremental.h: Include "elfcpp_file.h" and "output.h".
8942 (Incremental_binary): New class.
8943 (Sized_incremental_binary): New class.
8944 (open_incremental_binary): Declare.
8945 * object.cc (is_elf_object): Use
8946 elfcpp::Elf_recognizer::is_elf_file.
8947 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
8948 * output.h (Output_file::filesize): New method.
8949
fd3c5f0b
ILT
89502009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8951
8952 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
8953 New function.
8954 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
8955 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
8956 function.
8957 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
8958 function.
8959 (Arm_relocate_functions::movw_abs_nc): New function.
8960 (Arm_relocate_functions::movt_abs): New function.
8961 (Arm_relocate_functions::thm_movw_abs_nc): New function.
8962 (Arm_relocate_functions::thm_movt_abs): New function.
8963 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
8964 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
8965 (Scan::global): Likewise.
8966 (Relocate::relocate): Likewise.
8967 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8968
7f5309a5
ILT
89692009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8970
8971 * arm.cc (Arm_relocate_functions::got_prel) New function.
8972 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
8973 (Relocate::relocate): Likewise.
8974 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8975
364c7fa5
ILT
89762009-10-06 Ian Lance Taylor <iant@google.com>
8977
8978 * options.h (class General_options): Define
8979 split_stack_adjust_size parameter.
8980 * object.h (class Object): Add uses_split_stack_ and
8981 has_no_split_stack_ fields. Add uses_split_stack and
8982 has_no_split_stack accessor functions. Declare
8983 handle_split_stack_section.
8984 (class Reloc_symbol_changes): Define.
8985 (class Sized_relobj): Define Function_offsets. Declare
8986 split_stack_adjust, split_stack_adjust_reltype, and
8987 find_functions.
8988 * object.cc (Object::handle_split_stack_section): New function.
8989 (Sized_relobj::do_layout): Call handle_split_stack_section.
8990 * dynobj.cc (Sized_dynobj::do_layout): Call
8991 handle_split_stack_section.
8992 * reloc.cc (Sized_relobj::relocate_sections): Call
8993 split_stack_adjust for executable sections in split_stack
8994 objects. Pass reloc_map to relocate_section.
8995 (Sized_relobj::split_stack_adjust): New function.
8996 (Sized_relobj::split_stack_adjust_reltype): New function.
8997 (Sized_relobj::find_functions): New function.
8998 * target-reloc.h: Include "object.h".
8999 (relocate_section): Add reloc_symbol_changes parameter. Change
9000 all callers.
9001 * target.h (class Target): Add calls_non_split method. Declare
9002 do_calls_non_split virtual method. Declare match_view and
9003 set_view_to_nop.
9004 * target.cc: Include "elfcpp.h".
9005 (Target::do_calls_non_split): New function.
9006 (Target::match_view): New function.
9007 (Target::set_view_to_nop): New function.
9008 * gold.cc (queue_middle_tasks): Give an error if mixing
9009 split-stack and non-split-stack objects with -r.
9010 * i386.cc (Target_i386::relocate_section): Add
9011 reloc_symbol_changes parameter.
9012 (Target_i386::do_calls_non_split): New function.
9013 * x86_64.cc (Target_x86_64::relocate_section): Add
9014 reloc_symbol_changes parameter.
9015 (Target_x86_64::do_calls_non_split): New function.
9016 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
9017 parameter.
9018 * powerpc.cc (Target_powerpc::relocate_section): Add
9019 reloc_symbol_changes parameter.
9020 * sparc.cc (Target_sparc::relocate_section): Add
9021 reloc_symbol_changes parameter.
9022 * configure.ac: Call AM_CONDITIONAL for the default target.
9023 * configure: Rebuild.
9024 * testsuite/Makefile.am (TEST_AS): New variable.
9025 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
9026 (check_DATA): Add split_i386 and split_x86_64 files.
9027 (SPLIT_DEFSYMS): Define.
9028 (split_i386_[1234n].o): New targets.
9029 (split_i386_[124]): New targets.
9030 (split_i386_[1234r].stdout): New targets.
9031 (split_x86_64_[1234n].o): New targets.
9032 (split_x86_64_[124]): New targets.
9033 (split_x86_64_[1234r].stdout): New targets.
9034 (MOSTLYCLEANFILES): Add new executables.
9035 * testsuite/split_i386.sh: New file.
9036 * testsuite/split_x86_64.sh: New file.
9037 * testsuite/split_i386_1.s: New file.
9038 * testsuite/split_i386_2.s: New file.
9039 * testsuite/split_i386_3.s: New file.
9040 * testsuite/split_i386_4.s: New file.
9041 * testsuite/split_i386_n.s: New file.
9042 * testsuite/split_x86_64_1.s: New file.
9043 * testsuite/split_x86_64_2.s: New file.
9044 * testsuite/split_x86_64_3.s: New file.
9045 * testsuite/split_x86_64_4.s: New file.
9046 * testsuite/split_x86_64_n.s: New file.
9047 * testsuite/testfile.cc (Target_test): Update relocation_section
9048 function.
9049 * testsuite/Makefile.in: Rebuild.
9050
e8a9fcda
ILT
90512009-10-06 Ian Lance Taylor <iant@google.com>
9052
9053 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
9054 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
9055 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
9056 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
9057 the address on ldo_addrs_.
9058 (Target_i386::Relocate::fix_up_ldo): New function.
9059
e99daf92
ILT
90602009-10-06 Rafael Espindola <espindola@google.com>
9061
9062 * plugin.cc (add_input_library): New.
9063 (Plugin::load): Add add_input_library to tv.
9064 (Plugin_manager::add_input_file): Add the is_lib argument.
9065 (add_input_file): Update call to Plugin_manager::add_input_file.
9066 (add_input_library): New.
9067 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
9068
966d4097
DK
90692009-09-30 Doug Kwan <dougkwan@google.com>
9070
9071 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
9072 symbol and call Symbol::may_need_copy_reloc to determine if
9073 a copy reloc is needed.
9074 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
9075 nocopyreloc is given in command line.
9076 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
9077 given in command line.
9078 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
9079 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
9080 of the removed Target_i386::may_need_copy_reloc.
9081 * options.h (copyreloc): New option with default value false.
9082 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9083 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
9084 instead of the removed Target_powerpc::may_need_copy_reloc.
9085 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9086 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
9087 instead of the removed Target_sparc::may_need_copy_reloc.
9088 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
9089 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
9090 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
9091 instead of the removed Target_x86_64::may_need_copy_reloc.
9092
029ba973
ILT
90932009-09-30 Ian Lance Taylor <iant@google.com>
9094
9095 * object.h (class Object): Remove target_ field, and target,
9096 sized_target, and set_target methods.
9097 (Object::sized_target): Remove.
9098 (class Sized_relobj): Update declarations. Remove sized_target.
9099 * object.cc (Sized_relobj::setup): Remove target parameter.
9100 Change all callers.
9101 (Input_objects::add_object): Don't do anything with the target.
9102 (make_elf_sized_object): Add punconfigured parameter. Change all
9103 callers. Set or test parameter target.
9104 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
9105 Change all callers.
9106 * parameters.cc (Parameters::set_target): Change parameter type to
9107 be non-const.
9108 (Parameters::default_target): Remove.
9109 (set_parameters_target): Change parameter type to be non-const.
9110 (parameters_force_valid_target): New function.
9111 (parameters_clear_target): New function.
9112 * parameters.h (class Parameters): Update declarations. Remove
9113 default_target method. Add sized_target and clear_target
9114 methods. Change target_ to be non-const.
9115 (set_parameters_target): Update declaration.
9116 (parameters_force_valid_target): Declare.
9117 (parameters_clear_target): Declare.
9118 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
9119 as NULL if we aren't searching.
9120 (Add_symbols::run): Don't check for compatible target.
9121 * fileread.cc (Input_file::open_binary): Call
9122 parameters_force_valid_target.
9123 * gold.cc (queue_middle_tasks): Likewise.
9124 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
9125 set_target on object.
9126 * dynobj.h (class Sized_dynobj): Update declarations.
9127 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
9128 make_elf_object returns NULL.
9129 (Archive::include_member): Don't check whether object target is
9130 compatible.
9131 * output.cc (Output_section::add_input_section): Get target from
9132 parameters.
9133 (Output_section::relax_input_section): Likewise.
9134 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
9135 parameters.
9136 (Sized_relobj::do_scan_relocs): Likewise.
9137 (Sized_relobj::relocate_sections): Likewise.
9138 * resolve.cc (Symbol_table::resolve): Likewise.
9139 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
9140 parameter. Change all callers.
9141 (Symbol_table::add_from_object): Get target from parameters.
9142 (Symbol_table::add_from_relobj): Don't check object target.
9143 (Symbol_table::add_from_dynobj): Likewise.
9144 (Symbol_table::define_special_symbol): Get target from
9145 parameters.
9146 * symtab.h (class Symbol_table): Update declaration.
9147 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
9148 parameter. Change all callers. Clear parameter target.
9149 (Binary_test): Test target here.
9150 * testsuite/object_unittest.cc (gold_testsuite): Remove
9151 target_test_pointer parameter. Change all callers.
9152 (Object_test): Test target here.
9153
a6a22b83
ILT
91542009-09-26 Ian Lance Taylor <iant@google.com>
9155
9156 * testsuite/initpri1.c: Don't try to use constructor priorities if
9157 compiling with gcc before 4.3.
9158
6a8f49fe
ILT
91592009-09-22 Mikolaj Zalewski <mikolajz@google.com>
9160
9161 * testsuite/retain_symbols_file_test.sh (check_present): Change
9162 output file name to retain_symbols_file_test.stdout.
9163 (check_absent): Likewise.
9164
8c604651
CS
91652009-09-18 Craig Silverstein <csilvers@google.com>
9166
9167 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
9168 * options.cc: Include <cerrno> and <fstream>.
9169 (General_options::finalize): Parse -retain-symbols-file tag.
9170 * options.h: New flag.
9171 (General_options): New method should_retain_symbol, new
9172 variable symbols_to_retain.
9173 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
9174 should_retain_symbol map.
9175 * testsuite/Makefile.am (retain_symbols_file_test): New test.
9176 * testsuite/Makefile.in: Regenerate.
9177 * testsuite/retain_symbols_file_test.sh: New file.
9178
ca58b19f
NC
91792009-09-18 Nick Clifton <nickc@redhat.com>
9180
9181 * po/es.po: Updated Spanish translation.
9182
20e6d0d6
DK
91832009-09-17 Doug Kwan <dougkwan@google.com>
9184
9185 * debug.h (DEBUG_RELAXATION): New constant.
9186 (DEBUG_ALL): Add DEBUG_RELAXATION.
9187 (debug_string_to_enum): Add relaxation debug option.
9188 * layout.cc
9189 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
9190 Layout::Relaxation_debug_check::read_sections,
9191 Layout::Relaxation_debug_check::read_sections): New method definitions.
9192 (Layout::Layout): Initialize data members
9193 record_output_section_data_from_scrips_,
9194 script_output_section_data_list_ and relaxation_debug_check_.
9195 (Layout::save_segments, Layout::restore_segments,
9196 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9197 Layout::relaxation_loop_body): New method definitions.
9198 (Layout::finalize): Support relaxation. Move section layout code to
9199 Layout::relaxation_loop_body.
9200 (Layout::set_asection_address_from_script): Move code for orphan
9201 section placement out.
9202 (Layout::place_orphan_sections_in_script): New method definition.
9203 * layout.h (Output_segment_headers, Output_file_header):
9204 New forward class declarations.
9205 (Layout::~Layout): Define.
9206 (Layout::new_output_section_data_from_script): New method definition.
9207 (Layout::place_orphan_sections_in_script): New method declaration.
9208 (Layout::Segment_states): New type declaration.
9209 (Layout::save_segments, Layout::restore_segments,
9210 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9211 Layout::relaxation_loop_body): New method declarations.
9212 (Layout::Output_section_data_list): New type declaration.
9213 (Layout::Relaxation_debug_check): New class definition.
9214 (Layout::record_output_section_data_from_script_,
9215 Layout::script_output_section_data_list_, Layout::segment_states_,
9216 Layout::relaxation_debug_check_): New data members.
9217 * output.cc: (Output_section_headers::do_size): New method definition.
9218 (Output_section_headers::Output_section_headers): Move size
9219 computation to Output_section_headers::do_size.
9220 (Output_segment_headers::do_size): New method definition.
e1df38aa 9221 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
9222 Output_file_header::do_size and call it.
9223 (Output_file_header::do_size): New method definition.
9224 (Output_data_group::Output_data_group): Adjust call to
9225 Output_section_data.
9226 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
9227 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 9228 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
9229 RELAXED_INPUT_SECTION_CODE.
9230 (Output_section::Output_section): Initialize data member checkpoint_.
9231 (Output_section::~Output_section): Delete checkpoint object pointed
9232 by checkpoint_.
9233 (Output_section::add_input_section): Always add an Input_section if
9234 relaxing.
9235 (Output_section::add_merge_input_section): Add assert.
9236 (Output_section::relax_input_section): New method definition.
9237 (Output_section::set_final_data_size): Set load address to zero for
9238 an unallocated section.
9239 (Output_section::do_address_and_file_offset_have_reset_values):
9240 New method definition.
9241 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
9242 Handle relaxed input section.
9243 (Output_section::sort_attached_input_sections): Checkpoint input
9244 section list lazily.
9245 (Output_section::get_input_sections): Change type of input_sections to
9246 list of Simple_input_section pointers. Checkpoint input section list
9247 lazily. Also handle relaxed input sections.
9248 (Output_section::add_input_section_for_script): Take a reference to
9249 a Simple_input_section object instead of Relobj pointer and section
9250 index as parameter. Handle relaxed input sections.
9251 (Output_section::save_states, Output_section::restore_states): New
9252 method definitions.
9253 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
9254 (Output_data::is_data_size_fixed): New method definition.
9255 (Output_data::reset_addresss_and_file_offset): Do not reset data size
9256 if it is fixed.
9257 (Output_data::address_and_file_offset_have_reset_values): New method
9258 definition.
9259 (Output_data::do_address_and_file_offset_have_reset_values): New method
9260 definition.
9261 (Output_data::set_data_size): Check that data size is not fixed.
9262 (Output_data::fix_data_size): New method definition.
9263 (Output_data::is_data_size_fixed_): New data member.
9264 (Output_section_headers::set_final_data_size): New method definition.
9265 (Output_section_headers::do_size): New method declaration.
9266 (Output_segment_headers::set_final_data_size): New method definition.
9267 (Output_segment_headers::do_size): New method declaration.
9268 (Output_file_header::set_final_data_size)::New method definition.
9269 (Output_file_header::do_size)::New method declaration.
9270 (Output_section_data::Output_section_data): Add new parameter
9271 is_data_size_fixed and use it to fix data size.
9272 (Output_data_const::Output_data_const): Adjust call to base class
9273 constructor and fix data size.
9274 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
9275 base class constructor and fix data size.
9276 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
9277 base class constructor and fix data size.
9278 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
9279 class constructor and fix data size.
9280 (Output_data_group::set_final_data_size): New method definition.
9281 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
9282 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
9283 class constructor and fix data size.
9284 (Output_relaxed_input_section): New class definition.
9285 (Output_section::Simple_input_section): New class definition.
9286 (Output_section::get_input_sections): Adjust parameter list.
9287 (Output_section::add_input_section_for_script): Same.
9288 (Output_section::save_states, Output_section::restore_states,
9289 Output_section::do_address_and_file_offset_have_reset_values,
9290 (Output_section::Input_section::Input_section): Handle
9291 RELAXED_INPUT_SECTION_CODE. Add new overload for
9292 Output_relaxed_input_section.
9293 (Output_section::Input_section::is_input_section,
9294 Output_section::Input_section::set_output_section): Handle relaxed
9295 input section.
9296 (Output_section::Input_section::is_relaxed_input_section,
9297 Output_section::Input_section::output_section_data,
9298 Output_section::Input_section::relaxed_input_section): New method
9299 definitions.
9300 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
9301 value.
9302 (Output_section::Input_section::u1_): Update comments.
9303 (Output_section::Input_section::u2_): Add new union member poris.
9304 (Output_section::Checkpoint_output_section): New classs definition.
9305 (Output_section::relax_input_section): New method declaration.
9306 (Output_section::checkpoint_): New data member.
9307 (Output_segment): Update comments.
9308 (Output_segment::Output_segment): Un-privatize copy constructor.
9309 (Output_segment::operator=): Un-privatize.
9310 * script-sections.cc (Output_section_element::Input_section_list):
9311 Change element type to Output_section::Simple_input_section.
9312 (Output_section_element_dot_assignment::set_section_addresses):
9313 Register output section data for relaxation clean up.
9314 (Output_data_exression::Output_data_expression): Adjust call to base
9315 constructor to fix data size.
9316 (Output_section_element_data::set_section_addresses): Register
9317 Output_data_expression object for relaxation clean up.
9318 (struct Input_section_info): Replace Relobj pointer and section index
9319 pair with Output_section::Simple_input_section and Convert struct to a
9320 class.
9321 (Input_section_sorter::operator()): Adjust access to
e1df38aa 9322 Input_section_info data member to use accessors.
20e6d0d6
DK
9323 (Output_section_element_input::set_section_addresses): Use layout
9324 parameter. Adjust code to use Output_section::Simple_input_section
9325 and Input_secction_info classes. Register filler for relaxation
9326 clean up.
9327 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
9328 and section index pair with Output_section::Simple_input_section
9329 class. Adjust code accordingly.
9330 (Phdrs_element::release_segment): New method definition.
9331 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
9332 segment list.
9333 (Script_sections::release_segments): New method definition.
9334 * gold/script-sections.h (Script_sections::release_segments): New
9335 method declaration.
9336 * gold/target.h (Target::may_relax, Target::relax,
9337 Target::do_may_relax, Target::do_relax): New method definitions.
9338
5e445df6
ILT
93392009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9340
9341 * arm.cc (has_signed_unsigned_overflow): New function.
9342 (Arm_relocate_functions::abs8): New function.
9343 (Target_arm::Scan::local): Handle R_ARM_ABS8.
9344 (Target_arm::Scan::global): Likewise.
9345 (Target_arm::relocate::relocate): Likewise.
9346 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9347 Likewise.
9348
8c604651 93492009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
9350
9351 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
9352 * testsuite/Makefile.in: Regenerate.
9353
1e9cc1c2
NC
93542009-09-11 Nick Clifton <nickc@redhat.com>
9355
9356 * po/gold.pot: Updated by the Translation project.
9357
6a89f575
CC
93582009-09-08 Cary Coutant <ccoutant@google.com>
9359
9360 * output.cc (Output_file::open): Add execute permission to empty file.
9361 * testsuite/Makefile.am (permission_test): New test.
9362 * testsuite/Makefile.in: Regenerate.
9363
fdcac5af
ILT
93642009-09-02 Ian Lance Taylor <iant@google.com>
9365
9366 * output.cc (Output_file::resize): Call map_no_anonymous rather
9367 than map.
9368
44453f85
ILT
93692009-09-01 Mikolaj Zalewski <mikolajz@google.com>
9370
9371 * gold.cc: Include "incremental.h".
9372 (queue_initial_tasks): Call Incremental_checker methods.
9373 * incremental.cc: Include "output.h".
9374 (Incremental_checker::can_incrementally_link_output_file): New
9375 method.
9376 * incremental.h (Incremental_checker): New class.
9377
9378 * output.cc (Output_file::open_for_modification): New method.
9379 (Output_file::map_anonymous): Changed return type to bool. Record
9380 map in base_ field.
9381 (Output_file::map_no_anonymous): New method, broken out of map.
9382 (Output_file::map): Use map_no_anonymous and map_anonymous.
9383 * output.h (class Output_file): Update declarations.
9384
293c1386
CC
93852009-08-24 Cary Coutant <ccoutant@google.com>
9386
9387 * options.h (Command_line::Pre_options): New class.
9388 (Command_line::pre_options): New member.
9389 * options.cc (gold::options::ready_to_register): New variable.
9390 (One_option::register_option): Do nothing if not registering options.
9391 Assert if same short option registered twice.
9392 (General_options::General_options): Turn off option registration when
9393 done constructing.
9394 (Command_line::Pre_options::Pre_options): New constructor.
9395
f773f3d2
CC
93962009-08-24 Cary Coutant <ccoutant@google.com>
9397
06a73cfe
CC
9398 * options.h (General_options::no_keep_memory): Remove incorrect
9399 short option.
f773f3d2 9400
a15af8e2
RW
94012009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9402
9403 * Makefile.am (am__skiplex, am__skipyacc): New.
9404 * Makefile.in: Regenerate.
9405
c462b41b
RW
94062009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9407
14ec8efd
RW
9408 * Makefile.am (AM_CPPFLAGS): Renamed from ...
9409 (INCLUDES): ... this.
9410 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
9411 (AM_CPPFLAGS): Renamed from ...
9412 (INCLUDE): ... this.
9413 * Makefile.in, testsuite/Makefile.in: Regenerate.
9414
81ecdfbb
RW
9415 * Makefile.in: Regenerate.
9416 * aclocal.m4: Likewise.
9417 * config.in: Likewise.
9418 * configure: Likewise.
9419 * testsuite/Makefile.in: Likewise.
9420
c462b41b
RW
9421 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9422 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9423 * Makefile.in: Regenerate.
9424 * testsuite/Makefile.in: Regenerate.
9425
2da73f13
CC
94262009-08-19 Cary Coutant <ccoutant@google.com>
9427
9428 * resolve.cc (Symbol_table::resolve): Don't complain about defined
9429 symbols in shared libraries overridden by hidden or internal symbols
9430 in the main program.
9431
2db70501
CD
94322009-08-19 Chris Demetriou <cgd@google.com>
9433
9434 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
9435 checking source file names in error messages.
9436
f733487b
DK
94372009-08-18 Doug Kwan <dougkwan@google.com>
9438
9439 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
9440 an elcpp::Ehdr as parameter. Adjust call to set_target.
9441 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
9442 an elfcpp::Ehdr as parameter.
9443 * object.cc (Object::set_target): Remove the version that looks up
9444 a target and sets it.
9445 (Sized_relobj::setup): Take a Target object instead of
9446 an elfcpp::Ehdr as parameter. Adjust call to set_target.
9447 (make_elf_sized_object): Find target and ask target to
9448 make an ELF object.
9449 * object.h: (Object::set_target): Remove the version that looks up
9450 a target and sets it.
9451 (Sized_relobj::setup): Take a Target object instead of
9452 an elfcpp:Ehdr as parameter.
9453 * target.cc: Include dynobj.h.
9454 (Target::do_make_elf_object_implementation): New.
2e702c99 9455 (Target::do_make_elf_object): New.
f733487b
DK
9456 * target.h (Target::make_elf_object): New template declaration.
9457 (Target::do_make_elf_object): New method declarations.
9458 (Target::do_make_elf_object_implementation): New template declaration.
9459
cc70f101
ILT
94602009-08-14 Ian Lance Taylor <iant@google.com>
9461
9462 * gold.h (FUNCTION_NAME): Define.
9463 (gold_unreachable): Use FUNCTION_NAME.
9464
ef5e0cb1
ST
94652009-08-12 Sriraman Tallam <tmsriram@google.com>
9466
9467 * icf.cc (Icf::find_identical_sections): Issue a warning when a
9468 symbol in the --keep-unique list is not found.
9469
48c187ce
ST
94702009-08-12 Sriraman Tallam <tmsriram@google.com>
9471
9472 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
9473 been maked as --keep-unique.
9474 (Icf::unfold_section): New function.
9475 * icf.h (Icf::unfold_section): New function.
9476 * options.h (General_options::keep_unique): New option.
9477 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
9478 * testsuite/Makefile.in: Regenerate.
9479 * testsuite/icf_keep_unique_test.sh: New file.
9480 * testsuite/icf_keep_unique_test.cc: New file.
9481
645afe0c
CC
94822009-08-12 Cary Coutant <ccoutant@google.com>
9483
9484 PR 10471
9485 * resolve.cc (Symbol_table::resolve): Check for references from
9486 dynamic objects to hidden and internal symbols.
9487 * testsuite/Makefile.am (hidden_test.sh): New test.
9488 * testsuite/Makefile.in: Regenerate.
9489 * testsuite/hidden_test.sh: New script.
9490 * testsuite/hidden_test_1.c: New test source.
9491 * testsuite/hidden_test_main.c: New test source.
9492
11af873f
DK
94932009-08-11 Doug Kwan <dougkwan@google.com>
9494
9495 * arm.cc: Update comments.
9496 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
9497 segment to locate the .ARM.exidx section if present.
9498
b9f7d72d
DK
94992009-08-09 Doug Kwan <dougkwan@google.com>
9500
9501 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
9502 patch.
9503
ddd3c53c
ST
95042009-08-07 Sriraman Tallam <tmsriram@google.com>
9505 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
9506 compiler warnings.
9507
27721062
ST
95082009-08-06 Sriraman Tallam <tmsriram@google.com>
9509
9510 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
9511 valid tls_segment only for non-debug-section relocations.
9512 * testsuite/Makefile.am: Add gc_tls_test.
9513 * testsuite/Makefile.in: Regenerate.
9514 * testsuite/gc_tls_test.cc: New file.
9515 * testsuite/gc_tls_test.sh: New file.
9516
ef15dade 95172009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 9518
ef15dade
ST
9519 * icf.cc: New file.
9520 * icf.h: New file.
9521 * Makefile.am (CCFILES): Add icf.cc.
9522 (HFILES): Add icf.h
9523 * Makefile.in: Regenerate.
9524 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
9525 * gc.h (gc_process_relocs): Populate lists used by icf to contain
9526 section, symbol and addend information for the relocs.
9527 * gold.cc (queue_middle_tasks): Call identical code folding.
9528 * gold.h: Add defines for multimap.
9529 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
9530 to the call of finalize_local_symbols.
9531 * main.cc (main): Create object of class Icf.
9532 * object.cc (Sized_relobj::do_layout): Allow this function to be
9533 called twice during icf.
9534 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
9535 to sections marked as identical by icf.
9536 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
9537 when available.
9538 (Sized_relobj::do_section_entsize): New function.
9539 * object.h (Object::section_entsize): New function.
9540 (Object::do_section_entsize): New pure virtual function.
9541 (Relobj::finalize_local_symbols): Add new parameter.
9542 (Relobj::do_section_entsize): New function.
9543 * options.h (General_options::icf): New option.
9544 (General_options::icf_iterations): New option.
9545 (General_options::print_icf_sections): New option.
9546 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
9547 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
9548 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
9549 icf.
9550 * symtab.cc (Symbol_table::is_section_folded): New function.
9551 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
9552 to sections marked as identical by icf.
9553 * symtab.h (Symbol_table::set_icf): New function.
9554 (Symbol_table::icf): New function.
9555 (Symbol_table::is_section_folded): New function.
9556 (Symbol_table::icf_): New data member.
9557 * target-reloc.h (relocate_section): Ignore sections folded by icf.
9558 * testsuite/Makefile.am: Add commands to build icf_test.
9559 * testsuite/Makefile.in: Regenerate.
9560 * testsuite/icf_test.sh: New file.
9561 * testsuite/icf_test.cc: New file.
9562
c3b65ac4
CD
95632009-07-24 Chris Demetriou <cgd@google.com>
9564
9565 * layout.cc (is_compressible_debug_section): Fix incorrect
9566 comment about compressed section names.
9567
1caf2c51
ILT
95682009-07-20 Ian Lance Taylor <ian@airs.com>
9569
9570 PR 10419
9571 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
9572
1ef4d87f
ILT
95732009-07-16 Ian Lance Taylor <iant@google.com>
9574
9575 PR 10400
9576 * layout.h: #include <map>.
9577 (class Kept_section): Change from struct to class. Add accessors
9578 and setters. Add section size to Comdat_group mapping. Change
9579 Comdat_group to std::map. Add is_comdat_ field. Add
9580 linkonce_size field in union.
9581 (class Layout): Update declaration of find_or_add_kept_section.
9582 Don't declare find_kept_object.
9583 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
9584 parameter. Add object, shndx, is_comdat, and is_group_name
9585 parameters. Change all callers. Adjust for new Kept_section.
9586 (Layout::find_kept_object): Remove.
9587 * object.cc (Sized_relobj::include_section_group): Update use of
9588 Kept_section. Rename secnum to shndx. Only record
9589 Kept_comdat_section if sections are the same size.
9590 (Sized_relobj::include_linkonce_section): Update use of
9591 Kept_section. Only record Kept_comdat_section if sections are the
9592 same size. Set size of linkonce section.
9593 (Sized_relobj::map_to_kept_section): Update call to
9594 get_kept_comdat_section.
9595 * object.h (class Sized_relobj): Rename fields in
9596 Kept_comdat_section to drop trailing underscores; change object
9597 field to Relobj*. Change Kept_comdat_section_table to store
9598 struct rather than pointer.
9599 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
9600 Add kept_object and kept_shndx parameters. Change all callers.
9601 (Sized_relobj::get_kept_comdat_section): Change return type to
9602 bool. Add kept_object and kept_shndx parameters. Change all
9603 callers.
9604 * plugin.cc (Pluginobj::include_comdat_group): Update call to
9605 Layout::find_or_add_kept_section.
9606
37c3b7b0
ILT
96072009-07-09 Ian Lance Taylor <iant@google.com>
9608
9609 * merge.cc (Object_merge_map::initialize_input_to_output_map):
9610 Reserve space in the hash table.
9611
98fa85cb
ILT
96122009-07-06 Mikolaj Zalewski <mikolajz@google.com>
9613
9614 * fileread.cc (File_read::get_mtime): New method.
9615 * fileread.h (Timespec): New structure.
9616 (File_read::get_mtime): New method.
9617 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
9618 Renamed from timestamp_nsec.
9619 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
9620 Elf_Xword.
e1df38aa 9621 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 9622 timestamp_nsec.
e1df38aa 9623 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
9624 (Incremental_inputs::report_obejct): Save mtime; style fix.
9625 (Incremental_inputs::report_script): Save mtime; style fix.
9626 (Incremental_inputs::finalize_inputs): Style fix.
9627 (Incremental_inputs::finalize): Style fix.
9628 (Incremental_inputs::create_input_section_data): Store inputs
9629 mtime.
9630 * incremental.h (Incremental_inputs::report_script): Add mtime
9631 argument.
9632 (Incremental_inputs::Input_info::Input_info): Intialize only one
9633 union member.
9634 (Incremental_inputs::Input_info::archive): Move to nameless
9635 union.
9636 (Incremental_inputs::Input_info::obejct): Move to nameless union.
9637 (Incremental_inputs::Input_info::script): Move to nameless union.
9638 (Incremental_inputs::mtime): New field.
9639 * script.cc (read_input_script): Pass file mtime to
9640 Incremental_input.
9641 * script.h (Script_info::inputs): Style fix.
9642
c9d70757
ILT
96432009-07-01 Ian Lance Taylor <ian@airs.com>
9644
9645 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
9646 instead of 32.
9647
9c547ec3
ILT
96482009-06-24 Ian Lance Taylor <iant@google.com>
9649
9650 PR 10156
9651 * layout.cc (Layout::choose_output_section): If we find an
9652 existing section, update the flags.
9653 (Layout::create_notes): New function, broken out of
9654 Layout::finalize.
9655 (Layout::finalize): Don't create note sections.
9656 (Layout::create_note): Don't crash if linker script discards
9657 section.
9658 (Layout::create_gold_note): Likewise.
9659 (Layout::create_build_id): Likewise. Don't set
9660 after_input_sections on the section.
9661 (Layout::create_executable_stack_info): Remove target parameter.
9662 Change caller.
9663 * layout.h (class Layout): Declare create_notes. Update
9664 declaration of create_executable_stack_info.
9665 * gold.cc (queue_middle_tasks): Call create_notes.
9666 * output.cc (Output_section::update_flags_for_input_section): Move
9667 here from output.h. If SHF_ALLOC flag is newly set, mark address
9668 invalid.
9669 * output.h (Output_data::mark_address_invalid): New function.
9670 (class Output_section): Only declare, not define,
9671 update_flags_for_input_section. Remove set_flags.
9672
55458500
ILT
96732009-06-24 Ian Lance Taylor <iant@google.com>
9674
9675 * script-sections.cc (Output_section_definition::
9676 set_section_addresses): Rename shadowing local load_address to
9677 laddr.
9678
1307d6cd
ILT
96792009-06-24 Ian Lance Taylor <iant@google.com>
9680
9681 PR 10244
9682 * reloc.cc (relocate_sections): Skip empty relocation sections.
9683
ec3f783e
ILT
96842009-06-23 Ian Lance Taylor <iant@google.com>
9685
9686 PR 10156
9687 * layout.cc (Layout::create_note): Use choose_output_section
9688 rather than make_output_section.
9689
459c9f1c
ILT
96902009-06-23 Ian Lance Taylor <iant@google.com>
9691
9692 PR 10237
9693 * options.cc (General_options::parse_V): Set printed_version_.
9694 (General_options::General_options): Initialize printed_version_.
9695 * options.h (class General_options): Add printed_version_ field.
9696 * gold.cc (queue_initial_tasks): If there are no input files,
9697 don't give a fatal error if we printed the version information.
9698 (queue_middle_tasks): If using -r with a shared object, give a
9699 fatal error rather than an ordinary error.
9700
1518dc8f
ILT
97012009-06-23 Ian Lance Taylor <iant@google.com>
9702
9703 PR 10219
9704 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
9705 (Layout::make_output_section): Set have_stabstr_section_ if we see
9706 a .stab*str section.
9707 (Layout::finalize): Call link_stabs_sections.
9708 (Layout::link_stabs_sections): New file.
9709 * layout.h (class Layout): Add have_stabstr_section_ field.
9710 Declare link_stabs_sections.
9711
3d857b98
DK
97122009-06-23 Doug Kwan <dougkwan@google.com>
9713
9714 * Makefile.am (libgold_a_LIBADD): New.
9715 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 9716 * Makefile.in: Regenerate.
3d857b98
DK
9717 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
9718 * configure: Regenerate.
9719 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
9720 * fileread.cc: Include sys/state.h
9721 * gold.h: Declare memmem and strndup if found missing.
9722 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
9723
0639a6f6
ILT
97242009-06-23 Ian Lance Taylor <iant@google.com>
9725
9726 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
9727 * configure: Rebuild.
9728
8d63875c
ILT
97292009-06-23 Ian Lance Taylor <iant@google.com>
9730
9731 PR 10147
9732 * object.cc (Object::section_contents): Don't try to get a view if
9733 the section has length zero.
9734 (Object::handle_gnu_warning_section): If the section is empty, use
9735 the name of the section as the warning.
9736
f7c8a183
ILT
97372009-06-23 Ian Lance Taylor <iant@google.com>
9738
9739 PR 10133
9740 * stringpool.h (class Stringpool_template): Add optimize_ field.
9741 (Stringpool_template::set_optimize): New function.
9742 * stringpool.cc (Stringpool_template::Stringpool_template):
9743 Initialize optimize_ field.
9744 (Stringpool_template::set_string_offsets): Test local optimize
9745 fild rather than parameter.
9746 * layout.cc (Layout::Layout): Call set_optimize on the section
9747 name stringpool.
9748
e6a307ba
ILT
97492009-06-22 Ian Lance Taylor <iant@google.com>
9750
9751 PR 10030
9752 * yyscript.y: Parse TARGET.
9753 * script.cc (script_set_target): New function.
9754 * script-c.h (script_set_target): Declare.
9755 * options.cc (General_options::string_to_object_format): Rename
9756 from string_to_object_format in anonymous namespace. Change
9757 callers.
9758 * options.h (class General_options): Declare
9759 string_to_object_format.
9760
3ee173de
ILT
97612009-06-22 Ian Lance Taylor <iant@google.com>
9762
9763 * script-sections.cc (Script_sections::create_segments): Don't put
9764 program headers in a PT_LOAD segment if -n or -N.
9765
97662009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
9767
9768 PR 10141
9769 * options.h (class General_options): Add -z lazy and -z now. Sort
9770 -z options into alphabetical order.
9771 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
9772
cd6739a1 97732009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
9774
9775 * layout.cc (Layout::make_output_section): Call
9776 Target::new_output_section.
9777 (Layout::attach_allocated_section_to_segment): Put large section
9778 sections in a separate load segment with the large segment flag
9779 set.
9780 (Layout::segment_precedes): Sort large data segments after other
9781 load segments.
9782 (align_file_offset): New static function.
9783 (Layout::set_segment_offsets): Use align_file_offset.
9784 * output.h (class Output_section): Add is_small_section_ and
9785 is_large_section_ fields.
9786 (Output_section::is_small_section): New function.
9787 (Output_section::set_is_small_section): New function.
9788 (Output_section::is_large_section): New function.
9789 (Output_section::set_is_large_section): New function.
9790 (Output_section::is_large_data_section): New function.
9791 (class Output_segment): Add is_large_data_segment_ field.
9792 (Output_segment::is_large_data_segment): New function.
9793 (Output_segment::set_is_large_data_segment): New function.
9794 * output.cc (Output_section::Output_section): Initialize new
9795 fields.
9796 (Output_segment::Output_segment): Likewise.
9797 (Output_segment::add_output_section): Add assertion that large
9798 data sections always go in large data segments. Force small data
9799 sections to the end of the list of data sections. Force small BSS
9800 sections to the start of the list of BSS sections. For large BSS
9801 sections to the end of the list of BSS sections.
9802 * symtab.h (class Symbol): Declare is_common_shndx.
9803 (Symbol::is_defined): Check Symbol::is_common_shndx.
9804 (Symbol::is_common): Likewise.
9805 (class Symbol_table): Define enum Commons_section_type. Update
9806 declarations. Add small_commons_ and large_commons_ fields.
9807 * symtab.cc (Symbol::is_common_shndx): New function.
9808 (Symbol_table::Symbol_table): Initialize new fields.
9809 (Symbol_table::add_from_object): Put small and large common
9810 symbols in the right list.
9811 (Symbol_table::sized_finalized_symbol): Check
9812 Symbol::is_common_shndx.
9813 (Symbol_table::sized_write_globals): Likewise.
9814 * common.cc (Symbol_table::do_allocate_commons): Allocate new
9815 common symbol lists. Don't call do_allocate_commons_list if the
9816 list is empty.
9817 (Symbol_table::do_allocate_commons_list): Remove is_tls
9818 parameter. Add comons_section_type parameter. Change all
9819 callers. Handle small and large common symbols.
9820 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
9821 Symbol::is_common_shndx.
9822 * resolve.cc (symbol_to_bits): Likewise.
9823 * target.h (Target::small_common_shndx): New function.
9824 (Target::small_common_section_flags): New function.
9825 (Target::large_common_shndx): New function.
9826 (Target::large_common_section_flags): New function.
9827 (Target::new_output_section): New function.
9828 (Target::Target_info): Add small_common_shndx, large_common_shndx,
9829 small_common_section_flags, and large_common_section_flags
9830 fields.
9831 (Target::do_new_output_section): New virtual function.
9832 * arm.cc (Target_arm::arm_info): Initialize new fields.
9833 * i386.cc (Target_i386::i386_info): Likewise.
9834 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
9835 Likewise.
9836 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
9837 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
9838 (Target_x86_64::do_new_output_section): New function.
9839 * configure.ac: Define conditional MCMODEL_MEDIUM.
9840 * testsuite/Makefile.am (check_PROGRAMS): Add large.
9841 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
9842 (large_LDFLAGS): Define.
9843 * testsuite/large.c: New file.
9844 * testsuite/testfile.cc (Target_test::test_target_info):
9845 Initialize new fields.
9846 * configure, testsuite/Makefile.in: Rebuild.
9847
bb04269c
DK
98482009-06-05 Doug Kwan <dougkwan@google.com>
9849
9850 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 9851 * Makefile.in: Regenerate.
bb04269c
DK
9852 * i386.cc (class Target_i386): Define new virtual method to
9853 override do_is_local_label_name in parent.
9854 * object.cc (Sized_relobj::do_count_local_symbols): Discard
9855 local symbols if --discard-locals or -X is given.
9856 * options.h (class General_options): Declare new options
9857 '--discard-locals' and '-X' for discarding locals.
9858 * target.h (class Target): Define new methods is_local_label_name.
9859 Declare new virtual method do_is_local_label_name.
9860 * target.cc: New file.
9861 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
9862 (check_SCRIPTS): Add discard_locals_test.sh.
9863 (check_DATA): Add discard_local_tests.syms.
9864 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
9865 (discard_local_tests.syms, discard_locals_test.o): New make rules.
9866 * testsuite/Makefile.in: Regenerate.
9867 * testsuite/discard_locals_test.c: New file.
9868 * testsuite/discard_locals_test.sh: Same.
9869
805bb01c
DK
98702009-06-05 Doug Kwan <dougkwan@google.com>
9871
9872 * object.cc (Sized_relobj::Sized_relobj): Initialize
9873 discarded_eh_frame_shndx_ to -1U.
9874 (Sized_relobj::do_layout): Record index of a discard .eh_frame
9875 section.
9876 (Sized_relobj::do_count_local_symbols): Skip local symbols in
9877 a discarded .eh_frame section.
9878 (Sized_relobj::do_finalize_local_symbols): Ditto.
9879 * object.h (class Sized_relobj): Declare new member
9880 discarded_eh_frame_shndx_.
9881 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
9882 (local_labels_test.o, local_labels_test): New rules.
9883 * testsuite/Makefile.in: Regenerate.
9884
1dcd334d
DK
98852009-06-04 Doug Kwan <dougkwan@google.com>
9886
9887 * layout.cc (Layout::section_name_mapping): Add mapping for
9888 special ARM sections.
9889
96d49306
DK
98902009-06-03 Doug Kwan <dougkwan@google.com>
9891
9892 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
9893 (utils::has_overflow): Same.
9894
dff16297
ILT
98952009-06-03 Ian Lance Taylor <iant@google.com>
9896
9897 * layout.cc (Layout::section_name_mapping): New array, replacing
9898 Layout::linkonce_mapping.
9899 (Layout::section_name_mapping_count): New variable, replacing
9900 Layout::linkonce_mapping_count.
9901 (Layout::linkonce_output_name): Remove.
9902 (Layout::output_section_name): Rewrite.
9903 * layout.h (class Layout): Rename Linkonce_mapping to
9904 Section_name_mapping, linkonce_mapping to section_name_mapping,
9905 linkonce_mapping_count to section_name_mapping_count. Don't
9906 declare linkonce_output_name.
9907
c121c671
DK
99082009-06-03 Doug Kwan <dougkwan@google.com>
9909
9910 * gold/arm.cc (namespace utils): New.
9911 (Target_arm::reloc_is_non_pic): Define new method.
9912 (class Arm_relocate_functions): New.
9913 (Target_arm::Relocate::relocate): Handle relocation types used by
9914 Android.
9915
07800fab
ILT
99162009-06-03 Ian Lance Taylor <iant@google.com>
9917
9918 * arm.cc (Target_arm::scan::global): Use || instead of |.
9919
c121c671
DK
99202009-06-02 Doug Kwan <dougkwan@google.com>
9921
9922 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
9923 issued_non_pic_error_.
9924 (class Target_arm::Scan): Declare new method check_non_pic.
9925 Define new method symbol_needs_plt_entry.
9926 Declare new data member issued_non_pic_error_.
9927 (class Target_arm::Relocate): Declare new method
9928 should_apply_static_reloc.
9929 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
9930 (Target_arm::Scan::check_non_pic): Define new method.
9931 (Target_arm::Scan::local): Handle a small subset of reloc types used
9932 by Android.
9933 (Target_arm::Scan::local): Same.
9934 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
9935
b19b0c6d
ILT
99362009-05-31 Mikolaj Zalewski <mikolajz@google.com>
9937
9938 * incremental.cc (Incremental_inputs::report_command_line): Filter
9939 out --incremental-* options.
9940
94cdfcff
DK
99412009-05-29 Doug Kwan <dougkwan@google.com>
9942
9943 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
9944 template class.
9945 (class Target_arm): Update comment.
9946 (Target_arm::Target_arm): Initialize new data members GOT_,
9947 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
9948 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
9949 and Target_arm::rel_dyn_section.
9950 Declare new_enum Target_arm::Got_type.
9951 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
9952 and DYNBSS_.
9953 Update commments for member do_dynsym_value.
9954 (Target_arm::got_size, Target_arm::plt_section,
9955 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
9956 new methods inside class defintion.
9957 (Target_arm::got_section): Define new method.
9958 (Target_arm::rel_dyn_section): Same.
9959 (Output_data_plt_arm): New template class.
9960 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
9961 (Output_data_plt_arm:do_adjust_output_section): Define new method.
9962 (Output_data_plt_arm::add_entry): Same.
9963 (Output_data_plt_arm::first_plt_entry): Define new
9964 static data member for PLT instruction template.
9965 (Output_data_plt_arm::plt_entry): Same.
9966 (Output_data_plt_arm::do_write): Define new method.
9967 (Target_arm::make_plt_entry): Same.
9968 (Target_arm::do_finalize_sections): Same.
9969 (Target_arm::do_dynsym_value): Same.
9970
4a657b0d
DK
99712009-05-28 Doug Kwan <dougkwan@google.com>
9972
9973 * Makefile.am (TARGETSOURCES): Add arm.cc.
9974 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
9975 * Makefile.in: Regenerate.
9976 * arm.cc: New file.
9977 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
9978
e7ae8c36
DK
99792009-05-26 Doug Kwan <dougkwan@google.com>
9980
9981 * options.cc (General_options::parse_exclude_libs). Fix a comment.
9982 (General_options::check_excluded_libs): Strip off directories in
9983 archive name before matching like GNU ld does.
9984 * testsuite/Makefile.am (MOSTLYCLEANFILES,
9985 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
9986 (exclude_libs_test_LDFLAGS): Add linker option
9987 -Wl,--exclude-libs,libexclude_libs_test_3
9988 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
9989 an explicit archive without using -l.
9990 (alt/libexclude_libs_test_3.a): New make rule.
9991 * testsuite/Makefile.in: Regenerate.
9992 * testsuite/exclude_libs_test.c : Declare lib3_default().
9993 (main): Call it.
9994 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
9995 * exclude_libs_test_3.c: New file.
9996
f12e7348
NC
99972009-05-26 Nick Clifton <nickc@redhat.com>
9998
9999 * po/id.po: New Indonesian translation.
10000 * po/gold.pot: Updated template file.
10001
4daadc0d
ST
100022009-05-22 Sriraman Tallam <tmsriram@google.com>
10003
e1df38aa 10004 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
10005 gc_comdat_test files. Add -Wl,--gc-sections to build
10006 gc_comdat_test.
10007 * testsuite/Makefile.in: Regenerate.
10008 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
10009
531813ad
ST
100102009-05-21 Sriraman Tallam <tmsriram@google.com>
10011
10012 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
10013 kept comdat section was garbage collected.
10014 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
10015 * testsuite/Makefile.in: Regenerate.
10016 * testsuite/gc_comdat_test.sh: New file.
10017 * testsuite/gc_comdat_test_1.cc: New file.
10018 * testsuite/gc_comdat_test_2.cc: New file.
10019
65514900
CC
100202009-05-19 Doug Kwan <dougkwan@google.com>
10021
10022 * archive.cc (Archive::Archive): Move constructor from archive.h
10023 to here. Initialize no_export_.
10024 (Archive::get_elf_object_for_member): Set no_export flag of object.
10025 * archive.h (Archive::Archive): Move constructor body to
10026 archive.cc.
10027 (Archive::no_export): New method.
10028 (Archive::no_export_): New field.
10029 * object.h (Object::Object): Initialize no_export_ to false.
10030 (Object::no_export, Object::set_no_export): New methods.
10031 (Object::no_export_): New field.
10032 * options.cc (General_options::parse_exclude_libs): New method.
10033 (General_options::check_excluded_libs) Same.
10034 * options.h (exclude_libs): New option.
10035 (General_options::check_excluded_libs): New method declaration.
10036 (General_options::excluded_libs_): New field.
10037 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
10038 default or protected visibility if an object has no-export flag set.
10039 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
10040 (check_SCRIPTS): Add exclude_libs_test.sh.
10041 (check_DATA): Add exclude_libs_test.syms.
10042 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
10043 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
10044 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
10045 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
10046 (exclude_libs_test.syms, libexclude_libs_test_1.a,
10047 libexclude_libs_test_2.a): New rules.
10048 * testsuite/Makefile.in: Regenerate.
10049 * testsuite/exclude_libs_test.c: New file.
10050 * testsuite/exclude_libs_test.sh: Ditto.
10051 * testsuite/exclude_libs_test_1.c: Ditto.
10052 * testsuite/exclude_libs_test_2.c: Ditto.
10053
1b77ea50
ILT
100542009-05-15 Ian Lance Taylor <iant@google.com>
10055
10056 * configure.ac: Check for declarations for cases where libiberty.h
10057 checks HAVE_DECL_xxx.
10058 * configure, config.in: Rebuild.
10059
072fe7ce
ILT
100602009-05-15 Mikolaj Zalewski <mikolajz@google.com>
10061
10062 * gold.h (Incremental_argument_list): Remove (invalid) forward
10063 declaration.
10064 * incremental.cc (Incremental_inputs::report_achive): New method.
10065 (Incremental_inputs::report_object): New method.
10066 (Incremental_inputs::report_script): New method.
10067 (Incremental_inputs::finalize_inputs): New method.
10068 (Incremental_inputs::finalize): Call finalize_inputs().
10069 (Incremental_inputs::sized_create_incremental_inputs_section_data):
10070 Create inputs entries.
10071 * incremental.h (Incremental_input_type): New enum.
10072 (Incremental_inputs::Incremental_input): Initialize new fields.
10073 (Incremental_inputs::report_inputs): New method.
10074 (Incremental_inputs::report_achive): New method.
10075 (Incremental_inputs::report_object): New method.
10076 (Incremental_inputs::report_script): New method.
10077 (Incremental_inputs::finalize_inputs): New method.
10078 (Incremental_inputs::Input_info): New struct.
10079 (Incremental_inputs::Input_info_map): New typedef.
10080 (Incremental_inputs::lock_): New field.
10081 (Incremental_inputs::Inputs_): New field.
10082 (Incremental_inputs::Inputs_map): New field.
10083 * main.cc (main): Call Incremental_input::report_inputs.
10084 * options.h (Input_argument_list): Typedef moved from
10085 Input_arguments.
10086 (Input_file_group::Files): Remove, use ::Input_argument_list.
10087 (Input_file_group::Input_argument_list): Remove, use
10088 ::Input_argument_list.
10089 * plugin.cc (Plugin_manager::add_input_file): Add error in
10090 incremental build.
10091 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
10092 functions.
10093 * script.cc (read_input_script): Call
10094 Incremental_input::report_script.
10095 * script.h (Script_info): New class.
10096
b0481b0b
ILT
100972009-04-27 Ian Lance Taylor <iant@google.com>
10098
10099 * x86_64.cc (do_adjust_output_section): Set entsize to
10100 plt_entry_size.
10101
b22a5a41 101022009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
10103
10104 * output.cc (Output_file::close): After short writes, continue
10105 writing from the correct offset in the buffer being written.
10106
40fde488
CD
101072009-04-23 Chris Demetriou <cgd@google.com>
10108
10109 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
10110 * configure: Regenerate.
10111 * config.in: Regenerate.
10112 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
10113 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
10114
3ce2c28e
ILT
101152009-04-21 Mikolaj Zalewski <mikolajz@google.com>
10116
10117 * incremental.cc (Incremental_inputs_header_data): Renamed from
10118 Incremental_input_header_data.
10119 (Incremental_inputs_header_data::data_size): New field.
10120 (Incremental_inputs_header_data::put_input_file_count): Renamed
10121 from input_file_count.
10122 (Incremental_inputs_header_data::put_command_line_offset): Renamed
10123 from command_line_offset.
10124 (Incremental_inputs_header_data::put_reserved): Renamed from
10125 put_reserved.
10126 (Incremental_inputs_entry_data): Renamed from
10127 Incremental_input_entry_data.
10128 (Incremental_inputs_entry_data::data_size): New field.
10129 (Incremental_inputs::report_command_line): New method.
10130 (Incremental_inputs::finalize): New method.
10131 (Incremental_inputs::create_incremental_inputs_data): New method.
10132 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
10133 * incremental.h: New file.
10134 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
10135 (Layout::finalize): Create incremental inputs section in
10136 incremental builds.
10137 (Layout::create_incremental_info_sections): New method.
10138 * layout.h (Layout::incremental_inputs): New method.
10139 (Layout::create_incremental_info_sections): New method.
10140 (Layout::incremental_inputs_): New field.
10141 * main.cc (main): Notify Incremental_input of the command line.
10142
e55bde5e
ILT
101432009-04-01 Ian Lance Taylor <iant@google.com>
10144 Mikolaj Zalewski <mikolajz@google.com>
10145
10146 * gold.h (reserve_unordered_map): Define, three versions, one for
10147 each version of Unordered_map.
10148 * layout.cc (Layout::Layout): Remove options parameter. Add
10149 number_of_input_files parameter. Don't initialize options_.
10150 Initialize number_of_input_files_ and resized_signatures_. Move
10151 sections_are_attached_.
10152 (Layout::layout_group): Reserve space for group_signatures_.
10153 (Layout::find_or_add_kept_section): Change name parameter to be a
10154 reference. Resize signatures_ map when it gets large enough.
10155 (Layout::layout_eh_frame): Use parameters->options() instead of
10156 this->options_.
10157 (Layout::make_output_section): Likewise.
10158 (Layout::attach_allocated_section_to_segment): Likewise.
10159 (Layout::finalize, Layout::create_executable_stack): Likewise.
10160 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
10161 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
10162 * layout.h (class Layout): Update declarations. Remove options_
10163 field. Add number_of_input_files_ and resized_signatures_
10164 fields. Move sections_are_attached_ field.
10165 * main.cc (main): Pass number of input files to Layout
10166 constructor. Don't pass options.
10167
154b857c
ILT
101682009-03-30 Ian Lance Taylor <iant@google.com>
10169
10170 * ffsll.c (ffsll): Correct implementation.
10171
2f35ab9b
ILT
101722009-03-27 Ian Lance Taylor <iant@google.com>
10173
fd03461a
ILT
10174 * ffsll.c: New file.
10175 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
10176 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
10177 * ftruncate.c (ftruncate): Declare before definition.
10178 * mremap.c (mremap): Likewise.
10179 * pread.c (pread): Likewise.
10180 * configure, Makefile.in, config.in: Rebuild.
10181
2f35ab9b
ILT
10182 * mremap.c: New file.
10183 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
10184 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
10185 (mremap): Declare if HAVE_MREMAP is not defined.
10186 * configure, Makefile.in, config.in: Rebuild.
10187
33aea2fd
CC
101882009-03-27 Cary Coutant <ccoutant@google.com>
10189
10190 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
10191 position independent.
10192 * sparc.cc (Target_sparc::check_non_pic): Likewise.
10193 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
10194
6d479619
CC
101952009-03-24 Cary Coutant <ccoutant@google.com>
10196
10197 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
10198 an executable.
10199 (needs_dynamic_reloc): Likewise.
10200
afc06bb8
ILT
102012009-03-24 Ian Lance Taylor <iant@google.com>
10202
10203 * yyscript.y (file_cmd): Recognize EXTERN.
10204 (extern_name_list, extern_name_list_body): New nonterminals.
10205 * script.cc (script_add_extern): Define.
10206 * script-c.h (script_add_extern): Declare.
10207
f6060a4d
ILT
102082009-03-24 Rafael Avila de Espindola <espindola@google.com>
10209
10210 * object.cc (is_elf_object): Define.
10211 * object.h (is_elf_object): Declare.
10212 * archive.cc (Archive::get_elf_object_for_member): Call
10213 is_elf_object.
33aea2fd 10214 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 10215
26736d8e
ILT
102162009-03-24 Elliott Hughes <enh@google.com>
10217
10218 * output.cc (Output_file::map_anonymous): Define.
10219 (Output_file::map): Use map_anonymous. If the regular mmap fails,
10220 try an anonymous one. Report the size if the mmap fails.
10221 * output.h (class Output_file): Declare map_anonymous.
10222
22fd9730
ILT
102232009-03-24 Ian Lance Taylor <iant@google.com>
10224
10225 * target-select.cc (instantiate_target): Don't acquire the lock if
10226 the instantiated_target_ field has already been set.
10227
cb010894
ILT
102282009-03-23 Ian Lance Taylor <iant@google.com>
10229
7f055c20
ILT
10230 * gold-threads.h (class Initialize_lock): Define.
10231 * gold-threads.cc (class Initialize_lock_once): Define.
10232 (initialize_lock_control): New static variable.
10233 (initialize_lock_pointer): New static variable.
10234 (initialize_lock_once): New static function.
10235 (Initialize_lock::Initialize_lock): Define.
10236 (Initialize_lock::initialize): Define.
10237 * target-select.h: Include "gold-threads.h".
10238 (class Target_selector): Add lock_ and initialize_lock_ fields.
10239 Don't define instantiate_target, just declare it.
10240 * target-select.cc (Target_selector::Target_selector): Initialize
10241 new fields.
10242 (Target_selector::instantiate_target): Define.
10243 * descriptors.h: Include "gold-threads.h".
10244 (class Descriptors): Add initialize_lock_ field.
10245 * descriptors.cc (Descriptors::Descriptors): Initialize new
10246 field.
10247 (Descriptors::open): Use initialize_lock_ field
10248 * errors.h (class Errors): Add initialize_lock_ field.
10249 * errors.cc (Errors::Errors): Initialize new field.
10250 (Errors::initialize_lock): Use initialize_lock_ field.
10251 * powerpc.cc (class Target_selector_powerpc): Remove
10252 instantiated_target_ field. In do_recognize call
10253 instantiate_target rather than do_instantiate_target. In
10254 do_instantiate_target just allocate a new target.
10255 * sparc.cc (class Target_selector_sparc): Likewise.
10256
36959681
ILT
10257 * freebsd.h: New file.
10258 * i386.cc: Include "freebsd.h".
10259 (Target_i386): Derive from Target_freebsd rather than
10260 Sized_target.
10261 (Target_selector_i386): Derive from Target_selector_freebsd rather
10262 than Target_selector.
10263 * x86_64.cc: Include "freebsd.h".
10264 (Target_x86_64): Derive from Target_freebsd rather than
10265 Sized_target.
10266 (Target_selector_x86_64): Derive from Target_selector_freebsd
10267 rather than Target_selector.
10268 * target.h (class Target): Add adjust_elf_header and
10269 do_adjust_elf_header.
10270 * output.cc (Output_file_header:: do_sized_write): Call target
10271 adjust_elf_header routine.
10272 * configure.tgt: Set targ_osabi.
10273 * configure.ac: Define GOLD_DEFAULT_OSABI.
10274 * parameters.cc (Parameters::default_target): Pass
10275 GOLD_DEFAULT_OSABI to select_target.
10276 * target-select.h (class Target_selector): Make instantiate_target
10277 protected rather than private.
10278 * Makefile.am (HFILES): Add freebsd.h.
10279 * configure, Makefile.in, config.in: Rebuild.
10280
cb010894
ILT
10281 * merge.cc (do_add_input_section): Correct pend value. Change
10282 message about last entry not being null terminated from error to
10283 warning.
10284
0e879927
ILT
102852009-03-20 Mikolaj Zalewski <mikolajz@google.com>
10286
10287 * incremental.cc: New file.
10288 * Makefile.am (CCFILES): Add incremental.cc.
10289 * Makefile.in: Rebuild.
10290
41105937
PP
102912009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
10292
10293 * layout.cc (Layout::output_section_name): Preserve names
10294 of '.note.' sections.
e1df38aa 10295
60439920
ILT
102962009-03-19 Ian Lance Taylor <iant@google.com>
10297
10298 * descriptors.cc (Descriptors::open): Check that the options are
10299 valid before using them.
10300
0d371ad3
ILT
103012009-03-18 Ian Lance Taylor <iant@google.com>
10302
10303 * script-sections.h: Include <list>.
10304 (class Script_sections): Change Sections_elements from std::vector
10305 to std::list. Typedef public Elements_iterator. Add
10306 orphan_section_placement_, data_segment_align_start_, and
10307 saw_data_segment_align_ fields. Remove data_segment_align_index_
10308 field.
10309 * script-sections.cc (class Orphan_section_placement): New class.
10310 (class Sections_element): Add virtual functions is_relro and
10311 orphan_section_init. Remove virtual function place_orphan_here.
10312 (class Output_section_definition): Add is_relro and
10313 orphan_section_init. Remove place_orphan_here.
10314 (class Orphan_output_section): Likewise.
10315 (Script_sections::Script_sections): Update for field changes.
10316 (Script_sections::data_segment_align): Set saw_data_segment_align_
10317 and data_segment_align_start_, not data_segment_align_index.
10318 (Script_sections::data_segment_relro_end): Check
10319 saw_data_segment_align_. Use data_segment_align_start_ rather
10320 than data_segment_align_index_.
10321 (Script_sections::place_orphan): Rewrite to use
10322 Orphan_section_placement.
10323
9201d894
ILT
103242009-03-17 Ian Lance Taylor <iant@google.com>
10325
9c5b8369
ILT
10326 * archive.cc (Archive::add_symbols): Check for a version attached
10327 to the symbol name in the archive map.
10328 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
10329 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
10330 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
10331 (ver_test_11.a): New target.
10332 * testsuite/Makefile.in: Rebuild.
10333
9201d894
ILT
10334 * configure.ac: Check for chsize and posix_fallocate. Replace
10335 ftruncate.
10336 * ftruncate.c: New file, from gnulib.
10337 * output.cc (posix_fallocate): Define dummy version if not
10338 HAVE_POSIX_FALLOCATE.
10339 (Output_file::map): Call posix_fallocate rather than lseek and
10340 write.
10341 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
10342 * configure, Makefile.in, config.in: Rebuild.
10343
ef4ab7a8 103442009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 10345
ef4ab7a8
PP
10346 * layout.h (Layout::create_note): Add section_name parameter.
10347 * layout.cc (Layout::create_note): Likewise.
10348 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 10349
8c500701
ILT
103502009-03-17 Ian Lance Taylor <iant@google.com>
10351
e85b18e1
ILT
10352 * descriptors.cc: Include "options.h".
10353 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
10354 (Descriptors::open): Always use O_CLOEXEC when opening a new
10355 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
10356 then set FD_CLOEXEC.
10357
9efe6174
ILT
10358 * sparc.cc (class Target_sparc): Add has_got_section.
10359 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
10360 make sure we have a GOT section.
10361
10362 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
10363 (Target_sparc::Scan::local): Likewise.
10364 (Target_sparc::Scan::global): Likewise.
10365 (Target_sparc::Relocate::relocate): Likewise.
10366 (Target_sparc::Relocate::relocate_tls): Likewise.
10367
8c500701
ILT
10368 * symtab.cc (Symbol_table::define_default_version): New function,
10369 broken out of add_from_object.
10370 (Symbol_table::add_from_object): Call define_default_version.
10371 (Symbol_table::define_special_symbol): Add resolve_oldsym
10372 parameter. Change all callers. If the version for a symbol comes
10373 from a version script, resolve it with the symbol with the same
10374 name with no version. Also add the symbol without a version if
10375 appropriate.
10376 (do_define_in_output_data): If resolving with oldsym, don't delete
10377 sym.
10378 (do_define_in_output_segment): Likewise.
10379 (do_define_as_constant): Likewise.
10380 * symtab.h (class Symbol_table): Update declarations.
10381
f1ed28fb
ILT
103822009-03-13 Ian Lance Taylor <iant@google.com>
10383
15f8229b
ILT
10384 * readsyms.cc (Read_symbols::incompatible_warning): New function.
10385 (Read_symbols::requeue): New function.
10386 (Read_symbols::do_read_symbols): If make_elf_object fails because
10387 the target type is not configured, and the file was searched for,
10388 issue a warning and retry with the next directory.
10389 (Add_symbols::run): If the file has an incompatible format, and
10390 it was searched for, requeue the Read_symbols task. On error,
10391 release the object.
10392 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
10393 dirindex parameter to constructor. Change all callers. Declare
10394 incompatible_warning and requeue.
10395 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
10396 input_argument_ and input_group_ fields. Add them to
10397 constructor. Change all callers.
10398 (class Read_script): Add dirindex_ field. Add it to constructor.
10399 Change all callers.
10400 * archive.cc (Archive::setup): Remove input_objects parameter.
10401 Change all callers.
10402 (Archive::get_file_and_offset): Likewise.
10403 (Archive::read_all_symbols): Likewise.
10404 (Archive::read_symbols): Likewise.
10405 (Archive::get_elf_object_for_member): Remove input_objects
10406 parameter. Add punconfigured parameter. Change all callers.
10407 (Archive::add_symbols): Change return type to bool. Check return
10408 value of include_member.
10409 (Archive::include_all_members): Likewise.
10410 (Archive::include_member): Change return type to bool. Return
10411 false if first included object has incompatible target. Set
10412 included_member_ field.
10413 (Add_archive_symbols::run): If add_symbols returns false, requeue
10414 Read_symbols task.
10415 * archive.h (class Archive): Add included_member_ field.
10416 Initialize it in constructor. Add input_file and searched_for
10417 methods. Update declarations.
10418 (class Add_archive_symbols): Add dirpath_, dirindex_, and
10419 input_argument_ fields. Add them to constructor. Change all
10420 callers.
10421 * script.cc: Include "target-select.h".
10422 (class Parser_closure): Add skip_on_incompatible_target_ and
10423 found_incompatible_target_ fields. Add
10424 skip_on_incompatible_target parameter to constructor. Change all
10425 callers. Add methods skip_on_incompatible_target,
10426 clear_skip_on_incompatible_target, found_incompatible_target, and
10427 set_found_incompatible_target.
10428 (read_input_script): Add dirindex parameter. Change all callers.
10429 If parser finds an incompatible target, requeue Read_symbols
10430 task.
10431 (script_set_symbol): Clear skip_on_incompatible_target in
10432 closure.
10433 (script_add_assertion, script_parse_option): Likewise.
10434 (script_start_sections, script_add_phdr): Likewise.
10435 (script_check_output_format): New function.
10436 * script.h (read_input_script): Update declaration.
10437 * script-c.h (script_check_output_format): Declare.
10438 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
10439 (ignore_cmd): Remove OUTPUT_FORMAT.
10440 * fileread.cc (Input_file::Input_file): Add explicit this.
10441 (Input_file::will_search_for): New function.
10442 (Input_file::open): Add pindex parameter. Change all callers.
10443 * fileread.h (class Input_file): Add input_file_argument method.
10444 Declare will_search_for. Update declarations.
10445 * object.cc (make_elf_object): Add punconfigured parameter.
10446 Change all callers.
10447 * object.h (class Object): Make input_file public. Add
10448 searched_for method.
10449 (make_elf_object): Update declaration.
10450 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
10451 restart search.
10452 * dirsearch.h (class Dirsearch): Update declaration.
10453 * options.h (class General_options): Add --warn-search-mismatch.
10454 * parameters.cc (Parameters::is_compatible_target): New function.
10455 * parameters.h (class Parameters): Declare is_compatible_target.
10456 * workqueue.cc (Workqueue::add_blocker): New function.
10457 * workqueue.h (class Workqueue): Declare add_blocker.
10458
f1ed28fb
ILT
10459 * fileread.cc (Input_file::open): Remove options parameter.
10460 Change all callers.
10461 (Input_file::open_binary): Likewise.
10462 * script.cc (read_input_script): Likewise.
10463 * readsyms.h (class Read_symbols): Remove options_ field. Remove
10464 options parameter from constructor. Change all callers.
10465 (class Read_script): Likewise.
10466 * fileread.h (class Input_file): Update declarations.
10467 * script.h (read_input_script): Update declaration.
10468
34dd024a
NC
104692009-03-10 Nick Clifton <nickc@redhat.com>
10470
10471 * po/es.po: New Spanish translation.
10472
6d71b17c
CC
104732009-03-06 Cary Coutant <ccoutant@google.com>
10474
10475 * options.cc (parse_short_option): Keep dash_z from registering itself.
10476
031cdbed
ILT
104772009-03-03 Ian Lance Taylor <iant@google.com>
10478
10479 PR 9918
10480 * target-reloc.h (relocate_section): Pass output_section to
10481 relocate.
10482 * i386.cc (Target_i386::should_apply_static_reloc): Add
10483 output_section parameter. Change all callers.
10484 (Target_i386::Relocate::relocate): Add output_section parameter.
10485 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10486 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
10487 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
10488 * testsuite/two_file_shared.sh: New script.
10489 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
10490 (check_DATA): Add two_file_shared.dbg.
10491 (two_file_shared.dbg): New target.
10492 * testsuite/Makefile.in: Rebuild.
10493
15d5fa16
ILT
104942009-03-01 Ian Lance Taylor <iant@google.com>
10495
10496 * configure.ac: Check for byteswap.h.
10497 * configure: Rebuild.
10498 * config.in: Rebuild.
10499
8a4c0b0d
ILT
105002009-03-01 Mikolaj Zalewski <mikolajz@google.com>
10501
10502 * layout.cc (Layout::find_or_add_kept_section): New function.
10503 (Layout::add_comdat): Removed.
10504 * layout.h (struct Kept_section): Move out of class Layout.
10505 Remove trailing underscores from field names. Add group_sections
10506 field. Rename group_ field to is_group. Change all uses.
10507 (class Layout): Declare find_or_add_kept_section, not add_comdat.
10508 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
10509 comdat_groups_ field.
10510 (Sized_relobj::include_section_group): Use
10511 find_or_add_kept_section and Kept_section::group_sections.
10512 (Sized_relobj::include_linkonce_section): Likewise.
10513 * object.cc (class Sized_relobj): Don't define Comdat_group or
10514 Comdat_group_table. Remove find_comdat_group and
10515 add_comdat_group. Remove comdat_groups_ field.
10516 * plugin.cc (include_comdat_group): Use
10517 Layout::find_or_add_kept_section.
10518
b4ecf66b
ILT
105192009-02-28 Ian Lance Taylor <iant@google.com>
10520
14359ca0
ILT
10521 * README: --gc-sections and map files are now supported. Document
10522 some build requirements.
10523
b4ecf66b
ILT
10524 PR 6992
10525 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
10526 relocatable link set the value of the section symbol to zero.
10527 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
10528 relocatable link don't include the section address in the local
10529 symbol value.
10530
0602e05a
ILT
105312009-02-27 Ian Lance Taylor <iant@google.com>
10532
fd9d194f
ILT
10533 PR 6811
10534 * options.h (class Search_directory): Add is_system_directory.
10535 (class General_options): Declare is_in_system_directory.
10536 * options.cc (get_relative_sysroot): Make static.
10537 (get_default_sysroot): Make static.
10538 (General_optoins::is_in_system_directory): New function.
10539 * fileread.cc (Input_file::is_in_system_directory): New function.
10540 * fileread.h (class Input_file): Declare is_in_system_directory.
10541 * object.h (class Object): Add is_in_system_directory.
10542 (class Input_objects): Remove system_library_directory_ field.
10543 * object.cc (Input_objects::add_object): Don't set
10544 system_library_directory_.
10545 (input_objects::found_in_system_library_directory): Remove.
10546 * symtab.cc (Symbol_table::write_globals): Remove input_objects
10547 parameter. Change all callers.
10548 (Symbol_table::sized_write_globals): Likewise.
10549 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
10550 Call Object::is_in_system_directory.
10551 * symtab.h (class Symbol_table): Update declarations.
10552
61edd21f
ILT
10553 PR 5990
10554 * descriptors.h (Open_descriptor): Add is_on_stack field.
10555 * descriptors.cc (Descriptors::open): If the descriptor is on the
10556 top of the stack, remove it. Initialize is_on_stack field.
10557 (Descriptors::release): Only add pod to stack if it is not on the
10558 stack already.
10559 (Descriptors::close_some_descriptor): Clear stack_next and
10560 is_on_stack fields.
10561
e29e076a
ILT
10562 PR 7091
10563 * output.cc (Output_section::find_starting_output_address): Rename
10564 from starting_output_address; add PADDR parameter; change return
10565 type.
10566 * output.h (class Output_section): Declare
10567 find_starting_output_address instead of starting_output_address.
10568 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
10569 section symbol for which we can't find a merge section.
10570
0602e05a
ILT
10571 PR 9836
10572 * symtab.cc (Symbol_table::add_from_object): If the visibility is
10573 hidden or internal, force the symbol to be local.
10574 * resolve.cc (Symbol::override_visibility): Define.
10575 (Symbol::override_base): Use override_visibility.
10576 (Symbol_table::resolve): Likewise.
10577 (Symbol::override_base_with_special): Likewise.
10578 (Symbol_table::override_with_special): If the visibility is hidden
10579 or internal, force the symbol to be local.
10580 * symtab.h (class Symbol): Add set_visibility and
10581 override_visibility.
10582 * testsuite/ver_test_1.sh: New file.
10583 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
10584 (check_DATA): Add ver_test_1.syms.
10585 (ver_test_1.syms): New target.
10586 * testsuite/Makefile.in: Rebuild.
10587
401a9a73
CC
105882009-02-25 Cary Coutant <ccoutant@google.com>
10589
10590 * layout.cc (Layout::choose_output_section): Don't rename sections
10591 when using a linker script that has a SECTIONS clause.
10592 * Makefile.in: Regenerate.
10593
10594 * testsuite/Makefile.am (script_test_5.sh): New test case.
10595 * testsuite/Makefile.in: Regenerate.
10596 * testsuite/script_test_5.cc: New file.
10597 * testsuite/script_test_5.sh: New file.
10598 * testsuite/script_test_5.t: New file.
10599
f488e4b0
CC
106002009-02-13 Rafael Avila de Espindola <espindola@google.com>
10601
10602 * archive.cc (Archive::include_member): Update calls to add_symbols.
10603 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
10604 the Layout argument.
10605 * dynobj.h (do_add_symbols): Add the Layout argument.
10606 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
10607 Layout argument.
10608 * object.h (Object::add_symbols): Add the Layout argument.
10609 (Object::do_add_symbols): Add the Layout argument.
10610 (Sized_relobj::do_add_symbols): Add the Layout argument.
10611 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
10612 Unify the two versions.
10613 (Add_plugin_symbols): Remove.
10614 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
10615 (Sized_pluginobj::do_add_symbols): Unify the two versions.
10616 (Add_plugin_symbols): Remove.
10617 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
10618 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
10619 (Add_symbols::run): Make it work with Pulginobj.
10620
89dd1680
ILT
106212009-02-06 Ian Lance Taylor <iant@google.com>
10622
10623 * object.cc (Sized_relobj::do_layout): Make info message start
10624 with lower case letter.
10625
266d0a74
ILT
106262009-02-06 Mikolaj Zalewski <mikolajz@google.com>
10627
602b464e
ILT
10628 * binary.cc: Fix file comment.
10629
266d0a74
ILT
10630 * options.h (enum Incremental_disposition): Define.
10631 (class General_options): Add new options: --incremental,
10632 --incremental_changed, --incremental_unchanged,
10633 --incremental_unknown. Add incremental_disposition_ and
10634 implicit_incremental_ fields.
10635 (General_options::incremental_disposition): New function.
10636 (class Position_dependent_options): Add incremental_disposition
10637 option.
10638 (Position_dependent_options::copy_from_options): Set incremental
10639 dispositions.
10640 * options.cc (General_options::parse_incremental_changed): New
10641 function.
2e702c99
RM
10642 (General_options::parse_incremental_unchanged): New function.
10643 (General_options::parse_incremental_unknown): New function.
10644 (General_options::General_options): Initialize new fields
266d0a74 10645 incremental_disposition_ and implicit_incremental_.
2e702c99 10646 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
10647 without --incremental.
10648
f073bbf7
CD
106492009-02-06 Chris Demetriou <cgd@google.com>
10650
10651 * gold.h (gold_undefined_symbol): Change to take only a Symbol
10652 pointer and to report location as the file name associated with
10653 the symbol.
10654 (gold_undefined_symbol_at_location): New function to replace the
10655 old gold_undefined_symbol functionality.
10656 * target-reloc.h (relocate_section): Update to use
10657 gold_undefined_symbol_at_location.
10658 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
10659 Call gold_undefined_symbol function rather than gold_error.
10660 * errors.h (Errors::undefined_symbol): Take location as a
10661 string, rather than calculating it from a relocation.
10662 * errors.cc (Errors::fatal): Print "fatal error:" before the
10663 formatted message.
10664 (Errors::error, Errors::error_at_location): Print "error: "
10665 before the formatted message.
10666 (Errors::undefined_symbol): Take location as a string, rather
10667 than calculating it from a relocation.
10668 (gold_undefined_symbol_at_location): New function akin to
10669 old gold_undefined_symbol, calculates location from relocation.
10670 (gold_undefined_symbol): Change to take only a Symbol pointer
10671 and to report location as the file name associated with the symbol.
10672 * testsuite/debug_msg.sh: Update for changed error messages.
10673 * testsuite/undef_symbol.sh: Likewise.
10674
8e94a90c
ILT
106752009-02-04 Duncan Sands <baldrick@free.fr>
10676
10677 PR 9812
10678 * reduced_debug_output.h
10679 (Output_reduced_debug_abbrev_section::failed): Use format for
10680 gold_warning.
10681 (Output_reduced_debug_info_section::faild): Likewise.
10682
88a0e15b
ILT
106832009-01-31 Mikolaj Zalewski <mikolajz@google.com>
10684
10685 * script.cc (Lazy_demangler): New class.
2e702c99 10686 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
10687 symbol only once.
10688
5efc7cd2
CC
106892009-01-29 Cary Coutant <ccoutant@google.com>
10690
10691 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
10692 to __tls_get_addr.
10693 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10694
e0ebcf42
ILT
106952009-01-28 Ian Lance Taylor <iant@google.com>
10696
5efc7cd2 10697 * version.cc (version_string): Bump to 1.9.
75fe7426 10698
e0ebcf42
ILT
10699 * gold.h: Include <cstring> and <stdint.h>.
10700 * version.cc: Include <cstdio>.
10701 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
10702 warning.
10703 * reduced_debug_output.cc (insert_into_vector): Rename from
10704 Insert_into_vector; change all callers. Use Swap_unaligned to
10705 avoid aliasing issue; remove union since it is unnecessary.
10706
8e2813be 107072009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
10708
10709 * Makefile.am (CCFILES): Add gc.cc.
10710 (HFILES): Add gc.h.
10711 * Makefile.in: Regenerate.
10712 * gold.cc (Gc_runner): New class.
10713 (queue_initial_tasks): Call garbage collection related tasks
10714 when corresponding options are invoked.
10715 (queue_middle_gc_tasks): New function.
10716 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
10717 processed early before laying out sections during garbage collection.
10718 * gold.h (queue_middle_gc_tasks): New function.
10719 (is_prefix_of): Move from "layout.cc".
10720 * i386.cc (Target_i386::gc_process_relocs): New function.
10721 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
10722 * main.cc (main): Create object of class "Garbage_collection".
10723 * object.cc (Relobj::copy_symbols_data): New function.
10724 (Relobj::is_section_name_included): New function.
e1df38aa
NC
10725 (Sized_relobj::do_layout): Allow this function to be called twice
10726 during garbage collection and defer layout of section during the
6d03d481
ST
10727 first call.
10728 * object.h (Relobj::get_symbols_data): New function.
10729 (Relobj::is_section_name_included): New function.
10730 (Relobj::copy_symbols_data): New function.
10731 (Relobj::set_symbols_data): New function.
10732 (Relobj::get_relocs_data): New function.
10733 (Relobj::set_relocs_data): New function.
10734 (Relobj::is_output_section_offset_invalid): New pure virtual function.
10735 (Relobj::gc_process_relocs): New function.
10736 (Relobj::do_gc_process_relocs): New pure virtual function.
10737 (Relobj::sd_): New data member.
10738 (Sized_relobj::is_output_section_offset_invalid): New function.
10739 (Sized_relobj::do_gc_process_relocs): New function.
10740 * options.h (General_options::gc_sections): Modify to not be a no-op.
10741 (General_options::print_gc_sections): New option.
10742 * plugin.cc (Plugin_finish::run): Remove function call to
10743 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
10744 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
10745 * reloc.cc (Read_relocs::run): Add task to process relocs and
10746 determine unreferenced sections when doing garbage collection.
10747 (Gc_process_relocs): New class.
10748 (Sized_relobj::do_gc_process_relocs): New function.
10749 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
10750 sections that are garbage collected.
10751 * reloc.h (Gc_process_relocs): New class.
10752 * sparc.cc (Target_sparc::gc_process_relocs): New function.
10753 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
10754 symbols whose corresponding sections are garbage collected.
10755 (Symbol_table::Symbol_table): Add new parameter for the garbage
10756 collection object.
10757 (Symbol_table::gc_mark_undef_symbols): New function.
10758 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10759 (Symbol_table::gc_mark_dyn_syms): New function.
10760 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
10761 as garbage.
10762 (Symbol_table::add_from_object): Likewise.
10763 (Symbol_table::add_from_relobj): When building shared objects, do not
10764 treat externally visible symbols as garbage.
10765 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
10766 table information for static and relocatable links.
10767 * symtab.h (Symbol_table::set_gc): New function.
10768 (Symbol_table::gc): New function.
10769 (Symbol_table::gc_mark_undef_symbols): New function.
10770 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10771 (Symbol_table::gc_mark_dyn_syms): New function.
10772 (Symbol_table::gc_): New data member.
e1df38aa 10773 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
10774 function.
10775 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
10776 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
10777
3b293544
CF
107782009-01-20 Chris Faylor <me.sourceware@sourceware.org>
10779
10780 * options.h (General_options::gc_sections): Define as a no-op for now.
10781 (General_options::no_keep_memory): Ditto.
10782 (General_options::Bshareable): Define.
10783 * options.cc (General_options::finalize): Honor -Bshareable.
10784
83d22aa8
AS
107852009-01-20 Andreas Schwab <schwab@suse.de>
10786
10787 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
10788 read the value in the contents, since we don't use it. Use the
10789 template endianness when writing.
10790 (Relocate::relocate): Use it for R_PPC_REL16_HA.
10791
cd536b21
AS
107922009-01-19 Andreas Schwab <schwab@suse.de>
10793
10794 * configure.tgt (powerpc64-*): Fix targ_obj.
10795
99e9a495
ILT
107962009-01-15 Ian Lance Taylor <iant@google.com>
10797
10798 * object.cc (Sized_relobj::write_local_symbols): Don't write out
10799 local symbols when stripping all symbols.
10800
bbbfea06
CC
108012009-01-14 Cary Coutant <ccoutant@google.com>
10802
99e9a495 10803 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 10804
0f7c0701
CC
108052009-01-14 Cary Coutant <ccoutant@google.com>
10806
10807 * archive.cc (Archive::get_elf_object_for_member): Remove call
10808 to File_read::claim_for_plugin.
10809 * descriptors.cc (Descriptors::open): Remove reference to
10810 is_claimed.
10811 (Descriptors::claim_for_plugin): Remove.
10812 * descriptors.h (Descriptors::claim_for_plugin): Remove.
10813 (Descriptors::is_claimed): Remove.
10814 (claim_descriptor_for_plugin): Remove.
10815 * fileread.cc (File_read::claim_for_plugin): Remove.
10816 * fileread.h (File_read::claim_for_plugin): Remove.
10817 (File_read::descriptor): Reopen descriptor if necessary.
10818 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
10819 (Plugin_manager::all_symbols_read): Add task parameter. Change
10820 all callers.
10821 (Plugin_manager::get_input_file): New function.
10822 (Plugin_manager::release_input_file): New function.
10823 (Pluginobj::Pluginobj): Add filesize parameter and initialize
10824 corresponding data member.
10825 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
10826 and pass to base constructor. Change all callers.
10827 (get_input_file, release_input_file): New functions.
10828 (make_sized_plugin_object): Add filesize parameter. Change all callers.
10829 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
10830 (Plugin_manager::all_symbols_read): Add task parameter.
10831 (Plugin_manager::get_input_file): New function.
10832 (Plugin_manager::release_input_file): New function.
10833 (Plugin_manager::task_): New data member.
10834 (Pluginobj::Pluginobj): Add filesize parameter.
10835 (Pluginobj::filename): New function.
10836 (Pluginobj::descriptor): New function.
10837 (Pluginobj::filesize): New function.
10838 (Pluginobj::filesize_): New data member.
10839 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
10840 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
10841 File_read::claim_for_plugin; use Object::unlock to unlock the file.
10842
10843 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
10844 with archive libraries.
10845 * testsuite/Makefile.in: Regenerate.
10846 * testsuite/plugin_test.c (struct sym_info): New type.
10847 (get_input_file, release_input_file): New static variables.
10848 (onload): Capture new transfer vector entries.
10849 (claim_file_hook): Stop reading at end of file according to filesize.
10850 Factor out parsing of readelf output into separate function.
10851 (all_symbols_read_hook): Exercise get_input_file and release_input_file
10852 APIs and get the source file name from the symbol table. Convert
10853 source file name to corresponding object file name. Print info
10854 message when adding new input files.
10855 (parse_readelf_line): New function.
10856 * testsuite/plugin_test_1.sh: Add checks for new info messages.
10857 * testsuite/plugin_test_2.sh: Likewise.
10858 * testsuite/plugin_test_3.sh: Likewise.
10859 * testsuite/plugin_test_4.sh: New test case.
10860
62a6d109
ILT
108612009-01-07 Ian Lance Taylor <iant@google.com>
10862
10863 * version.cc (version_string): Bump to 1.8.
10864
483620e8
CC
108652008-12-23 Cary Coutant <ccoutant@google.com>
10866
10867 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
10868 * plugin.cc (Plugin_manager::finish): Rename as
10869 layout_deferred_objects. Move cleanup to separate function.
10870 (Plugin_manager::cleanup): New function.
10871 (Plugin_finish::run): Call layout_deferred_objects and cleanup
10872 separately.
10873 * plugin.h (Plugin_manager::finish): Rename as
10874 layout_deferred_objects.
10875 (Plugin_manager::cleanup): New function.
10876 (Plugin_manager::cleanup_done): New field.
10877
d66a9eb3
CC
108782008-12-23 Cary Coutant <ccoutant@google.com>
10879
10880 * plugin.cc (is_visible_from_outside): New function.
10881 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
10882 so we don't return "IR only" status for exported symbols or -r links.
10883
10884 * testsuite/Makefile.am (plugin_test_3): New test case.
10885 * testsuite/Makefile.in: Regenerate.
10886 * testsuite/plugin_test_3.sh: New file.
10887
5995b570
CC
108882008-12-22 Cary Coutant <ccoutant@google.com>
10889
10890 * object.cc (Sized_relobj::layout_section): New function.
10891 (Sized_relobj::do_layout): Defer layout of input sections until after
10892 plugin has provided replacement files.
10893 (Sized_relobj::do_layout_deferred_sections): New function.
10894 * object.h (Relobj::set_section_offset): Remove virtual keyword.
10895 (Relobj::layout_deferred_sections): New function.
10896 (Relobj::do_layout_deferred_sections): New function.
10897 (Sized_relobj::do_layout_deferred_sections): New function.
10898 (Sized_relobj::layout_section): New function.
10899 (Sized_relobj::Deferred_layout): New structure.
10900 (Sized_relobj::deferred_layout_): New field.
10901 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
10902 Change all callers. Layout deferred sections.
10903 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
10904 references.
10905 (Plugin_hook::run): Move code from do_plugin_hook inline.
10906 (Plugin_hook::do_plugin_hook): Remove.
10907 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
10908 (Plugin_manager::finish): Renamed, was cleanup.
10909 (Plugin_manager::should_defer_layout): New function.
10910 (Plugin_manager::add_deferred_layout_object): New function.
10911 (Plugin_manager::Deferred_layout_list): New type.
10912 (Plugin_manager::deferred_layout_objects_): New field.
10913 (Plugin_hook::do_plugin_hook): Remove.
10914
ee769c88
ILT
109152008-12-17 Ian Lance Taylor <iant@google.com>
10916
10917 * options.h (class General_options): Add --no case for
10918 --export-dynamic.
10919
abc8dcba
CC
109202008-12-16 Cary Coutant <ccoutant@google.com>
10921
10922 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
10923 vector.
10924 (Plugin_manager::claim_file): Create plugin object even if
10925 plugin did not call the add_symbols callback.
10926 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
10927 asking for more symbols than were added.
10928 * testsuite/Makefile.am (plugin_test_1): Add test case with
10929 no global symbols.
10930 (empty.syms): New target.
10931 * testsuite/Makefile.in: Regenerate.
10932 * testsuite/plugin_test.c (claim_file_hook): Add new debug
10933 message. Don't call add_symbols if no globals.
10934 (all_symbols_read_hook): Don't provide replacement for empty
10935 claimed file.
10936
b0074644
ILT
109372008-12-12 Ian Lance Taylor <iant@google.com>
10938
68943102
ILT
10939 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
10940 r_type == 0 for a local symbol with r_sym == 0.
10941 (scan_relocatable_relocs): Pass r_sym to
10942 local_non_section_strategy.
10943 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
10944 r_sym parameter.
10945
b0074644
ILT
10946 * configure.ac: Update test for TLS descriptors: they are
10947 supported as of glibc 2.9.
10948 * configure: Rebuild.
10949
c2508178
ILT
109502008-12-11 Ian Lance Taylor <iant@google.com>
10951
10952 PR 7091
10953 * target-reloc.h (Default_scan_relocatable_relocs): For each
10954 function, map r_type == 0 to RELOC_DISCARD.
10955
2756a258
CC
109562008-12-10 Cary Coutant <ccoutant@google.com>
10957
10958 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
10959 object to override a kept COMDAT group from a plugin object.
10960
bb6f53d3
ILT
109612008-12-09 Ian Lance Taylor <iant@google.com>
10962
fbc558e1
ILT
10963 PR 7088
10964 * yyscript.y (file_cmd): Handle INPUT.
10965
bb6f53d3
ILT
10966 * testsuite/initpri1.c: Change all declarations to be full
10967 prototypes by adding void, to avoid compiler warnings.
10968
4674ecfc
CC
109692008-12-05 Rafael Avila de Espindola <espindola@google.com>
10970
10971 * options.cc (General_options::parse_plugin_opt): New.
10972 (General_options::add_plugin): The argument now is just the filename.
10973 (General_options::add_plugin_option): New.
10974 * options.h (plugin_opt): New.
10975 (add_plugin): Change argument name.
10976 (add_plugin_option): New.
10977 * plugin.cc (Plugin::load): Don't parse the plugin option.
10978 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
10979 (Plugin::add_option): New.
10980 (Plugin::args_): Change type.
10981 (Plugin::filename_): New.
10982 (Plugin_manager::add_plugin_option): New.
10983 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
10984 * testsuite/Makefile.in: Regenerate.
10985
fd06b4aa
CC
109862008-12-05 Cary Coutant <ccoutant@google.com>
10987
10988 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
10989 Handle --strip-lto-sections option.
10990 * options.h (strip_lto_sections): New option.
10991
6c52134c
CC
109922008-12-01 Cary Coutant <ccoutant@google.com>
10993
10994 * plugin.cc (ld_plugin_message): Change format parameter to const.
10995 Fix mismatch between new[] and delete.
10996
a45248e0
CC
109972008-11-14 Cary Coutant <ccoutant@google.com>
10998
10999 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
11000 instead of -1U.
11001
c82fbeee
CS
110022008-11-05 Craig Silverstein <csilvers@google.com>
11003
11004 * options.cc (General_options::parse_dynamic_list): New function.
11005 * options.h (General_options): New flags dynamic_list,
11006 dynamic_list_data, dynamic_list_cpp_new, and
11007 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
11008 (General_options::in_dynamic_list): New function.
11009 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
11010 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
11011 (Lex::can_continue_name): Likewise.
11012 (yylex): Likewise.
11013 (read_script_file): New parameter script_options.
11014 (read_dynamic_list): New function.
11015 (Script_options::define_dynamic_list): New function.
11016 (dynamic_list_keyword_parsecodes): New variable.
11017 (dynamic_list_keywords): New variable.
11018 * script.h (Script_options::define_dynamic_list): New function
11019 prototype.
11020 (read_dynamic_list): New function prototype.
11021 * symtab.cc (strprefix): New macro.
11022 (Symbol::should_add_dynsym_entry): Support dynamic_list,
11023 dynamic_list_data, dynamic_list_cpp_new, and
11024 dynamic_list_cpp_typeinfo.
11025 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
11026 (dynamic_list_expr): New rule.
11027 (dynamic_list_nodes): Likewise.
11028 (dynamic_list_node): Likewise.
11029 * testsuite/Makefile.am (dynamic_list): New test.
11030 * testsuite/Makefile.in: Regenerated.
11031 * testsuite/dynamic_list.t: New file.
11032 * testsuite/dynamic_list.sh: New file.
11033
e0bb29a5
CS
110342008-11-05 Craig Silverstein <csilvers@google.com>
11035
11036 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
11037 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
11038 (t11_last): Likewise.
11039 * testsuite/ver_test_6.c (main): Likewise.
11040
4e1e25e0
CC
110412008-10-07 Cary Coutant <ccoutant@google.com>
11042
11043 * options.c (General_options::finalize): Add check for -static and
11044 -shared.
11045 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
11046 is not empty.
11047
92f03fcb
CC
110482008-10-02 Cary Coutant <ccoutant@google.com>
11049
11050 * plugin.cc (make_sized_plugin_object): Fix conditional
11051 compilation to work when not all targets are enabled.
11052
fbd8a257
CC
110532008-09-29 Cary Coutant <ccoutant@google.com>
11054
11055 * archive.cc (Archive::get_file_and_offset): Use filename instead
11056 of name to get library path.
11057 (Archive::include_member): Unlock external member of a thin archive.
11058
11059 * testsuite/Makefile.am (TEST_AR): New variable.
11060 (thin_archive_test_1): New test.
11061 (thin_archive_test_2): New test.
81636b3f
CC
11062 * testsuite/Makefile.in: Regenerate.
11063 * testsuite/thin_archive_main.cc: New file.
11064 * testsuite/thin_archive_test_1.cc: New file.
11065 * testsuite/thin_archive_test_2.cc: New file.
11066 * testsuite/thin_archive_test_3.cc: New file.
11067 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 11068
eff45813
CC
110692008-09-29 Cary Coutant <ccoutant@google.com>
11070
11071 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
11072 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
11073 instead of -1U.
11074 (Sized_relobj::do_finalize_local_symbols): Likewise.
11075 (Sized_relobj::map_to_kept_section): Likewise.
11076 * object.h (Sized_relobj::invalid_address): New constant.
11077 (Sized_relobj::do_output_section_offset): Check for invalid_address
11078 and return -1ULL.
11079 * output.cc (Output_reloc::local_section_offset): Use constant
11080 invalid_address instead of -1U.
11081 (Output_reloc::get_address): Likewise.
11082 (Output_section::output_address): Change -1U to -1ULL.
11083 * output.h (Output_reloc::invalid_address): New constant.
11084 * reloc.cc (Sized_relobj::write_sections): Use constant
11085 invalid_address instead of -1U.
11086 (Sized_relobj::relocate_sections): Likewise.
11087 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
11088 values for merge sections.
11089 * target-reloc.h (relocate_for_relocatable): Use constant
11090 invalid_address instead of -1U.
11091
89fc3421
CC
110922008-09-19 Cary Coutant <ccoutant@google.com>
11093
11094 Add plugin functionality for link-time optimization (LTO).
11095 * configure.ac (plugins): Add --enable-plugins option.
11096 * configure: Regenerate.
11097 * config.in: Regenerate.
11098 * Makefile.am (LIBDL): New variable.
11099 (CCFILES): Add plugin.cc.
11100 (HFILES): Add plugin.h.
11101 (ldadd_var): Add LIBDL.
11102 * Makefile.in: Regenerate.
11103
11104 * archive.cc: Include "plugin.h".
11105 (Archive::setup): Don't preread archive symbols when using a plugin.
11106 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
11107 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
11108 files.
11109 (Archive::include_member): Add symbols from plugin objects.
11110 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
11111 * descriptors.cc (Descriptors::open): Check for file descriptors
11112 abandoned by plugins.
11113 (Descriptors::claim_for_plugin): New function.
11114 * descriptors.h (Descriptors::claim_for_plugin): New function.
11115 (Open_descriptor::is_claimed): New field.
11116 (claim_descriptor_for_plugin): New function.
11117 * fileread.cc (File_read::claim_for_plugin): New function.
11118 * fileread.h (File_read::claim_for_plugin): New function.
11119 (File_read::descriptor): New function.
11120 * gold.cc: Include "plugin.h".
11121 (queue_initial_tasks): Add task to call plugin hooks for generating
11122 new object files.
11123 * main.cc: Include "plugin.h".
11124 (main): Load plugin libraries.
11125 * object.h (Pluginobj): Declare.
11126 (Object::pluginobj): New function.
11127 (Object::do_pluginobj): New function.
11128 (Object::set_target): New function.
11129 * options.cc: Include "plugin.h".
11130 (General_options::parse_plugin): New function.
11131 (General_options::General_options): Initialize plugins_ field.
11132 (General_options::add_plugin): New function.
11133 * options.h (Plugin_manager): Declare.
11134 (General_options): Add --plugin option.
11135 (General_options::has_plugins): New function.
11136 (General_options::plugins): New function.
11137 (General_options::add_plugin): New function.
11138 (General_options::plugins_): New field.
11139 * plugin.cc: New file.
11140 * plugin.h: New file.
11141 * readsyms.cc: Include "plugin.h".
11142 (Read_symbols::do_read_symbols): Check for archive before checking
11143 for ELF file. Call plugin hooks to claim files.
11144 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
11145 from a real object file; force override when processing replacement
11146 files.
11147 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
11148 (Symbol::init_base_object): Likewise.
11149 (Symbol::init_base_output_data): Likewise.
11150 (Symbol::init_base_output_segment): Likewise.
11151 (Symbol::init_base_constant): Likewise.
11152 (Symbol::init_base_undefined): Likewise.
11153 (Symbol::output_section): Assert that object is not a plugin.
11154 (Symbol_table::add_from_pluginobj): New function.
11155 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
11156 undefined.
11157 (Symbol_table::sized_write_globals): Likewise.
11158 (Symbol_table::add_from_pluginobj): Instantiate template.
11159 * symtab.h (Sized_pluginobj): Declare.
11160 (Symbol::in_real_elf): New function.
11161 (Symbol::set_in_real_elf): New function.
11162 (Symbol::in_real_elf_): New field.
11163 (Symbol_table::add_from_pluginobj): New function.
11164
11165 * testsuite/Makefile.am (AM_CFLAGS): New variable.
11166 (LIBDL): New variable.
11167 (LDADD): Add LIBDL.
11168 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
11169 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
11170 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
11171 (MOSTLYCLEANFILES): Likewise.
11172 * testsuite/Makefile.in: Regenerate.
11173 * testsuite/plugin_test.c: New file.
11174 * testsuite/plugin_test_1.sh: New file.
11175 * testsuite/plugin_test_2.sh: New file.
11176
de31bda5
ILT
111772008-09-16 Ian Lance Taylor <iant@google.com>
11178
9c2d0ef9
ILT
11179 * target-reloc.h (relocate_section): Check whether a symbol is
11180 defined by the ABI before reporting an undefined symbol error.
11181 * target.h (Target::is_defined_by_abi): Make parameter const.
11182 (Target::do_is_defined_by_abi): Likewise.
11183 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
11184 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
11185 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
11186 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
11187 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
11188 * testsuite/Makefile.in: Rebuild.
11189
de31bda5
ILT
11190 * fileread.cc (make_view): Add casts to avoid warning.
11191
9fa33bee
AO
111922008-09-16 Alexandre Oliva <aoliva@redhat.com>
11193
11194 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
11195 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11196
183fd0e3
AO
111972008-09-16 Alexandre Oliva <aoliva@redhat.com>
11198
11199 * options.h (General_options::output_is_executable): New.
11200 (General_options::output_is_pie): New.
11201 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
11202 for shared libraries.
11203 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11204
7be8330a
CD
112052008-09-11 Chris Demetriou <cgd@google.com>
11206
11207 * options.h (origin): New -z option.
11208 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
11209 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
11210 in DT_FLAGS_1.
11211
a9caad02
CC
112122008-09-05 Cary Coutant <ccoutant@google.com>
11213
11214 * fileread.cc (File_read::make_view): Add check for attempt to map
11215 beyond end of file.
11216
ae6dce4d
CC
112172008-09-05 Cary Coutant <ccoutant@google.com>
11218
11219 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
11220 explicit instantiations.
11221
d7ab2a47
KVH
112222008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
11223
11224 PR gold/6858
11225 * options.cc (General_options::finalize): Allow undefined symbols
11226 in shlibs if linking -shared.
11227
11228 PR gold/6859
11229 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
11230 symbols as not needing a dynsym entry.
11231
1e52a9c1
CS
112322008-08-20 Craig Silverstein <csilvers@google.com>
11233
11234 * fileread.cc (File_read::open): Do not lock the file unless it
11235 was successfully opened.
11236
d85c80a3
CC
112372008-08-14 Cary Coutant <ccoutant@google.com>
11238
11239 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
11240 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
11241 * testsuite/tls_test.cc (struct int128): 128-bit struct
11242 for testing TLS relocs with non-zero addend.
11243 (v12): New TLS variable.
11244 (t12): New test.
11245 (t_last): Add check for v12.
11246 * testsuite/tls_test.h (t12): New function.
11247 * testsuite/tls_test_main.cc (thread_routine): Call new test.
11248
2d924fd9
ILT
112492008-08-13 Ian Lance Taylor <iant@google.com>
11250
11251 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
11252 set tls_segment_ or relro_segment_.
11253 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
11254 when appropriate.
11255 * output.h (Output_section::clear_is_relro): New function.
11256 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
11257 sections specially even when output_data_ is empty.
11258 (Output_segment::maximum_alignment): When first section is relro,
11259 only force alignment for PT_LOAD segments.
11260 * script.cc (script_data_segment_align): New function.
11261 (script_data_segment_relro_end): New function.
11262 * script-c.h (script_data_segment_align): Declare.
11263 (script_data_segment_relro_end): Declare.
11264 * script-sections.h (class Script_sections): Declare
11265 data_segment_align and data_segment_relro_end. Add fields
11266 segment_align_index_ and saw_relro_end_.
11267 * script-sections.cc (class Sections_element): Add set_is_relro
11268 virtual function. Add new bool* parameter to place_orphan_here.
11269 Add get_output_section virtual function.
11270 (class Output_section_definition): Add set_is_relro. Add new
11271 bool* parameter to place_orphan_here. Add get_output_section.
11272 Add is_relro_ field.
11273 (Output_section_definition::Output_section_definition): Initialize
11274 evaluated_address_, evaluated_load_address, evaluated_addralign_,
11275 and is_relro_ fields.
11276 (Output_section_definition::place_orphan_here): Add is_relro
11277 parameter.
11278 (Output_section_definition::set_section_addresses): Set relro for
11279 output section.
11280 (Output_section_definition::alternate_constraint): Likewise.
11281 (class Orphan_output_section): Add new bool* parameter to
11282 place_orphan_here. Add get_output_section.
11283 (Orphan_output_section::place_orphan_here): Add is_relro
11284 parameter.
11285 (Script_sections::Script_sections): Initialize
11286 data_segment_align_index_ and saw_relro_end_.
11287 (Script_sections::data_segment_align): New function.
11288 (Script_sections::data_segment_relro_end): New function.
11289 (Script_sections::place_orphan): Set or clear is_relro.
11290 (Script_sections::set_section_addresses): Force alignment of first
11291 TLS section.
11292 * yyscript.y (exp): Call script_data_segment_align and
11293 script_data_segment_relro_end.
11294 * testsuite/relro_script_test.t: New file.
11295 * testsuite/relro_test.cc (using_script): Declare.
11296 (t1, t2): Test using_script.
11297 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
11298 (relro_script_test_SOURCES): Define.
11299 (relro_script_test_DEPENDENCIES): Define.
11300 (relro_script_test_LDFLAGS): Define.
11301 (relro_script_test_LDADD): Define.
11302 (relro_script_test.so): New target.
11303 * testsuite/Makefile.in: Rebuild.
11304
f827c9a9
CC
113052008-08-06 Cary Coutant <ccoutant@google.com>
11306
11307 * archive.cc (Archive::total_archives, Archive::total_members)
11308 (Archive::total_members_loaded): New variables.
11309 (Archive::setup): Add parameter. Add option to preread
11310 archive symbols.
11311 (Archive::read_armap): Add counter.
11312 (Archive::get_file_and_offset): New function.
11313 (Archive::get_elf_object_for_member): New function.
11314 (Archive::read_all_symbols): New function.
11315 (Archive::read_symbols): New function.
11316 (Archive::add_symbols): Add counters.
11317 (Archive::include_all_members): Use armap to find members if it's
11318 already built.
11319 (Archive::include_member): Skip reading symbols if already read.
11320 Factored code into Archive::get_file_and_offset and
11321 Archive::get_elf_object_for_member. Changed call to
11322 Mapfile::report_include_archive_member.
11323 (Archive::print_stats): New function.
11324 * archive.h: Declare Object and Read_symbols_data classes.
11325 (Archive::Archive): Add initializers for new members.
11326 (Archive::setup): Add parameter.
11327 (Archive::print_stats): New function.
11328 (Archive::total_archives, Archive::total_members)
11329 (Archive::total_members_loaded): New variables.
11330 (Archive::get_file_and_offset): New function.
11331 (Archive::get_elf_object_for_member): New function.
11332 (Archive::read_all_symbols): New function.
11333 (Archive::read_symbols): New function.
11334 (Archive::Archive_member): New class.
11335 (Archive::members_): New member.
11336 (Archive::num_members_): New member.
11337 * main.cc: Include archive.h.
11338 (main): Call Archive::print_stats.
11339 * mapfile.cc (Mapfile::report_include_archive_member): Delete
11340 archive parameter; member_name is now the fully-decorated name.
11341 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
11342 * options.h: (General_options): Add --preread-archive-symbols option.
11343 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
11344 Archive::setup.
11345
de4c45bd
ILT
113462008-08-04 Ian Lance Taylor <iant@google.com>
11347
11348 * symtab.h (Symbol::use_plt_offset): New function.
11349 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
11350 * powerpc.cc (Relocate::relocate): Likewise.
11351 * sparc.cc (Relocate::relocate): Likewise.
11352 * x86_64.cc (Relocate::relocate): Likewise.
11353 * testsuite/weak_plt.sh: New test.
11354 * testsuite/weak_plt_main.cc: New test.
11355 * testsuite/weak_plt_shared.cc: New test.
11356 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
11357 (check_PROGRAMS): Add weak_plt.
11358 (check_DATA): Add weak_plt_shared.so.
11359 (weak_plt_main_pic.o, weak_plt): New targets.
11360 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
11361 * testsuite/Makefile.in: Rebuild.
11362
11363 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
11364 gcctestdir/ld.
11365 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
11366 * testsuite/Makefile.in: Rebuild.
11367
323ee3f4
AM
113682008-08-04 Alan Modra <amodra@bigpond.net.au>
11369
11370 * Makefile.am (POTFILES.in): Set LC_ALL=C.
11371 * Makefile.in: Regenerate.
11372 * po/POTFILES.in: Regenerate.
11373
7c07ecec
ILT
113742008-07-29 Ian Lance Taylor <iant@google.com>
11375
11376 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
11377 symbols before other symbols.
11378 * testsuite/script_test_2.cc (test_addr): Declare.
11379 (test_addr_alias): Declare.
11380 (main): Check that test_addr and test_addr_alias have the right
cd536b21 11381 values.
7c07ecec
ILT
11382 * testsuite/script_test_2.t: Define test_addr_alias and
11383 test_addr.
11384
5778530e
ILT
113852008-07-24 Ian Lance Taylor <iant@google.com>
11386
2a00e4fb
ILT
11387 PR 5990
11388 * descriptors.cc: New file.
11389 * descriptors.h: New file.
11390 * gold-threads.h (class Hold_optional_lock): New class.
11391 * fileread.cc: Include "descriptors.h".
11392 (File_read::~File_read): Release descriptor rather than closing
11393 it.
11394 (File_read::open) [file]: Call open_descriptor rather than open.
11395 Set is_descriptor_opened_.
11396 (File_read::open) [memory]: Assert that descriptor is not open.
11397 (File_read::reopen_descriptor): New function.
11398 (File_read::release): Release descriptor.
11399 (File_read::do_read): Make non-const. Reopen descriptor.
11400 (File_read::read): Make non-const.
11401 (File_read::make_view): Reopen descriptor.
11402 (File_read::do_readv): Likewise.
11403 * fileread.h (class File_read): Add is_descriptor_opened_ field.
11404 Update declarations.
11405 * layout.cc: Include "descriptors.h".
11406 (Layout::create_build_id): Use open_descriptor rather than open.
11407 * output.cc: Include "descriptors.h".
11408 (Output_file::open): Use open_descriptor rather than open.
11409 * archive.cc (Archive::const_iterator): Change Archive to be
11410 non-const.
11411 (Archive::begin, Archive::end): Make non-const.
11412 (Archive::count_members): Likewise.
11413 * archive.h (class Archive): Update declarations.
11414 * object.h (Object::read): Make non-const.
11415 * Makefile.am (CCFILES): Add descriptors.cc.
11416 (HFILES): Add descriptors.h.
11417 * Makefile.in: Rebuild.
11418
801647d1
ILT
11419 PR 6716
11420 * gold.h: Always include <clocale>. Add Solaris workarounds
11421 following code in binutils/sysdep.h.
11422
5edd166e
ILT
11423 PR 6048
11424 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
11425 this->eh_frame_hdr_ is NULL before using it.
11426
c89ad728
ILT
11427 * dynobj.cc (Versions::Versions): Update comment.
11428
aa86f06b
ILT
11429 * dynobj.cc (Versions::Versions): If there is an soname, use it as
11430 the base version name.
11431
5778530e
ILT
11432 * stringpool.cc (Stringpool_template::add_with_length): Set key to
11433 array size plus one.
11434 (Stringpool_template::set_string_offsets): Subtract one from key
11435 before using it as an array index.
11436 (Stringpool_template::get_offset_with_length): Likewise.
11437 (Stringpool_template::write_to_buffer): Likewise.
11438 * stringpool.h (Stringpool_template::get_offset_from_key):
11439 Likewise.
11440
057ead22
ILT
114412008-07-23 Ian Lance Taylor <iant@google.com>
11442
7f649c59
ILT
11443 PR 6658
11444 * object.h (Merged_symbol_value::value): Do our best to handle a
11445 negative addend.
11446
057ead22
ILT
11447 PR 6647
11448 * script.cc (Version_script_info::get_versions): Don't add empty
11449 version tag to return value.
11450 (Version_script_info::get_symbol_version_helper): Change return
11451 type to bool. Add pversion parameter. Change all callers.
11452 (script_register_vers_node): Don't require a non-NULL tag.
11453 * script.h (class Version_script_info): Update declarations.
11454 (Version_script_info::get_symbol_version): Change return type to
11455 bool. Add version parameter. Change all callers.
11456 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
11457 handling. Handle an empty version from a version script.
11458 (Symbol_table::define_special_symbol): Likewise.
11459 * testsuite/ver_test_10.script: New file.
11460 * testsuite/ver_test_10.sh: New file.
11461 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
11462 (check_DATA): Add ver_test_10.syms.
11463 (ver_test_10.syms, ver_test_10.so): New target.
11464 * testsuite/Makefile.in: Rebuild.
11465
58e54ac2
CD
114662008-07-23 Simon Baldwin <simonb@google.com>
11467
11468 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
11469 to zero for undefined symbols from dynamic libraries.
11470
95d14cd3
ILT
114712008-07-23 Ian Lance Taylor <iant@google.com>
11472
11473 * symtab.cc (Symbol_table::resolve): Remove version parameter.
11474 Change all callers.
11475 * symtab.h (class Symbol_table): Update declaration.
11476 * testsuite/ver_test_9.cc: New file.
11477 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
11478 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
11479 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
11480 (ver_test_9.so, ver_test_9.o): New targets.
11481 * testsuite/Makefile.in: Rebuild.
11482
92de84a6
ILT
114832008-07-22 Ian Lance Taylor <iant@google.com>
11484
34810851
ILT
11485 * options.h (class General_options): Define --check-sections.
11486 * layout.cc (Layout::set_segment_offsets): Handle
11487 --check-sections.
11488
af6156ef
ILT
11489 * options.h (class General_options): Define -n/--nmagic and
11490 -N/--omagic.
11491 * options.cc (General_options::finalize): For -n/--nmagic or
11492 -N/--omagic, set -static.
11493 * layout.cc (Layout::attach_allocated_section_to_segment): If
11494 -N/--omagic, don't put read-only and read-write sections in
11495 different segments.
11496 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
11497 finding a read-only segment.
11498 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
11499 don't set the minimum segment alignment to the common page size,
11500 and don't set the file offset to the address modulo the page size.
11501 * script-sections.cc (Script_sections::create_segments): If
11502 -n/--omagic, don't put read-only and read-write sections in
11503 different segments.
11504
92de84a6
ILT
11505 * cref.cc: New file.
11506 * cref.h: New file.
11507 * options.h (class General_options): Add --print-symbol-counts.
11508 * main.cc (main): Issue defined symbol report if requested.
11509 * archive.cc (Archive::interpret_header): Make into a const member
11510 function.
11511 (Archive::add_symbols): Call Input_objects::archive_start and
11512 archive_stop.
11513 (Archive::const_iterator): Define new class.
11514 (Archive::begin, Archive::end): New functions.
11515 (Archive::include_all_members): Rewrite to use iterator.
11516 (Archive::count_members): New function.
11517 * archive.h (class Archive): Update declarations.
11518 (Archive::filename): New function.
11519 * object.cc: Include "cref.h".
11520 (Sized_relobj::Sized_relobj): Initialize defined_count_.
11521 (Sized_relobj::do_get_global_symbol_counts): New function.
11522 (Input_objects::add_object): Add object to cross-referencer.
11523 (Input_objects::archive_start): New function.
11524 (Input_objects::archive_stop): New function.
11525 (Input_objects::print_symbol_counts): New function.
11526 * object.h: Declare Cref and Archive.
11527 (Object::get_global_symbol_counts): New function.
11528 (Object::do_get_global_symbol_counts): New pure virtual function.
11529 (class Sized_relobj): Add defined_count_ field. Update
11530 declarations.
11531 (class Input_objects): Add cref_ field. Update constructor.
11532 Update declarations.
11533 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
11534 defined_count_.
11535 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
11536 symbol counts.
11537 (Sized_dynobj::do_get_global_symbol_counts): New function.
11538 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
11539 defined_count_. Update declarations. Define Symbols typedef.
11540 * symtab.cc (Symbol_table::add_from_relobj): Add defined
11541 parameter. Change all callers.
11542 (Symbol_table::add_from_dynobj): Add sympointers and defined
11543 parameters. Change all callers.
11544 * symtab.h (class Symbol_table): Update declarations.
11545 * Makefile.am (CCFILES): Add cref.cc.
11546 (HFILES): Add cref.h.
11547 * Makefile.in: Rebuild.
11548
3f7c5e1d
CD
115492008-07-22 Simon Baldwin <simonb@google.com>
11550
11551 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
11552 to zero when writing undefined symbols.
11553
e0b64032
ILT
115542008-07-22 Ian Lance Taylor <iant@google.com>
11555
11556 * output.cc (Output_section::add_input_section): Don't try to
11557 merge empty merge sections.
11558
096b02cf
CS
115592008-07-21 Craig Silverstein <csilvers@google.com>
11560
11561 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
11562 Include symbol version in error message.
cd536b21 11563
1d1f116d
CD
115642008-07-20 Chris Demetriou <cgd@google.com>
11565
cd536b21 11566 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
11567 (RANDOM_SEED_CFLAGS): New substituted variable.
11568 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
11569 * configure: Rebuild.
11570 * Makefile.in: Likewise.
11571 * testsuite/Makefile.in: Likewise.
11572
a18f591e
ILT
115732008-07-18 Ian Lance Taylor <iant@google.com>
11574
11575 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
11576 where we see NAME/NULL and NAME/VERSION as separate symbols.
11577 * testsuite/ver_test_main.cc (main): Call t4.
11578 (t4, t4_2a): Define.
11579 * testsuite/ver_test_2.cc (t4_2): Define.
11580 * testsuite/ver_test_2.script: Put t4_2a in VER2.
11581 * testsuite/ver_test_4.cc (t4_2a): Define.
11582 * testsuite/ver_test_4.script: Put t4_2a in VER2.
11583 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
11584
c6e3f6ed
ILT
115852008-07-17 Ian Lance Taylor <iant@google.com>
11586
11587 * dynobj.cc (Versions::add_def): If we give an error about a
11588 missing version, go ahead and create the version anyhow.
11589
ef9beddf
ILT
115902008-07-10 Ian Lance Taylor <iant@google.com>
11591
11592 Handle output sections with more than 0x7fffffff bytes.
11593 * object.h (class Relobj): Change map_to_output_ to
11594 output_sections_, and just keep a section pointer. Change all
11595 uses. Move comdat group support to Sized_relobj.
11596 (Relobj::is_section_specially_mapped): Remove.
11597 (Relobj::output_section): Remove poff parameter. Change all
11598 callers.
11599 (Relobj::output_section_offset): New function.
11600 (Relobj::set_section_offset): Rewrite.
11601 (Relobj::map_to_output): Remove.
11602 (Relobj::output_sections): New function.
11603 (Relobj::do_output_section_offset): New pure virtual function.
11604 (Relobj::do_set_section_offset): Likewise.
11605 (class Sized_relobj): Add section_offsets_ field. Add comdat
11606 group support from Relobj. Update declarations.
11607 (Sized_relobj::get_output_section_offset): New function.
11608 (Sized_relobj::do_output_section_offset): New function.
11609 (Sized_relobj::do_set_section_offset): New function.
11610 * object.cc (Relobj::output_section_address): Remove.
11611 (Sized_relobj::Sized_relobj): Initialize new fields.
11612 (Sized_relobj::include_section_group): Cast find_kept_object to
11613 Sized_relobj.
11614 (Sized_relobj::include_linkonce_section): Likewise.
11615 (Sized_relobj::do_layout): Use separate arrays for output section
11616 and output offset.
11617 (Sized_relobj::do_count_local_symbols): Change map_to_output to
11618 output_sections.
11619 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
11620 output_sections and section_offsets.
11621 (Sized_relobj::write_local_symbols): Likewise.
11622 (map_to_kept_section): Compute output address directly.
11623 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
11624 output_sections and section_offsets.
11625 (Sized_relobj::write_sections): Likewise.
11626 (Sized_relobj::relocate_sections): Likewise.
11627 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
11628 * output.h (class Output_reloc): Update declarations. Change
11629 u2_.relobj to Sized_relobj*.
11630 (class Output_data_reloc): Change add functions to use
11631 Sized_relobj*.
11632 * output.cc (Output_reloc::Output_reloc): Change relobj to
11633 Sized_relobj*.
11634 (Output_reloc::local_section_offset): Change return type to
11635 Elf_Addr. Use get_output_section_offset.
11636 (Output_reloc::get_address): Likewise.
11637 (Output_section::is_input_address_mapped): Don't call
11638 is_section_specially_mapped.
11639 (Output_section::output_offset): Likewise.
11640 (Output_section::output_address): Likewise.
11641 (Output_section::starting_output_address): Likewise.
11642 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
11643 parameter to Sized_relobj*.
11644 (Copy_relocs::need_copy_reloc): Likewise.
11645 (Copy_relocs::save): Likewise.
11646 * copy-relocs.h (class Copy_relocs): Update declarations.
11647 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
11648 Sized_relobj*. Change relobj_ field to Sized_relobj*.
11649 * target-reloc.h (relocate_for_relocatable): Change
11650 offset_in_output_section type to Elf_Addr. Change code that uses
11651 it as well.
11652 * layout.cc (Layout::layout): Always set *off.
11653 * mapfile.cc (Mapfile::print_input_section): Use
11654 output_section_offset.
11655 * i386.cc (Target_i386::copy_reloc): Change object parameter to
11656 Sized_relobj*.
11657 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
11658 * sparc.cc (Target_sparc::copy_reloc): Likewise.
11659 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
11660
5cb66f97
ILT
116612008-07-03 Ian Lance Taylor <iant@google.com>
11662
11663 * layout.cc (Layout::include_section): Do not discard unrecognized
11664 SHT_STRTAB sections.
11665
afe47622
CS
116662008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
11667
11668 * script.cc (Lex::can_continue_name): Make '?' allowable in
11669 version-script names.
11670 * testsuite/version_script.map: Change glob pattern to use '?'
11671
5adf9721
ILT
116722008-06-30 Manish Singh <yosh@gimp.org>
11673
11674 PR 6585
11675 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
11676 Correct typo.
11677
e6fde208
ILT
116782008-06-30 Ian Lance Taylor <iant@google.com>
11679
11680 PR 6660
11681 PR 6682
11682 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
11683 versions]: Don't try to read the value in the contents, since we
11684 don't use it. Use the template endianness when writing.
11685
3f2e6a2d
CC
116862008-06-25 Cary Coutant <ccoutant@google.com>
11687
11688 * fileread.cc (File_read::make_view): Assert on zero-length view.
11689 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
11690 symbol table when there are no symbols to read.
11691
c43d3a48
CS
116922008-06-23 Craig Silverstein <csilvers@google.com>
11693
11694 * version.cc (version_string): Bump to 1.7
11695
5f494ea0
CS
116962008-06-18 Craig Silverstein <csilvers@google.com>
11697
11698 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
11699 constant 0xFFFF to type Valtype.
11700 (Powerpc_relocate_functions::rel16_ha): Likewise.
11701
c42e122e
ILT
117022008-06-17 Ian Lance Taylor <iant@google.com>
11703
f34787f8
ILT
11704 * output.h (Output_section::Input_section): Initialize p2align_ to
11705 zero for Output_section_data constructors.
11706 (Output_section::Input_section::addralign): If not an input
11707 section, return the alignment of the Output_section_data.
11708 * testsuite/copy_test.cc: New file.
11709 * testsuite/copy_test_1.cc: New file.
11710 * testsuite/copy_test_2.cc: New file.
11711 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
11712 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
11713 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
11714 (copy_test_1_pic.o, copy_test_1.so): New targets.
11715 (copy_test_2_pic.o, copy_test_2.so): New targets.
11716 * testsuite/Makefile.in: Rebuild.
11717
c42e122e
ILT
11718 * script-sections.cc (Script_sections::place_orphan): Initialize
11719 local variable exact.
11720
ce3ac18a
DE
117212008-06-13 David Edelsohn <edelsohn@gnu.org>
11722
11723 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
11724
42cacb20
DE
117252008-06-12 David Edelsohn <edelsohn@gnu.org>
11726 David S. Miller <davem@davemloft.net>
11727
11728 * powerpc.cc: New file.
11729 * Makefile.am (TARGETSOURCES): Add powerpc.cc
11730 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
11731 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
11732 * Makefile.in: Rebuild.
11733
7b308235
ILT
117342008-06-09 Ian Lance Taylor <iant@google.com>
11735
11736 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
11737 <exception>.
11738 (throwing, orig_terminate): New static variables.
11739 (terminate_handler): New static function.
11740 (t2): Set terminate handler.
11741
f0b886e3
ILT
117422008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
11743
11744 PR 6584
cd536b21 11745 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
11746 alignment.
11747
3e90f135
CC
117482008-05-30 Cary Coutant <ccoutant@google.com>
11749
11750 * archive.cc (Archive::include_all_members) Correct to step
11751 over symbol table and extended name table in thin archives.
11752
e09ad04a
ILT
117532008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
11754
11755 PR 6407
11756 * target-reloc.h (relocate_for_relocatable): Fix new_offset
11757 calculation.
11758
62b01cb5
ILT
117592008-05-28 Caleb Howe <cshowe@google.com>
11760
11761 * reduced_debug_output.cc: New file.
11762 * reduced_debug_output.h: New file.
92de84a6 11763 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
11764 * options.cc (General_options::finalize): Add strip_debug_non_line
11765 to the strip heirarchy.
11766 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
11767 fields.
11768 * layout.cc: Include "reduced_debug_output.h".
11769 (Layout::Layout): Initialize new fields.
11770 (line_only_debug_sections): New static array.
11771 (is_lines_only_debug_sections): New static inline function.
11772 (Layout::include_section): Handle --strip-debug-non-line.
11773 (Layout::make_output_section): If --strip-debug-non-line, build
11774 new output sections for .debug_abbrev and .debug_info.
11775 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
11776 gold. Warn about possible overflow.
11777 (read_signed_LEB_128): Likewise.
11778 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
11779 (read_signed_LEB_128): Declare.
11780 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
11781 (HFILES): Add reduced_debug_output.h.
11782 * Makefile.in: Rebuild.
11783
7d9e3d98
ILT
117842008-05-21 Ian Lance Taylor <iant@google.com>
11785
11786 * mapfile.cc: New file.
11787 * mapfile.h: New file.
11788 * options.h (class General_options): Add -M/--print-map and -Map.
11789 * options.cc (General_options::finalize): Make -M equivalent to
11790 -Map -.
11791 * main.cc: Include <cstdio> and "mapfile.h".
11792 (main): Open mapfile if requested.
11793 * gold.cc (class Middle_runner): Add mapfile_ field. Update
11794 constructor. Change caller.
11795 (queue_initial_tasks): Add mapfile parameter. Change caller.
11796 (queue_middle_tasks): Likewise.
11797 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
11798 declarations.
11799 * archive.cc: Include "mapfile.h".
11800 (Archive::add_symbols): Add mapfile parameter. Change all
11801 callers. Pass mapfile, symbol, and reason to include_member.
11802 (Archive::include_all_members): Add mapfile parameter. Change all
11803 callers.
11804 (Archive::include_member): Add mapfile, sym, and why parameters.
11805 Change all callers. Report inclusion to map file.
11806 * archive.h: Include "fileread.h".
11807 (class Archive): Update declarations.
11808 (Archive::file): New const method.
11809 (class Add_archive_symbols): Add mapfile_ field. Update
11810 constructor. Change all callers.
11811 * readsyms.h (class Read_symbols): Likewise.
11812 (class Finish_group): Likewise.
11813 (class Read_script): Likewise.
11814 * common.cc: Include "mapfile.h".
11815 (Symbol_table::allocate_commons): Add mapfile parameter. Change
11816 all callers.
11817 (Symbol_table::do_allocate_commons): Likewise.
11818 (Symbol_table::do_allocate_commons_list): Likewise. Report common
11819 symbol allocation to mapfile.
11820 * common.h (class Allocate_commons_task): Add mapfile_ field.
11821 Update constructor. Change all callers.
11822 * symtab.h (class Symbol_table): Update declarations.
11823 * layout.cc: Include "mapfile.h".
11824 (Layout_task_runner::run): Print information to mapfile.
11825 (Layout::create_gold_note): Change Output_data_fixed_space to
11826 Output_data_zero_fill.
11827 (Layout::create_build_id): Likewise.
11828 (Layout::print_to_mapfile): New function.
11829 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
11830 constructor. Change caller.
11831 (class Layout): Declare print_to_mapfile.
11832 * output.cc (Output_section::Input_section::print_to_mapfile): New
11833 function.
11834 (Output_section::add_input_section): If producing a map, always
11835 add to input_sections_ list.
11836 (Output_section::do_print_to_mapfile): New function.
11837 (Output_segment::print_sections_to_mapfile): New function.
11838 (Output_segment::print_section_list_to_mapfile): New function.
11839 * output.h: Include "mapfile.h".
11840 (Output_data::print_to_mapfile): New function.
11841 (Output_data::do_print_to_mapfile): New virtual function.
11842 (Output_segment_headers::do_print_to_mapfile): New function.
11843 (Output_file_header::do_print_to_mapfile): New function.
11844 (Output_data_const::do_print_to_mapfile): New function.
11845 (class Output_data_const_buffer): Add map_name_ field. Update
11846 constructor. Change all callers. Add do_print_to_mapfile
11847 function.
11848 (class Output_data_fixed_space): Likewise.
11849 (class Output_data_space): Likewise.
11850 (class Output_data_zero_fill): New class.
11851 (Output_data_strtab::do_print_to_mapfile): New function.
11852 (Output_data_reloc_base::do_print_to_mapfile): New function.
11853 (Output_relocatable_relocs::do_print_to_mapfile): New function.
11854 (Output_data_group::do_print_to_mapfile): New function.
11855 (Output_data_got::do_print_to_mapfile): New function.
11856 (Output_data_dynamic::do_print_to_mapfile): New function.
11857 (Output_symtab_xindex::do_print_to_mapfile): New function.
11858 (class Output_section): Declare do_print_to_mapflie. Declare
11859 print_to_mapfile in Input_section.
11860 (class Output_segment): Declare new functions.
11861 * object.h (Sized_relobj::symbol_count): New function.
11862 * script-sections.cc
11863 (Output_section_element_dot_assignment::set_section_addresses):
11864 Change Output_data_fixed_space to Output_data_zero_fill.
11865 (Output_data_expression::do_print_to_mapfile): New function.
11866 * script.cc (read_input_script): Add mapfile parameter. Change
11867 all callers.
11868 * script.h (read_input_script): Update declaration.
11869 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
11870 (Eh_frame::do_print_to_mapfile): New function.
11871 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
11872 (Output_merge_string::do_print_to_mapfile): New function.
11873 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
11874 function.
11875 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
11876 function.
11877 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
11878 function.
11879 * Makefile.am (CCFILES): Add mapfile.cc.
11880 (HFILES): Add mapfile.h.
11881 * Makefile.in: Rebuild.
11882
9f1d377b
ILT
118832008-05-19 Ian Lance Taylor <iant@google.com>
11884
11885 * options.h (class General_options): Add -z relro.
11886 * layout.cc (Layout::Layout): Initialize relro_segment_.
11887 (Layout::add_output_section_data): Return the output section.
11888 (Layout::make_output_section): Rcognize relro sections and mark
11889 them appropriately.
11890 (Layout::attach_allocated_section_to_segment): Put relro sections
11891 in a PT_GNU_RELRO segment.
11892 (Layout::create_initial_dynamic_sections): Mark the .dynamic
11893 section as relro.
11894 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
11895 PT_TLS segments.
11896 (Layout::linkonce_mapping): Map d.rel.ro.local to
11897 .data.rel.ro.local.
11898 (Layout::output_section_name): Us .data.rel.ro.local for any
11899 section which begins with that.
11900 * layout.h (class Layout): Update add_output_section_data
11901 declaration. Add relro_segment_ field.
11902 * output.cc (Output_section::Output_section): Initialize is_relro_
11903 and is_relro_local_ fields.
11904 (Output_segment::add_output_section): Group relro sections.
11905 (Output_segment::is_first_section_relro): New function.
11906 (Output_segment::maximum_alignment): If there is a relro section,
11907 align the segment to the common page size.
11908 (Output_segment::set_section_addresses): Track whether we are
11909 looking at relro sections. If the last section is a relro
11910 section, align to the common page size.
11911 (Output_segment::set_section_list_addresses): Add in_relro
11912 parameter. Change all callers. Align to the page size when
11913 moving from relro to non-relro section.
11914 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
11915 segment.
11916 * output.h (class Output_section): Add is_relro_ and
11917 is_relro_local_ fields.
11918 (Output_section::is_relro): New function.
11919 (Output_section::set_is_relro): New function.
11920 (Output_section::is_relro_local): New function.
11921 (Output_section::set_is_relro_local): New function.
11922 (class Output_segment): Update declarations.
11923 * i386.cc (Target_i386::got_section): Mark .got section as relro.
11924 * sparc.cc (Target_sparc::got_section): Likewise.
11925 * x86_64.cc (Target_x86_64::got_section): Likewise.
11926 * testsuite/relro_test_main.cc: New file.
11927 * testsuite/relro_test.cc: New file.
11928 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
11929 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
11930 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
11931 (relro_test.so, relro_test_pic.o): New targets.
11932 * testsuite/Makefile.in: Rebuild.
11933
a984ee1d
ILT
119342008-05-16 Ian Lance Taylor <iant@google.com>
11935
01676dcd
ILT
11936 * output.cc (Output_segment::add_output_section): Remove front
11937 parameter.
11938 * output.h (class Output_segment): Remove
11939 add_initial_output_section and overloaded add_output_section.
11940 Update declaration of remaining add_output_section.
11941 * layout.cc (Layout::create_interp): Call add_output_section
11942 rather than add_initial_output_section.
11943 (Layout::finish_dynamic_section): Likewise.
11944
497897f9
ILT
11945 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
11946 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
11947 know the dynamic type.
11948 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
11949 field. Initialize it in constructor.
11950 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
11951 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
11952 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
11953 reloc.
11954
a984ee1d
ILT
11955 * output.cc (Output_reloc::get_address): Change return type to
11956 Elf_Addr.
11957 * output.h (class Output_reloc): Update get_address declaration.
11958 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
11959 for section addresses.
11960
55ba0940
ILT
119612008-05-09 Ian Lance Taylor <iant@google.com>
11962
11963 PR 6493
11964 * gold.cc (gold_nomem): Use return value of write.
11965
75517b77
ILT
119662008-05-08 Ian Lance Taylor <iant@google.com>
11967
11968 * symtab.c (Symbol::init_base_output_data): Add version
11969 parameter. Change all callers.
11970 (Symbol::init_base_output_segment): Likewise.
11971 (Symbol::init_base_constant): Likewise.
11972 (Symbol::init_base_undefined): Likewise.
11973 (Sized_symbol::init_output_data): Likewise.
11974 (Sized_symbol::init_output_segment): Likewise.
11975 (Sized_symbol::init_constant): Likewise.
11976 (Sized_symbol::init_undefined): Likewise.
11977 (Symbol_table::do_define_in_output_data): If the new symbol has a
11978 version, mark it as the default.
11979 (Symbol_table::do_define_in_output_segment): Likewise.
11980 (Symbol_table::do_define_as_constant): Likewise.
11981 * symtab.h (class Symbol): Update declarations.
11982 (class Sized_symbol): Likewise.
11983 * resolve.cc (Symbol::override_version): New function.
c42e122e 11984 (Symbol::override_base): Call override_version.
75517b77
ILT
11985 (Symbol::override_base_with_special): Likewise.
11986 * testsuite/ver_script_8.script: New file.
11987 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
11988 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
11989 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
11990 (ver_test_8_1.so, ver_test_8_2.so): New targets.
11991
f1f70eae
ILT
119922008-05-06 Ian Lance Taylor <iant@google.com>
11993
f3e9c5c5
ILT
11994 PR 6049
11995 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
11996 functions.
11997 (class General_options): Remove existing --undefined, and add
11998 --no-undefined instead. Add new --undefined as synonym for -u.
11999 * archive.cc (Archive::add_symbols): Check whether symbol was
12000 named with -u.
12001 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
12002 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
12003 all uses. Add IS_UNDEFINED. Update declarations to split
12004 different versions of init_base. Declare init_base_undefined.
12005 (Symbol::is_defined): Handle IS_UNDEFINED.
12006 (Symbol::is_undefined): Likewise.
12007 (Symbol::is_weak_undefined): Call is_undefined.
12008 (Symbol::is_absolute): Handle IS_CONSTANT.
12009 (class Sized_symbol): Update declarations to split different
12010 versions of init. Declare init_undefined.
12011 (class Symbol_table): Declare new functions.
12012 * symtab.cc (Symbol::init_base_object): Rename from init_base.
12013 Change all callers.
12014 (Symbol::init_base_output_data): Likewise.
12015 (Symbol::init_base_output_segment): Likewise.
12016 (Symbol::init_base_constant): Likewise.
12017 (Symbol::init_base_undefined): New function.
12018 (Sized_symbol::init_object): Rename from init. Change all
12019 callers.
12020 (Sized_symbol::init_output_data): Likewise.
12021 (Sized_symbol::init_output_segment): Likewise.
12022 (Sized_symbol::init_constant): Likewise.
12023 (Sized_symbol::init_undefined): New function.
12024 (Symbol_table::add_undefined_symbols_from_command_line): New
12025 function.
12026 (Symbol_table::do_add_undefined_symbols_from_command_line): New
12027 function.
12028 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
12029 (Symbol::output_section): Likewise.
12030 (Symbol::set_output_section): Likewise.
12031 (Symbol_table::sized_finalize_symbol): Likewise.
12032 (Symbol_table::sized_write_globals): Likewise.
12033 * resolve.cc (Symbol_table::should_override): Likewise.
12034 (Symbol::override_base_with_special): Likewise.
12035
8bdcdf2c
ILT
12036 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
12037 symbol, change it to have default visibility.
12038 * testsuite/protected_1.cc: New file.
12039 * testsuite/protected_2.cc: New file.
12040 * testsuite/protected_3.cc: New file.
12041 * testsuite/protected_main_1.cc: New file.
12042 * testsuite/protected_main_2.cc: New file.
12043 * testsuite/protected_main_3.cc: New file.
12044 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
12045 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
12046 (protected_1_LDFLAGS, protected_1_LDADD): Define.
12047 (protected_1.so): New target.
12048 (protected_1_pic.o, protected_2_pic.o): New targets.
12049 (protected_3_pic.o): New target.
12050 (check_PROGRAMS): Add protected_2.
12051 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
12052 (protected_2_LDFLAGS, protected_2_LDADD): Define.
12053 * testsuite/Makefile.in: Rebuild.
12054
2b706932
ILT
12055 * options.h (DEFINE_var): Add set_user_set_##varname__.
12056 (DEFINE_bool_alias): New macro.
12057 (class General_options): Define -Bstatic using DEFINE_bool_alias
12058 rather than DEFINE_special. Add --undefined as an alias for -z
12059 defs.
12060 * options.cc (General_options::parse_Bstatic): Remove.
12061
d82a5bcc
ILT
12062 * options.h (class General_options): Add --fatal-warnings.
12063 * main.cc (main): Implement --fatal-warnings.
12064 * errors.h (Errors::warning_count): New function.
12065
f1f70eae
ILT
12066 * options.h (class General_options): Add -Bsymbolic-functions.
12067 * symtab.h (Symbol::is_preemptible): Check for
12068 -Bsymbolic-functions.
12069
8825ac63
ILT
120702008-05-05 Ian Lance Taylor <iant@google.com>
12071
d98bc257
ILT
12072 * options.h (DEFINE_bool): For DASH_Z, create the negative option
12073 as noVARNAME rather than no-VARNAME.
12074 (class General_options): Add option -z combreloc.
12075 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
12076 get_address.
12077 (Output_reloc::sort_before) [SHT_REL]: New function.
12078 (Output_reloc::sort_before) [SHT_RELA]: New function.
12079 (class Output_data_reloc_base): Add sort_relocs_ field. Define
12080 Sort_relocs_comparison.
12081 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
12082 parameter. Change all callers.
12083 (Output_data_reloc::Output_data_reloc) [both versions]: Add
12084 sort_relocs parameter. Change all callers.
12085 * output.cc (Output_reloc::get_address): New function, broken out
12086 of write_rel.
12087 (Output_reloc::write_rel): Call it.
12088 (Output_reloc::compare): New function.
12089 (Output_data_reloc_base::do_write): Optionally sort relocs.
12090
60b2b4e7
ILT
12091 * configure.ac: If targ_extra_obj is set, link it in.
12092 * configure.tgt: Initialize all variables.
12093 (x86_64*): Set targ_extra_obj and targ_extra_size.
12094 * configure: Rebuild.
12095
8825ac63
ILT
12096 * object.cc (Sized_relobj::include_section_group): Adjust section
12097 indexes read from group data. Build vector to pass to
12098 layout_group.
12099 * layout.cc (Layout::layout_group): Add flags and shndxes
12100 parameters. Remove contents parameter. Change caller. Update
12101 explicit instantiations.
12102 * layout.h (class Layout): Update layout_group declaration.
12103 * output.cc (Output_data_group::Output_data_group): Add flags and
12104 input_shndxes parameters. Remove contents parameter. Change
12105 caller.
12106 (Output_data_group::do_write): Change input_sections_ to
12107 input_shndxes_.
12108 * output.h (class Output_data_group): Update constructor
12109 declaration. Rename input_sections_ to input_shndxes_.
12110 * testsuite/many_sections_test.cc: Add template.
12111
e94cf127
CC
121122008-04-30 Cary Coutant <ccoutant@google.com>
12113
4418b2d5
CC
12114 * target-reloc.h (relocate_section): Fix dead-pointer bug.
12115
e94cf127
CC
12116 * layout.cc (Layout::include_section): Refactored check for debug
12117 info section.
12118 (Layout::add_comdat): Add new parameters. Change type
12119 of signature parameter. Add object and shndx to signatures table.
12120 (Layout::find_kept_object): New function.
12121 * layout.h: Include <cstring>.
12122 (Layout::is_debug_info_section): New function.
12123 (Layout::add_comdat): Add new parameters.
12124 (Layout::find_kept_object): New function.
12125 (Layout::Kept_section): New struct.
12126 (Layout::Signatures): Change type of map range.
12127 * object.cc (Relobj::output_section_address): New function.
12128 (Sized_relobj::include_section_group): Add new parameters. Change
12129 calls to Layout::add_comdat. Change to build table of kept comdat
12130 groups and table mapping discarded sections to kept sections.
12131 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
12132 (Sized_relobj::do_layout): Change calls to include_section_group and
12133 include_linkonce_section.
12134 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
12135 value to zero when section is discarded.
12136 (Sized_relobj::map_to_kept_section): New function.
12137 * object.h (Relobj::output_section_address): New function.
12138 (Relobj::Comdat_group): New type.
12139 (Relobj::find_comdat_group): New function.
12140 (Relobj::Comdat_group_table): New type.
12141 (Relobj::Kept_comdat_section): New type.
12142 (Relobj::Kept_comdat_section_table): New type.
12143 (Relobj::add_comdat_group): New function.
12144 (Relobj::set_kept_comdat_section): New function.
12145 (Relobj::get_kept_comdat_section): New function.
12146 (Relobj::comdat_groups_): New field.
12147 (Relobj::kept_comdat_sections_): New field.
12148 (Symbol_value::input_value): Update comment.
12149 (Sized_relobj::map_to_kept_section) New function.
12150 (Sized_relobj::include_linkonce_section): Add new parameter.
12151 * target-reloc.h (Comdat_behavior): New type.
12152 (get_comdat_behavior): New function.
12153 (relocate_section): Add code to map a discarded section to the
12154 corresponding kept section when applying a relocation.
12155
e4e5049b
CS
121562008-04-30 Craig Silverstein <csilvers@google.com>
12157
12158 * dwarf_reader.cc (next_generation_count): New static var.
12159 (Addr2line_cache_entry): New struct.
12160 (addr2line_cache): New static var.
12161 (Dwarf_line_info::one_addr2line): Added caching.
12162 (Dwarf_line_info::clear_addr2line_cache): New function.
12163 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
12164 cache-size parameter.
12165 (Dwarf_line_info::one_addr2line_cache): New function.
12166 * symtab.cc (Symbol_table::detect_odr_violations): Pass
12167 new cache-size argument to one_addr2line(), and clear cache.
12168
d09e9154
CC
121692008-04-28 Cary Coutant <ccoutant@google.com>
12170
12171 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
12172 R_386_PC8 relocations.
12173
7ef73768
ILT
121742008-04-23 Ian Lance Taylor <iant@google.com>
12175
55438702
ILT
12176 * object.cc (Sized_relobj::include_section_group): Check for
12177 invalid section group.
12178
c165fb93
ILT
12179 * object.cc (make_elf_object): Correct test for 64-bit ELF file
12180 header size.
12181
7ef73768
ILT
12182 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
12183 than read for file header.
12184 * archive.cc (Archive::include_member): Likewise.
12185
6194aaab
L
121862008-04-23 Paolo Bonzini <bonzini@gnu.org>
12187
12188 * aclocal.m4: Regenerate.
12189 * configure: Regenerate.
12190
d491d34e
ILT
121912008-04-19 Ian Lance Taylor <iant@google.com>
12192
5ea2bac6
ILT
12193 * version.cc (version_string): Bump to 1.6.
12194
7bc3e21a
ILT
12195 * testsuite/Makefile.am (many_sections_r_test): New target.
12196 (many_sections_r_test_SOURCES): Remove.
12197 (many_sections_r_test_DEPENDENCIES): Remove.
12198 (many_sections_r_test_LDFLAGS): Remove.
12199 (many_sections_r_test_LDADD): Remove.
12200
7fcd3aa9
ILT
12201 * object.cc (Sized_relobj::do_add_symbols): Always pass
12202 local_symbol_count_ to add_from_relobj.
12203
4c94d6ae
ILT
12204 * testsuite/Makefile.am (many_sections_check.h): Only check one in
12205 every thousand variables.
12206 * testsuite/Makefile.in: Rebuild.
12207
d491d34e
ILT
12208 * object.cc (Xindex::initialize_symtab_xindex): New function.
12209 (Xindex::read_symtab_xindex): New function.
12210 (Xindex::sym_xindex_to_shndx): New function.
12211 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
12212 available.
12213 (Sized_relobj::do_initialize_xindex): New function.
12214 (Sized_relobj::do_read_symbols): Adjust section links.
12215 (Sized_relobj::symbol_section_and_value): Add is_ordinary
12216 parameter. Change all callers.
12217 (Sized_relobj::include_section_group): Adjust section links and
12218 symbol section indexes.
12219 (Sized_relobj::do_layout): Adjust section links.
12220 (Sized_relobj::do_count_local_symbols): Adjust section links and
12221 symbol section indexes.
12222 (Sized_relobj::do_finalize_local_symbols): Distinguish between
12223 ordinary and special symbols.
12224 (Sized_relobj::write_local_symbols): Add symtab_xindex and
12225 dynsym_xindex parameters. Change all callers. Adjust section
12226 links. Use SHN_XINDEX when needed.
12227 (Sized_relobj::get_symbol_location_info): Adjust section links.
12228 Don't get fooled by special symbols.
12229 * object.h (class Xindex): Define.
12230 (class Object): Add xindex_ parameter. Declare virtual functoin
12231 do_initialize_xindex.
12232 (Object::adjust_sym_shndx): New function.
12233 (Object::set_xindex): New protected function.
12234 (class Symbol_value): Add is_ordinary_shndx_ field.
12235 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
12236 (Symbol_value::value): Assert ordinary section.
12237 (Symbol_value::initialize_input_to_output_map): Likewise.
12238 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
12239 Change all callers.
12240 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
12241 all callers.
12242 (class Sized_relobj): Update declarations.
12243 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
12244 parameter. Change all callers.
12245 (Sized_relobj::adjust_shndx): New function.
12246 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
12247 field.
12248 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
12249 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
12250 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
12251 (Sized_dynobj::read_dynsym_section): Adjust section links.
12252 (Sized_dynobj::read_dynamic): Likewise.
12253 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
12254 section links.
12255 (Sized_dynobj::do_initialize_xindex): New function.
12256 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
12257 do_initialize_xindex.
12258 (Sized_dynobj::adjust_shndx): New function.
12259 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
12260 dynsym_xindex_ fields.
12261 (Layout::finalize): Add a call to set_section_indexes before
12262 creating the symtab sections.
12263 (Layout::set_section_indexes): Don't do anything if the section
12264 already has a section index.
12265 (Layout::create_symtab_sections): Add shnum parameter. Change
12266 caller. Create .symtab_shndx section if needed.
12267 (Layout::create_shdrs): Add shstrtab_section parameter. Change
12268 caller.
12269 (Layout::allocated_output_section_count): New function.
12270 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
12271 needed.
12272 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
12273 fields. Update declarations.
12274 (Layout::symtab_xindex): New function.
12275 (Layout::dynsym_xindex): New function.
12276 (class Write_symbols_task): Add layout_ field.
12277 (Write_symbols_task::Write_symbols_task): Add layout parameter.
12278 Change caller.
12279 * output.cc (Output_section_headers::Output_section_headers): Add
12280 shstrtab_section parameter. Change all callers.
12281 (Output_section_headers::do_sized_write): Store overflow values
12282 for section count and section string table section index in
12283 section header zero.
12284 (Output_file_header::do_sized_write): Check for overflow of
12285 section count and section string table section index.
12286 (Output_symtab_xindex::do_write): New function.
12287 (Output_symtab_xindex::endian_do_write): New function.
12288 * output.h (class Output_section_headers): Add shstrtab_section_.
12289 Update declarations.
12290 (class Output_symtab_xindex): Define.
12291 (Output_section::has_out_shndx): New function.
12292 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
12293 field.
12294 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
12295 Change all callers.
12296 (Sized_symbol::init): Likewise.
12297 (Symbol::output_section): Check for ordinary symbol.
12298 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
12299 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
12300 callers.
12301 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
12302 Change all callers. Simplify handling of symbols from sections
12303 not included in the link.
12304 (Symbol_table::add_from_dynobj): Handle ordinary symbol
12305 distinction.
12306 (Weak_alias_sorter::operator()): Assert that symbols are
12307 ordinary.
12308 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
12309 distinction.
12310 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
12311 parameters. Change all callers.
12312 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
12313 symbol distinction. Use SHN_XINDEX when needed.
12314 (Symbol_table::write_section_symbol): Add symtab_xindex
12315 parameter. Change all callers.
12316 (Symbol_table::sized_write_section_symbol): Likewise. Use
12317 SHN_XINDEX when needed.
12318 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
12319 declarations.
12320 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
12321 (Symbol::is_defined): Check is_ordinary.
12322 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
12323 (Symbol::is_absolute, Symbol::is_common): Likewise.
12324 (class Sized_symbol): Update declarations.
12325 (class Symbol_table): Update declarations.
12326 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
12327 parameters. Change all callers.
12328 (Sized_symbol::override): Likewise.
12329 (Symbol_table::override): Likewise.
12330 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
12331 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
12332 is_ordinary, and orig_st_shndx parameters. Change all callers.
12333 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
12334 to be in an ordinary section.
12335 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
12336 object and is_ordinary parameters. Change all callers.
12337 (Sized_dwarf_line_info::read_relocs): Add object parameter.
12338 Change all callers. Don't add undefined or non-ordinary symbols
12339 to reloc_map_.
12340 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
12341 Change all callers.
12342 * dwarf_reader.h (class Sized_dwarf_line_info): Update
12343 declarations.
12344 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
12345 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
12346 (Sized_relobj::relocate_sections): Likewise.
12347 * target-reloc.h (scan_relocs): Adjust section symbol index.
12348 (scan_relocatable_relocs): Likewise.
12349 * i386.cc (Scan::local): Check for ordinary symbols.
12350 * sparc.cc (Scan::local): Likewise.
12351 * x86_64.cc (Scan::local): Likewise.
12352 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
12353 to symbol_section_and_value.
12354 * testsuite/many_sections_test.cc: New file.
12355 * testsuite/Makefile.am (BUILT_SOURCES): Define.
12356 (check_PROGRAMS): Add many_sections_test.
12357 (many_sections_test_SOURCES): Define.
12358 (many_sections_test_DEPENDENCIES): Define.
12359 (many_sections_test_LDFLAGS): Define.
12360 (BUILT_SOURCES): Add many_sections_define.h.
12361 (many_sections_define.h): New target.
12362 (BUILT_SOURCES): Add many_sections_check.h.
12363 (many_sections_check.h): New target.
12364 (check_PROGRAMS): Add many_sections_r_test.
12365 (many_sections_r_test_SOURCES): Define.
12366 (many_sections_r_test_DEPENDENCIES): Define.
12367 (many_sections_r_test_LDFLAGS): Define.
12368 (many_sections_r_test_LDADD): Define.
12369 (many_sections_r_test.o): New target.
12370 * testsuite/Makefile.in: Rebuild.
12371
c5818ff1
CC
123722008-04-17 Cary Coutant <ccoutant@google.com>
12373
12374 * errors.cc (Errors::info): New function.
12375 (gold_info): New function.
12376 * errors.h (Errors::info): New function.
12377 * gold.h (gold_info): New function.
12378 * object.cc (Input_objects::add_object): Print trace output.
12379 * options.cc (options::parse_set): New function.
12380 (General_options::parse_wrap): Deleted.
12381 (General_options::General_options): Deleted initializer.
12382 * options.h (options::String_set): New typedef.
12383 (options::parse_set): New function.
12384 (DEFINE_set): New macro.
12385 (General_options::wrap): Changed to use DEFINE_set. Changed
12386 callers of any_wrap_symbols and is_wrap_symbol.
12387 (General_options::trace, General_options::trace_symbol):
12388 New options.
12389 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
12390 (General_options::wrap_symbols_): Deleted.
12391 * symtab.cc (Symbol_table::add_from_object): Print trace output.
12392
b5be4a7c
DM
123932008-04-17 David S. Miller <davem@davemloft.net>
12394
12395 * options.cc (General_options::parse_V): New function.
12396 * options.h: Add entries for -V and -Qy.
12397
155a0dd7
ILT
123982008-04-17 Ian Lance Taylor <iant@google.com>
12399
12400 * common.cc (Symbol_table::allocate_commons): Remove options
12401 parameter. Change caller.
12402 (Symbol_table::do_allocate_commons): Remove options parameter.
12403 Change caller. Just call do_allocate_commons_list twice.
12404 (Symbol_table::do_allocate_commons_list): New function, broken out
12405 of do_allocate_commons.
12406 * common.h (class Allocate_commons_task): Remove options_ field.
12407 Update constructor.
12408 * symtab.cc (Symbol_table::Symbol_table): Initialize
12409 tls_commons_.
12410 (Symbol_table::add_from_object): Put TLS common symbols on
12411 tls_commons_ list.
12412 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
12413 which are IN_OUTPUT_DATA.
12414 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
12415 allocate_commons and do_allocate_commons declarations. Declare
12416 do_allocate_commons_list.
12417 * gold.cc (queue_middle_tasks): Update creation of
12418 Allocate_commons_task to not pass options.
12419 * testsuite/Makefile.am (INCLUDES): Add -I.. .
12420 (TLS_TEST_C_FLAGS): New variable.
12421 (tls_test_c_pic.o): New target.
12422 (tls_test_shared.so): Link in tls_test_c_pic.o.
12423 (tls_test_c_pic_ie.o): New target.
12424 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
12425 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
12426 (tls_test_c.o): New target.
12427 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
12428 (tls_pic_test_LDADD): Likewise.
12429 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
12430 (tls_shared_gd_to_ie_test_LDADD): Likewise.
12431 (tls_test_c_gnu2.o): New target.
12432 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
12433 tls_test_c_gnu2.o.
12434 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
12435 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
12436 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
12437 * testsuite/tls_test.cc: Include "config.h".
12438 (t_last): Call t11_last.
12439 * testsuite/tls_test.h (t11, t11_last): Declare.
12440 * testsuite/tls_test_c.c: New file.
12441 * testsuite/tls_test_main.cc (thread_routine): Call t11.
12442 * configure.ac: Check for OpenMP support.
12443 * configure, config.in, Makefile.in: Rebuild.
12444 * testsuite/Makefile.in: Rebuild.
12445
edfbb029
CC
124462008-04-16 Cary Coutant <ccoutant@google.com>
12447
12448 * i386.cc (Target_i386::define_tls_base_symbol): New function.
12449 (Target_i386::tls_base_symbol_defined_): New field.
12450 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12451 (Target_i386::Scan::global): Likewise.
12452 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
12453 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
12454 (Target_x86_64::tls_base_symbol_defined_): New field.
12455 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12456 (Target_x86_64::Scan::global): Likewise.
12457
f3c69fca
CC
124582008-04-16 Cary Coutant <ccoutant@google.com>
12459
12460 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
12461 (Symbol::needs_plt_entry): Allow weak undefined symbols.
12462 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
12463 building shared libraries.
12464 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
12465 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
12466 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
12467 * testsuite/Makefile.in: Rebuild.
12468 * testsuite/weak_undef.h: New file.
12469 * testsuite/weak_undef_file1.cc: Add extra test cases.
12470 * testsuite/weak_undef_file2.cc: Likewise.
12471 * testsuite/weak_undef_test.cc: Likewise.
12472
7c414435
DM
124732008-04-16 David S. Miller <davem@davemloft.net>
12474
32b769e1
DM
12475 * sparc.cc (Target_sparc::Scan): Change from struct to class.
12476 Add issued_non_pic_error_ field. Declare check_non_pic.
12477 (Target_sparc::Scan::check_non_pic): New function.
12478 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
12479 (Target_sparc::Scan::global): Likewise.
12480
11936fb1
DM
12481 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
12482 * configure: Rebuild.
12483
7c414435
DM
12484 * options.h (DEFINE_enable): New macro.
12485 (new_dtags): New enable option.
12486 (initfirst, interpose, loadfltr, nodefaultlib,
12487 nodelete, nodlopen, nodump): New -z options.
12488 * layout.cc (Layout:finish_dynamic_section): If new
12489 dtags enabled, emit DT_RUNPATH. Also, emit a
12490 DT_FLAGS_1 containing any specified -z flags.
12491
85c7bf8b
ILT
124922008-04-16 Ian Lance Taylor <iant@google.com>
12493
12c0daef
ILT
12494 * copy-relocs.cc: New file.
12495 * copy-relocs.h: New file.
12496 * reloc.cc: Remove Copy_relocs code.
12497 * reloc.h: Likewise.
12498 * reloc-types.h (struct Reloc_types) [both versions]: Add
12499 get_reloc_addend_noerror.
12500 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
12501 variants of add_global which take an addend which must be zero.
12502 * i386.cc: Include "copy-relocs.h".
12503 (class Target_i386): Change type of copy_relocs_ to variable,
12504 update initializer.
12505 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
12506 Change all callers.
12507 (Target_i386::do_finalize_sections): Change handling of
12508 copy_relocs_.
12509 * sparc.cc: Include "copy-relocs.h".
12510 (class Target_sparc): Change type of copy_relocs_ to variable,
12511 update initializer.
12512 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
12513 Change all callers.
12514 (Target_sparc::do_finalize_sections): Change handling of
12515 copy_relocs_.
12516 * x86_64.cc: Include "copy-relocs.h".
12517 (class Target_x86_64): Change type of copy_relocs_ to variable,
12518 update initializer.
12519 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
12520 class. Change all callers.
12521 (Target_x86_64::do_finalize_sections): Change handling of
12522 copy_relocs_.
12523 * Makefile.am (CCFILES): Add copy-relocs.cc.
12524 (HFILES): Add copy-relocs.h.
12525
4f4995b6
ILT
12526 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
12527
85c7bf8b
ILT
12528 * testsuite/script_test_4.sh: Permit leading zeroes.
12529
4f2a9edd
ILT
125302008-04-15 Ian Lance Taylor <iant@google.com>
12531
e6188289
ILT
12532 * script-sections.cc (Script_sections::create_segments): Use
12533 header_size_adjustment even when there is enough room for the
12534 headers.
12535 * testsuite/script_test_4.sh: New file.
12536 * testsuite/script_test_4.t: New file.
12537 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
12538 (check_DATA): Add script_test_4.stdout.
12539 (MOSTLYCLEANFILES): Likewise.
12540 (script_test_4): New target.
12541 (script_test_4.stdout): New target.
12542 * testsuite/Makefile.in: Rebuild.
12543
4f2a9edd
ILT
12544 * sparc.cc: Add definitions for Output_data_plt_sparc class
12545 constants.
12546
f5314dd5
DM
125472008-04-14 David S. Miller <davem@davemloft.net>
12548
12549 * sparc.cc: New file.
12550 * Makefile.am (TARGETSOURCES): Add sparc.cc
12551 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
12552 * configure.tgt: Document targ_extra_size and
12553 targ_extra_big_endian. Add entries for sparc-* and
12554 sparc64-*.
12555 * configure.ac: Handle targ_extra_size and
12556 targ_extra_big_endian.
12557 * Makefile.in: Rebuild.
12558 * configure: Likewise.
12559 * po/POTFILES.in: Likewise.
12560 * po/gold.pot: Likewise.
12561
154e0e9a
ILT
125622008-04-14 Ian Lance Taylor <iant@google.com>
12563
12564 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
12565 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
12566 in the name/type/flags to section mapping. Don't call
12567 allocate_output_section.
12568 (Layout::choose_output_section): Change parameter from adjust_name
12569 to is_input_section. Don't permit input sections after sections
12570 are attached to segments. Don't call allocate_output_section.
12571 (Layout::layout_eh_frame): Call update_flags_for_input_section,
12572 not write_enable_output_section.
12573 (Layout::make_output_section): Don't push to
12574 unattached_section_list_ nor call attach_to_segment. Call
12575 attach_section_to_segment if sections are attached.
12576 (Layout::attach_sections_to_segments): New function.
12577 (Layout::attach_section_to_segment): New function.
12578 (Layout::attach_allocated_section_to_segment): Rename from
12579 attach_to_segment. Remove flags parameter.
12580 (Layout::allocate_output_section): Remove function.
12581 (Layout::write_enable_output_section): Remove function.
12582 * layout.h (class Layout): Update for above changes. Add new
12583 field sections_are_attached_.
12584 * output.h (Output_section::update_flags_for_input_section): New
12585 function.
12586 * output.cc (Output_section::add_input_section): Call
12587 update_flags_for_input_section.
12588 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
12589
009a67a2
CC
125902008-04-11 Cary Coutant <ccoutant@google.com>
12591
12592 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
12593 thought unnecessary.
12594 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
12595
759b1a24
ILT
125962008-04-11 Ian Lance Taylor <iant@google.com>
12597
12598 * output.h (class Output_section_data): Remove inline definition
12599 of set_addralign.
12600 * output.cc (Output_section_data::set_addralign): New function.
12601
c2b45e22
CC
126022008-04-11 Cary Coutant <ccoutant@google.com>
12603
12604 Add support for TLS descriptors for i386 and x86_64.
12605 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
12606 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
12607 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
12608 GOT_TYPE_TLS_DESC.
12609 (Target_i386::got_mod_index_entry): Remove unnecessary code.
12610 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
12611 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
12612 relocations.
12613 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
12614 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
12615 Fix problem with initial-exec relocations.
12616 (Target_i386::Relocate::relocate_tls): Likewise.
12617 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
12618 relaxation.
12619 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
12620 support for section-plus-offset dynamic table entries.
12621 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
12622 (Output_data_dynamic::Dynamic_entry): Add support for
12623 section-plus-offset dynamic table entries.
12624 (Output_data_dynamic::Classification): Likewise.
12625 (Output_data_dynamic::classification_): Renamed offset_.
12626 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
12627 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
12628 (Target_x86_64::make_plt_section): New function.
12629 (Target_x86_64::reserve_tlsdesc_entries): New function.
12630 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
12631 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
12632 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
12633 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
12634 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
12635 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
12636 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
12637 add extra PLT entry for TLS descriptors.
12638 (Output_data_plt_x86_64::got_): New field.
12639 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
12640 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
12641 fields.
12642 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
12643 descriptors.
12644 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
12645 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
12646 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
12647 R_386_TLS_DESC_CALL relocations.
12648 (Target_x86_64::Scan::global): Likewise.
12649 (Target_x86_64::do_finalize_sections): Add dynamic table entries
12650 for TLS descriptors.
12651 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
12652 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
12653 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
12654 GD-to-IE relaxation.
12655 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
12656 and TLS_DESCRIPTORS.
12657 * Makefile.in: Rebuild.
12658 * configure: Rebuild.
12659 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
12660 (tls_test_shared2.so): New target.
12661 (tls_shared_gd_to_ie_test_SOURCES): New variable.
12662 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
12663 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
12664 (tls_shared_gd_to_ie_test_LDADD): New variable.
12665 (tls_shared_gnu2_gd_to_ie_test): New target.
12666 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
12667 New targets.
12668 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
12669 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
12670 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
12671 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
12672 (tls_shared_gnu2_test): New target.
12673 (tls_test_gnu2_shared.so): New target.
12674 (tls_shared_gnu2_test_SOURCES): New variable.
12675 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
12676 (tls_shared_gnu2_test_LDFLAGS): New variable.
12677 (tls_shared_gnu2_test_LDADD): New variable.
12678 * testsuite/Makefile.in: Rebuild.
12679 * testsuite/Makefile.
12680
83bfb6b7
ILT
126812008-04-11 Ian Lance Taylor <iant@google.com>
12682
12683 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
12684 justsyms.t.
12685 * testsuite/Makefile.in: Rebuild.
12686
12687 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
12688 long.
12689 * testsuite/script_test_2.cc (main): Adjust test.
12690
706e1f5e
ILT
126912008-04-11 David S. Miller <davem@davemloft.net>
12692 Ian Lance Taylor <iant@google.com>
12693
12694 * options.h (General_options): Add entries for '-Y' and
12695 '-relax'.
12696 * options.cc (General_options:finalize): If -Y was used, add those
12697 entries to the library path instead of the default "/lib" and
12698 "/usr/lib".
12699
7c98e6bb
DM
127002008-04-11 David S. Miller <davem@davemloft.net>
12701
12702 * testsuite/justsyms.t: Start at 0x100.
12703 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
12704 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
12705 long.
12706 * testsuite/script_test_2.cc: Adjust string and section length
12707 checks.
7c98e6bb 12708
99a37bfd
ILT
127092008-04-09 Ian Lance Taylor <iant@google.com>
12710
2cefc357
ILT
12711 PR gold/5996
12712 * script-sections.cc (Sections_element::allocate_to_segment): Add
12713 orphan parameter.
12714 (Output_section_definition::allocate_to_segment): Likewise.
12715 (Orphan_output_section::allocate_to_segment): Likewise.
12716 (Script_sections::attach_sections_using_phdrs_clause): Don't
12717 propagate non-PT_LOAD segments to orphan sections.
12718 * testsuite/Makefile.am (script_test_3.stdout): Generate using
12719 readelf rather than objdump.
12720 * testsuite/script_test_3.sh: Adjust accordingly. Test that
12721 .interp section and PT_INTERP segment are the same size.
12722 * testsuite/Makefile.in: Rebuild.
12723
99a37bfd
ILT
12724 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
12725 aliases for symbols defined in the same object.
12726 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
12727 (weak_alias_test_SOURCES): New variable.
12728 (weak_alias_test_DEPENDENCIES): New variable.
12729 (weak_alias_test_LDFLAGS): New variable.
12730 (weak_alias_test_LDADD): New variable.
12731 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
12732 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
12733 (weak_alias_test_3.o): New target.
12734 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
12735 * testsuite/weak_alias_test_main.cc: New file.
12736 * testsuite/weak_alias_test_1.cc: New file.
12737 * testsuite/weak_alias_test_2.cc: New file.
12738 * testsuite/weak_alias_test_3.cc: New file.
12739
780e49c5
ILT
127402008-04-08 Ian Lance Taylor <iant@google.com>
12741
cdb0b8f5
ILT
12742 * options.h (class General_options): Add --noinhibit-exec option.
12743 * main.cc (main): Check --noinhibit-exec.
12744
0864d551
ILT
12745 * options.h (class General_options): Define --wrap as a special
12746 option. Add wrap_symbols_ field.
12747 (General_options::any_wrap_symbols): New function.
12748 (General_options::is_wrap_symbol): New function.
12749 * options.cc (General_options::parse_wrap): New function.
12750 (General_options::General_options): Initialize wrap_symbols_.
12751 * symtab.cc (Symbol_table::wrap_symbol): New function.
12752 (Symbol_table::add_from_object): Handle --wrap.
12753 * symtab.h (class Symbol_table): Declare wrap_symbol.
12754 * target.h (Target::wrap_char): New function.
12755 (Target::Target_info): Add wrap_char field.
12756 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
12757 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12758 * testsuite/testfile.cc (Target_test::test_target_info):
12759 Likewise.
12760
789aa6de
ILT
12761 * errors.cc (Errors::undefined_symbol): Mention symbol version if
12762 there is one.
12763
2c38906f
ILT
12764 * layout.h (class Layout): Add added_eh_frame_data_ field.
12765 * layout.cc (Layout::Layout): Initialize new field.
12766 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
12767 output section until we find a section we merged successfully.
12768 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
12769 that the size be non-zero.
12770
780e49c5
ILT
12771 * merge.cc (Object_merge_map::get_output_offset): Remove inline
12772 qualifier.
12773
7fcd0256
ILT
127742008-04-08 Craig Silverstein <csilvers@google.com>
12775
12776 * configure.ac: Export new conditional variable HAVE_ZLIB.
12777 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
12778 on HAVE_ZLIB.
12779 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
12780 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12781
6835af53
ILT
127822008-04-07 Ian Lance Taylor <iant@google.com>
12783
e24f324c
ILT
12784 * version.cc (version_string): Set to "1.5".
12785
a036edd8
ILT
12786 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
12787 Add issued_non_pic_error_ field. Declare check_non_pic.
12788 (Target_x86_64::Scan::check_non_pic): New function.
12789 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
12790 (Target_x86_64::Scan::global): Likewise.
12791
624f8810
ILT
12792 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
12793 addend parameter. Change caller. Handle merge sections.
12794 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
12795 Address to Addend. Don't add in the result of
12796 local_section_offset, pass down the addend and use the returned
12797 value.
12798 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
12799 Update declarations of local_section_offset and symbol_value.
12800 * testsuite/two_file_test_1.cc (t18): New function.
12801 * testsuite/two_file_test_2.cc (f18): New function.
12802 * testsuite/two_file_test_main.cc (main): Call t18.
12803 * testsuite/two_file_test.h (t18, f18): Declare.
12804
6835af53
ILT
12805 * configure.ac: Don't test for objdump, c++filt, or readelf.
12806 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
12807 conditionals.
12808 (TEST_READELF): New variable.
12809 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
12810 (check_PROGRAMS): Add two_file_strip_test.
12811 (two_file_strip_test): New target.
12812 (check_PROGRAMS): Add two_file_same_shared_strip_test.
12813 (two_file_same_shared_strip_test_SOURCES): New variable.
12814 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
12815 (two_file_same_shared_strip_test_LDFLAGS): New variable.
12816 (two_file_same_shared_strip_test_LDADD): New variable.
12817 (two_file_shared_strip.so): New target.
12818 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
12819 (ver_test_5.syms, ver_test_7.syms): Likewise.
12820 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
12821 (strip_test_3.stdout): Use TEST_OBJDUMP.
12822 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12823
86925eef
CC
128242008-04-04 Cary Coutant <ccoutant@google.com>
12825
12826 * symtab.h (Symbol::is_weak_undefined): New function.
12827 (Symbol::is_strong_undefined): New function.
12828 (Symbol::is_absolute): New function.
12829 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
12830 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
12831 absolute symbols.
12832 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
12833 (weak_undef_test): New target.
12834 * testsuite/Makefile.in: Rebuild.
12835 * testsuite/weak_undef_file1.cc: New file.
12836 * testsuite/weak_undef_file2.cc: New file.
12837 * testsuite/weak_undef_test.cc: New file.
12838
126f3ece
ILT
128392008-04-03 Craig Silverstein <csilvers@google.com>
12840
12841 * compressed_output.h (class Output_compressed_section): Use
12842 unsigned buffer.
12843 * compressed_output.cc (zlib_compress): Use unsigned buffers,
12844 add zlib header.
12845 (zlib_compressed_suffix): Removed.
12846 (Output_compressed_section::set_final_data_size): Use unsigned
12847 buffers.
12848 * testsuite/Makefile.am (flagstest_compress_debug_sections):
12849 Fix linker invocation.
12850 (flagstest_o_specialfile_and_compress_debug_sections):
12851 Likewise.
12852 * testsuite/Makefile.in: Regenerated.
12853
deae2a14
DM
128542008-04-02 David S. Miller <davem@davemloft.net>
12855
12856 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
12857 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
12858
70752818
ILT
128592008-04-02 Craig Silverstein <csilvers@google.com>
12860
12861 * TODO: New file.
12862
39d0cb0e
ILT
128632008-04-02 Ian Lance Taylor <iant@google.com>
12864
12865 * fileread.cc (File_read::find_view): Add byteshift and vshifted
12866 parameters. Update for new key type to views_. Change all
12867 callers.
12868 (File_read::read): Adjust for byteshift in returned view.
12869 (File_read::add_view): New function, broken out of
12870 find_and_make_view.
12871 (File_read::make_view): New function, broken out of
12872 find_and_make_view.
12873 (File_read::find_or_make_view): Add offset and aligned
12874 parameters. Rewrite accordingly. Change all callers.
12875 (File_read::get_view): Add offset and aligned parameters. Adjust
12876 for byteshift in return value.
12877 (File_read::get_lasting_view): Likewise.
12878 * fileread.h (class File_read): Update declarations.
12879 (class File_read::View): Add byteshift_ field. Add byteshift to
12880 constructor. Add byteshift method.
12881 * archive.h (Archive::clear_uncached_views): New function.
12882 (Archive::get_view): Add aligned parameter. Change all callers.
12883 * object.h (Object::get_view): Add aligned parameter. Change all
12884 callers.
12885 (Object::get_lasting_view): Likewise.
12886
12887 * fileread.cc (File_read::release): Don't call clear_views if
12888 there are multiple objects.
12889 * fileread.h (File_read::clear_uncached_views): New function.
12890 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
12891 on the archive.
12892
a1207466
CC
128932008-03-31 Cary Coutant <ccoutant@google.com>
12894
12895 Add thin archive support.
12896 * archive.cc (Archive::armagt): New const.
12897 (Archive::setup): Remove task parameter and calls to unlock.
12898 (Archive::unlock_nested_archives): New function.
12899 (Archive::read_header): Add nested_off parameter. Change
12900 all callers.
12901 (Archive::interpret_header): Likewise.
12902 (Archive::include_all_members): Change to handle thin
12903 archives.
12904 (Archive::include_member): Likewise.
12905 * archive.h (Archive::Archive): Add new parameters and
12906 initializers.
12907 (Archive::armagt): New const.
12908 (Archive::setup): Remove task parameter.
12909 (Archive::unlock_nested_archives): New function.
12910 (Archive::read_header): Add nested_off parameter.
12911 (Archive::interpret_header): Likewise.
12912 (Archive::Nested_archive_table): New typedef.
12913 (Archive::is_thin_archive_): New field.
12914 (Archive::nested_archives_): New field.
12915 (Archive::options_): New field.
12916 (Archive::dirpath_): New field.
12917 (Archive::task_): New field.
12918 * readsyms.cc (Read_symbols::do_read_symbols): Add check
12919 for thin archives. Pass additional parameters to
12920 Archive::Archive. Unlock the archive file after calling
12921 Archive::setup.
cd536b21 12922
479f6503
ILT
129232008-03-29 Ian Lance Taylor <iant@google.com>
12924
686c8caf
ILT
12925 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
12926 version symbol to be local.
12927 * testsuite/ver_test_4.sh: New file.
12928 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
12929 (check_DATA): Add ver_test_4.syms.
12930 (ver_test_4.syms): New target.
12931 * testsuite/Makefile.in: Rebuild.
12932
ab794b6b
ILT
12933 * output.cc
12934 (Output_section::Input_section_sort_entry::has_priority): New
12935 function.
12936 (Output_section::Input_section_sort_entry::match_file_name): New
12937 function.
12938 (Output_section::Input_section_sort_entry::match_section_name):
12939 Remove.
12940 (Output_section::Input_section_sort_entry::match_section_name_prefix):
12941 Remove.
12942 (Output_section::Input_section_sort_entry::match_section_file):
12943 Remove.
12944 (Output_section::Input_section_sort_compare::operator()): Rewrite
12945 using new Input_section_sort_entry functions. Sort crtbegin and
12946 crtend first. Sort sections with no priority before sections with
12947 a priority.
12948 * testsuite/initpri1.c (d3): Check j != 4.
12949 (cd5): New constructor/destructor function.
12950 (main): Check j != 2.
12951
479f6503
ILT
12952 * symtab.cc (Symbol_table::add_from_object): If we don't use the
12953 new symbol when resolving, don't call set_is_default.
12954 * testsuite/ver_test_7.cc: New file.
12955 * testsuite/ver_test_7.sh: New file.
12956 * testsuite/Makefile.am (ver_test_7.so): New target.
12957 (ver_test_7.o): New target.
12958 (check_SCRIPTS): Add ver_test_7.sh.
12959 (check_DATA): Add ver_test_7.syms.
12960 (ver_test_7.syms): New target.
12961
2fd32231
ILT
129622008-03-28 Ian Lance Taylor <iant@google.com>
12963
12964 * layout.cc (Layout::layout): If we see an input section with a
12965 name that needs sorting, set the must_sort flag for the output
12966 section.
12967 (Layout::make_output_section): If the name of the output section
12968 indicates that it might require sorting, set the may_sort flag.
12969 * output.h (Output_section::may_sort_attached_input_sections): New
12970 function.
12971 (Output_section::set_may_sort_attached_input_sections): New
12972 function.
12973 (Output_section::must_sort_attached_input_sections): New
12974 function.
12975 (Output_section::set_must_sort_attached_input_sections): New
12976 function.
12977 (class Output_section): Declare Input_section_sort_entry. Define
12978 Input_section_sort_compare. Declare
12979 sort_attached_input_sections. Add new fields:
12980 may_sort_attached_input_sections_,
12981 must_sort_attached_input_sections_,
12982 attached_input_sections_are_sorted_.
12983 * output.cc (Output_section::Output_section): Initialize new
12984 fields.
12985 (Output_section::add_input_section): Add an entry to
12986 input_sections_ if may_sort or must_sort are true.
12987 (Output_section::set_final_data_size): Call
12988 sort_attached_input_sections if necessary.
12989 (Output_section::Input_section_sort_entry): Define new class.
12990 (Output_section::Input_section_sort_compare::operator()): New
12991 function.
12992 (Output_section::sort_attached_input_sections): New function.
12993 * configure.ac: Check whether the compiler supports constructor
12994 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
12995 * testsuite/initpri1.c: New file.
12996 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
12997 CONSTRUCTOR_PRIORITY.
12998 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
12999 (initpri1_LDFLAGS): New variable.
13000 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
13001
18e6b24e
ILT
130022008-03-27 Ian Lance Taylor <iant@google.com>
13003
49bdd526
ILT
13004 * common.cc (Sort_commons::operator): Correct sorting algorithm.
13005 * testsuite/common_test_1.c: New file.
13006 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
13007 (common_test_1_SOURCES): New variable.
13008 (common_test_1_DEPENDENCIES): New variable.
13009 (common_test_1_LDFLAGS): New variable.
13010
18e6b24e
ILT
13011 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
13012 and commons_ correctly when NAME/VERSION does not override
13013 NAME/NULL.
13014 * testsuite/ver_test_6.c: New file.
13015 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
13016 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
13017 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
13018
04bf7072
ILT
130192008-03-26 Ian Lance Taylor <iant@google.com>
13020
5871526f
ILT
13021 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
13022 of an undefined symbol from a version script.
13023 * testsuite/Makefile.am (ver_test_5.so): New target.
13024 (ver_test_5.o): New target.
13025 (check_SCRIPTS): Add ver_test_5.sh.
13026 (check_DATA): Add ver_test_5.syms.
13027 (ver_test_5.syms): New target.
13028 * testsuite/ver_test_5.cc: New file.
13029 * testsuite/ver_test_5.script: New file.
13030 * testsuite/ver_test_5.sh: New file.
13031 * Makefile.in, testsuite/Makefile.in: Rebuild.
13032
04bf7072
ILT
13033 PR gold/5986
13034 Fix problems building gold with gcc 4.3.0.
13035 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
13036 (gold_error_at_location, gold_warning_at_location): Use it.
13037 * configure.ac: Check whether we can compile and use a template
13038 function with a printf attribute.
13039 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
13040 when jumping over bytes.
13041 * object.cc: Instantiate Object::read_section_data.
13042 * debug.h: Include <cstring>
13043 * dwarf_reader.cc: Include <algorithm>
13044 * main.cc: Include <cstring>.
13045 * options.cc: Include <cstring>.
13046 * output.cc: Include <cstring>.
13047 * script.cc: Include <cstring>.
13048 * script.h: Include <string>.
13049 * symtab.cc: Include <cstring> and <algorithm>.
13050 * target-select.cc: Include <cstring>.
13051 * version.cc: Include <string>.
13052 * testsuite/testmain.cc: Include <cstdlib>.
13053 * configure, config.in: Rebuild.
13054
874c5b28
ILT
130552008-03-25 Ian Lance Taylor <iant@google.com>
13056
819d6c3a
ILT
13057 * options.cc: Include "../bfd/bfdver.h".
13058 (options::help): Print bug reporting address.
13059
f4b2c6f5
ILT
13060 * version.cc (print_version): Adjust output for current value of
13061 BFD_VERSION_STRING.
13062
13063 * NEWS: New file.
13064
e96caa79
ILT
13065 * options.cc (options::help): Print list of supported targets.
13066 * target-select.h: Include <vector>.
13067 (class Target_selector): Make machine_, size_, and is_big_endian_
13068 fields const. Add bfd_name_ and instantiated_target_ fields.
13069 (Target_selector::Target_selector): Add bfd_name parameter.
13070 (Target_selector::recognize): Make non-virtual, call
13071 do_recognize.
13072 (Target_selector::recognize_by_name): Make non-virtual, call
13073 do_recognize_by_name.
13074 (Target_selector::supported_names): New function.
13075 (Target_selector::bfd_name): New function.
13076 (Target_selector::do_instantiate_target): New pure virtual
13077 function.
13078 (Target_selector::do_recognize): New virtual function.
13079 (Target_selector::do_recognize_by_name): New virtual function.
13080 (Target_selector::instantiate_target): New private function.
13081 (supported_target_names): Declare.
13082 * target-select.cc (Target_selector::Target_selector): Update for
13083 new parameter and fields.
13084 (select_target_by_name): Check that the name matches before
13085 calling recognize_by_name.
13086 (supported_target_names): New function.
13087 * i386.cc (class Target_selector_i386): Update Target_selector
13088 constructor call. Remove recognize and recognize_by_name. Add
13089 do_instantiate_target.
13090 * x86_64.cc (class Target_selector_x86_64): Likewise.
13091 * testsuite/testfile.cc (class Target_selector_test): Update for
13092 changes to Target_selector.
13093
874c5b28
ILT
13094 * README: Rewrite, with some notes on unsupported features.
13095
0a65a3a7
CC
130962008-03-24 Cary Coutant <ccoutant@google.com>
13097
13098 * i386.cc (Target_i386::Got_type): New enum declaration.
13099 (Target_i386::Scan::local): Updated callers of Output_data_got
13100 member functions.
13101 (Target_i386::Scan::global): Likewise.
13102 (Target_i386::Relocate::relocate): Likewise.
13103 (Target_i386::Relocate::relocate_tls): Likewise.
13104 * object.h (Got_offset_list): New class.
13105 (Sized_relobj::local_has_got_offset): Added got_type parameter.
13106 (Sized_relobj::local_got_offset): Likewise.
13107 (Sized_relobj::set_local_got_offset): Likewise.
13108 (Sized_relobj::local_has_tls_got_offset): Removed.
13109 (Sized_relobj::local_tls_got_offset): Removed.
13110 (Sized_relobj::set_local_tls_got_offset): Removed.
13111 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
13112 * output.cc (Output_data_got::add_global): Added got_type parameter.
13113 (Output_data_got::add_global_with_rel): Likewise.
13114 (Output_data_got::add_global_with_rela): Likewise.
13115 (Output_data_got::add_global_pair_with_rel): New function.
13116 (Output_data_got::add_global_pair_with_rela): New function.
13117 (Output_data_got::add_local): Added got_type parameter.
13118 (Output_data_got::add_local_with_rel): Likewise.
13119 (Output_data_got::add_local_with_rela): Likewise.
13120 (Output_data_got::add_local_pair_with_rel): New function.
13121 (Output_data_got::add_local_pair_with_rela): New function.
13122 (Output_data_got::add_global_tls): Removed.
13123 (Output_data_got::add_global_tls_with_rel): Removed.
13124 (Output_data_got::add_global_tls_with_rela): Removed.
13125 (Output_data_got::add_local_tls): Removed.
13126 (Output_data_got::add_local_tls_with_rel): Removed.
13127 (Output_data_got::add_local_tls_with_rela): Removed.
13128 * output.h (Output_data_got::add_global): Added got_type parameter.
13129 (Output_data_got::add_global_with_rel): Likewise.
13130 (Output_data_got::add_global_with_rela): Likewise.
13131 (Output_data_got::add_global_pair_with_rel): New function.
13132 (Output_data_got::add_global_pair_with_rela): New function.
13133 (Output_data_got::add_local): Added got_type parameter.
13134 (Output_data_got::add_local_with_rel): Likewise.
13135 (Output_data_got::add_local_with_rela): Likewise.
13136 (Output_data_got::add_local_pair_with_rel): New function.
13137 (Output_data_got::add_local_pair_with_rela): New function.
13138 (Output_data_got::add_global_tls): Removed.
13139 (Output_data_got::add_global_tls_with_rel): Removed.
13140 (Output_data_got::add_global_tls_with_rela): Removed.
13141 (Output_data_got::add_local_tls): Removed.
13142 (Output_data_got::add_local_tls_with_rel): Removed.
13143 (Output_data_got::add_local_tls_with_rela): Removed.
13144 * resolve.cc (Symbol::override_base_with_special): Removed
13145 reference to has_got_offset_ field.
13146 * symtab.cc (Symbol::init_fields): Replaced initialization
13147 of got_offset_ with got_offsets_. Removed initialization
13148 of has_got_offset_
53fcba31 13149 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
13150 (Symbol::got_offset): Likewise.
13151 (Symbol::set_got_offset): Likewise.
13152 (Symbol::has_tls_got_offset): Removed.
13153 (Symbol::tls_got_offset): Removed.
13154 (Symbol::set_tls_got_offset): Removed.
13155 (Symbol::got_offset_): Removed.
13156 (Symbol::tls_mod_got_offset_): Removed.
13157 (Symbol::tls_pair_got_offset_): Removed.
13158 (Symbol::got_offsets_): New field.
13159 (Symbol::has_got_offset): Removed.
13160 (Symbol::has_tls_mod_got_offset): Removed.
13161 (Symbol::has_tls_pair_got_offset): Removed.
13162 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
13163 (Target_x86_64::Scan::local): Updated callers of Output_data_got
13164 member functions.
13165 (Target_x86_64::Scan::global): Likewise.
13166 (Target_x86_64::Relocate::relocate): Likewise.
13167 (Target_x86_64::Relocate::relocate_tls): Likewise.
13168
bd52eafb
BE
131692008-03-25 Ben Elliston <bje@au.ibm.com>
13170
13171 * yyscript.y: Fix spelling error in comment.
13172
8b105e34
ILT
131732008-03-24 Ian Lance Taylor <iant@google.com>
13174
8ed814a9
ILT
13175 * options.h (class General_options): Define build_id option.
13176 * layout.h (class Layout): Declare write_build_id, create_note,
13177 create_build_id. Add build_id_note_ member.
13178 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
13179 "libiberty.h", "md5.h", "sha1.h".
13180 (Layout::Layout): Initialize eh_frame_data_,
13181 eh_frame_hdr_section_, and build_id_note_.
13182 (Layout::finalize): Call create_build_id.
13183 (Layout::create_note): New function, broken out of
13184 Layout::create_gold_note.
13185 (Layout::create_gold_note): Call create_note.
13186 (Layout::create_build_id): New function.
13187 (Layout::write_build_id): New function.
13188 (Close_task_runner::run): Call write_build_id.
13189
8b105e34
ILT
13190 * x86_64.cc: Correct license to GPLv3.
13191
086a1841
ILT
131922008-03-23 Ian Lance Taylor <iant@google.com>
13193
13194 * options.cc: Include "demangle.h".
13195 (parse_optional_string): New function.
13196 (parse_long_option): Handle takes_optional_argument.
13197 (parse_short_option): Update dash_z initializer. Handle
13198 takes_optional_argument.
13199 (General_options::General_options): Initialize do_demangle_.
13200 (General_options::finalize): Set do_demangle_. Handle demangling
13201 style.
13202 * options.h (parse_optional_string): Declare.
13203 (struct One_option): Add optional_arg field. Update constructor.
13204 Update call constructor calls. Add takes_optional_argument
13205 function.
13206 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
13207 (DEFINE_optional_string): Define.
13208 (General_options::demangle): Change from DEFINE_bool to
13209 DEFINE_optional_string.
13210 (General_options::no_demangle): New function.
13211 (General_options::do_demangle): New function.
13212 (General_options::set_do_demangle): New function.
13213 (General_options::execstack_status_): Move definition to end of
13214 class definition.
13215 (General_options::static_): Likewise.
13216 (General_options::do_demangle_): New field.
13217 * object.cc (big_endian>::get_symbol_location_info): Call
13218 Options::do_demangle, not Options::demangle.
13219 * symtab.cc (demangle): Likewise.
13220
cbb93e63
ILT
132212008-03-22 Ian Lance Taylor <iant@google.com>
13222
13223 * gold.h: Include <cstddef> and <sys/types.h>
13224 * options.h: Include <cstring>.
13225
ec531623
ILT
132262008-03-21 Ian Lance Taylor <iant@google.com>
13227
13228 * Added source code to GNU binutils.
This page took 0.77587 seconds and 4 git commands to generate.