2012-05-23 Stan Shebs <stan@codesourcery.com>
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
9b689de0
CC
12012-05-23 Cary Coutant <ccoutant@google.com>
2
3 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
4 more carefully.
5
b24fdbf5
CC
62012-05-22 Cary Coutant <ccoutant@google.com>
7
8 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
9 object before exporting symbol.
10
e550e1a2
L
112012-05-21 H.J. Lu <hongjiu.lu@intel.com>
12
13 * testsuite/tls_test.cc: Include "config.h" first.
14 * testsuite/tls_test_c.c: Likewise.
15
df7b86aa
NC
162012-05-17 Daniel Richard G. <skunk@iskunk.org>
17 Nick Clifton <nickc@redhat.com>
18
19 PR 14072
20 * configure.in: Add check that sysdep.h has been included before
21 any system header files.
22 * configure: Regenerate.
23 * config.in: Regenerate.
24
1007b503
CC
252012-05-14 Cary Coutant <ccoutant@google.com>
26
27 * layout.cc (Layout::make_output_section): Mark .tdata section
28 as RELRO.
29 * testsuite/relro_test.cc: Add a TLS variable.
30
fd885f3a
L
312012-05-10 H.J. Lu <hongjiu.lu@intel.com>
32
33 PR gold/14091
34 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
35 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
36 R_X86_64_64.
37
80f5885c
CC
382012-05-08 Cary Coutant <ccoutant@google.com>
39
40 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
41 (lines_only_debug_sections): Likewise.
42
2e702c99
RM
432012-05-02 Roland McGrath <mcgrathr@google.com>
44
45 * nacl.cc: New file.
46 * nacl.h: New file.
47 * Makefile.am (CCFILES, HFILES): Add them.
48 * Makefile.in: Regenerate.
49 * i386.cc (Output_data_plt_i386_nacl): New class.
50 (Output_data_plt_i386_nacl_exec): New class.
51 (Output_data_plt_i386_nacl_dyn): New class.
52 (Target_i386_nacl): New class.
53 (Target_selector_i386_nacl): New class.
54 (target_selector_i386): Use it instead of Target_selector_i386.
55 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
56 (Target_x86_64_nacl): New class.
57 (Target_selector_x86_64_nacl): New class.
58 (target_selector_x86_64, target_selector_x32): Use it instead of
59 Target_selector_x86_64.
60 * arm.cc (Output_data_plt_arm_nacl): New class.
61 (Target_arm_nacl): New class.
62 (Target_selector_arm_nacl): New class.
63 (target_selector_arm, target_selector_armbe): Use it instead of
64 Target_selector_arm.
65
66 * target-select.cc (select_target): Take new Input_file* and off_t
67 arguments, pass them on to recognize method of selector.
68 * object.cc (make_elf_sized_object): Update caller.
69 * parameters.cc (parameters_force_valid_target): Likewise.
70 * incremental.cc (make_sized_incremental_binary): Likewise.
71 * target-select.h: Update decl.
72 (Target_selector::recognize): Take new Input_file* argument,
73 pass it on to do_recognize.
74 (Target_selector::do_recognize): Take new Input_file* argument.
75 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
76 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
77 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
78 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
79
80 * target.h (Target::Target_info): New members isolate_execinstr
81 and rosegment_gap.
82 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
83 * arm.cc (Target_arm::arm_info): Update initializer.
84 * i386.cc (Target_i386::i386_info): Likewise.
85 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
86 * sparc.cc (Target_sparc::sparc_info): Likewise.
87 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
88 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
89 * layout.cc (Layout::attach_allocated_section_to_segment):
90 Take new const Target* argument. If target->isolate_execinstr(), act
91 like --rosegment.
92 (Layout::find_first_load_seg): Take new const Target* argument;
93 if target->isolate_execinstr(), reject PF_X segments.
94 (Layout::relaxation_loop_body): Update caller.
95 (Layout::set_segment_offsets): If target->isolate_execinstr(),
96 reset file offset to zero when we hit LOAD_SEG, and then do a second
97 loop over the segments before LOAD_SEG to reassign offsets after
98 addresses have been determined. Handle target->rosegment_gap().
99 (Layout::attach_section_to_segment): Take new const Target* argument;
100 pass it to attach_allocated_section_to_segment.
101 (Layout::make_output_section): Update caller.
102 (Layout::attach_sections_to_segments): Take new const Target* argument;
103 pass it to attach_section_to_segment.
104 * gold.cc (queue_middle_tasks): Update caller.
105 * layout.h (Layout): Update method decls with new arguments.
106
107 * arm.cc (Target_arm::Target_arm): Take optional argument for the
108 Target_info pointer to use.
109 (Target_arm::do_make_data_plt): New virtual method.
110 (Target_arm::make_data_plt): New method that calls it.
111 (Target_arm::make_plt_entry): Use it.
112 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
113 for the section alignment.
114 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
115 method.
116 (Output_data_plt_arm::first_plt_entry_offset): Call it.
117 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
118 method.
119 (Output_data_plt_arm::get_plt_entry_size): Call it.
120 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
121 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
122 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
123 method.
124 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
125 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
126 method instead of sizeof(plt_entry).
127 (Output_data_plt_arm::add_entry): Likewise.
128 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
129 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
130 than static method.
131 (Target_arm::plt_entry_size): Likewise.
132 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
133 Move to ...
134 (Output_data_plt_arm_standard): ... here, new class.
135 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
136 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
137 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
138
139 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
140 Take additional argument for the PLT entry size.
141 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
142 Use get_plt_entry_size method rather than plt_entry_size variable.
143 (Output_data_plt_x86_64::reserve_slot): Likewise.
144 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
145 (Output_data_plt_x86_64::add_entry): Likewise.
146 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
147 (Output_data_plt_x86_64::address_for_global): Likewise.
148 (Output_data_plt_x86_64::address_for_local): Likewise.
149 (Output_data_plt_x86_64::set_final_data_size): Likewise.
150 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
151 Make method non-static.
152 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
153 method.
154 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
155 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
156 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
157 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
158 virtual method.
159 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
160 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
161 virtual method.
162 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
163 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
164 virtual method.
165 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
166 (Output_data_plt_x86_64::plt_entry_size)
167 (Output_data_plt_x86_64::first_plt_entry)
168 (Output_data_plt_x86_64::plt_entry)
169 (Output_data_plt_x86_64::tlsdesc_plt_entry)
170 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
171 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
172 (Output_data_plt_x86_64_standard): ... here, new class.
173 (Target_x86_64::Target_x86_64): Take optional argument for the
174 Target_info pointer to use.
175 (Target_x86_64::do_make_data_plt): New virtual method.
176 (Target_x86_64::make_data_plt): New method to call it.
177 (Target_x86_64::init_got_plt_for_update): Use that.
178 Call this->plt_->add_eh_frame method here.
179 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
180 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
181 rather than static method.
182 (Target_x86_64::plt_entry_size): Likewise.
183 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
184 rather than plt_entry_size variable. Move guts of PLT filling to...
185 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
186 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
187 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
188
189 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
190 additional argument for the section alignment.
191 Don't do add_eh_frame_for_plt here.
192 (Output_data_plt_i386::first_plt_entry_offset): Make the method
193 non-static. Use get_plt_entry_size method rather than plt_entry_size
194 variable.
195 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
196 method.
197 (Output_data_plt_i386::get_plt_entry_size): Call it.
198 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
199 (Output_data_plt_i386::add_eh_frame): New method to call it.
200 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
201 method.
202 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
203 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
204 method.
205 (Output_data_plt_i386::fill_plt_entry): New method to call it.
206 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
207 method instead of plt_entry_size.
208 (Output_data_plt_i386::plt_entry_size)
209 (Output_data_plt_i386::plt_eh_frame_fde_size)
210 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
211 (Output_data_plt_i386_standard): ... here, new class.
212 (Output_data_plt_i386_exec): New class.
213 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
214 (Output_data_plt_i386_exec::first_plt_entry): ... here.
215 (Output_data_plt_i386::exec_plt_entry): Move to ...
216 (Output_data_plt_i386_exec::plt_entry): ... here.
217 (Output_data_plt_i386_dyn): New class.
218 (Output_data_plt_i386::first_plt_entry): Move to ...
219 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
220 (Output_data_plt_i386::dyn_plt_entry): Move to ...
221 (Output_data_plt_i386_dyn::plt_entry): ... here.
222 (Target_i386::Target_i386): Take optional argument for the Target_info
223 pointer to use.
224 (Target_i386::do_make_data_plt): New virtual method.
225 (Target_i386::make_data_plt): New method to call it.
226 (Target_i386::make_plt_section): Use that.
227 Call this->plt_->add_eh_frame method here.
228 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
229 rather than plt_entry_size variable.
230 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
231 (Output_data_plt_i386::address_for_local): Likewise.
232 (Output_data_plt_i386::do_write): Likewise.
233 Move guts of PLT filling to...
234 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
235 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
236 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
237 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
238
b9b9f2ee
CC
2392012-05-01 Cary Coutant <ccoutant@google.com>
240
241 * dwarf_reader.cc (Dwarf_die::read_attributes)
242 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
243 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
244 * reduced_debug_output.cc
245 (Output_reduced_debug_info_section::get_die_end): Remove
246 DW_FORM_GNU_ref_index. Add default case.
247
57923f48
MW
2482012-04-26 Mark Wielaard <mjw@redhat.com>
249
250 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
251 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
252 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
253 DW_AT_high_pc as offset from DW_AT_low_pc.
254
255 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
256 * testsuite/Makefile.in: Regenerate.
257 * testsuite/gdb_index_test_3.c: New test source file.
258 * testsuite/gdb_index_test_3.sh: New test source file.
259
2c54b4f4
ILT
2602012-04-25 Ian Lance Taylor <iant@google.com>
261
262 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
263 pointer.
264 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
265 as a class, not a struct.
266 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
267 (Target_arm::apply_cortex_a8_workaround): Likewise.
268 * gc.h: Declare Reloc_types as a struct, not a class.
269 * object.h: Declare Symbols_data as a struct.
270 * reloc.h: Declare Read_relocs_data as a struct.
271 * target.h: Declare Relocate_info as a struct.
272
a5a5f7a3
DM
2732012-04-24 David S. Miller <davem@davemloft.net>
274
275 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
276 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
277 and R_SPARC_WPLT30.
278
f038d496
CC
2792012-04-24 Cary Coutant <ccoutant@google.com>
280
281 * incremental-dump.cc (find_input_containing_global): Replace
282 magic number with symbolic constant.
283 (dump_incremental_inputs): Update version number.
284 * incremental.cc (Output_section_incremental_inputs): Update version
285 number; import symbolic constants from Incremental_inputs_reader.
286 (Incremental_inputs::create_data_sections): Align relocations
287 section correctly for 64-bit targets.
288 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
289 constants; add padding.
290 (Output_section_incremental_inputs::write_header): Add assert for
291 header_size.
292 (Output_section_incremental_inputs::write_input_files): Add assert
293 for input_entry_size.
294 (Output_section_incremental_inputs::write_info_blocks): Add padding;
295 add assert for object_info_size, input_section_entry_size,
296 global_sym_entry_size.
297 * incremental.h (Incremental_inputs_reader): Add symbolic constants
298 for data structure sizes; use them.
299 (Incremental_input_entry_reader): Import symbolic constants from
300 Incremental_inputs_reader; use them.
301
a4d85145
DM
3022012-04-23 David S. Miller <davem@davemloft.net>
303
304 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
305 and elf_flags_set_.
306 (Target_sparc::Target_sparc): Initialize new fields.
307 (Target_sparc::do_make_elf_object): New function.
308 (Target_sparc::do_adjust_elf_header): New function.
309
1d509098
CC
3102012-04-23 Cary Coutant <ccoutant@google.com>
311
312 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
313 CU range table of gdb index.
314
7ebeff7f
DM
3152012-04-20 David S. Miller <davem@davemloft.net>
316
317 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
318 instead of false.
319
13cf9988
DM
3202012-04-16 David S. Miller <davem@davemloft.net>
321
2a1079e8
DM
322 * sparc.cc (Target_sparc::got_address): New function.
323 (Sparc_relocate_functions::gdop_hix22): New function.
324 (Sparc_relocate_functions::gdop_lox10): New function.
325 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
326 relocs.
327 (Target_sparc::Scan::local): Likewise if the global symbol is not
328 preemptible and is not IFUNC.
329 (Target_sparc::Relocate::relocate): Perform GOTDATA code
330 transformations for local and non-preemptible non-IFUNC global
331 symbols.
332
0bc964fc
DM
333 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
334 writing out 64-bit part of ranges.
335
661d7a80
DM
336 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
337 -fpic and -fpie respectively.
338 * Makefile.in: Regenerate.
339
8c2bf391
DM
340 * sparc.cc (class Target_sparc): Add rela_ifunc_.
341 (Target_sparc::Target_sparc): Initialize new field.
342 (Target_sparc::do_plt_section_for_global): New function.
343 (Target_sparc::do_plt_section_for_local): New function.
344 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
345 (Target_sparc::make_plt_section): New function, broken out of
346 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
347 (Target_sparc::make_plt_entry): Call make_plt_section.
348 (Target_sparc::make_local_ifunc_plt_entry): New function.
349 (Target_sparc::rela_ifunc_section): New function.
350 (Target_sparc::plt_section): Remove const.
351 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
352 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
353 and ifunc_count_ fields.
354 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
355 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
356 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
357 (Output_data_plt_sparc::rela_ifunc): New function.
358 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
359 (Output_data_plt_sparc::has_ifunc_section): New function.
360 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
361 (Output_data_plt_sparc::address_for_global): New function.
362 (Output_data_plt_sparc::address_for_local): New function.
363 (Output_data_plt_sparc::plt_index_to_offset): New function.
364 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
365 and entry_count.
366 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
367 entry_count.
368 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
369 R_SPARC_JMP_IREL to switch.
370 (Target_sparc::Scan::check_non_pic): Likewise.
371 (Target_sparc::Scan::local): Handle IFUNC symbols.
372 (Target_sparc::Scan::local): Likewise.
373 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
374 and plt_address_for_local.
375 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
376 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
377
13cf9988
DM
378 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
379 (class Output_data_reloc): Adjust calls to Output_reloc_type.
380 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
381 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
382 global relocs too.
383 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
384 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
385 calls.
386 * sparc.cc (Target_sparc::Scan::global): Likewise.
387 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
388
31821be0
CC
3892012-04-16 Cary Coutant <ccoutant@google.com>
390
391 * archive.cc (Library_base::should_include_member): Check for
392 --export-dynamic-symbol.
393 * options.h (class General_options): Add --export-dynamic-symbol.
394 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
395 --export-dynamic-symbol.
396 (Symbol_table::gc_mark_undef_symbols): Likewise.
397 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
398
2615994e
DM
3992012-04-12 David S. Miller <davem@davemloft.net>
400
401 * sparc.cc (Reloc::wdisp10): New relocation method.
402 (Reloc::h34): Likewise.
403 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
404 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
405 R_SPARC_WDISP10.
406 (Target_sparc::Scan::local): Likewise.
407 (Target_sparc::Scan::global): Likewise.
408 (Target_sparc::Relocate::relocate): Likewise.
409
6782735d
CC
4102012-04-09 Cary Coutant <ccoutant@google.com>
411
412 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
413 low_pc == 0.
414
8c7a0b00
ILT
4152012-04-06 Ian Lance Taylor <iant@google.com>
416
417 * timer.cc: #include <unistd.h>.
418
58797674
RM
4192012-04-06 Roland McGrath <mcgrathr@google.com>
420
421 * configure.in (AC_CHECK_HEADERS): Add locale.h.
422 * config.in: Regenerate.
423 * configure: Regenerate.
424
44350750
NC
4252012-04-05 Nick Clifton <nickc@redhat.com>
426
427 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
428 (AM_LC_MESSAGES): Add.
429 * aclocal.m4: Regenerate.
430 * config.in: Regenerate.
431 * configure: Regenerate.
432
c1027032
CC
4332012-03-21 Cary Coutant <ccoutant@google.com>
434
435 * Makefile.am: Add gdb-index.cc, gdb-index.h.
436 * Makefile.in: Regenerate.
437 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
438 (Sized_elf_reloc_mapper::symbol_section): New function.
439 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
440 (make_elf_reloc_mapper): New function.
441 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
442 (Dwarf_abbrev_table::do_read_abbrevs): New function.
443 (Dwarf_abbrev_table::do_get_abbrev): New function.
444 (Dwarf_ranges_table::read_ranges_table): New function.
445 (Dwarf_ranges_table::read_range_list): New function.
446 (Dwarf_pubnames_table::read_section): New function.
447 (Dwarf_pubnames_table::read_header): New function.
448 (Dwarf_pubnames_table::next_name): New function.
449 (Dwarf_die::Dwarf_die): New function.
450 (Dwarf_die::read_attributes): New function.
451 (Dwarf_die::skip_attributes): New function.
452 (Dwarf_die::set_name): New function.
453 (Dwarf_die::set_linkage_name): New function.
454 (Dwarf_die::attribute): New function.
455 (Dwarf_die::string_attribute): New function.
456 (Dwarf_die::int_attribute): New function.
457 (Dwarf_die::uint_attribute): New function.
458 (Dwarf_die::ref_attribute): New function.
459 (Dwarf_die::child_offset): New function.
460 (Dwarf_die::sibling_offset): New function.
461 (Dwarf_info_reader::check_buffer): New function.
462 (Dwarf_info_reader::parse): New function.
463 (Dwarf_info_reader::do_parse): New function.
464 (Dwarf_info_reader::do_read_string_table): New function.
465 (Dwarf_info_reader::lookup_reloc): New function.
466 (Dwarf_info_reader::get_string): New function.
467 (Dwarf_info_reader::visit_compilation_unit): New function.
468 (Dwarf_info_reader::visit_type_unit): New function.
469 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
470 Sized_elf_reloc_mapper.
471 (Sized_dwarf_line_info::symbol_section): Remove function.
472 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
473 (Sized_dwarf_line_info::read_line_mappings): Remove object
474 parameter, adjust callers.
475 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
476 * dwarf_reader.h: Include <sys/types.h>.
477 (class Track_relocs): Remove forward declaration.
478 (class Elf_reloc_mapper): New class.
479 (class Sized_elf_reloc_mapper): New class.
480 (class Dwarf_abbrev_table): New class.
481 (class Dwarf_range_list): New class.
482 (class Dwarf_ranges_table): New class.
483 (class Dwarf_pubnames_table): New class.
484 (class Dwarf_die): New class.
485 (class Dwarf_info_reader): New class.
486 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
487 (Sized_dwarf_line_info::symbol_section): Remove member function.
488 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
489 base class.
490 * gdb-index.cc: New source file.
491 * gdb-index.h: New source file.
492 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
493 and .debug_types sections, call Layout::add_to_gdb_index.
494 (Sized_relobj_incr::do_section_name): Implement.
495 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
496 return type; Implement.
497 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
498 return type.
499 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
500 parameter list and return type.
501 (Sized_incr_dynobj::do_section_contents): Likewise.
502 * layout.cc: Include gdb-index.h.
503 (Layout::Layout): Initialize gdb_index_data_.
504 (Layout::init_fixed_output_section): Check for .gdb_index section.
505 (Layout::add_to_gdb_index): New function. Instantiate.
506 * layout.h: Add forward declaration for class Gdb_index.
507 (Layout::add_to_gdb_index): New member function.
508 (Layout::gdb_index_data_): New data member.
509 * main.cc: Include gdb-index.h.
510 (main): Print statistics for gdb index.
511 * object.cc (Object::section_contents): Move code into
512 do_section_contents.
513 (need_decompressed_section): Check for sections needed when building
514 gdb index.
515 (build_compressed_section_map): Likewise.
516 (Sized_relobj_file::do_read_symbols): Need local symbols when building
517 gdb index.
518 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
519 sections; call Layout::add_to_gdb_index.
520 (Sized_relobj_file::do_decompressed_section_contents): Call
521 do_section_contents directly.
522 * object.h (Object::do_section_contents): Adjust parameter list and
523 return type.
524 (Object::do_decompressed_section_contents): Call do_section_contents
525 directly.
526 (Sized_relobj_file::do_section_contents): Adjust parameter list and
527 return type.
528 * options.h (class General_options): Add --gdb-index option.
529 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
530 list and return type.
531 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
532 * reloc.h (Track_relocs::checkpoint): New function.
533 (Track_relocs::reset): New function.
534
535 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
536 New test cases.
537 * testsuite/Makefile.in: Regenerate.
538 * testsuite/gdb_index_test.cc: New test source file.
539 * testsuite/gdb_index_test_1.sh: New test source file.
540 * testsuite/gdb_index_test_2.sh: New test source file.
541
647f1574
DK
5422012-03-19 Doug Kwan <dougkwan@google.com>
543
544 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 545 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
546 __exidx_start and __exidx_end. Make symbol table parameter
547 anonymous as it is not used.
548 * gold.cc (queue_middle_tasks): Call target hook to define any
549 target-specific symbols.
550 * target.h (Target::define_standard_symbols): New method.
551 (Target::do_define_standard_symbols): Same.
552 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
553 * testsuite/Makefile.in: Regenerate.
554 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
555 and __exidx_end.
556 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
557 relocations are generated for __exidx_start and __exidx_end.
558
7c6109da
DK
5592012-03-16 Doug Kwan <dougkwan@google.com>
560
561 * testsuite/Makefile.am: Disable test initpri3b.
562 * testsuite/Makefile.in: Regenerate.
563
7b8957f8
DK
5642012-03-15 Doug Kwan <dougkwan@google.com>
565
566 * arm.cc (Target_arm::got_section): Make .got section read-only
567 if -z now is given.
568
14dc9ef7
ILT
5692012-03-15 Ian Lance Taylor <iant@google.com>
570
571 PR gold/13850
572 * layout.cc (Layout::make_output_section): Correctly mark
573 SHT_INIT_ARRAY, et. al., as relro.
574
fa40b62a
DK
5752012-03-14 Doug Kwan <dougkwan@google.com>
576
577 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
578 dynamic relocations for protected symbols in shared objects.
579
fd325007
ILT
5802012-03-13 Ian Lance Taylor <iant@google.com>
581
582 * resolve.cc (Symbol_table::resolve): When merging common symbols,
583 keep the larger alignment.
584
e8dd54e1
CC
5852012-03-12 Cary Coutant <ccoutant@google.com>
586
587 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
588 handling of DW_LNE_define_file.
589
feb5f3b0
CC
5902012-03-12 Cary Coutant <ccoutant@google.com>
591
592 * reduced_debug_output.cc
593 (Output_reduced_debug_info_section::get_die_end): Add new FORM
594 codes to switch.
595
a1fb4256
CC
5962012-02-29 Cary Coutant <ccoutant@google.com>
597
598 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
599
5dd8762a
CC
6002012-02-29 Cary Coutant <ccoutant@google.com>
601
602 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
603 Call Object::decompressed_section_contents.
604 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
605 New dtor.
606 (Sized_dwarf_line_info::buffer_start_): New data member.
607 * merge.cc (Output_merge_data::do_add_input_section): Call
608 Object::decompressed_section_contents.
609 (Output_merge_string::do_add_input_section): Likewise.
610 * object.cc (need_decompressed_section): New function.
611 (build_compressed_section_map): Decompress sections needed later.
612 (Sized_relobj_file::do_decompressed_section_contents): New function.
613 (Sized_relobj_file::do_discard_decompressed_sections): New function.
614 * object.h (Object::decompressed_section_contents): New function.
615 (Object::discard_decompressed_sections): New function.
616 (Object::do_decompressed_section_contents): New function.
617 (Object::do_discard_decompressed_sections): New function.
618 (Compressed_section_info): New type.
619 (Compressed_section_map): Include decompressed section contents.
620 (Sized_relobj_file::do_decompressed_section_contents): New function.
621 (Sized_relobj_file::do_discard_decompressed_sections): New function.
622
7b5de7ee
CC
6232012-02-16 Cary Coutant <ccoutant@google.com>
624
625 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
626 * testsuite/Makefile.in: Regenerate.
627
f9fa4a63
CC
6282012-02-14 Cary Coutant <ccoutant@google.com>
629
630 * options.cc (General_options::finalize): Disallow -pie and -static.
631
2c175ebc
DK
6322012-02-03 Doug Kwan <dougkwan@google.com>
633
634 * arm.cc (Arm_relocate_functions::abs8,
635 Arm_relocate_functions::abs16): Use
636 Bits::has_signed_unsigned_overflow32.
637 (Arm_relocate_functions::thm_abs8): Correct range of
638 overflow check.
639 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
640 in assertions.
641
90cff06f
DK
6422012-02-02 Doug Kwan <dougkwan@google.com>
643
644 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
645 position independent outputs, not just shared objects.
646
63887f3d
L
6472012-01-30 H.J. Lu <hongjiu.lu@intel.com>
648
649 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
650 * configure: Regenerated.
651
bef2b434
ILT
6522012-01-27 Ian Lance Taylor <iant@google.com>
653
654 * reloc.h (Bits): New class with static functions, copied from
655 namespace utils in arm.cc.
656 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
657 instead.
658
c335b55d
L
6592012-01-27 H.J. Lu <hongjiu.lu@intel.com>
660
661 * incremental.cc (write_info_blocks): Correct relocation offset.
662
41194d9f
L
6632012-01-27 H.J. Lu <hongjiu.lu@intel.com>
664
665 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
666 (Relocate::tls_gd_to_le): Likewise.
667
1bae613c
L
6682012-01-27 H.J. Lu <hongjiu.lu@intel.com>
669
670 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
671
24482ca0
L
6722012-01-27 H.J. Lu <hongjiu.lu@intel.com>
673
674 * configure.ac: Check if -mcmodel=medium works.
675 * configure: Regenerated.
676
c2c7840a
CC
6772012-01-24 Cary Coutant <ccoutant@google.com>
678
679 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
680 definition and ...
681 (read_unsigned_LEB_128_x): ... this new function.
682 (read_signed_LEB_128): Replaced with inline definition and ...
683 (read_signed_LEB_128_x): ... this new function.
684 * int_encoding.h (read_unsigned_LEB_128_x): New function.
685 (read_unsigned_LEB_128): Add inline definition.
686 (read_signed_LEB_128_x): New function.
687 (read_signed_LEB_128): Add inline definition.
688 * testsuite/Makefile.am (leb128_unittest): New unit test.
689 * testsuite/Makefile.in: Regenerate.
690 * testsuite/leb128_unittest.cc: New unit test.
691
833de760 6922012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
693
694 PR gold/13617
695 * i386.cc (Target_i386::do_code_fill): When using a jmp
696 instruction, pad with nop instructions.
697 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
698
618d6666
L
6992012-01-22 H.J. Lu <hongjiu.lu@intel.com>
700
701 * x86_64.cc (gc_process_relocs): Add typename on types used in
702 template.
703 (scan_relocs): Likewise.
704 (relocate_section): Likewise.
705 (apply_relocation): Likewise.
706
3660ff06
L
7072012-01-10 H.J. Lu <hongjiu.lu@intel.com>
708
709 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
710 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
711 under x32.
712
fc51264f
L
7132012-01-09 H.J. Lu <hongjiu.lu@intel.com>
714
715 * x86_64.cc: Initial support for x32.
716
dd74ae06
CC
7172012-01-03 Cary Coutant <ccoutant@google.com>
718
719 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
720 Use abstract base class for GOT.
721 * gold/output.h (class Output_data_got_base): New abstract base class.
722 (class Output_data_got): Derive from new base class, adjust ctors.
723 (Output_data_got::reserve_slot): Make virtual; rename to
724 do_reserve_slot; Adjust callers.
725 * gold/target.h (Sized_target::init_got_plt_for_update): Return
726 pointer to abstract base class.
727 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
728
83896202
ILT
7292011-12-18 Ian Lance Taylor <iant@google.com>
730
731 * object.h (Relobj::local_symbol_value): New function.
732 (Relobj::local_plt_offset): New function.
733 (Relobj::local_has_got_offset): New function.
734 (Relobj::local_got_offset): New function.
735 (Relobj::set_local_got_offset): New function.
736 (Relobj::do_local_symbol_value): New pure virtual function.
737 (Relobj::do_local_plt_offset): Likewise.
738 (Relobj::do_local_has_got_offset): Likewise.
739 (Relobj::do_local_got_offset): Likewise.
740 (Relobj::do_set_local_got_offset): Likewise.
741 (Sized_relobj::do_local_has_got_offset): Rename from
742 local_has_got_offset.
743 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
744 (Sized_relobj::do_set_local_got_offset): Rename from
745 set_local_got_offset.
746 (Sized_relobj_file::do_local_plt_offset): Rename from
747 local_plt_offset.
748 (Sized_relobj_file::do_local_symbol_value): New function.
749 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
750 local_plt_offset.
751 * output.cc (Output_data_got::Got_entry::write): Change object to
752 Relobj. Use local_symbol_value.
753 (Output_data_got::add_global_with_rel): Change rel_dyn to
754 Output_data_reloc_generic*. Use add_global_generic.
755 (Output_data_got::add_global_with_rela): Remove. Change all
756 callers to use add_global_with_rel.
757 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
758 Output_data_reloc_generic*. Use add_global_generic.
759 (Output_data_got::add_global_pair_with_rela): Remove. Change all
760 callers to use add_global_pair_with_rel.
761 (Output_data_got::add_local): Change object to Relobj*.
762 (Output_data_got::add_local_plt): Likewise.
763 (Output_data_got::add_local_with_rel): Change object to Relobj*,
764 change rel_dyn to Output_data_reloc_generic*. Use
765 add_local_generic.
766 (Output_data_got::add_local_with_rela): Remove. Change all
767 callers to use all_local_with_rel.
768 (Output_data_got::add_local_pair_with_rel): Change object to
769 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
770 add_output_section_generic.
771 (Output_data_got::add_local_pair_with_rela): Remove. Change all
772 callers to use add_local_pair_with_rel.
773 (Output_data_got::reserve_local): Change object to Relobj*.
774 * output.h: (class Output_data_reloc_generic): Add pure virtual
775 declarations for add_global_generic, add_local_generic,
776 add_output_section_generic.
777 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
778 functions for Output_data_reloc_generic. Update declarations for
779 changes listed in output.cc.
780 (class Output_data_got): Change template parameter to got_size.
781 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
782 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
783 function.
784 (Sized_relobj_incr::do_local_plt_offset): New function.
785 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
786 add_global_generic.
787
76677ad0
CC
7882011-12-17 Cary Coutant <ccoutant@google.com>
789
790 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
791 * resolve.cc (Symbol_table::resolve): Likewise.
792 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
793 arrays.
794 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
795
8b8dd8d5
ILT
7962011-12-16 Ian Lance Taylor <iant@google.com>
797
798 * output.h (Output_data_reloc_generic::add): Only call
799 add_dynamic_reloc if this is a dynamic reloc section.
800
d55525b9
L
8012011-12-15 H.J. Lu <hongjiu.lu@intel.com>
802
803 PR gold/13505
804 * target-reloc.h (apply_relocation): Replace <64, false> with
805 <size, big_endian>.
806
ff81c7c1
NC
8072011-11-25 Nick Clifton <nickc@redhat.com>
808
809 * po/it.po: New Italian translation.
810
628f39be
SA
8112011-11-17 Sterling Augustine <saugustine@google.com>
812
813 * script.cc (script_include_directive): Implement.
814 (read_script_file): New local variables name and search_path. Update
815 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
816 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
817 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
818
98ef3ea4
SA
8192011-11-11 Sterling Augustine <saugustine@google.com>
820
821 * yyscript.y (section_cmd): Add support for INCLUDE directive.
822 (file_or_sections_cmd): Likewise.
823
f4a8b6d7
DK
8242011-11-11 Doug Kwan <dougkwan@google.com>
825
826 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
827 if --just-symbols is given.
828
29ab395d
DK
8292011-11-10 Doug Kwan <dougkwan@google.com>
830
831 PR gold/13362
832 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
833 when processing data relocs.
834 * reloc.h (Relocate_functions::rel_unaligned): New method.
835 (Relocate_functions::pcrel_unaligned): Ditto.
836 (Relocate_functions::rel32_unaligned): Ditto.
837 (Relocate_functions::pcrel32_unaligned): Ditto.
838
2c339f71
DK
8392011-11-09 Doug Kwan <dougkwan@google.com>
840
841 PR gold/13362
842 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
843 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
844 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
845 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
846 (Relocate_functions::rel_unaligned): New.
847 (Relocate_functions::rel32_unaligned): New.
848 * target-reloc.h (relocate_for_relocatable): Add code to handle
849 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
850 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
851 arm_unaligned_reloc_r): New targets.
852 * testsuite/Makefile.in: Regenerate.
853 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
854 linking.
855
3f3cddf1
ILT
8562011-11-02 Ian Lance Taylor <iant@google.com>
857
858 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
859 NATIVE_LINKER.
860 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
861 * options.cc (General_options::finalize): Use library search path
862 from configure script if specified. If not native and no sysroot,
863 only search TOOLLIBDIR.
864 * options.h (Search_directory::Search_directory): Change name to
865 const std::string&.
866 (General_options::add_to_library_path_with_sysroot): Change arg to
867 const std::string&.
868 * configure, Makefile.in, config.in: Rebuild.
869
a8e2273b
ILT
8702011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
871
872 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
873 we are working around the ARM1176 Erratum.
874 * options.h (General_options::fix_arm1176): Add option.
875 * testsuite/Makefile.am: Add testcases, and keep current ones
876 working.
877 * testsuite/Makefile.in: Regenerate.
878 * testsuite/arm_fix_1176.s: New file.
879 * testsuite/arm_fix_1176.sh: Likewise.
880
cd6eab1c
ILT
8812011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
882
883 * arm.cc (Target_arm::Target_arm): Remove initialisation of
884 may_use_blx_.
885 (Target_arm::may_use_blx): Remove method.
886 (Target_arm::set_may_use_blx): Likewise.
887 (Target_arm::may_use_v4t_interworking): New method.
888 (Target_arm::may_use_v5t_interworking): Likewise.
889 (Target_arm::may_use_blx_): Remove member variable.
890 (Arm_relocate_functions::arm_branch_common): Check for v5T
891 interworking.
892 (Arm_relocate_functions::thumb_branch_common): Likewise.
893 (Reloc_stub::stub_type_for_reloc): Likewise.
894 (Target_arm::do_finalize_sections): Correct interworking checks.
895 * testsuite/Makefile.am: Add new tests.
896 * testsuite/Makefile.in: Regenerate.
897 * testsuite/arm_farcall_arm_arm.s: New test.
898 * testsuite/arm_farcall_arm_arm.sh: Likewise.
899 * testsuite/arm_farcall_arm_thumb.s: Likewise.
900 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
901 * testsuite/arm_farcall_thumb_arm.s: Likewise.
902 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
903 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
904 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
905
286adcf4
CC
9062011-10-31 Cary Coutant <ccoutant@google.com>
907
908 PR gold/13023
909 * expression.cc (Expression::eval_with_dot): Add
910 is_section_dot_assignment parameter.
911 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
912 absolute and assigning to dot within a section.
913 * script-sections.cc
914 (Output_section_element_assignment::set_section_addresses): Pass
915 dot_section to set_if_absolute.
916 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
917 as is_section_dot_assignment flag to eval_with_dot.
918 (Output_section_element_dot_assignment::set_section_addresses):
919 Likewise.
920 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
921 parameter. Also set value if relative to dot_section; set the
922 symbol's output_section.
923 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
924 parameter. Adjust all callers.
925 (Expression::eval_maybe_dot): Likewise.
926 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
927 Adjust all callers.
928 * testsuite/script_test_2.t: Test assignment of an absolute value
929 to dot within an output section element.
930
9634ed06
CC
9312011-10-31 Cary Coutant <ccoutant@google.com>
932
933 * options.h (class General_options): Add --[no-]gnu-unique options.
934 * symtab.cc (Symbol_table::sized_write_globals): Convert
935 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
936
de4101c7
CC
9372011-10-31 Cary Coutant <ccoutant@google.com>
938
939 PR gold/13359
940 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
941 unnecessary assertion.
942 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
943
7257cc92
ST
9442011-10-31 Sriraman Tallam <tmsriram@google.com>
945
946 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
947 gc_mark_symbol.
948 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
949 gc_mark_symbol.
950 Change to just keep the section associated with symbol.
951 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
952 they are externally visible and --export-dynamic is turned on.
953 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
954
bfc34b3f
ILT
9552011-10-19 Ian Lance Taylor <iant@google.com>
956
957 PR gold/13163
958 * script-sections.cc
959 (Output_section_element_dot_assignment::needs_output_section): New
960 function.
961
ea0d8c47
ILT
9622011-10-19 Ian Lance Taylor <iant@google.com>
963
964 PR gold/13204
965 * layout.cc (Layout::segment_precedes): Don't assert failure if a
966 --section-start option was seen.
967 * options.h (General_options::any_section_start): New function.
968
abd242a9
DM
9692011-10-18 David S. Miller <davem@davemloft.net>
970
971 PR binutils/13301
972 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
973 member to track relocation locations that have moved during TLS
974 reloc optimizations.
975 (Target_sparc::Relocate::Relocate): Initialize to NULL.
976 (Target_sparc::Relocate::relocate): Adjust view down by 4
977 bytes if it matches reloc_adjust_addr_.
978 (Target_sparc::Relocate::relocate_tls): Always move the
979 __tls_get_addr call delay slot instruction forward 4 bytes when
980 performing relaxation.
981
bab9090f
CC
9822011-10-18 Cary Coutant <ccoutant@google.com>
983
984 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
985 (Output_file::map_no_anonymous): Check for non-zero
986 return code from posix_fallocate.
987
f7c5b166
CC
9882011-10-17 Cary Coutant <ccoutant@google.com>
989
990 PR gold/13245
991 * plugin.cc (is_visible_from_outside): Check for symbols
992 referenced from dynamic objects.
993 * resolve.cc (Symbol_table::resolve): Don't count references
994 from dynamic objects as references from real ELF files.
995 * testsuite/plugin_test_2.sh: Adjust expected result.
996
b490c0bb
CC
9972011-10-17 Cary Coutant <ccoutant@google.com>
998
999 * gold.cc: Include timer.h.
1000 (queue_middle_tasks): Stamp time.
1001 (queue_final_tasks): Likewise.
1002 * main.cc (main): Store timer in parameters. Print timers
1003 for each pass.
1004 * parameters.cc (Parameters::Parameters): Initialize timer_.
1005 (Parameters::set_timer): New function.
1006 (set_parameters_timer): New function.
1007 * parameters.h (Parameters::set_timer): New function.
1008 (Parameters::timer): New function.
1009 (Parameters::timer_): New data member.
1010 (set_parameters_timer): New function.
1011 * timer.cc (Timer::stamp): New function.
1012 (Timer::get_pass_time): New function.
1013 * timer.h (Timer::stamp): New function.
1014 (Timer::get_pass_time): New function.
1015 (Timer::pass_times_): New data member.
1016
f475cf7b
CC
10172011-10-17 Cary Coutant <ccoutant@google.com>
1018
1019 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
1020 task for members of lib groups.
1021
cdd7e244
CC
10222011-10-17 Cary Coutant <ccoutant@google.com>
1023
1024 PR gold/13288
4f95c8b4 1025 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
1026 (File_read::make_view): Move bounds check (replace with assert)...
1027 (File_read::find_or_make_view): ... to here.
1028
dfb45471
CC
10292011-10-12 Cary Coutant <ccoutant@google.com>
1030
4f95c8b4 1031 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
1032 ::read returns less than requested size.
1033
53bbcc1b
CC
10342011-10-10 Cary Coutant <ccoutant@google.com>
1035
4f95c8b4 1036 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
1037 Initialize defined_count_.
1038 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
1039 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
1040 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
1041 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
1042 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 1043 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
1044 member.
1045 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 1046 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
1047 Return zeroes instead of internal error.
1048
397b129b
CC
10492011-10-10 Cary Coutant <ccoutant@google.com>
1050
1051 PR gold/13249
4f95c8b4 1052 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 1053 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 1054 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
1055 (Output_reloc::type_): Adjust size of bit field.
1056 (Output_reloc::use_plt_offset_): New bit field.
1057 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
1058 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
1059 flag. Adjust all callers.
4f95c8b4 1060 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
1061 creating RELATIVE relocations.
1062
d5698657
NC
10632011-10-10 Nick Clifton <nickc@redhat.com>
1064
1065 * po/es.po: Updated Spanish translation.
1066 * po/fi.po: Updated Finnish translation.
1067
6a59a5c2
DN
10682011-10-03 Diego Novillo <dnovillo@google.com>
1069
1070 * options.cc (parse_uint): Fix dereference of RETVAL.
1071
f0558624
ST
10722011-09-29 Sriraman Tallam <tmsriram@google.com>
1073
1074 * layout.h (section_order_map_): New member.
1075 (get_section_order_map): New member function.
1076 * output.cc (Output_section::add_input_section): Check for patterns
1077 only when --section-ordering-file is specified.
1078 * gold.cc (queue_middle_tasks): Delay updating order of sections till
1079 output_sections have been formed.
1080 * layout.cc (Layout_Layout): Initialize section_order_map_.
1081 * plugin.cc (update_section_order): Store order in order_map. Do not
1082 update the order.
1083 * testsuite/Makefile.am: Add test case for plugin_final_layout.
1084 * testsuite/Makefile.in: Regenerate.
1085 * testsuite/plugin_section_order.c: New file.
1086 * testsuite/plugin_final_layout.cc: New file.
1087 * testsuite/plugin_final_layout.sh: New file.
1088
a7dac153
CC
10892011-09-29 Cary Coutant <ccoutant@google.com>
1090
4f95c8b4 1091 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 1092 Check for NULL.
4f95c8b4 1093 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
1094 symbols during incremental update.
1095 (Symbol_table::add_from_dynobj): Likewise.
1096
eebd87a5
ILT
10972011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1098 Ian Lance Taylor <iant@google.com>
1099
1100 * symtab.cc (Symbol_table::define_special_symbol): Always
1101 canonicalize version string.
1102
403a3331
CC
11032011-09-26 Cary Coutant <ccoutant@google.com>
1104
4f95c8b4
CC
1105 * gold.cc (queue_initial_tasks): Move option checks ...
1106 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
1107 some options; make others fatal.
1108
235061c2
CC
11092011-09-26 Cary Coutant <ccoutant@google.com>
1110
1111 gcc PR lto/47247
1112 * plugin.cc (get_symbols_v2): New function.
1113 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
1114 (is_referenced_from_outside): New function.
1115 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
1116 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
1117 (get_symbols): Pass version parameter.
1118 (get_symbols_v2): New function.
1119 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
1120 parameter.
1121 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
1122 (onload): Add LDPT_GET_SYMBOLS_V2.
1123 (all_symbols_read_hook): Use get_symbols_v2; check for
1124 LDPR_PREVAILING_DEF_IRONLY_EXP.
1125 * testsuite/plugin_test_3.sh: Update expected results.
1126
dc87f620
ILT
11272011-09-23 Simon Baldwin <simonb@google.com>
1128
1129 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
1130 configuration options.
1131 * configure: Regenerate.
1132 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
1133 * Makefile.in: Regenerate.
1134 * testsuite/Makefile.in: Regenerate.
1135
a8279f82
ST
11362011-09-19 Sriraman Tallam <tmsriram@google.com>
1137
1138 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
1139
0c9350c8
CC
11402011-09-19 Cary Coutant <ccoutant@google.com>
1141
1142 * incremental.cc (can_incremental_update): Fix typo in comment.
1143 * incremental.h (can_incremental_update): Likewise.
1144
aa06ae28
CC
11452011-09-18 Cary Coutant <ccoutant@google.com>
1146
1147 * incremental.cc (can_incremental_update): New function.
1148 * incremental.h (can_incremental_update): New function.
1149 * layout.cc (Layout::init_fixed_output_section): Call it.
1150 (Layout::make_output_section): Don't allow patch space in .eh_frame.
1151 * object.cc (Sized_relobj_file::do_layout): Call
1152 can_incremental_update.
1153
ebb300b2
CC
11542011-09-13 Cary Coutant <ccoutant@google.com>
1155
1156 * configure.ac: Check for glibc support for gnu_indirect_function
1157 support with static linking, setting automake conditional
1158 IFUNC_STATIC.
1159 * Makefile.in: Regenerate.
1160 * configure: Regenerate.
1161
1162 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
1163 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
1164 for IFUNC_STATIC.
1165 * testsuite/Makefile.in: Regenerate.
1166
1206d0d5
CC
11672011-09-13 Cary Coutant <ccoutant@google.com>
1168
1169 * incremental.cc (Sized_relobj_incr::do_layout): Call
1170 report_comdat_group for kept comdat sections.
1171 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
1172 * testsuite/Makefile.in: Regenerate.
1173 * testsuite/incr_comdat_test_1.cc: New source file.
1174 * testsuite/incr_comdat_test_2_v1.cc: New source file.
1175 * testsuite/incr_comdat_test_2_v2.cc: New source file.
1176 * testsuite/incr_comdat_test_2_v3.cc: New source file.
1177
40b29874
ILT
11782011-09-13 Ian Lance Taylor <iant@google.com>
1179
1180 * object.cc (Sized_relobj_file::do_layout): Remove unused local
1181 variable external_symbols_offset.
1182
1b045aac
ILT
11832011-09-12 Ian Lance Taylor <iant@google.com>
1184
1185 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
1186 triggered if object has no symbols.
1187
24c6c55a
DM
11882011-09-09 David S. Miller <davem@davemloft.net>
1189
1190 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
1191 (Output_fill_debug_line::do_write): Likewise.
1192
66570254
CC
11932011-08-29 Cary Coutant <ccoutant@google.com>
1194
1195 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
1196 casts to match formatting specs.
1197 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
1198
8ea8cd50
CC
11992011-08-26 Cary Coutant <ccoutant@google.com>
1200
1201 * layout.cc (Free_list::allocate): Provide guarantee of minimum
1202 remaining hole size when allocating.
1203 (Layout::make_output_section): Set fill methods for debug sections.
1204 * layout.h (Free_list::Free_list_node): Move from private to
1205 public.
1206 (Free_list::set_min_hole_size): New function.
1207 (Free_list::begin, Free_list::end): New functions.
1208 (Free_list::min_hole_): New data member.
1209 * output.cc: Include dwarf.h.
1210 (Output_fill_debug_info::do_minimum_hole_size): New function.
1211 (Output_fill_debug_info::do_write): New function.
1212 (Output_fill_debug_line::do_minimum_hole_size): New function.
1213 (Output_fill_debug_line::do_write): New function.
1214 (Output_section::Output_section): Initialize new data member.
1215 (Output_section::set_final_data_size): Ensure patch space is larger
1216 than minimum hole size.
1217 (Output_section::do_write): Fill holes in debug sections.
1218 * output.h (Output_fill): New class.
1219 (Output_fill_debug_info): New class.
1220 (Output_fill_debug_line): New class.
1221 (Output_section::set_free_space_fill): New function.
1222 (Output_section::free_space_fill_): New data member.
1223 * testsuite/Makefile.am (incremental_test_3): Add
1224 --incremental-patch option.
1225 (incremental_test_4): Likewise.
1226 (incremental_test_5): Likewise.
1227 (incremental_test_6): Likewise.
1228 (incremental_copy_test): Likewise.
1229 (incremental_common_test_1): Likewise.
1230 * testsuite/Makefile.in: Regenerate.
1231
7cf80422
NC
12322011-08-26 Nick Clifton <nickc@redhat.com>
1233
1234 * po/es.po: Updated Spanish translation.
1235
c3f7b0e5
CC
12362011-08-01 Cary Coutant <ccoutant@google.com>
1237
1238 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
1239 * gold/testsuite/Makefile.in: Regenerate.
1240 * gold/testsuite/justsyms_exec.c: New source file.
1241 * gold/testsuite/justsyms_lib.c: New source file.
1242
9590bf25
CC
12432011-08-01 Cary Coutant <ccoutant@google.com>
1244
1245 * layout.cc (Layout::set_segment_offsets): Don't realign text
1246 segment if -Ttext was specified.
1247 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
1248 file type.
1249 * object.h (Sized_relobj_file::e_type): New function.
1250 (Sized_relobj_file::e_type_): New data member.
1251 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
1252 base address for ET_EXEC files.
1253 * target.cc (Target::do_make_elf_object_implementation): Allow
1254 ET_EXEC files with --just-symbols option.
1255
dcd8d12e
CC
12562011-07-28 Cary Coutant <ccoutant@google.com>
1257
1258 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
1259 Add thread_number parameter.
1260 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
1261 * workqueue-threads.cc
1262 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
1263 current thread if its thread number is greater than desired thread
1264 count.
1265 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
1266 Add thread_number parameter.
1267 (Workqueue::should_cancel_thread): Likewise.
1268 (Workqueue::find_runnable_or_wait): Pass thread_number to
1269 should_cancel_thread.
1270 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
1271 parameter.
1272
804eb480
ST
12732011-07-22 Sriraman Tallam <tmsriram@google.com>
1274
1275 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
1276 only after checking if it cannot be forced local.
1277 * symtab.h (is_externally_visible): Check if the symbol is not forced
1278 local.
1279
f1ddb600
ILT
12802011-07-15 Ian Lance Taylor <iant@google.com>
1281
1282 * options.h (class General_options): Add --print-output-format.
1283 Move -EL next to -EB, for better --help output.
1284 * target-select.cc: Include <cstdio>, "options.h", and
1285 "parameters.h".
1286 (Target_selector::do_target_bfd_name): New function.
1287 (print_output_format): New function.
1288 * target-select.h (class Target_selector): Update declarations.
1289 (Target_selector::target_bfd_name): New function.
1290 (print_output_format): Declare.
1291 * main.cc: Include "target-select.h".
1292 (main): Handle --print-output-format.
1293 * gold.cc: Include "target-select.h".
1294 (queue_initial_tasks): Handle --print-output-format when there are
1295 no input files.
1296 * parameters.cc (parameters_force_valid_target): Give a better
1297 error message if -EB/-EL does not match target.
1298 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
1299 function.
1300
7d172687
ILT
13012011-07-15 Ian Lance Taylor <iant@google.com>
1302
1303 * i386.cc (class Output_data_plt_i386): Add layout_ field.
1304 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
1305 (Output_data_plt_i386::do_write): Write address of .dynamic
1306 section to first entry in .got.plt section.
1307 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
1308 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1309 Initialize layout_.
1310 (Output_data_plt_x86_64::do_write): Write address of .dynamic
1311 section to first entry in .got.plt section.
1312 * layout.h (Layout::dynamic_section): New function.
1313
e9552f7e
ST
13142011-07-13 Sriraman Tallam <tmsriram@google.com>
1315
1316 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
1317 to claim_file call.
1318 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
1319 input_section_position_, and input_section_glob_.
1320 (read_layout_from_file): Call function section_ordering_specified.
1321 * layout.h (is_section_ordering_specified): New function.
1322 (section_ordering_specified): New function.
1323 (section_ordering_specified_): New boolean member.
1324 * main.cc(main): Call load_plugins after layout object is defined.
1325 * output.cc (Output_section::add_input_section): Use
1326 function section_ordering_specified to check if section ordering is
1327 needed.
1328 * output.cc (Output_section::add_relaxed_input_section): Use
1329 function section_ordering_specified to check if section ordering is
1330 needed.
1331 (Output_section::update_section_layout): New function.
1332 (Output_section::sort_attached_input_sections): Check if input section
1333 must be reordered.
1334 * output.h (Output_section::update_section_layout): New function.
1335 * plugin.cc (get_section_count): New function.
1336 (get_section_type): New function.
1337 (get_section_name): New function.
1338 (get_section_contents): New function.
1339 (update_section_order): New function.
58797674 1340 (allow_section_ordering): New function.
e9552f7e
ST
1341 (Plugin::load): Add the new interfaces to the transfer vector.
1342 (Plugin_manager::load_plugins): New parameter.
1343 (Plugin_manager::all_symbols_read): New parameter.
1344 (Plugin_manager::claim_file): New parameter. Save the elf object for
1345 unclaimed objects.
1346 (Plugin_manager::get_elf_object): New function.
1347 (Plugin_manager::get_view): Change to directly use the bool to check
1348 if get_view is called from claim_file_hook.
1349 * plugin.h (input_objects): New function
1350 (Plugin__manager::load_plugins): New parameter.
1351 (Plugin_manager::claim_file): New parameter.
1352 (Plugin_manager::get_elf_object): New function.
1353 (Plugin_manager::in_claim_file_handler): New function.
1354 (Plugin_manager::in_claim_file_handler_): New member.
1355 (layout): New function.
1356 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
1357 handler with an extra parameter. Make the elf object before calling
1358 claim_file handler.
1359 * testsuite/plugin_test.c (get_section_count): New function pointer.
1360 (get_section_type): New function pointer.
1361 (get_section_name): New function pointer.
1362 (get_section_contents): New function pointer.
1363 (update_section_order): New function pointer.
1364 (allow_section_ordering): New function pointer.
1365 (onload): Check if the new interfaces exist.
1366
9446efde
ILT
13672011-07-13 Ian Lance Taylor <iant@google.com>
1368
1369 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
1370 relro section.
1371 * x86_64.cc (Target_x86_64::got_section): Likewise.
1372 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
1373 (relro_now_test_SOURCES): New variable.
1374 (relro_now_test_DEPENDENCIES): New variable.
1375 (relro_now_test_LDFLAGS): New variable.
1376 (relro_now_test_LDADD): New variable.
1377 (relro_now_test.so): New target.
1378 * testsuite/Makefile.in: Rebuild.
1379
07aa62f2
ILT
13802011-07-12 Ian Lance Taylor <iant@google.com>
1381
1382 PR gold/12980
1383 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
1384 GLOB_DAT relocation rather than a RELATIVE relocation for a
1385 protected symbol when creating a shared library.
1386 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
1387 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
1388 * testsuite/protected_main_1.cc (main): Test that protected
1389 function has same address.
1390
e2153196
ILT
13912011-07-11 Ian Lance Taylor <iant@google.com>
1392
1393 PR gold/12979
1394 * options.h (class General_options): Add -Bgroup.
1395 * options.cc (General_options::finalize): If -Bgroup is set,
1396 default to --unresolved-symbols=report-all.
1397 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
1398 * target-reloc.h (issue_undefined_symbol_error): Handle
1399 --unresolved-symbols=report-all.
1400
6daf5215
ILT
14012011-07-08 Ian Lance Taylor <iant@google.com>
1402
1403 PR gold/11985
1404 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
1405 if linker script discards key sections.
1406 (Layout::create_dynamic_symtab): Likewise.
1407 (Layout::assign_local_dynsym_offsets): Likewise.
1408 (Layout::sized_create_version_sections): Likewise.
1409 (Layout::create_interp): Likewise.
1410 (Layout::finish_dynamic_section): Likewise.
1411 (Layout::set_dynamic_symbol_size): Likewise.
1412
beabb2c6
ILT
14132011-07-08 Ian Lance Taylor <iant@google.com>
1414
1415 PR gold/12386
1416 * options.h (class General_options): Add --unresolved-symbols.
1417 * target-reloc.h (issue_undefined_symbol_error): Check
1418 --unresolved-symbols. Add comments.
1419
9c16daf1
ILT
14202011-07-08 Ian Lance Taylor <iant@google.com>
1421
1422 * testsuite/odr_violation2.cc (Ordering::operator()): Make
1423 expression more complex.
1424
191f1a2d
ILT
14252011-07-08 Ian Lance Taylor <iant@google.com>
1426
1427 PR gold/11317
1428 * target-reloc.h (issue_undefined_symbol_error): New inline
1429 function, broken out of relocate_section.
1430 (relocate_section): Call issue_undefined_symbol_error.
1431 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1432 there is no TLS segment if we are about to issue an undefined
1433 symbol error.
1434 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1435
62855347
ILT
14362011-07-08 Ian Lance Taylor <iant@google.com>
1437
1438 PR gold/12279
1439 * resolve.cc (Symbol_table::should_override): Add fromtype
1440 parameter. Change all callers. Give error when linking together
1441 TLS and non-TLS symbol.
1442 (Symbol_table::should_override_with_special): Add fromtype
1443 parameter. Change all callers.
1444 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1445 there is no TLS segment if we have reported some errors.
1446 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1447
67181c72
ILT
14482011-07-08 Ian Lance Taylor <iant@google.com>
1449
1450 PR gold/12372
1451 * target.h (Target::plt_address_for_global): New function.
1452 (Target::plt_address_for_local): New function.
1453 (Target::plt_section_for_global): Remove.
1454 (Target::plt_section_for_local): Remove.
1455 (Target::do_plt_address_for_global): New virtual function.
1456 (Target::do_plt_address_for_local): New virtual function.
1457 (Target::do_plt_section_for_global): Remove.
1458 (Target::do_plt_section_for_local): Remove.
1459 (Target::register_global_plt_entry): Add Symbol_table and Layout
1460 parameters.
1461 * output.cc (Output_data_got::Got_entry::write): Use
1462 plt_address_for_global and plt_address_for_local.
1463 * layout.cc (Layout::add_target_dynamic_tags): Use size and
1464 address of output section.
1465 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
1466 got_irelative_, and irelative_count_ fields. Update
1467 declarations.
1468 (Output_data_plt_i386::has_irelative_section): New function.
1469 (Output_data_plt_i386::entry_count): Add irelative_count_.
1470 (Output_data_plt_i386::set_final_data_size): Likewise.
1471 (class Target_i386): Add got_irelative_ and rel_irelative_
1472 fields. Update declarations.
1473 (Target_i386::Target_i386): Initialize new fields.
1474 (Target_i386::do_plt_address_for_global): New function replacing
1475 do_plt_section_for_global.
1476 (Target_i386::do_plt_address_for_local): New function replacing
1477 do_plt_section_for_local.
1478 (Target_i386::got_section): Create got_irelative_.
1479 (Target_i386::rel_irelative_section): New function.
1480 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
1481 fields. Don't define __rel_iplt_{start,end}.
1482 (Output_data_plt_i386::add_entry): Add symtab and layout
1483 parameters. Change all callers. Use different PLT and GOT for
1484 IFUNC symbols.
1485 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
1486 layout parameters. Change all callers. Use different PLT and
1487 GOT.
1488 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
1489 (Output_data_plt_i386::rel_irelative): New function.
1490 (Output_data_plt_i386::address_for_global): New function.
1491 (Output_data_plt_i386::address_for_local): New function.
1492 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
1493 IRELATIVE GOT when changing IFUNC GOT entries.
1494 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
1495 reloc.
1496 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
1497 if we didn't create an IRELATIVE GOT.
1498 (Target_i386::Relocate::relocate): Use plt_address_for_global and
1499 plt_address_for_local.
1500 (Target_i386::do_dynsym_value): Use plt_address_for_global.
1501 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
1502 got_irelative_, and irelative_count_ fields. Update
1503 declarations.
1504 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1505 Initialize new fields. Remove symtab parameter. Change all
1506 callers.
1507 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
1508 irelative_count_.
1509 (Output_data_plt_x86_64::has_irelative_section): New function.
1510 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
1511 (class Target_x86_64): Add got_irelative_ and rel_irelative_
1512 fields. Update declarations.
1513 (Target_x86_64::Target_x86_64): Initialize new fields.
1514 (Target_x86_64::do_plt_address_for_global): New function replacing
1515 do_plt_section_for_global.
1516 (Target_x86_64::do_plt_address_for_local): New function replacing
1517 do_plt_section_for_local.
1518 (Target_x86_64::got_section): Create got_irelative_.
1519 (Target_x86_64::rela_irelative_section): New function.
1520 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
1521 all callers. Don't create __rel_iplt_{start,end}.
1522 (Output_data_plt_x86_64::add_entry): Add symtab and layout
1523 parameters. Change all callers. Use different PLT and GOT for
1524 IFUNC symbols.
1525 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
1526 layout parameters. Change all callers. Use different PLT and
1527 GOT.
1528 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
1529 parameters. Change all callers. Use different PLT and GOT for
1530 IFUNC symbols.
1531 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
1532 (Output_data_plt_x86_64::rela_irelative): New function.
1533 (Output_data_plt_x86_64::address_for_global): New function.
1534 (Output_data_plt_x86_64::address_for_local): New function.
1535 (Output_data_plt_x86_64::set_final_data_size): Likewise.
1536 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
1537 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
1538 (Target_x86_64::register_global_plt_entry): Add symtab and layout
1539 parameters.
1540 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
1541 reloc.
1542 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
1543 symbols if we didn't create an IRELATIVE GOT.
1544 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
1545 plt_address_for_local.
1546 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
1547 * testsuite/ifuncvar1.c: New test file.
1548 * testsuite/ifuncvar2.c: New test file.
1549 * testsuite/ifuncvar3.c: New test file.
1550 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
1551 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
1552 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
1553 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
1554 * testsuite/Makefile.in: Rebuild.
1555
33c15b45
CC
15562011-07-07 Cary Coutant <ccoutant@google.com>
1557
1558 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
1559 (two_file_test_1_ndebug.o): Likewise.
1560 (two_file_test_1b_ndebug.o): Likewise.
1561 (two_file_test_2_ndebug.o): Likewise.
1562 (two_file_test_main_ndebug.o): Likewise.
1563 (incremental_test_2): Link with no-debug versions.
1564
f48b5fb7
CC
15652011-07-06 Cary Coutant <ccoutant@google.com>
1566
1567 * gold/incremental.cc
1568 (Output_section_incremental_inputs::write_info_blocks): Check for
1569 hidden and internal symbols.
1570
221597a5
CC
15712011-07-06 Cary Coutant <ccoutant@google.com>
1572
1573 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
1574 Check disposition for startup file.
1575 (Incremental_inputs::report_command_line): Ignore
1576 --incremental-startup-unchanged option.
1577 * options.cc (General_options::parse_incremental_startup_unchanged):
1578 New function.
1579 (General_options::General_options): Initialize new data member.
1580 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
1581 (General_options): Add --incremental-startup-unchanged option.
1582 (General_options::incremental_startup_disposition): New function.
1583 (General_options::incremental_startup_disposition_): New data member.
1584
e24719f6
CC
15852011-07-06 Cary Coutant <ccoutant@google.com>
1586
1587 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
1588 input file index to Script_info ctor.
1589 (Sized_incremental_binary::do_file_has_changed): Find the
1590 command-line argument for files named in scripts.
1591 * incremental.h (Script_info::Script_info): New ctor
1592 with input file index.
1593 (Script_info::input_file_index): New function.
1594 (Script_info::input_file_index_): New data member.
1595 (Incremental_binary::get_library): Add const.
1596 (Incremental_binary::get_script_info): Add const.
1597 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
1598 * testsuite/Makefile.am (incremental_test_5): New test case.
1599 (incremental_test_6): New test case.
1600 * testsuite/Makefile.in: Regenerate.
1601
8f7c81e8
CC
16022011-07-06 Cary Coutant <ccoutant@google.com>
1603
1604 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
1605 debug output when command lines differ.
1606
9fbd3822
CC
16072011-07-06 Cary Coutant <ccoutant@google.com>
1608
1609 * incremental.cc (Incremental_inputs::report_command_line): Ignore
1610 --incremental-patch option.
1611 * layout.cc (Free_list::allocate): Extend allocation beyond original
1612 end if enabled.
1613 (Layout::make_output_section): Mark sections that should get
1614 patch space.
1615 * options.cc (parse_percent): New function.
1616 * options.h (parse_percent): New function.
1617 (DEFINE_percent): New macro.
1618 (General_options): Add --incremental-patch option.
1619 * output.cc (Output_section::Output_section): Initialize new data
1620 members.
1621 (Output_section::add_input_section): Print section name when out
1622 of patch space.
1623 (Output_section::add_output_section_data): Likewise.
1624 (Output_section::set_final_data_size): Add patch space when
1625 doing --incremental-full.
1626 (Output_section::do_reset_address_and_file_offset): Remove patch
1627 space.
1628 (Output_segment::set_section_list_addresses): Print debug output
1629 only if --incremental-update.
1630 * output.h (Output_section::set_is_patch_space_allowed): New function.
1631 (Output_section::is_patch_space_allowed_): New data member.
1632 (Output_section::patch_space_): New data member.
1633 * parameters.cc (Parameters::incremental_full): New function.
1634 * parameters.h (Parameters::incremental_full): New function
1635 * testsuite/Makefile.am (incremental_test_2): Add test for
1636 --incremental-patch option.
1637 * testsuite/Makefile.in: Regenerate.
1638 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
1639 (t18): Remove function body.
1640
f6cccc2c
DK
16412011-07-05 Doug Kwan <dougkwan@google.com>
1642
1643 PR gold/12771
1644 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
1645 Arm_Address type for relocation result.
1646 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
1647 overflow check.
1648 (Arm_relocate_functions::abs32): Use unaligned access.
1649 (Arm_relocate_functions::rel32): Ditto.
1650 (Arm_relocate_functions::prel31): Ditto.
1651 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
1652 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
1653 static data relocations.
1654 * testsuite/Makefile.in: Regnerate.
1655 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
1656
28a13fec
ILT
16572011-07-05 Ian Lance Taylor <iant@google.com>
1658
1659 PR gold/12392
1660 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
1661 symbols if necessary.
1662 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
1663
24d47b34
ILT
16642011-07-05 Ian Lance Taylor <iant@google.com>
1665
1666 PR gold/12952
1667 * resolve.cc (Symbol::override_base_with_special): Simply override
1668 version with special symbol version, ignoring previous version.
1669
41f9cbbe
ILT
16702011-07-05 Ian Lance Taylor <iant@google.com>
1671
1672 * object.cc (Sized_relobj_file::include_section_group): Add
1673 information to comment about signature location.
1674
886288f1
ILT
16752011-07-02 Ian Lance Taylor <iant@google.com>
1676
1677 PR gold/12957
1678 * options.h (class General_options): Add -f and -F.
1679 * options.cc (General_options::finalize): Fatal error if -f/-F
1680 are used without -shared.
1681 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
1682
ae3a6d4f
ILT
16832011-07-02 Ian Lance Taylor <iant@google.com>
1684
1685 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
1686
21131061
ILT
16872011-07-01 Ian Lance Taylor <iant@google.com>
1688
1689 PR gold/12525
1690 PR gold/12952
1691 * resolve.cc (Symbol::override_base_with_special): Don't override
1692 the version if the overriding symbol has a different name.
1693 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
1694 all callers. If we give an error about an undefined version,
1695 define the base version if necessary.
1696 * dynobj.h (class Versions): Update declaration.
1697 * testsuite/weak_alias_test_5.cc: New file.
1698 * testsuite/weak_alias_test.script: New file.
1699 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
1700 and versioned_alias have the right value, and call t2.
1701 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
1702 weak_alias_test_5.so.
1703 (weak_alias_test_LDADD): Likewise.
1704 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
1705 * testsuite/Makefile.in: Rebuild.
1706
611062c0
ILT
17072011-07-01 Ian Lance Taylor <iant@google.com>
1708
1709 PR gold/12525
1710 * options.h (class General_options): Support -z notext.
1711 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
1712 -Wl,-z,notext.
1713 (two_file_shared_nonpic.so): Likewise.
1714 (two_file_shared_mixed.so): Likewise.
1715 (two_file_shared_mixed_1.so): Likewise.
1716 (weak_undef_lib_nonpic.so): Likewise.
1717 (alt/weak_undef_lib_nonpic.so): Likewise.
1718 (tls_test_shared_nonpic.so): Likewise.
1719 * testsuite/Makefile.in: Rebuild.
1720
328c7c2f
ILT
17212011-07-01 Ian Lance Taylor <iant@google.com>
1722
1723 PR gold/12525
1724 * configure.ac: Test whether static linking works, setting
1725 the automake conditional HAVE_STATIC.
1726 * testsuite/Makefile.am: Disable tests using -static if
1727 HAVE_STATIC is not true.
1728 * configure, testsuite/Makefile.in: Rebuild.
1729
02d7cd44
ILT
17302011-07-01 Ian Lance Taylor <iant@google.com>
1731
1732 PR gold/12525
1733 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
1734 Assert if we see DW_EH_PE_indirect.
1735 * target.h (Target::ehframe_datarel_base): New function.
1736 (Target::do_ehframe_datarel_base): New target function.
1737 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
1738 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
1739 function.
1740
07a60597
ILT
17412011-07-01 Ian Lance Taylor <iant@google.com>
1742
1743 PR gold/12571
1744 * options.h (class General_options): Add
1745 --ld-generated-unwind-info.
1746 * ehframe.cc (Fde::write): Add address parameter. Change all
1747 callers. If associated with PLT, fill in address and size.
1748 (Cie::set_output_offset): Only add merge mapping if there is an
1749 object.
1750 (Cie::write): Add address parameter. Change all callers.
1751 (Eh_frame::add_ehframe_for_plt): New function.
1752 * ehframe.h (class Fde): Update declarations. Move shndx_ and
1753 input_offset_ fields into union u_, with new plt field.
1754 (Fde::Fde): Adjust for new union field.
1755 (Fde::Fde) [Output_data version]: New constructor.
1756 (Fde::add_mapping): Only add merge mapping if there is an object.
1757 (class Cie): Update declarations.
1758 (class Eh_frame): Declare add_ehframe_for_plt.
1759 * layout.cc (Layout::layout_eh_frame): Break out code into
1760 make_eh_frame_section, and call it.
1761 (Layout::make_eh_frame_section): New function.
1762 (Layout::add_eh_frame_for_plt): New function.
1763 * layout.h (class Layout): Update declarations.
1764 * merge.cc (Merge_map::add_mapping): Add assertion.
1765 * i386.cc: Include "dwarf.h".
1766 (class Output_data_plt_i386): Make first_plt_entry,
1767 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
1768 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1769 and plt_eh_frame_fde.
1770 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
1771 boundary. Call add_eh_frame_for_plt if appropriate.
1772 * x86_64.cc: Include "dwarf.h".
1773 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
1774 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
1775 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1776 and plt_eh_frame_fde.
1777 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
1778 appropriate.
1779
14788a3f
ILT
17802011-06-29 Ian Lance Taylor <iant@google.com>
1781
1782 PR gold/12629
1783 * object.cc (Sized_relobj_file::layout_section): Change shdr
1784 parameter to be const.
1785 (Sized_relobj_file::layout_eh_frame_section): New function, broken
1786 out of do_layout.
1787 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
1788 appropriate. Call layout_eh_frame_section.
1789 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
1790 sections.
1791 * object.h (class Sized_relobj_file): Update declarations.
1792
6c21fce1
ILT
17932011-06-29 Ian Lance Taylor <iant@google.com>
1794
37e41b03 1795 PR gold/12652
6c21fce1
ILT
1796 * script.cc (Token::integer_value): Accept trailing M/m/K/k
1797 modifier.
1798 (Lex::gather_token): Accept trailing M/m/K/k for integers.
1799
4d5e4e62
ILT
18002011-06-29 Ian Lance Taylor <iant@google.com>
1801
1802 PR gold/12675
1803 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
1804 SHT_X86_64_UNWIND.
1805 * layout.cc (Layout::layout_eh_frame): Likewise.
1806
886f533a
ILT
18072011-06-29 Ian Lance Taylor <iant@google.com>
1808
1809 PR gold/12695
1810 * layout.cc (Layout::symtab_section_shndx): New function.
1811 * layout.h (class Layout): Declare symtab_section_shndx.
1812 * output.cc (Output_section::write_header): Call it.
1813
f3ae1b28
ILT
18142011-06-29 Ian Lance Taylor <iant@google.com>
1815
1816 PR gold/12818
1817 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
1818 symbols which are not used in a relocation.
1819
aecf301f
ILT
18202011-06-28 Ian Lance Taylor <iant@google.com>
1821
1822 PR gold/12898
1823 * layout.cc (Layout::segment_precedes): Don't crash if a linker
1824 script create indistinguishable segments.
1825 (Layout::set_segment_offsets): Use stable_sort when sorting
1826 segments. Pass this to Compare_segments constructor.
1827 * layout.h (class Layout): Make segment_precedes non-static.
1828 (class Compare_segments): Change from struct to class. Add
1829 layout_ field. Add constructor.
1830 * script-sections.cc
1831 (Script_sections::attach_sections_using_phdrs_clause): Rename
1832 local orphan to is_orphan. Don't report failure to put empty
1833 section in segment. On attachment failure, report name of
1834 section, and attach to first PT_LOAD segment.
1835
03ef7571
ILT
18362011-06-28 Ian Lance Taylor <iant@google.com>
1837
1838 PR gold/12934
1839 * target-select.cc (Target_selector::Target_selector): Add
1840 emulation parameter. Change all callers.
1841 (select_target_by_bfd_name): Rename from select_target_by_name.
1842 Change all callers.
1843 (select_target_by_emulation): New function.
1844 (supported_emulation_names): New function.
1845 * target-select.h (class Target_selector): Add emulation_ field.
1846 Update declarations.
1847 (Target_selector::recognize_by_bfd_name): Rename from
1848 recognize_by_name. Change all callers.
1849 (Target_selector::supported_bfd_names): Rename from
1850 supported_names. Change all callers.
1851 (Target_selector::recognize_by_emulation): New function.
1852 (Target_selector::supported_emulations): New function.
1853 (Target_selector::emulation): New function.
1854 (Target_selector::do_recognize_by_bfd_name): Rename from
1855 do_recognize_by_name. Change all callers.
1856 (Target_selector::do_supported_bfd_names): Rename from
1857 do_supported_names. Change all callers.
1858 (Target_selector::do_recognize_by_emulation): New function.
1859 (Target_selector::do_supported_emulations): New function.
1860 (select_target_by_bfd_name): Change name in declaration.
1861 (select_target_by_emulation): Declare.
1862 (supported_emulation_names): Declare.
1863 * parameters.cc (parameters_force_valid_target): Try to find
1864 target based on emulation from -m option.
1865 * options.h (class General_options): Change doc string for -m.
1866 * options.cc (help): Print emulations.
1867 (General_options::parse_V): Likewise.
1868 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
1869 Add emulation parameter. Change all callers.
1870
200b2bb9
ILT
18712011-06-28 Ian Lance Taylor <iant@google.com>
1872
1873 * target.h (class Target): Add osabi_ field.
1874 (Target::osabi): New function.
1875 (Target::set_osabi): New function.
1876 (Target::Target): Initialize osabi_.
1877 (Target::do_adjust_elf_header): Make pure virtual.
1878 (Sized_target::do_adjust_elf_header): Declare.
1879 * target.cc (Sized_target::do_adjust_elf_header): New function.
1880 (class Sized_target): Instantiate all versions.
1881 * freebsd.h (class Target_freebsd): Remove.
1882 (Target_selector_freebsd::do_recognize): Call set_osabi on
1883 Target.
1884 (Target_selector_freebsd::do_recognize_by_name): Likewise.
1885 (Target_selector_freebsd::set_osabi): Remove.
1886 * i386.cc (class Target_i386): Inherit from Sized_target rather
1887 than Target_freebsd.
1888 * x86_64.cc (class Target_x86_64): Likewise.
1889
b3ce541e
ILT
18902011-06-28 Ian Lance Taylor <iant@google.com>
1891
1892 * target.h (Target::can_check_for_function_pointers): Rewrite.
1893 Make non-virtual.
1894 (Target::can_icf_inline_merge_sections): Likewise.
1895 (Target::section_may_have_icf_unsafe_poineters): Likewise.
1896 (Target::Target_info): Add can_icf_inline_merge_sections field.
1897 (Target::do_can_check_for_function_pointers): New virtual
1898 function.
1899 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
1900 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
1901 from can_check_for_function_pointers, move in file.
1902 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
1903 section_may_have_icf_unsafe_poineters, move in file.
1904 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
1905 * i386.cc (Target_i386::do_can_check_for_function_pointers):
1906 Rename from can_check_for_function_pointers, move in file.
1907 (Target_i386::can_icf_inline_merge_sections): Remove.
1908 (Target_i386::i386_info): Initialize
1909 can_icf_inline_merge_sections.
1910 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
1911 Initialize can_icf_inline_merge_sections.
1912 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
1913 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
1914 Rename from can_check_for_function_pointers, move in file.
1915 (Target_x86_64::can_icf_inline_merge_sections): Remove.
1916 (Target_x86_64::x86_64_info): Initialize
1917 can_icf_inline_merge_sections.
1918 * testsuite/testfile.cc (Target_test::test_target_info):
1919 Likewise.
1920 * icf.cc (get_section_contents): Correct formatting.
1921
6d1c4efb
ILT
19222011-06-27 Ian Lance Taylor <iant@google.com>
1923
1924 * symtab.cc (Symbol::versioned_name): New function.
1925 (Symbol_table::add_to_final_symtab): Use versioned_name when
1926 appropriate.
1927 (Symbol_table::sized_write_symbol): Likewise.
1928 * symtab.h (class Symbol): Declare versioned_name.
1929 * stringpool.h (class Stringpool_template): Add variant of add
1930 which takes a std::basic_string.
1931 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
1932 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
1933 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
1934 (ver_test_12.o): New target.
1935 * testsuite/Makefile.in: Rebuild.
1936
57eb9b50
DK
19372011-06-27 Doug Kwan <dougkwan@google.com>
1938
1939 * arm.cc (Arm_relocate_functions::thm_jump8,
1940 Arm_relocate_functions::thm_jump11): Use a wider signed
1941 type to compute offset.
1942 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
1943 arm_thm_jump8.
1944 * testsuite/Makefile.in: Regenerate.
1945 * testsuite/arm_branch_in_range.sh: Check test results of
1946 arm_thm_jump11 and arm_thm_jump8.
1947 * testsuite/arm_thm_jump11.s: New test source file.
1948 * testsuite/arm_thm_jump11.t: New linker script.
1949 * testsuite/arm_thm_jump8.s: New test source file.
1950 * testsuite/arm_thm_jump8.t: New linker script.
1951
487b39df
ILT
19522011-06-24 Ian Lance Taylor <iant@google.com>
1953
1954 * layout.cc: Include "object.h".
1955 (ctors_sections_in_init_array): New static variable.
1956 (Layout::is_ctors_in_init_array): New function.
1957 (Layout::layout): Add entry to ctors_sections_in_init_array if
1958 appropriate.
1959 * layout.h (class Layout): Declare is_ctors_in_init_array.
1960 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
1961 is_ctors_reverse_view is set.
1962 (Sized_relobj_file::write_sections): Add layout parameter. Change
1963 all callers. Set is_ctors_reverse_view field of View_size.
1964 (Sized_relobj_file::reverse_words): New function.
1965 * object.h (Sized_relobj_file::View_size): Add
1966 is_ctors_reverse_view field.
1967 (class Sized_relobj_file): Update declarations.
1968 * testsuite/initpri3.c: New test.
1969 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
1970 initpri3b.
1971 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
1972 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
1973 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
1974 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
1975 * testsuite/Makefile.in: Rebuild.
1976
472076e4
CC
19772011-06-24 Cary Coutant <ccoutant@google.com>
1978
1979 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
1980 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
1981 (debug_msg_cdebug.err): New targets.
1982 * testsuite/Makefile.in: Regenerate.
1983 * testsuite/debug_msg.sh: Check output of link with compressed debug.
1984 Fix checks for link with shared library.
1985
a60af0db
DK
19862011-06-24 Doug Kwan <dougkwan@google.com>
1987
1988 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
1989 skip empty text sections.
1990 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
1991
5393d741
ILT
19922011-06-22 Ian Lance Taylor <iant@google.com>
1993
1994 PR gold/12910
1995 * options.h (class General_options): Add --ctors-in-init-array.
1996 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
1997 friends as SHT_PROGBITS for merging sections.
1998 (Layout::layout): Remove special handling of .init_array and
1999 friends. Don't sort if doing relocatable link. Sort for .ctors
2000 and .dtors if ctors_in_init_array.
2001 (Layout::make_output_section): Force correct section types for
2002 .init_array and friends. Don't sort if doing relocatable link,
2003 Don't sort .ctors and .dtors if ctors_in_init_array.
2004 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
2005 (Layout::output_section_name): Add relobj parameter. Change all
2006 callers. Handle .ctors. and .dtors. in code rather than table.
2007 Handle .ctors and .dtors if ctors_in_init_array.
2008 (Layout::match_file_name): New function, moved from output.cc.
2009 * layout.h (class Layout): Update declarations.
2010 * output.cc: Include "layout.h".
2011 (Input_section_sort_entry::get_priority): New function.
2012 (Input_section_sort_entry::match_file_name): Just call
2013 Layout::match_file_name.
2014 (Output_section::Input_section_sort_init_fini_compare::operator()):
2015 Handle .ctors and .dtors. Sort by explicit priority rather than
2016 by name.
2017 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
2018 * testsuite/initpri2.c: New test.
2019 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
2020 (check_PROGRAMS): Add initpri2.
2021 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
2022 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
2023 * configure, testsuite/Makefile.in: Rebuild.
2024
e1f74f98
ILT
20252011-06-19 Ian Lance Taylor <iant@google.com>
2026
2027 PR gold/12880
2028 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
2029 .interp section to a PT_INTERP segment even if we have seen a
2030 --dynamic-linker option. Don't do it if we have seen a PHDRS
2031 clause in a linker script.
2032 (Layout::finalize): Don't create a .interp section if we've
2033 already create a PT_INTERP segment.
2034 (Layout::create_interp): Always call choose_output_section (revert
2035 patch of 2011-06-17). Don't create PT_INTERP segment.
2036 * script-sections.cc
2037 (Script_sections::create_note_and_tls_segments): Add a .interp
2038 section to a PT_INTERP segment even if we have seen a
2039 --dynamic-linker option.
2040
766f91bb
ILT
20412011-06-18 Ian Lance Taylor <iant@google.com>
2042
2043 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
2044 merely because a non-PT_LOAD segment has a dynamic reloc.
2045
0d212c3a
ILT
20462011-06-18 Ian Lance Taylor <iant@google.com>
2047
2048 * layout.cc (Layout::finish_dynamic_section): Don't create
2049 DT_FLAGS entry if not needed.
2050
911a5072
ILT
20512011-06-18 Ian Lance Taylor <iant@google.com>
2052
2053 PR gold/12745
2054 * layout.cc (Layout::layout_eh_frame): Correct handling of
2055 writable .eh_frame section.
2056
534b4e5f
ILT
20572011-06-17 Ian Lance Taylor <iant@google.com>
2058
2059 PR gold/12893
2060 * resolve.cc (Symbol_table::resolve): Don't give an error if a
2061 symbol is redefined with the exact same object and value.
2062
10b4f102
ILT
20632011-06-17 Ian Lance Taylor <iant@google.com>
2064
2065 PR gold/12880
2066 * layout.h (class Layout): Add interp_segment_ field.
2067 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
2068 (Layout::attach_allocated_section_to_segment): If making shared
2069 library, put .interp section in PT_INTERP segment.
2070 (Layout::finalize): Also call create_interp if -dynamic-linker
2071 option was used.
2072 (Layout::create_interp): Assert that there is no PT_INTERP
2073 segment. If not using a SECTIONS clause, use make_output_section.
2074 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
2075 * script-sections.cc
2076 (Script_sections::create_note_and_tls_segments): If making shared
2077 library, put .interp section in PT_INTERP segment.
2078
a29b0dad
ILT
20792011-06-17 Ian Lance Taylor <iant@google.com>
2080
e588ea8d
ILT
2081 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
2082 when making a shared library.
2083
20842011-06-17 Ian Lance Taylor <iant@google.com>
2085
2086 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
2087 parameter. Change all callers. Don't issue warning about PC32
2088 against locally defined symbol.
a29b0dad 2089
9d3b0698
ILT
20902011-06-16 Ian Lance Taylor <iant@google.com>
2091
2092 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
2093 occurs in same object.
2094
85b0f90c
AM
20952011-06-14 Alan Modra <amodra@gmail.com>
2096
2097 * po/POTFILES.in: Regenerate.
2098
a94907d9
ILT
20992011-06-09 Ian Lance Taylor <iant@google.com>
2100
2101 * script-sections.cc
2102 (Orphan_output_section::set_section_addresses): For a relocatable
2103 link set address to 0.
2104
4fb3a1c3
CC
21052011-06-09 Cary Coutant <ccoutant@google.com>
2106
2107 PR gold/12804
2108 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
2109 used with --compress-debug-sections.
2110 * gold/object.cc (Sized_relobj_file::do_layout): Report
2111 uncompressed size of compressed input sections.
2112
61220854
CC
21132011-06-08 Cary Coutant <ccoutant@google.com>
2114
2115 PR gold/12804
2116 * testsuite/two_file_test_2_v1.cc: Change initialization of
2117 v2 to keep it in .data.
2118
e6455dfb
CC
21192011-06-07 Cary Coutant <ccoutant@google.com>
2120
2121 * common.cc (Symbol_table::do_allocate_commons_list): Call
2122 gold_fallback.
2123 * errors.cc (Errors::fatal): Adjust call to gold_exit.
2124 (Errors::fallback): New function.
2125 (gold_fallback): New function.
2126 * errors.h (Errors::fallback): New function.
2127 * gold.cc (gold_exit): Change status parameter to enum; adjust
2128 all callers.
2129 (queue_initial_tasks): Call gold_fallback.
2130 * gold.h: Include cstdlib.
2131 (Exit_status): New enum type.
2132 (gold_exit): Change status parameter to enum.
2133 (gold_fallback): New function.
2134 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
2135 (Layout::create_symtab_sections): Likewise.
2136 (Layout::create_shdrs): Likewise.
2137 * main.cc (main): Adjust call to gold_exit.
2138 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
2139 (Output_data_got::add_got_entry_pair): Likewise.
2140 (Output_section::add_input_section): Likewise.
2141 (Output_section::add_output_section_data): Likewise.
2142 (Output_segment::set_section_list_addresses): Likewise.
2143 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
2144
fb0e076f
CC
21452011-06-07 Cary Coutant <ccoutant@google.com>
2146
2147 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
2148 for incremental links.
2149 * output.cc (Output_segment::set_section_list_addresses): Remove
2150 FIXME and test for TLS or BSS.
2151
a5ee4d5d
CC
21522011-06-07 Cary Coutant <ccoutant@google.com>
2153
2154 * testsuite/Makefile.am: Add incremental_copy_test,
2155 incremental_common_test_1.
2156 * testsuite/Makefile.in: Regenerate.
2157 * testsuite/common_test_1_v1.c: New source file.
2158 * testsuite/common_test_1_v2.c: New source file.
2159 * testsuite/copy_test_v1.cc: New source file.
2160
5146f448
CC
21612011-06-07 Cary Coutant <ccoutant@google.com>
2162
2163 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
2164 update, allocate common from bss section's free list.
2165 * incremental-dump.cc (dump_incremental_inputs): Print flag for
2166 linker-defined symbols.
2167 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
2168 Skip GOT and PLT entries that are no longer referenced.
2169 (Output_section_incremental_inputs::write_info_blocks): Mark
2170 linker-defined symbols.
2171 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
2172 * output.cc (Output_section::allocate): New function.
2173 * output.h (Output_section::allocate): New function.
2174 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
2175 linker-defined symbols.
2176 (Symbol::override_base_with_special): Copy is_predefined_ flag.
2177 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
2178 (Symbol::init_base_output_data): Likewise.
2179 (Symbol::init_base_output_segment): Likewise.
2180 (Symbol::init_base_constant): Likewise.
2181 (Sized_symbol::init_output_data): Likewise.
2182 (Sized_symbol::init_output_segment): Likewise.
2183 (Sized_symbol::init_constant): Likewise.
2184 (Symbol_table::do_define_in_output_data): Likewise.
2185 (Symbol_table::do_define_in_output_segment): Likewise.
2186 (Symbol_table::do_define_as_constant): Likewise.
2187 * symtab.h (Symbol::is_predefined): New function.
2188 (Symbol::init_base_output_data): Add is_predefined parameter.
2189 (Symbol::init_base_output_segment): Likewise.
2190 (Symbol::init_base_constant): Likewise.
2191 (Symbol::is_predefined_): New data member.
2192 (Sized_symbol::init_output_data): Add is_predefined parameter.
2193 (Sized_symbol::init_output_segment): Likewise.
2194 (Sized_symbol::init_constant): Likewise.
2195 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
2196
26d3c67d
CC
21972011-06-07 Cary Coutant <ccoutant@google.com>
2198
2199 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
2200 instead of emit_copy_reloc.
2201 (Copy_relocs::emit_copy_reloc): Refactor.
2202 (Copy_relocs::make_copy_reloc): New function.
2203 (Copy_relocs::add_copy_reloc): Remove.
2204 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
2205 section.
2206 (Copy_relocs::make_copy_reloc): New function.
2207 (Copy_relocs::add_copy_reloc): Remove.
2208 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
2209 unchanged input files.
2210 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
2211 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
2212 Reserve BSS space for COPY relocations.
2213 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2214 (Output_section_incremental_inputs::write_info_blocks): Record
2215 whether a symbol is copied from a shared object.
2216 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
2217 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
2218 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
2219 (Incremental_input_entry_reader::get_output_symbol_index): Add
2220 is_copy parameter.
2221 (Incremental_binary::emit_copy_relocs): New function.
2222 (Incremental_binary::do_emit_copy_relocs): New function.
2223 (Sized_incremental_binary::Sized_incremental_binary): Initialize
2224 new data member.
2225 (Sized_incremental_binary::add_copy_reloc): New function.
2226 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2227 (Sized_incremental_binary::Copy_reloc): New struct.
2228 (Sized_incremental_binary::Copy_relocs): New typedef.
2229 (Sized_incremental_binary::copy_relocs_): New data member.
2230 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
2231 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
2232 * target.h (Sized_target::emit_copy_reloc): New function.
2233 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
2234
7cdb37d9
CC
22352011-06-02 Cary Coutant <ccoutant@google.com>
2236
2237 PR gold/12163
2238 * gold/archive.cc (Archive::Archive): Initialize new data member.
2239 (Archive::include_all_members): Return if archive has already been
2240 included.
2241 * gold/archive.h (Archive::include_all_members_): New data member.
2242
cc643b88
NC
22432011-06-02 Nick Clifton <nickc@redhat.com>
2244
2245 * dynobj.h: Fix spelling mistake in comment.
2246 * output.cc: Likewise.
2247
f62a3ca7 22482011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 2249 Asier Llano
f62a3ca7
DK
2250
2251 PR gold/12826
cc643b88 2252 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
2253 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
2254 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
2255 redundant arm_exidx_test.so.
2256 * testsuite/Makefile.in: Regenerate.
2257 (check_SCRIPTS): Add pr12826.sh
2258 (check_DATA): Add pr12826.stdout
2259 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
2260 * testsuite/pr12826.sh: New file.
2261 * testsuite/pr12826_1.s: Ditto.
2262 * testsuite/pr12826_1.s: Ditto.
2263
8dbe1edc
ILT
22642011-05-30 Ian Lance Taylor <iant@google.com>
2265
2266 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
2267 sections.
2268
c49875be
ILT
22692011-05-29 Ian Lance Taylor <iant@google.com>
2270
2271 PR gold/12804
2272 * testsuite/Makefile.am: Use different file name for two_file_test
2273 temporary file for each incremental test.
2274 * testsuite/Makefile.in: Rebuild.
2275
69d53f7a
ILT
22762011-05-29 Ian Lance Taylor <iant@google.com>
2277
2278 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
2279 binary input file is empty.
2280
41d0ab5f
ILT
22812011-05-27 Ian Lance Taylor <iant@google.com>
2282
2283 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
2284 (ver_test_9.so): Likewise.
2285 * testsuite/Makefile.in: Rebuild.
2286
89d8a36b
CC
22872011-05-26 Cary Coutant <ccoutant@google.com>
2288
2289 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
2290 * incremental.cc (Incremental_inputs::report_input_section): Fix
2291 comment, indentation.
2292 (Incremental_inputs::report_comdat_group): New function.
2293 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2294 of data for incremental input file entry.
2295 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
2296 group count, COMDAT group signatures.
2297 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
2298 an unchanged input file.
2299 * incremental.h (Incremental_object_entry::Incremental_object_entry):
2300 Initialize new data member.
2301 (Incremental_object_entry::add_comdat_group): New function.
2302 (Incremental_object_entry::get_comdat_group_count): New function.
2303 (Incremental_object_entry::get_comdat_signature_key): New function.
2304 (Incremental_object_entry::groups_): New data member.
2305 (Incremental_inputs::report_comdat_group): New function.
2306 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
2307 data for incremental input file entry.
2308 (Incremental_input_entry_reader::get_comdat_group_count): New function.
2309 (Incremental_input_entry_reader::get_input_section): Adjust size of
2310 data for incremental input file entry.
2311 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
2312 (Incremental_input_entry_reader::get_comdat_group_signature): New
2313 function.
2314 * object.cc (Sized_relobj::include_section_group): Report kept
2315 COMDAT groups for incremental links.
2316
1706a06f
ILT
23172011-05-24 David Meyer <pdox@google.com>
2318
2319 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
2320 with name parameter. Add found_name parameter.
2321 * fileread.cc (Input_file::find_file): Adjust code accordingly.
2322 * dirsearch.h (class Dirsearch): Update declaration.
2323
a10ae760
ILT
23242011-05-24 Ian Lance Taylor <iant@google.com>
2325
2326 * archive.cc (Library_base::should_include_member): Pull in object
2327 from archive if it defines the entry symbol.
2328 * parameters.cc (Parameters::entry): New function.
2329 * parameters.h (class Parameters): Declare entry.
2330 * output.h (class Output_file_header): Remove entry_ field.
2331 * output.cc (Output_file_header::Output_file_header): Remove entry
2332 parameter. Change all callers.
2333 (Output_file_header::entry): Use parameters->entry.
2334 * gold.cc (queue_middle_tasks): Likewise.
2335 * plugin.cc (Plugin_hook::run): Likewise.
2336
aa92d6ed
CC
23372011-05-24 Cary Coutant <ccoutant@google.com>
2338
2339 * gold.cc (queue_initial_tasks): Pass incremental base filename
2340 to Output_file::open_base_file; don't print error message.
2341 * incremental-dump.cc (main): Adjust call to
2342 Output_file::open_for_modification.
2343 * incremental-dump.cc (main): Likewise.
2344 * incremental.cc (Incremental_inputs::report_command_line):
2345 Ignore --incremental-base option when comparing command lines.
2346 Ignore parameter when given as separate argument.
2347 * options.h (class General_options): Add --incremental-base.
2348 * output.cc (Output_file::Output_file):
2349 (Output_file::open_base_file): Add base_name and writable parameters;
2350 read base file into new file; print error message here.
2351 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2352 callers.
2353 * output.h (Output_file::open_for_modification): Rename to...
2354 (Output_file::open_base_file): ...this; add base_name and
2355 writable parameters; adjust all callers.
2356 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2357 callers.
2358 * testsuite/Makefile.am (incremental_test_4): Test
2359 --incremental-base.
2360 * testsuite/Makefile.in: Regenerate.
2361
2eedd706
CC
23622011-05-24 Cary Coutant <ccoutant@google.com>
2363
2364 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
2365 incremental_test_4.
2366 * testsuite/Makefile.in: Regenerate.
2367 * testsuite/two_file_test_1_v1.cc: New test source file.
2368 * testsuite/two_file_test_1b_v1.cc: New test source file.
2369 * testsuite/two_file_test_2_v1.cc: New test source file.
2370
0f1c85a6
CC
23712011-05-24 Cary Coutant <ccoutant@google.com>
2372
2373 * dynobj.h (Dynobj::do_dynobj): New function.
2374 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
2375 flag and soname for shared objects.
2376 * incremental.cc (Incremental_inputs::report_object): Make
2377 either Incremental_object_entry or Incremental_dynobj_entry; add
2378 soname to string table.
2379 (Incremental_inputs::report_input_section): Add assertion.
2380 (Output_section_incremental_inputs::set_final_data_size): Adjust
2381 type of input file entry for shared libraries; adjust size of
2382 shared library info entry.
2383 (Output_section_incremental_inputs::write_input_files): Write
2384 as_needed flag for shared libraries.
2385 (Output_section_incremental_inputs::write_info_blocks): Adjust type
2386 of input file entry for shared libraries; write soname.
2387 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
2388 soname from incremental info.
2389 * incremental.h (enum Incremental_input_flags): Add
2390 INCREMENTAL_INPUT_AS_NEEDED.
2391 (Incremental_input_entry::Incremental_input_entry): Initialize new
2392 data member.
2393 (Incremental_input_entry::set_as_needed): New function.
2394 (Incremental_input_entry::as_needed): New function.
2395 (Incremental_input_entry::do_dynobj_entry): New function.
2396 (Incremental_input_entry::as_needed_): New data member.
2397 (Incremental_object_entry::Incremental_object_entry): Don't check
2398 for shared library.
2399 (Incremental_object_entry::do_type): Likewise.
2400 (class Incremental_dynobj_entry): New class.
2401 (Incremental_input_entry_reader::as_needed): New function.
2402 (Incremental_input_entry_reader::get_soname): New function.
2403 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
2404 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
2405 size of shared library info entry.
58797674 2406 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
2407 incremental link when adding DT_NEEDED entries.
2408 * object.h (Object::Object): Initialize new data member.
2409 (Object::dynobj): New function.
2410 (Object::set_as_needed): New function.
2411 (Object::as_needed): New function.
2412 (Object::do_dynobj): New function.
2413 (Object::as_needed_): New data member.
2414
6fa2a40b
CC
24152011-05-24 Cary Coutant <ccoutant@google.com>
2416
2417 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
2418 info; adjust display of GOT entries.
2419 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2420 vector of input objects; remove file_status_.
2421 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
2422 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
2423 got_plt reader; call target hooks to reserve GOT entries.
2424 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2425 of input file info header and GOT info entry.
2426 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
2427 relocation info.
2428 (Got_plt_view_info::got_descriptor): Remove.
2429 (Got_plt_view_info::sym_index): New data member.
2430 (Got_plt_view_info::input_index): New data member.
2431 (Local_got_offset_visitor::visit): Write input file index.
2432 (Global_got_offset_visitor::visit): Write 0 for input file index.
2433 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
2434 with sym_index and input_index.
2435 (Output_section_incremental_inputs::write_got_plt): Adjust size of
2436 incremental info GOT entry; replace got_descriptor with input_index.
2437 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
2438 map from input file index to object.
2439 (Sized_relobj_incr::do_layout): Replace direct data member reference
2440 with accessor function.
2441 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
2442 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
2443 Adjust size of input file info header.
2444 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
2445 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
2446 (Incremental_input_entry_reader::get_input_section): Adjust size of
2447 input file info header.
2448 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
2449 of incremental info GOT entry.
2450 (Incremental_got_plt_reader::get_got_desc): Remove.
2451 (Incremental_got_plt_reader::get_got_symndx): New function.
2452 (Incremental_got_plt_reader::get_got_input_index): New function.
2453 (Sized_incremental_binary::Sized_incremental_binary): Remove
2454 file_status_; add input_objects_.
2455 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
2456 (Sized_incremental_binary::set_file_is_unchanged): Remove.
2457 (Sized_incremental_binary::file_is_unchanged): Remove.
2458 (Sized_incremental_binary::set_input_object): New function.
2459 (Sized_incremental_binary::input_object): New function.
2460 (Sized_incremental_binary::file_status_): Remove.
2461 (Sized_incremental_binary::input_objects_): New data member.
2462 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
2463 references.
2464 (Sized_relobj_incr::invalid_address): Move to base class.
2465 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
2466 class.
2467 (Sized_relobj_incr::do_output_section_offset): Likewise.
2468 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
2469 (Sized_relobj_incr::section_offsets_): Likewise.
2470 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
2471 function.
2472 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
2473 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
2474 with accessor function.
2475 (Sized_relobj_file::do_layout): Likewise.
2476 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
2477 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
2478 (Sized_relobj_file::compute_final_local_value): Replace refs to
2479 section_offsets_ with accessor function.
2480 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
2481 * object.h (Relobj::Relobj): Initialize new data members.
2482 (Relobj::add_dyn_reloc): New function.
2483 (Relobj::first_dyn_reloc): New function.
2484 (Relobj::dyn_reloc_count): New function.
2485 (Relobj::first_dyn_reloc_): New data member.
2486 (Relobj::dyn_reloc_count_): New data member.
2487 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
2488 references.
2489 (Sized_relobj::Address): New typedef.
2490 (Sized_relobj::invalid_address): Move here from child class.
2491 (Sized_relobj::Sized_relobj): Initialize new data members.
2492 (Sized_relobj::sized_relobj): New function.
2493 (Sized_relobj::is_output_section_offset_invalid): Move here from
2494 child class.
2495 (Sized_relobj::get_output_section_offset): Likewise.
2496 (Sized_relobj::local_has_got_offset): Likewise.
2497 (Sized_relobj::local_got_offset): Likewise.
2498 (Sized_relobj::set_local_got_offset): Likewise.
2499 (Sized_relobj::do_for_all_local_got_entries): Likewise.
2500 (Sized_relobj::clear_got_offsets): New function.
2501 (Sized_relobj::section_offsets): Move here from child class.
2502 (Sized_relobj::do_output_section_offset): Likewise.
2503 (Sized_relobj::do_set_section_offset): Likewise.
2504 (Sized_relobj::Local_got_offsets): Likewise.
2505 (Sized_relobj::local_got_offsets_): Likewise.
2506 (Sized_relobj::section_offsets_): Likewise.
2507 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
2508 references.
2509 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
2510 class.
2511 (Sized_relobj_file::sized_relobj): New function
2512 (Sized_relobj_file::local_has_got_offset): Move to base class.
2513 (Sized_relobj_file::local_got_offset): Likewise.
2514 (Sized_relobj_file::set_local_got_offset): Likewise.
2515 (Sized_relobj_file::get_output_section_offset): Likewise.
2516 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
2517 (Sized_relobj_file::do_output_section_offset): Likewise.
2518 (Sized_relobj_file::do_set_section_offset): Likewise.
2519 (Sized_relobj_file::Local_got_offsets): Likewise.
2520 (Sized_relobj_file::local_got_offsets_): Likewise.
2521 (Sized_relobj_file::section_offsets_): Likewise.
2522 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
2523 (all constructors).
2524 (set_needs_dynsym_index): Convert relobj to derived class pointer.
2525 (Output_reloc::get_symbol_index): Likewise.
2526 (Output_reloc::local_section_offset): Likewise.
2527 (Output_reloc::get_address): Likewise.
2528 (Output_reloc::symbol_value): Likewise.
2529 (Output_data_got::reserve_slot): Move to class definition.
2530 (Output_data_got::reserve_local): New function.
2531 (Output_data_got::reserve_slot_for_global): Remove.
2532 (Output_data_got::reserve_global): New function.
2533 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
2534 (all constructors, two instantiations).
2535 (Output_reloc::get_relobj): New function (two instantiations).
2536 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
2537 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
2538 (Output_data_reloc::add_global): Adjust type of relobj.
2539 (Output_data_reloc::add_global_relative): Likewise.
2540 (Output_data_reloc::add_symbolless_global_addend): Likewise.
2541 (Output_data_reloc::add_local): Likewise.
2542 (Output_data_reloc::add_local_relative): Likewise.
2543 (Output_data_reloc::add_symbolless_local_addend): Likewise.
2544 (Output_data_reloc::add_local_section): Likewise.
2545 (Output_data_reloc::add_output_section): Likewise.
2546 (Output_data_reloc::add_absolute): Likewise.
2547 (Output_data_reloc::add_target_specific): Likewise.
2548 (Output_data_got::reserve_slot): Move definition here.
2549 (Output_data_got::reserve_local): New function.
2550 (Output_data_got::reserve_global): New function.
2551 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
2552 section_offsets_ with accessor function.
2553 (Sized_relobj_file::write_sections): Likewise.
2554 (Sized_relobj_file::do_relocate_sections): Likewise.
2555 * target.h (Sized_target::reserve_local_got_entry): New function.
2556 (Sized_target::reserve_global_got_entry): New function.
2557 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
2558 (Target_x86_64::reserve_global_got_entry): New function.
2559 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
2560
4829d394
CC
25612011-05-23 Cary Coutant <ccoutant@google.com>
2562
2563 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
2564 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
2565 bit when checking got_type.
2566 * incremental.cc (Sized_incremental_binary::setup_readers):
2567 Store symbol table and string table locations; initialize bit vector
2568 of file status flags.
2569 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
2570 unchanged files.
2571 (Sized_incremental_binary::do_process_got_plt): New function.
2572 (Sized_incremental_binary::get_symtab_view): Use stored locations.
2573 (Output_section_incremental_inputs::set_final_data_size): Record
2574 file index for each input file.
2575 (Output_section_incremental_inputs::write_got_plt): Store file index
2576 instead of input entry offset for each GOT entry.
2577 * incremental.h
2578 (Incremental_input_entry::Incremental_input_entry): Initialize new
2579 data member.
2580 (Incremental_input_entry::set_offset): Store file index.
2581 (Incremental_input_entry::get_file_index): New function.
2582 (Incremental_input_entry::file_index_): New data member.
2583 (Incremental_binary::process_got_plt): New function.
2584 (Incremental_binary::do_process_got_plt): New function.
2585 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2586 data members.
2587 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
2588 (Sized_incremental_binary::set_file_is_unchanged): New function.
2589 (Sized_incremental_binary::file_is_unchanged): New function.
2590 (Sized_incremental_binary::do_process_got_plt): New function.
2591 (Sized_incremental_binary::file_status_): New data member.
2592 (Sized_incremental_binary::main_symtab_loc_): New data member.
2593 (Sized_incremental_binary::main_strtab_loc_): New data member.
2594 * output.cc (Output_data_got::Got_entry::write): Add case
2595 RESERVED_CODE.
2596 (Output_data_got::add_global): Call add_got_entry.
2597 (Output_data_got::add_global_plt): Likewise.
2598 (Output_data_got::add_global_with_rel): Likewise.
2599 (Output_data_got::add_global_with_rela): Likewise.
2600 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
2601 (Output_data_got::add_global_pair_with_rela): Likewise.
2602 (Output_data_got::add_local): Call add_got_entry.
2603 (Output_data_got::add_local_plt): Likewise.
2604 (Output_data_got::add_local_with_rel): Likewise.
2605 (Output_data_got::add_local_with_rela): Likewise.
2606 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
2607 (Output_data_got::add_local_pair_with_rela): Likewise.
2608 (Output_data_got::reserve_slot): New function.
2609 (Output_data_got::reserve_slot_for_global): New function.
2610 (Output_data_got::add_got_entry): New function.
2611 (Output_data_got::add_got_entry_pair): New function.
2612 (Output_section::add_output_section_data): Edit FIXME.
2613 * output.h
2614 (Output_section_data_build::Output_section_data_build): New
2615 constructor with size parameter.
2616 (Output_data_space::Output_data_space): Likewise.
2617 (Output_data_got::Output_data_got): Initialize new data member; new
2618 constructor with size parameter.
2619 (Output_data_got::add_constant): Call add_got_entry.
2620 (Output_data_got::reserve_slot): New function.
2621 (Output_data_got::reserve_slot_for_global): New function.
2622 (class Output_data_got::Got_entry): Add RESERVED_CODE.
2623 (Output_data_got::add_got_entry): New function.
2624 (Output_data_got::add_got_entry_pair): New function.
2625 (Output_data_got::free_list_): New data member.
2626 * target.h (Sized_target::init_got_plt_for_update): New function.
2627 (Sized_target::register_global_plt_entry): New function.
2628 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
2629 Initialize new data member; call init; add constructor with PLT count.
2630 (Output_data_plt_x86_64::init): New function.
2631 (Output_data_plt_x86_64::add_relocation): New function.
2632 (Output_data_plt_x86_64::reserve_slot): New function.
2633 (Output_data_plt_x86_64::free_list_): New data member.
2634 (Target_x86_64::init_got_plt_for_update): New function.
2635 (Target_x86_64::register_global_plt_entry): New function.
2636 (Output_data_plt_x86_64::add_entry): Allocate from free list for
2637 incremental updates.
2638 (Output_data_plt_x86_64::add_relocation): New function.
2639 * testsuite/object_unittest.cc (Object_test): Set default options.
2640
ec69d6da
ILT
26412011-05-16 Ian Lance Taylor <iant@google.com>
2642
2643 * options.h (class General_options): Make -i a synonym for -r.
2644
732e31de
ILT
26452011-05-16 Ian Lance Taylor <iant@google.com>
2646
2647 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
2648
403676b5
CC
26492011-05-10 Cary Coutant <ccoutant@google.com>
2650
2651 * object.cc (Sized_relobj::do_count_local_symbols): Check for
2652 strip_all (-s).
2653
5b7b7d6e
ILT
26542011-05-06 Ian Lance Taylor <iant@google.com>
2655
2656 * layout.cc (Layout::layout): If the output section flags change,
2657 update the ordering.
2658
f0f9babf
CC
26592011-04-25 Cary Coutant <ccoutant@google.com>
2660
2661 * incremental-dump.cc (dump_incremental_inputs): Print local
2662 symbol info for each input file.
2663 * incremental.cc
2664 (Output_section_incremental_inputs::set_final_data_size): Add local
2665 symbol info to input file entries in incremental info.
2666 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2667 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
2668 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
2669 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
2670 implementation.
2671 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
2672 (Sized_incr_relobj::do_relocate): Write the local symbols.
2673 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
2674 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
2675 Adjust size of input file header.
2676 (Incremental_inputs_reader::get_local_symbol_offset): New function.
2677 (Incremental_inputs_reader::get_local_symbol_count): New function.
2678 (Incremental_inputs_reader::get_input_section): Adjust size of input
2679 file header.
2680 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
2681 (Sized_incr_relobj::This): New typedef.
2682 (Sized_incr_relobj::sym_size): New const data member.
2683 (Sized_incr_relobj::Local_symbol): New struct.
2684 (Sized_incr_relobj::do_output_local_symbol_count): New function.
2685 (Sized_incr_relobj::do_local_symbol_offset): New function.
2686 (Sized_incr_relobj::local_symbol_count_): New data member.
2687 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
2688 (Sized_incr_relobj::local_symbol_index_): New data member.
2689 (Sized_incr_relobj::local_symbol_offset_): New data member.
2690 (Sized_incr_relobj::local_dynsym_offset_): New data member.
2691 (Sized_incr_relobj::local_symbols_): New data member.
2692 * object.h (Relobj::output_local_symbol_count): New function.
2693 (Relobj::local_symbol_offset): New function.
2694 (Relobj::do_output_local_symbol_count): New function.
2695 (Relobj::do_local_symbol_offset): New function.
2696 (Sized_relobj::do_output_local_symbol_count): New function.
2697 (Sized_relobj::do_local_symbol_offset): New function.
2698
d0a9ace3
ILT
26992011-04-22 Vladimir Simonov <sv@sw.ru>
2700
2701 * descriptors.cc (set_close_on_exec): New function.
2702 (Descriptors::open): Use set_close_on_exec.
2703 * output.cc (S_ISLNK): Define if not defined.
2704
94a3fc8b
CC
27052011-04-22 Cary Coutant <ccoutant@google.com>
2706
2707 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2708 global symbol map.
2709 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2710 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
2711 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
2712 relocations.
2713 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
2714 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
2715 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
2716 * incremental.h
2717 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
2718 function.
2719 (Incremental_binary::apply_incremental_relocs): New function.
2720 (Incremental_binary::do_apply_incremental_relocs): New function.
2721 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2722 data member.
2723 (Sized_incremental_binary::add_global_symbol): New function.
2724 (Sized_incremental_binary::global_symbol): New function.
2725 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2726 (Sized_incremental_binary::symbol_map_): New data member.
2727 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
2728 * target.h (Sized_target::apply_relocation): New function.
2729 * target-reloc.h (apply_relocation): New function.
2730 * x86_64.cc (Target_x86_64::apply_relocation): New function.
2731
c87e4302
DK
27322011-04-22 Doug Kwan <dougkwan@google.com>
2733
2734 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
2735 flag of a SHT_ARM_EXIDX section.
2e702c99 2736 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
2737 * testsuite/Makefile.in: Regenerate.
2738 * testsuite/arm_exidx_test.s: New file.
2739 * testsuite/arm_exidx_test.sh: Same.
2740
e7782cf6
CC
27412011-04-20 Cary Coutant <ccoutant@google.com>
2742
2743 PR gold/12689
2744 * archive.h (Incremental_archive_entry::Archive_member):
2745 Initialize arg_serial_ (second constructor).
2746
308ecdc7
ILT
27472011-04-17 Ian Lance Taylor <iant@google.com>
2748
2749 * object.cc (Relocate_info::location): Simplify location string.
2750 * errors.cc (Errors::error_at_location): Don't print program
2751 name.
2752 (Errors::warning_at_location): Likewise.
2753 (Errors::undefined_symbol): Likewise.
2754 * testsuite/debug_msg.sh: Update accordingly.
2755
bec5b579
CC
27562011-04-14 Cary Coutant <ccoutant@google.com>
2757
2758 * gold/layout.cc (Layout::symtab_section_offset): New function.
2759 * gold/layout.h (Layout::symtab_section_offset): New function.
2760 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
2761
88597d34
ILT
27622011-04-12 Ian Lance Taylor <iant@google.com>
2763
2764 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
2765 with MREMAP_MAYMOVE.
2766 * output.h (class Output_file): Add map_is_allocated_ field.
2767 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
2768 not available, provide stubs. If mremap is not available, #define
2769 it to gold_mremap.
2770 (MREMAP_MAYMOVE): Define if not defined.
2771 (Output_file::Output_file): Initialize map_is_allocated_.
2772 (Output_file::resize): Check map_is_allocated_.
2773 (Output_file::map_anonymous): If mmap fails, use malloc.
2774 (Output_file::unmap): Don't do anything for an anonymous map.
2775 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
2776 is not available, provide stubs.
2777 (File_read::View::~View): Use free rather than delete[].
2778 (File_read::make_view): Use malloc rather than new[]. If mmap
2779 fails, use malloc.
2780 (File_read::find_or_make_view): Use malloc rather than new[].
2781 * gold.h: Remove HAVE_REMAP code.
2782 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
2783 exists. Rename mremap to gold_mremap. If mmap is not available
2784 don't do anything.
2785 * configure, config.in: Rebuild.
2786
11e361bc
ILT
27872011-04-11 Ian Lance Taylor <iant@google.com>
2788
2789 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
2790 initialize local variable v.
2791
cdc29364
CC
27922011-04-11 Cary Coutant <ccoutant@google.com>
2793
2794 * archive.cc (Archive::include_member): Adjust call to
2795 report_object.
2796 (Add_archive_symbols::run): Track argument serial numbers.
2797 (Lib_group::include_member): Likewise.
2798 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
2799 * archive.h (Incremental_archive_entry::Archive_member):
2800 Initialize arg_serial_.
2801 (Archive_member::arg_serial_): New data member.
2802 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
2803 (Sized_dynobj::do_add_symbols): Track symbols when doing an
2804 incremental link.
2805 (Sized_dynobj::do_for_all_local_got_entries): New function.
2806 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
2807 function.
2808 * fileread.cc (get_mtime): New function.
2809 * fileread.h (get_mtime): New function.
2810 * gold.cc (queue_initial_tasks): Check for incremental update.
2811 (process_incremental_input): New function.
2812 (queue_middle_tasks): Don't force valid target for incremental
2813 update.
2814 * incremental-dump.cc (find_input_containing_global): Adjust
2815 size of symbol info entry.
2816 (dump_incremental_inputs): Dump argument serial number and
2817 in_system_directory flag; bias shndx by 1; print symbol names
2818 when dumping per-file symbol lists; use new symbol info readers.
2819 * incremental.cc
2820 (Output_section_incremental_inputs:update_data_size): New function.
2821 (Sized_incremental_binary::setup_readers): Setup input readers
2822 for each input file; build maps for files added from libraries
2823 and scripts.
2824 (Sized_incremental_binary::check_input_args): New function.
2825 (Sized_incremental_binary::do_check_inputs): Build map of argument
2826 serial numbers to input arguments.
2827 (Sized_incremental_binary::do_file_has_changed): Rename
2828 do_file_is_unchanged to this; compare file modification times.
2829 (Sized_incremental_binary::do_init_layout): New function.
2830 (Sized_incremental_binary::do_reserve_layout): New function.
2831 (Sized_incremental_binary::do_get_input_reader): Remove.
2832 (Sized_incremental_binary::get_symtab_view): New function.
2833 (Incremental_checker::can_incrementally_link_output_file): Remove.
2834 (Incremental_inputs::report_command_line): Exclude --debug options.
2835 (Incremental_inputs::report_archive_begin): Add parameter; track
2836 argument serial numbers; don't put input file entry for archive
2837 before archive members.
2838 (Incremental_inputs::report_archive_end): Put input file entry
2839 for archive after archive members.
2840 (Incremental_inputs::report_object): Add parameter; track argument
2841 serial numbers and in_system_directory flag.
2842 (Incremental_inputs::report_script): Add parameter; track argument
2843 serial numbers.
2844 (Output_section_incremental_inputs::set_final_data_size): Adjust
2845 size of symbol info entry; check for forwarding symbols.
2846 (Output_section_incremental_inputs::write_input_files): Write
2847 in_system_directory flag and argument serial number.
2848 (Output_section_incremental_inputs::write_info_blocks): Map section
2849 indices between incremental info and original input file; store
2850 input section index for each symbol.
2851 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
2852 change operator() to visit().
2853 (class Global_got_offset_visitor): Likewise.
2854 (class Global_symbol_visitor_got_plt):
2855 (Output_section_incremental_inputs::write_got_plt): Use new visitor
2856 classes.
2857 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
2858 (Sized_incr_relobj::do_read_symbols): New function.
2859 (Sized_incr_relobj::do_layout): New function.
2860 (Sized_incr_relobj::do_layout_deferred_sections): New function.
2861 (Sized_incr_relobj::do_add_symbols): New function.
2862 (Sized_incr_relobj::do_should_include_member): New function.
2863 (Sized_incr_relobj::do_for_all_global_symbols): New function.
2864 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
2865 (Sized_incr_relobj::do_section_size): New function.
2866 (Sized_incr_relobj::do_section_name): New function.
2867 (Sized_incr_relobj::do_section_contents): New function.
2868 (Sized_incr_relobj::do_section_flags): New function.
2869 (Sized_incr_relobj::do_section_entsize): New function.
2870 (Sized_incr_relobj::do_section_address): New function.
2871 (Sized_incr_relobj::do_section_type): New function.
2872 (Sized_incr_relobj::do_section_link): New function.
2873 (Sized_incr_relobj::do_section_info): New function.
2874 (Sized_incr_relobj::do_section_addralign): New function.
2875 (Sized_incr_relobj::do_initialize_xindex): New function.
2876 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
2877 (Sized_incr_relobj::do_read_relocs): New function.
2878 (Sized_incr_relobj::do_gc_process_relocs): New function.
2879 (Sized_incr_relobj::do_scan_relocs): New function.
2880 (Sized_incr_relobj::do_count_local_symbols): New function.
2881 (Sized_incr_relobj::do_finalize_local_symbols): New function.
2882 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
2883 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
2884 (Sized_incr_relobj::do_relocate): New function.
2885 (Sized_incr_relobj::do_set_section_offset): New function.
2886 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
2887 (Sized_incr_dynobj::do_read_symbols): New function.
2888 (Sized_incr_dynobj::do_layout): New function.
2889 (Sized_incr_dynobj::do_add_symbols): New function.
2890 (Sized_incr_dynobj::do_should_include_member): New function.
2891 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
2892 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
2893 (Sized_incr_dynobj::do_section_size): New function.
2894 (Sized_incr_dynobj::do_section_name): New function.
2895 (Sized_incr_dynobj::do_section_contents): New function.
2896 (Sized_incr_dynobj::do_section_flags): New function.
2897 (Sized_incr_dynobj::do_section_entsize): New function.
2898 (Sized_incr_dynobj::do_section_address): New function.
2899 (Sized_incr_dynobj::do_section_type): New function.
2900 (Sized_incr_dynobj::do_section_link): New function.
2901 (Sized_incr_dynobj::do_section_info): New function.
2902 (Sized_incr_dynobj::do_section_addralign): New function.
2903 (Sized_incr_dynobj::do_initialize_xindex): New function.
2904 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
2905 (make_sized_incremental_object): New function.
2906 (Incremental_library::copy_unused_symbols): New function.
2907 (Incremental_library::do_for_all_unused_symbols): New function.
2908 * incremental.h (enum Incremental_input_flags): New type.
2909 (class Incremental_checker): Remove.
2910 (Incremental_input_entry::Incremental_input_entry): Add argument
2911 serial number.
2912 (Incremental_input_entry::arg_serial): New function.
2913 (Incremental_input_entry::set_is_in_system_directory): New function.
2914 (Incremental_input_entry::is_in_system_directory): New function.
2915 (Incremental_input_entry::arg_serial_): New data member.
2916 (Incremental_input_entry::is_in_system_directory_): New data member.
2917 (class Script_info): Move here from script.h.
2918 (Script_info::Script_info): Add filename parameter.
2919 (Script_info::filename): New function.
2920 (Script_info::filename_): New data member.
2921 (Incremental_script_entry::Incremental_script_entry): Add argument
2922 serial number.
2923 (Incremental_object_entry::Incremental_object_entry): Likewise.
2924 (Incremental_object_entry::add_input_section): Build list of input
2925 sections with map to original shndx.
2926 (Incremental_object_entry::get_input_section_index): New function.
2927 (Incremental_object_entry::shndx_): New data member.
2928 (Incremental_object_entry::name_key_): Rename; adjust all refs.
2929 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
2930 (Incremental_archive_entry::Incremental_archive_entry): Add argument
2931 serial number.
2932 (Incremental_inputs::report_archive_begin): Likewise.
2933 (Incremental_inputs::report_object): Likewise.
2934 (Incremental_inputs::report_script): Likewise.
2935 (class Incremental_global_symbol_reader): New class.
2936 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
2937 and store flags and input file type.
2938 (Incremental_input_entry_reader::arg_serial): New function.
2939 (Incremental_input_entry_reader::type): Extract type from flags.
2940 (Incremental_input_entry_reader::is_in_system_directory): New function.
2941 (Incremental_input_entry_reader::get_input_section_count): Call
2942 accessor function for type.
2943 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
2944 function for type; adjust size of global symbol entry.
2945 (Incremental_input_entry_reader::get_global_symbol_count): Call
2946 accessor function for type.
2947 (Incremental_input_entry_reader::get_object_count): Likewise.
2948 (Incremental_input_entry_reader::get_object_offset): Likewise.
2949 (Incremental_input_entry_reader::get_member_count): Likewise.
2950 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
2951 (Incremental_input_entry_reader::get_member_offset): Likewise.
2952 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
2953 (Incremental_input_entry_reader::Global_symbol_info): Remove.
2954 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
2955 (Incremental_input_entry_reader::get_global_symbol_reader): New
2956 function.
2957 (Incremental_input_entry_reader::get_output_symbol_index): New
2958 function.
2959 (Incremental_input_entry_reader::type_): Remove.
2960 (Incremental_input_entry_reader::flags_): New data member.
2961 (Incremental_inputs_reader::input_file_offset): New function.
2962 (Incremental_inputs_reader::input_file_index): New function.
2963 (Incremental_inputs_reader::input_file): Call input_file_offset.
2964 (Incremental_inputs_reader::input_file_at_offset): New function.
2965 (Incremental_relocs_reader::get_r_type): Reformat.
2966 (Incremental_relocs_reader::get_r_shndx): Reformat.
2967 (Incremental_relocs_reader::get_r_offset): Reformat.
2968 (Incremental_relocs_reader::data): New function.
2969 (Incremental_binary::Incremental_binary): Initialize new data members.
2970 (Incremental_binary::check_inputs): Add cmdline parameter.
2971 (Incremental_binary::file_is_unchanged): Remove.
2972 (Input_reader::arg_serial): New function.
2973 (Input_reader::get_unused_symbol_count): New function.
2974 (Input_reader::get_unused_symbol): New function.
2975 (Input_reader::do_arg_serial): New function.
2976 (Input_reader::do_get_unused_symbol_count): New function.
2977 (Input_reader::do_get_unused_symbol): New function.
2978 (Incremental_binary::input_file_count): New function.
2979 (Incremental_binary::get_input_reader): Change signature to use
2980 index instead of filename.
2981 (Incremental_binary::file_has_changed): New function.
2982 (Incremental_binary::get_input_argument): New function.
2983 (Incremental_binary::get_library): New function.
2984 (Incremental_binary::get_script_info): New function.
2985 (Incremental_binary::init_layout): New function.
2986 (Incremental_binary::reserve_layout): New function.
2987 (Incremental_binary::output_file): New function.
2988 (Incremental_binary::do_check_inputs): New function.
2989 (Incremental_binary::do_file_is_unchanged): Remove.
2990 (Incremental_binary::do_file_has_changed): New function.
2991 (Incremental_binary::do_init_layout): New function.
2992 (Incremental_binary::do_reserve_layout): New function.
2993 (Incremental_binary::do_input_file_count): New function.
2994 (Incremental_binary::do_get_input_reader): Change signature.
2995 (Incremental_binary::input_args_map_): New data member.
2996 (Incremental_binary::library_map_): New data member.
2997 (Incremental_binary::script_map_): New data member.
2998 (Sized_incremental_binary::Sized_incremental_binary): Initialize
2999 new data members.
3000 (Sized_incremental_binary::output_section): New function.
3001 (Sized_incremental_binary::inputs_reader): Add const.
3002 (Sized_incremental_binary::symtab_reader): Add const.
3003 (Sized_incremental_binary::relocs_reader): Add const.
3004 (Sized_incremental_binary::got_plt_reader): Add const.
3005 (Sized_incremental_binary::get_symtab_view): New function.
3006 (Sized_incremental_binary::Inputs_reader): New typedef.
3007 (Sized_incremental_binary::Input_entry_reader): New typedef.
3008 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
3009 (Sized_incremental_binary::do_file_is_unchanged): Remove.
3010 (Sized_incremental_binary::do_file_has_changed): New function.
3011 (Sized_incremental_binary::do_init_layout): New function.
3012 (Sized_incremental_binary::do_reserve_layout): New function.
3013 (Sized_input_reader::Inputs_reader): Remove.
3014 (Sized_input_reader::Input_entry_reader): Remove.
3015 (Sized_input_reader::do_arg_serial): New function.
3016 (Sized_input_reader::do_get_unused_symbol_count): New function.
3017 (Sized_input_reader::do_get_unused_symbol): New function.
3018 (Sized_incremental_binary::do_input_file_count): New function.
3019 (Sized_incremental_binary::do_get_input_reader): Change signature;
3020 use index instead of filename.
3021 (Sized_incremental_binary::section_map_): New data member.
3022 (Sized_incremental_binary::input_entry_readers_): New data member.
3023 (class Sized_incr_relobj): New class.
3024 (class Sized_incr_dynobj): New class.
3025 (make_sized_incremental_object): New function.
3026 (class Incremental_library): New class.
3027 * layout.cc (Free_list::num_lists): New static data member.
3028 (Free_list::num_nodes): New static data member.
3029 (Free_list::num_removes): New static data member.
3030 (Free_list::num_remove_visits): New static data member.
3031 (Free_list::num_allocates): New static data member.
3032 (Free_list::num_allocate_visits): New static data member.
3033 (Free_list::init): New function.
3034 (Free_list::remove): New function.
3035 (Free_list::allocate): New function.
3036 (Free_list::dump): New function.
3037 (Free_list::print_stats): New function.
3038 (Layout_task_runner::run): Resize output file for incremental updates.
3039 (Layout::Layout): Initialize new data members.
3040 (Layout::set_incremental_base): New function.
3041 (Layout::init_fixed_output_section): New function.
3042 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
3043 incremental updates.
3044 (Layout::create_gold_note): Do not create gold note section for
3045 incremental updates.
3046 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
3047 for incremental updates.
3048 (Layout::set_section_offsets): For incremental updates, allocate space
3049 from free list.
3050 (Layout::create_symtab_sections): Layout with offsets relative to
3051 start of section; for incremental updates, allocate space from free
3052 list.
3053 (Layout::create_shdrs): For incremental updates, allocate space from
3054 free list.
3055 (Layout::finish_dynamic_section): For incremental updates, do not
3056 check --as-needed (fixed in subsequent patch).
3057 * layout.h (class Free_list): New class.
3058 (Layout::set_incremental_base): New function.
3059 (Layout::incremental_base): New function.
3060 (Layout::init_fixed_output_section): New function.
3061 (Layout::allocate): New function.
3062 (Layout::incremental_base_): New data member.
3063 (Layout::free_list_): New data member.
3064 * main.cc (main): Print Free_list statistics.
3065 * object.cc (Relobj::finalize_incremental_relocs): Add
3066 clear_counts parameter; clear counts only when clear_counts is set.
3067 (Sized_relobj::Sized_relobj): Initialize new base class.
3068 (Sized_relobj::do_layout): Don't report special sections.
3069 (Sized_relobj::do_for_all_local_got_entries): New function.
3070 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
3071 symtab_off to all symbol table offsets.
3072 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
3073 * object.h (class Got_offset_list): Move to top of file.
3074 (Object::Object): Allow case where input_file == NULL.
3075 (Object::~Object): Likewise.
3076 (Object::input_file): Assert that input_file != NULL.
3077 (Object::lock): Allow case where input_file == NULL.
3078 (Object::unlock): Likewise.
3079 (Object::is_locked): Likewise.
3080 (Object::token): Likewise.
3081 (Object::release): Likewise.
3082 (Object::is_incremental): New function.
3083 (Object::get_mtime): New function.
3084 (Object::for_all_local_got_entries): New function.
3085 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
3086 (Object::set_is_in_system_directory): New function.
3087 (Object::is_in_system_directory): New function.
3088 (Object::do_is_incremental): New function.
3089 (Object::do_get_mtime): New function.
3090 (Object::do_for_all_local_got_entries): New function.
3091 (Object::is_in_system_directory_): New data member.
3092 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
3093 (class Sized_relobj_base): New class.
3094 (class Sized_relobj): Derive from Sized_relobj_base.
3095 (class Sized_relobj::Symbols): Redeclare from base class.
3096 (class Sized_relobj::local_got_offset_list): Remove.
3097 (class Sized_relobj::Output_sections): Redeclare from base class.
3098 (class Sized_relobj::do_for_all_local_got_entries): New function.
3099 (class Sized_relobj::write_local_symbols): Add offset parameter.
3100 (class Sized_relobj::local_symbol_offset_): Update comment.
3101 (class Sized_relobj::local_dynsym_offset_): Update comment.
3102 * options.cc (Input_arguments::add_file): Remove const.
3103 * options.h (Input_file_argument::Input_file_argument):
3104 Initialize arg_serial_ (all constructors).
3105 (Input_file_argument::set_arg_serial): New function.
3106 (Input_file_argument::arg_serial): New function.
3107 (Input_file_argument::arg_serial_): New data member.
3108 (Input_arguments::Input_arguments): Initialize file_count_.
3109 (Input_arguments::add_file): Remove const.
3110 (Input_arguments::number_of_input_files): New function.
3111 (Input_arguments::file_count_): New data member.
3112 (Command_line::number_of_input_files): Call
3113 Input_arguments::number_of_input_files.
3114 * output.cc (Output_segment_headers::Output_segment_headers):
3115 Set current size.
3116 (Output_section::Input_section::current_data_size): New function.
3117 (Output_section::Output_section): Initialize new data members.
3118 (Output_section::add_input_section): Don't do merge sections for
3119 an incremental link; allocate space from free list for an
3120 incremental update.
3121 (Output_section::add_output_section_data): Allocate space from
3122 free list for an incremental update.
3123 (Output_section::update_data_size): New function.
3124 (Output_section::set_fixed_layout): New function.
3125 (Output_section::reserve): New function.
3126 (Output_segment::set_section_addresses): Remove const.
3127 (Output_segment::set_section_list_addresses): Remove const; allocate
3128 space from free list for an incremental update.
3129 (Output_segment::set_offset): Adjust size of RELRO segment for an
3130 incremental update.
3131 * output.h (Output_data::current_data_size): Move here from
3132 child classes.
3133 (Output_data::pre_finalize_data_size): New function.
3134 (Output_data::update_data_size): New function.
3135 (Output_section_headers::update_data_size): new function.
3136 (Output_section_data_build::current_data_size): Move to Output_data.
3137 (Output_data_strtab::update_data_size): New function.
3138 (Output_section::current_data_size): Move to Output_data.
3139 (Output_section::set_fixed_layout): New function.
3140 (Output_section::has_fixed_layout): New function.
3141 (Output_section::reserve): New function.
3142 (Output_section::update_data_size): New function.
3143 (Output_section::has_fixed_layout_): New data member.
3144 (Output_section::free_list_): New data member.
3145 (Output_segment::set_section_addresses): Remove const.
3146 (Output_segment::set_section_list_addresses): Remove const.
3147 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
3148 New function.
3149 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
3150 New function.
3151 * readsyms.cc (Read_symbols::do_read_symbols): Add library
3152 parameter when calling Add_symbols constructor; store argument
3153 serial number for members of a lib group.
3154 (Add_symbols::locks): Allow case where token == NULL.
3155 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
3156 (Read_member::~Read_member): New function.
3157 (Read_member::is_runnable): New function.
3158 (Read_member::locks): New function.
3159 (Read_member::run): New function.
3160 (Check_script::~Check_script): New function.
3161 (Check_script::is_runnable): New function.
3162 (Check_script::locks): New function.
3163 (Check_script::run): New function.
3164 (Check_library::~Check_library): New function.
3165 (Check_library::is_runnable): New function.
3166 (Check_library::locks): New function.
3167 (Check_library::run): New function.
3168 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
3169 (Add_symbols::library_): New data member.
3170 (class Read_member): New class.
3171 (class Check_script): New class.
3172 (class Check_library): New class.
3173 * reloc.cc (Read_relocs::is_runnable): Allow case where
3174 token == NULL.
3175 (Read_relocs::locks): Likewise.
3176 (Scan_relocs::locks): Likewise.
3177 (Relocate_task::locks): Likewise.
3178 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
3179 to clear counters.
3180 (Sized_relobj::incremental_relocs_scan): Fix comment.
3181 (Sized_relobj::do_relocate): Pass output file offset to
3182 write_local_symbols.
3183 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
3184 from class declaration.
3185 * script.cc (read_input_script): Allocate Script_info; pass
3186 argument serial number to report_script.
3187 * script.h (class Script_info): Move to incremental.h.
3188 * symtab.cc (Symbol_table::add_from_incrobj): New function.
3189 * symtab.h (Symbol_table::add_from_incrobj): New function.
3190 (Symbol_table::set_file_offset): New function.
3191
b961d0d7
CC
31922011-04-05 Cary Coutant <ccoutant@google.com>
3193
3194 * incremental-dump.cc (dump_incremental_inputs): Change signature
3195 to take a Sized_incremental_binary; change caller. Use readers
3196 in Sized_incremental_binary.
3197 * incremental.cc
3198 (Sized_incremental_binary::find_incremental_inputs_sections):
3199 Rename do_find_incremental_inputs_sections to this.
3200 (Sized_incremental_binary::setup_readers): New function.
3201 (Sized_incremental_binary::do_check_inputs): Check
3202 has_incremental_info_ flag; move setup code to setup_readers;
3203 use input readers.
3204 (Sized_incremental_binary::do_file_is_unchanged): New function.
3205 (Sized_incremental_binary::do_get_input_reader): New function.
3206 * incremental.h (class Incremental_binary): Move to end of file.
3207 (Incremental_binary::file_is_unchanged): New function.
3208 (Incremental_binary::do_file_is_unchanged): New function.
3209 (Incremental_binary::Input_reader): New class.
3210 (Incremental_binary::get_input_reader): New function.
3211 (class Sized_incremental_binary): Move to end of file.
3212 (Sized_incremental_binary::Sized_incremental_binary): Setup the
3213 input section reader classes.
3214 (Sized_incremental_binary::has_incremental_info): New function.
3215 (Sized_incremental_binary::inputs_reader): New function.
3216 (Sized_incremental_binary::symtab_reader): New function.
3217 (Sized_incremental_binary::relocs_reader): New function.
3218 (Sized_incremental_binary::got_plt_reader): New function.
3219 (Sized_incremental_binary::do_file_is_unchanged): New function.
3220 (Sized_incremental_binary::Sized_input_reader): New class.
3221 (Sized_incremental_binary::get_input_reader): New function.
3222 (Sized_incremental_binary::find_incremental_inputs_sections):
3223 Rename do_find_incremental_inputs_sections to this.
3224 (Sized_incremental_binary::setup_readers): New function.
3225 (Sized_incremental_binary::has_incremental_info_): New data member.
3226 (Sized_incremental_binary::inputs_reader_): New data member.
3227 (Sized_incremental_binary::symtab_reader_): New data member.
3228 (Sized_incremental_binary::relocs_reader_): New data member.
3229 (Sized_incremental_binary::got_plt_reader_): New data member.
3230 (Sized_incremental_binary::current_input_file_): New data member.
3231
a869183f
PP
32322011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
3233
3234 PR gold/12640
3235 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
3236 violation.
3237
32382011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
3239
3240 * archive.cc (Archive::include_member): Adjust call to report_object.
3241 (Add_archive_symbols::run): Add script_info to call to
3242 report_archive_begin.
3243 (Lib_group::include_member): Adjust call to report_object.
3244 (Add_lib_group_symbols::run): Adjust call to report_object.
3245 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
3246 blocks. Add object count for script input files.
3247 * incremental.cc (Incremental_inputs::report_archive_begin): Add
3248 script_info parameter; change all callers.
3249 (Incremental_inputs::report_object): Add script_info parameter;
3250 change all callers.
3251 (Incremental_inputs::report_script): Store backpointer to
3252 incremental info entry.
3253 (Output_section_incremental_inputs::set_final_data_size): Record
3254 additional information for scripts.
3255 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3256 * incremental.h (Incremental_script_entry::add_object): New function.
3257 (Incremental_script_entry::get_object_count): New function.
3258 (Incremental_script_entry::get_object): New function.
3259 (Incremental_script_entry::objects_): New data member; adjust
3260 constructor.
3261 (Incremental_inputs::report_archive_begin): Add script_info parameter.
3262 (Incremental_inputs::report_object): Add script_info parameter.
3263 (Incremental_inputs_reader::get_object_count): New function.
3264 (Incremental_inputs_reader::get_object_offset): New function.
3265 * options.cc (Input_arguments::add_file): Return reference to
3266 new input argument.
3267 * options.h (Input_argument::set_script_info): New function.
3268 (Input_argument::script_info): New function.
3269 (Input_argument::script_info_): New data member; adjust all
3270 constructors.
3271 (Input_file_group::add_file): Return reference to new input argument.
3272 (Input_file_lib::add_file): Likewise.
3273 (Input_arguments::add_file): Likewise.
3274 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
3275 * script.cc (Parser_closure::Parser_closure): Add script_info
3276 parameter; adjust all callers.
3277 (Parser_closure::script_info): New function.
3278 (Parser_closure::script_info_): New data member.
3279 (read_input_script): Report scripts earlier to incremental info.
3280 (script_add_file): Set script_info in Input_argument.
3281 (script_add_library): Likewise.
3282 * script.h (Script_options::Script_info): Rewrite class.
3283
a869183f 32842011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
3285
3286 * archive.cc (Library_base::should_include_member): Move
3287 method here from class Archive.
3288 (Archive::Archive): Initialize base class.
3289 (Archive::should_include_member): Move to base class.
3290 (Archive::do_for_all_unused_symbols): New function.
3291 (Add_archive_symbols::run): Remove redundant access to
3292 incremental_inputs.
3293 (Lib_group::Lib_group): Initialize base class.
3294 (Lib_group::do_filename): New function.
3295 (Lib_group::include_member): Pass pointer to Lib_group to
3296 report_object.
3297 (Lib_group::do_for_all_unused_symbols): New function.
3298 (Add_lib_group_symbols::run): Report archive information for
3299 incremental links.
3300 * archive.h (class Library_base): New base class.
3301 (class Archive): Derive from Library_base.
3302 (Archive::filename): Move to base class.
3303 (Archive::set_incremental_info): Likewise.
3304 (Archive::incremental_info): Likewise.
3305 (Archive::Should_include): Likewise.
3306 (Archive::should_include_member): Likewise.
3307 (Archive::Armap_entry): Remove.
3308 (Archive::Unused_symbol_iterator): Remove.
3309 (Archive::unused_symbols_begin): Remove.
3310 (Archive::unused_symbols_end): Remove.
3311 (Archive::do_filename): New function.
3312 (Archive::do_get_mtime): New function.
3313 (Archive::do_for_all_unused_symbols): New function.
3314 (Archive::task_): Move to base class.
3315 (Archive::incremental_info_): Likewise.
3316 (class Lib_group): Derive from Library_base.
3317 (Lib_group::do_filename): New function.
3318 (Lib_group::do_get_mtime): New function.
3319 (Lib_group::do_for_all_unused_symbols): New function.
3320 (Lib_group::task_): Move to base class.
3321 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
3322 function.
3323 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
3324 function.
3325 * incremental.cc (Incremental_inputs::report_archive_begin):
3326 Use Library_base; call library's get_mtime; add incremental inputs
3327 entry before members.
3328 (class Unused_symbol_visitor): New class.
3329 (Incremental_inputs::report_archive_end): Use Library_base; use
3330 visitor class to record unused symbols; don't add incremental inputs
3331 entry after members.
3332 (Incremental_inputs::report_object): Use Library_base.
3333 * incremental.h
3334 (Incremental_archive_entry::Incremental_archive_entry): Remove
3335 unused Archive parameter.
3336 (Incremental_inputs::report_archive_begin): Use Library_base.
3337 (Incremental_inputs::report_archive_end): Likewise.
3338 (Incremental_inputs::report_object): Likewise.
3339 * object.cc (Sized_relobj::do_for_all_global_symbols): New
3340 function.
3341 * object.h (Object::for_all_global_symbols): New function.
3342 (Object::do_for_all_global_symbols): New function.
3343 (Sized_relobj::do_for_all_global_symbols): New function.
3344 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
3345 function.
3346 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
3347 function.
3348
61ab3e40
ILT
33492011-03-27 Ian Lance Taylor <iant@google.com>
3350
3351 * archive.cc (Archive::interpret_header): Return -1 if something
3352 goes wrong. Change callers accordingly.
3353
30e1f9e6
CC
33542011-03-25 Cary Coutant <ccoutant@google.com>
3355
3356 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
3357 * testsuite/Makefile.in: Regenerate.
3358
9370ce59 33592011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
3360
3361 * plugin.cc (get_view): New.
3362 (Plugin::load): Pass get_view to the plugin.
3363 (Plugin_manager::get_view): New.
3364
9312bb0a
ILT
33652011-03-21 Ian Lance Taylor <iant@google.com>
3366
3367 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 3368 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 3369
7e12ba9e
ST
33702011-03-21 Sriraman Tallam <tmsriram@google.com>
3371
3372 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
3373 Change == to -eq.
3374 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
3375 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
3376 Change == to -eq.
3377 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
3378 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
3379
fd7a005d
ILT
33802011-03-14 Ian Lance Taylor <iant@google.com>
3381
3382 * script-sections.cc (Sort_output_sections::script_compare):
3383 Rename from is_before, change return type.
3384 (Sort_output_sections::operator()): Adjust accordingly.
3385
ed16fd1b
ILT
33862011-03-11 Jeffrey Yasskin <jyasskin@google.com>
3387
3388 PR gold/12572
3389 * testsuite/odr_violation2.cc: Add comment to make all error line
3390 numbers double digits.
3391 * testsuite/debug_msg.sh: Adjust expected errors.
3392
71ff8986
ILT
33932011-03-09 Jeffrey Yasskin <jyasskin@google.com>
3394
3395 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
3396 but mark earlier ones as non-canonical
3397 (offset_to_iterator): Update search target and example
3398 (do_addr2line): Return extra lines in a vector*
3399 (format_file_lineno): Extract from do_addr2line
3400 (one_addr2line): Add vector* out-param
3401 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
3402 when a lineno entry appeared last for its instruction
3403 (Dwarf_line_info): Add vector* out-param
3404 * object.cc (Relocate_info): Pass NULL for the vector* out-param
3405 * symtab.cc (Odr_violation_compare): Include the lineno in the
3406 comparison again.
3407 (linenos_from_loc): New. Combine the canonical line for an
3408 address with its other lines.
3409 (True_if_intersect): New. Helper functor to make
3410 std::set_intersection a query.
3411 (detect_odr_violations): Compare sets of lines instead of just
3412 one line for each function. This became less deterministic, but
3413 has fewer false positives.
3414 * symtab.h: Declarations.
3415 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
3416 mix an optimized and non-optimized object in the same binary
3417 (odr_violation2.so): Same.
3418 * testsuite/Makefile.in: Regenerate from Makefile.am.
3419 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
3420 * testsuite/debug_msg.sh: Update line numbers and add
3421 assertions.
3422 * testsuite/odr_violation1.cc: Use OdrDerived, in a
3423 non-optimized context.
3424 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
3425 isn't inlined, and use OdrDerived in an optimized context.
3426 * testsuite/odr_header1.h: Defines OdrDerived, where
3427 optimization will change the
3428 first-instruction-in-the-destructor's file and line number.
3429 * testsuite/odr_header2.h: Defines OdrBase.
3430
a19fefdc
ILT
34312011-03-09 Ian Lance Taylor <iant@google.com>
3432
3433 * fileread.cc (File_read::clear_views): Don't delete the whole
3434 file view.
3435
ecb351e9
ILT
34362011-03-08 Ian Lance Taylor <iant@google.com>
3437
3438 PR gold/12525
3439 * fileread.cc: #include <climits>.
3440 (GOLD_IOV_MAX): Define.
3441 (File_read::read_multiple): Limit number of entries by iov_max.
3442 * fileread.h (class File_read): Always set max_readv_entries to
3443 128.
3444
b821d13c
ILT
34452011-03-07 Ian Lance Taylor <iant@google.com>
3446
3447 PR gold/12525
3448 * options.h (class General_options): Add -dy and -dn.
3449
89243142
CC
34502011-03-02 Cary Coutant <ccoutant@google.com>
3451
3452 * testsuite/script_test_9.t: Add TLS segment.
3453
d0773f31
ILT
34542011-03-02 Simon Baldwin <simonb@google.com>
3455
3456 * configure.ac: Add check for gnu_indirect_function support in
3457 the toolchain building binutils.
3458 * configure: Rebuild.
3459
9370ce59 34602011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
3461
3462 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
3463 plugin only symbols.
3464 (Symbol_table::sized_finalize_symbol) Mark symbol only present
3465 in plugin files as not needed in the symbol table.
3466
4cf7a849
ST
34672011-02-11 Sriraman Tallam <tmsriram@google.com>
3468
3469 * output.cc (Output_section::add_input_section): Delay fill
3470 generation for section ordering.
3471
b578bd7d
ILT
34722011-02-09 Ian Lance Taylor <iant@google.com>
3473
3474 PR gold/12316
3475 * object.h (class Sized_relobj): Remove clear_local_symbols.
3476 * reloc.cc (Sized_relobj::do_relocate): Don't call
3477 clear_local_symbols.
3478
9370ce59 34792011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
3480
3481 * plugin.cc (is_visible_from_outside): Return true for symbols
3482 in the -u option.
3483
55382fb7
ILT
34842011-02-04 Jeffrey Yasskin <jyasskin@google.com>
3485
3486 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
3487 filename.
3488
4e271fff
ST
34892011-02-02 Sriraman Tallam <tmsriram@google.com>
3490
3491 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 3492 to std::string.
4e271fff 3493 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 3494 section_name to be std::string.
4e271fff
ST
3495 (is_function_ctor_or_dtor): Change type of parameter to std::string.
3496
d433c3ac
ILT
34972011-01-25 Ian Lance Taylor <iant@google.com>
3498
3499 * script.cc (script_add_extern): Rewrite to use
3500 add_symbol_reference.
3501
880473a6
DK
35022011-01-25 Doug Kwan <dougkwan@google.com>
3503
d433c3ac 3504 * icf.cc (get_section_contents): Always lock section's object.
880473a6 3505
f30f86fa
ILT
35062011-01-24 Ian Lance Taylor <iant@google.com>
3507
3508 * options.h (class General_options): Accept
3509 --no-detect-odr-violations.
3510
8e51a0b9
ILT
35112011-01-24 Ian Lance Taylor <iant@google.com>
3512
3513 * version.cc (version_string): Bump to 1.11.
3514
0f3b89d8
ILT
35152011-01-24 Ian Lance Taylor <iant@google.com>
3516
3517 * plugin.cc (class Plugin_rescan): Define new class.
3518 (Plugin_manager::claim_file): Set any_claimed_.
3519 (Plugin_manager::save_archive): New function.
3520 (Plugin_manager::save_input_group): New function.
3521 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
3522 necessary.
3523 (Plugin_manager::new_undefined_symbol): New function.
3524 (Plugin_manager::rescan): New function.
3525 (Plugin_manager::rescannable_defines): New function.
3526 (Plugin_manager::add_input_file): Set any_added_.
3527 * plugin.h (class Plugin_manager): define new fields rescannable_,
3528 undefined_symbols_, any_claimed_, and any_added_. Declare
3529 Plugin_rescan as friend. Declare new functions.
3530 (Plugin_manager::Rescannable): Define type.
3531 (Plugin_manager::Rescannable_list): Define type.
3532 (Plugin_manager::Undefined_symbol_list): Define type.
3533 (Plugin_manager::Plugin_manager): Initialize new fields.
3534 * archive.cc (Archive::defines_symbol): New function.
3535 (Add_archive_symbols::run): Pass archive to plugins if any.
3536 * archive.h (class Archive): Declare defines_symbol.
3537 * readsyms.cc (Input_group::~Input_group): New function.
3538 (Finish_group::run): Pass input_group to plugins if any.
3539 * readsyms.h (class Input_group): Declare destructor.
3540 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
3541 any.
3542
3bb951e5
ILT
35432011-01-10 Ian Lance Taylor <iant@google.com>
3544
3545 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
3546 section as relro.
3547 (Layout::set_segment_offsets): Reset increase_relro before calling
3548 set_section_addresses a second time.
3549
0aa45fac
CC
35502011-01-04 Cary Coutant <ccoutant@google.com>
3551
3552 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
3553 sections before NOBITS sections.
3554
0db46eb4
L
35552011-01-01 H.J. Lu <hongjiu.lu@intel.com>
3556
3557 * version.cc (print_version): Update copyright to 2011.
3558
829c9745
CC
35592010-12-23 Cary Coutant <ccoutant@google.com>
3560
3561 * output.h (Output_data_reloc::add_output_section): Pass OD instead
3562 of OS to this->add. Add OD parameter to second form of the function.
3563
7500420b
ILT
35642010-12-20 Ian Lance Taylor <iant@google.com>
3565
3566 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
3567 second of two consecutive entries with same offset.
3568
f8e9a930
RW
35692010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3570
3571 * testsuite/Makefile.am (ifuncmain2static_LDADD)
3572 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
3573 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
3574 to avoid unneeded links against $(LDADD).
3575 * testsuite/Makefile.in: Regenerate.
3576
2fbb4320
ILT
35772010-12-15 Ian Lance Taylor <iant@google.com>
3578
3579 PR gold/12324
3580 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
3581 for R_X86_64_32 and R_X86_64_PC32.
3582 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
3583 ver_matching_def_pic.o.
3584 (ver_matching_def_pic.o): New target.
3585
fedb228d
RW
35862010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3587
3588 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
3589 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
3590 Move definition before File_read::View member definitions.
3591 (File_read::View::~View): Initialize and hold lock before
3592 updating current_mapped_bytes.
3593
9b547ce6
RW
35942010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3595
3596 * dwarf_reader.cc: Remove outdated comment.
3597 * gold-threads.cc: Fix typo in error message.
3598 * archive.cc: Fix typos in comments.
3599 * archive.h: Likewise.
3600 * arm-reloc-property.cc: Likewise.
3601 * arm-reloc-property.h: Likewise.
3602 * arm-reloc.def: Likewise.
3603 * arm.cc: Likewise.
3604 * attributes.h: Likewise.
3605 * cref.cc: Likewise.
3606 * ehframe.cc: Likewise.
3607 * fileread.h: Likewise.
3608 * gold.h: Likewise.
3609 * i386.cc: Likewise.
3610 * icf.cc: Likewise.
3611 * incremental.h: Likewise.
3612 * int_encoding.cc: Likewise.
3613 * layout.h: Likewise.
3614 * main.cc: Likewise.
3615 * merge.h: Likewise.
3616 * object.cc: Likewise.
3617 * object.h: Likewise.
3618 * options.cc: Likewise.
3619 * readsyms.cc: Likewise.
3620 * reduced_debug_output.cc: Likewise.
3621 * reloc.cc: Likewise.
3622 * script-sections.cc: Likewise.
3623 * sparc.cc: Likewise.
3624 * symtab.h: Likewise.
3625 * target-reloc.h: Likewise.
3626 * target.cc: Likewise.
3627 * target.h: Likewise.
3628 * timer.cc: Likewise.
3629 * timer.h: Likewise.
3630 * x86_64.cc: Likewise.
3631
83e17bd5
CC
36322010-12-09 Cary Coutant <ccoutant@google.com>
3633
3634 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
3635 stack.
3636 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
3637 parameter; change all callers.
3638 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
3639 * options.h (warn_execstack): New option.
3640
017257f8
DK
36412010-12-07 Doug Kwan <dougkwan@google.com>
3642
3643 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
3644 like function call relocations.
3645
c20cbc06
ILT
36462010-12-07 Ian Lance Taylor <iant@google.com>
3647
3648 * archive.cc (Archive::get_elf_object_for_member): Permit
3649 punconfigured to be NULL.
3650 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
3651 (Archive::include_member): Pass NULL to get_elf_object_for_member
3652 if we searched for the archive and this is the first included
3653 object.
3654
4dbfafcc
ILT
36552010-12-01 Ian Lance Taylor <iant@google.com>
3656
3657 * dwarf_reader.h (class Sized_dwarf_line_info): Add
3658 track_relocs_type_ field.
3659 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3660 Set track_relocs_type_.
3661 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
3662 contents when using RELA relocs.
3663 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
3664 reloc_map_.
3665 * reloc.cc (Track_relocs::next_addend): New function.
3666 * reloc.h (class Track_relocs): Declare next_addend.
3667
e5e19edd
ILT
36682010-12-01 Ian Lance Taylor <iant@google.com>
3669
3670 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
3671 virtual destructor.
3672
9a5ce24c
ILT
36732010-12-01 Ian Lance Taylor <iant@google.com>
3674
3675 * README: Update compilers known to work and fail.
3676
c7791212
NC
36772010-11-23 Matthias Klose <doko@ubuntu.com>
3678
3679 * configure.in: For --enable-gold, handle value `default' instead of
3680 `both*'. Always install ld as ld.bfd, install as ld if gold is
3681 not the default.
3682 * configure: Regenerate.
3683
0ad220c9
DK
36842010-11-18 Doug Kwan <dougkwan@google.com>
3685
3686 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
3687 and right_alignment to be zero. Store result alignment only if it is
3688 greater than existing alignment.
3689
ab8056e0
CC
36902010-11-16 Cary Coutant <ccoutant@google.com>
3691
3692 PR gold/12220
3693 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3694 Check for ".zdebug_line".
3695
fd064a5b
CC
36962010-11-16 Doug Kwan <dougkwan@google.com>
3697 Cary Coutant <ccoutant@google.com>
3698
3699 * output.h (Output_segment::set_section_addresses): Pass increase_relro
3700 by reference; adjust all callers.
3701 * output.cc (Output_segment::set_section_addresses): Adjust references
3702 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
3703 list is empty.
3704 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
3705 end at page boundary.
3706
6fc6ea19
CC
37072010-11-16 Cary Coutant <ccoutant@google.com>
3708
3709 PR gold/12220
3710 * layout.cc (Layout::choose_output_section): Transform names of
3711 compressed sections even when using a script with a SECTIONS clause.
3712 (Layout::output_section_name): Remove code to transform
3713 compressed debug section names.
3714 * output.cc (Output_section::add_input_section): Use uncompressed
3715 section size when tracking input sections.
3716
95a2c8d6
RS
37172010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
3718
3719 * symtab.h (Symbol::NON_PIC_REF): Remove.
3720 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
3721 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
3722 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
3723 (Symbol::use_plt_offset): Take a flags argument and pass it
3724 directly to needs_dynamic_reloc. Restrict check for undefined
3725 weak symbols to function calls.
3726 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
3727 (Target_arm::Scan::global): Use it.
3728 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
3729 (Target_arm::Relocate::relocate): Likewise.
3730 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
3731 parameter with an r_type parameter. Use get_reference_flags
3732 to get the flags.
3733 (Target_arm::Relocate::relocate): Update accordingly.
3734 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
3735 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
3736 (Target_i386::Scan::global): Likewise.
3737 (Target_i386::Relocate::relocate): Likewise.
3738 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
3739 parameter with an r_type parameter. Use get_reference_flags
3740 to get the flags.
3741 (Target_i386::Relocate::relocate): Update accordingly.
3742 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
3743 (Target_powerpc::Scan::global): Use it.
3744 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
3745 (Target_powerpc::Relocate::relocate): Likewise.
3746 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
3747 (Target_sparc::Scan::global): Use it.
3748 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
3749 (Target_sparc::Relocate::relocate): Likewise.
3750 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
3751 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
3752 (Target_x86_64::Scan::global): Likewise.
3753 (Target_x86_64::Relocate::relocate): Likewise.
3754
f625ae50
DK
37552010-11-08 Doug Kwan <dougkwan@google.com>
3756 Cary Coutant <ccoutant@google.com>
3757
3758 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
3759 (Arm_exidx_merge_section::section_contents_): New data member.
3760 (Arm_input_section::Arm_input_section): Initialize original_contents_.
3761 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 3762 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
3763 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
3764 in parameters instead of calling Object::section_contents without
3765 locking.
3766 (Arm_output_section::group_section): New parameter TASK. Pass it
3767 to callees that need locking objects.
3768 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
3769 to lock EXIDX input sections. Fix a formatting issue. Call
3770 Arm_exidx_merged_section::build_contents to create merged section
3771 contents.
3772 (Arm_output_section::create_stub_group): New parameter TASK. Use it
3773 to lock object of stub table owner.
3774 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
3775 TEXT_SIZE to initialize data member TEXT_SIZE_.
3776 (Arm_exidx_input_section::addralign): Fix typo in comment.
3777 (Arm_exidx_input_section::text_size): New method.
3778 (Target_arm::do_relax): New parameter TASK. Pass it to callees
3779 that require locking objects. Lock objects before scanning for stubs
3780 and updating local symbols.
3781 (Arm_input_section<big_endian>::init): Copy contents of original
3782 input section.
2e702c99 3783 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
3784 original input section instead of calling Object::section_contents
3785 without locking.
3786 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
3787 size without calling Object::section_size().
3788 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
3789 for size. Allocate a buffer for merged EXIDX entries.
3790 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 3791 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
3792 building code to Arm_exidx_merged_section::build_contetns. Write
3793 out contetns in buffer instead of building it on the fly.
3794 (Arm_relobj::make_exidx_input_section): Also pass text section size
3795 to Arm_exidx_input_section constructor.
3796 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
3797 (Arm_dynobj::do_read_symbols): Fix memory leak.
3798 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
3799 * target.h: (class Task): Add forward declaration.
3800 (Target::relax): Add new parameter TASK and pass it to
3801 Target::do_relax().
3802 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
3803
5f9bcf58
CC
38042010-11-05 Cary Coutant <ccoutant@google.com>
3805
3806 PR gold/10708
3807 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
3808 object when reading from the file.
3809 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
3810 second layout pass.
3811 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
3812 when reading section contents.
3813 (get_section_contents): Likewise.
3814 (icf::find_identical_sections): Likewise.
3815 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
3816 object when reading from the file.
3817 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
3818 the object when doing deferred section layout.
3819
e597fa08
NC
38202010-11-03 Nick Clifton <nickc@redhat.com>
3821
3822 PR gold/12001
3823 * script.h (class Symbol_assignment: name): New member. Returns
3824 the name of the symbol.
3825 * scrfipt.cc (Script_options::is_pending_assignment): New member.
3826 Returns true if the given symbol name is on the list of
3827 assignments wating to be processed.
3828 * archive.cc (should_incldue_member): If the symbol is undefined,
3829 check to see if it is on the list of symbols pending assignment.
3830
3f9a3278
ILT
38312010-11-03 Ryan Mansfield <rmansfield@qnx.com>
3832
3833 * script-sections.cc (Script_sections::find_memory_region): Check
3834 for a NULL output section pointer.
3835
d06fb4d1
DK
38362010-10-29 Doug Kwan <dougkwan@google.com>
3837
3838 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
3839 Output_section::add_relaxed_input_section.
3840 * output.cc (Output_section::add_relaxed_input_section): Add new
3841 arguments LAYOUT and NAME. Set section order index.
3842 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
3843 Copy section order index.
3844 * output.h (Output_section::add_relaxed_input_section): Add new
3845 arguments LAYOUT and NAME.
3846
90e24de5
ILT
38472010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3848
3849 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 3850 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
3851 * testsuite/Makefile.in: Regenerate.
3852
c9484ea5
DK
38532010-10-20 Doug Kwan <dougkwan@google.com>
3854
3855 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
3856 without SHF_LINK_ORDER flags.
3857 * layout.cc (Layout::choose_output_section): Do not filter
3858 SHF_LINK_ORDER flag in a relocatable link.
3859
5bc2f5be
CC
38602010-10-17 Cary Coutant <ccoutant@google.com>
3861
3862 * output.h (Output_segment::set_section_addresses): Change function
3863 signature. Update all callers.
3864 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
3865 sections.
3866 (Output_segment::set_section_addresses): Align after last TLS
3867 section. Add padding before last relro section instead of after.
3868
0c91cf04
DK
38692010-10-17 Doug Kwan <dougkwan@google.com>
3870
3871 * gold/arm.cc (Target_arm::got_section): Use correct order and set
3872 GOT output section to be writable.
3873
8c21d9d3
CC
38742010-10-14 Cary Coutant <ccoutant@google.com>
3875
3876 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
3877 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
3878 * gold.cc (queue_initial_tasks): Check parameters for incremental link
3879 mode.
3880 * incremental.cc (report_command_line): Ignore all forms of
3881 --incremental.
3882 * layout.cc (Layout::Layout): Check parameters for incremental link
3883 mode.
3884 * options.cc (General_options::parse_incremental): New function.
3885 (General_options::parse_no_incremental): New function.
3886 (General_options::parse_incremental_full): New function.
3887 (General_options::parse_incremental_update): New function.
3888 (General_options::incremental_mode_): New data member.
3889 (General_options::finalize): Check incremental_mode_.
3890 * options.h (General_options): Update help text for --incremental.
3891 Add --no-incremental, --incremental-full, --incremental-update.
3892 (General_options::Incremental_mode): New enum type.
3893 (General_options::incremental_mode): New function.
3894 (General_options::incremental_mode_): New data member.
3895 * parameters.cc (Parameters::incremental_mode_): New data member.
3896 (Parameters::set_options): Set incremental_mode_.
3897 (Parameters::set_incremental_full): New function.
3898 (Parameters::incremental): New function.
3899 (Parameters::incremental_update): New function.
3900 (set_parameters_incremental_full): New function.
3901 * parameters.h (Parameters::set_incremental_full): New function.
3902 (Parameters::incremental): New function.
3903 (Parameters::incremental_update): New function.
3904 (Parameters::incremental_mode_): New data member.
3905 (set_parameters_incremental_full): New function.
3906 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
3907 incremental link mode.
3908 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
3909 (Sized_relobj::do_relocate_sections): Likewise.
3910 * testsuite/Makefile.am (incremental_test): Use --incremental-full
3911 option.
3912 * testsuite/Makefile.in: Regenerate.
3913 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 3914
bb32aa18 39152010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
3916
3917 * script-sections.h (class Script_sections): Make
3918 Sections_elements typedef public.
3919 * script-sections.cc (class Sort_output_sections): Add elements_
3920 field. Add constructor which sets it; change all callers.
3921 (Sort_output_sections::is_before): New function.
3922 (Sort_output_sections::operator()): Call is_before.
3923 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
3924 conditional.
3925 * testsuite/script_test_10.sh: New test. Test script section
3926 order.
3927 * testsuite/script_test_10.t: Likewise.
3928 * testsuite/script_test_10.s: Likewise.
3929 * testsuite/Makefile.am: Wrap the cross linker tests and the
3930 common tests into NATIVE_OR_CROSS_LINKER.
3931 (check_SCRIPTS): Add script_test_10.sh.
3932 (check_DATA): Add script_test_10.stdout.
3933 (script_test_10.o, script_test_10): New targets.
3934 (script_test_10.stdout): New target.
3935 * configure, testsuite/Makefile.in: Regenerate.
3936
3cef7179
ILT
39372010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3938
3939 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
3940 error for the deprecated relocations.
3941 (Target_arm::Scan::global): Likewise.
3942 (Target_arm::Relocate::relocate): Likewise.
3943
7411e9a8
RS
39442010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
3945
3946 * fileread.cc (Input_file::find_file): Initialize *found_name
3947 and *namep when using the fallback search for case 4.
3948
6a9da32a
CC
39492010-10-11 Cary Coutant <ccoutant@google.com>
3950
3951 * options.h (class General_options): Redefine -z lazy as an alias for
3952 the negation of -z now.
3953
ac897c20
ILT
39542010-10-11 Ian Lance Taylor <iant@google.com>
3955
3956 * resolve.cc (symbol_to_bits): Report the value of the unsupported
3957 binding.
3958
ea5cae92
NC
39592010-10-06 Nick Clifton <nickc@redhat.com>
3960
3961 * script-sections.cc(class Memory_region): Remove
3962 current_lma_offset_ field. Rename current_vma_offset_ to
3963 current_offset_. Add last_section_ field.
3964 (Memory_region::get_current_vma_address): Rename to
3965 get_current_address.
3966 (Memory_region::get_current_lma_address): Delete.
3967 (Memory_region::increment_vma_offset): Rename to
3968 increment_offset.
3969 (Memory_region::increment_lma_offset): Delete.
3970 (Memory_region::attributes_compatible): New method. Returns
3971 true if the provided section is compatible with the region.
3972 (Memory_region::get_last_section): New method. Returns the last
3973 section to use the region.
3974 (Memory_region::set_last_section): New method. Stores the last
3975 section to use the region.
3976 (Script_sections::block_in_region): New method. Returns true if
3977 a block of memory is contained within a region.
3978 (Script_sections::find_memory_region): New method. Locates a
3979 memory region to be used to set a VMA or LMA address.
3980 (Output_section_definition::set_section_addresses): Add code to
3981 check for addresses set by memory regions.
3982 (Output_segment::set_section_addresses): Remove memory region
3983 walking code.
3984 (Script_sections::create_segment): Add a warning if a header
3985 segment is created outside of any region.
3986 * script-sections.h (class Script_sections): Add prototypes for
3987 find_memory_region and block_in_region methods.
3988 * testsuite/memory_test.s: Use .long instead of .word.
3989 * testsuite/memory_test.t: Add some more output sections.
3990 * testsuite/memory_test.sh: Update expected output.
3991
a9bfd952
DK
39922010-10-02 Doug Kwan <dougkwan@google.com>
3993
3994 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
3995 defintion to symtab.h
3996 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
3997 declaration to defintion.
3998
bacff3ab
NC
39992010-10-01 Nick Clifton <nickc@redhat.com>
4000
4001 * expression.cc (eval): Replace dummy argument with NULL.
4002 (eval_maybe_dot): Check for a NULL result section pointer.
4003 (Symbol_expression::value): Likewise.
4004 (Dot_expression::value): Likewise.
4005 (BINARY_EXPRESSION): Likewise.
4006 (Max_expression::value): Likewise.
4007 (Min_expression::value): Likewise.
4008 (Absolute_expression::value): Likewise.
4009 (Addr_expression::value_from_output_section): Likewise.
4010 (Loaddddr_expression::value_from_output_section): Likewise.
4011 (Segment_start_expression::value): Likewise.
4012 * script-sections.cc
4013 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
4014 argument with NULL.
4015 (Sections_elememt_dot_assignment::set_section_addresses):
4016 Likewise.
4017 (Output_data_expression::do_write_to_buffer): Likewise.
4018 (Output_section_definition::finalize_symbols): Likewise.
4019 (Output_section_definition::set_section_addresses): Likewise.
4020
f81bc8b5
DK
40212010-09-30 Doug Kwan <dougkwan@google.com>
4022
4023 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
4024
c95e9f27
ST
40252010-09-28 Sriraman Tallam <tmsriram@google.com>
4026
4027 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 4028 function.
c95e9f27
ST
4029 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
4030 virtual function.
4031 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
4032 virtual function.
4033 * icf.cc (get_section_contents): Inline merge sections only when
4034 target allows it.
4035
3cac54d2
RW
40362010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4037
4038 * configure: Regenerate.
4039
2904037a
ILT
40402010-09-17 Ian Lance Taylor <iant@google.com>
4041
4042 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
4043 * testsuite/Makefile.am (memory_test.o): New target.
4044 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
4045 memory_test.t.
4046 * testsuite/Makefile.in: Rebuild.
2904037a 4047
bca7fb63
DK
40482010-09-17 Doug Kwan <dougkwan@google.com>
4049
4050 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
4051 defintion if relocation uses GOT entries of the symbol.
4052 * testsuite/icf_safe_test.sh: Fix test.
4053 * testsuite/icf_safe_so_test.sh: Fix test.
4054
4ef28648
CC
40552010-09-16 Cary Coutant <ccoutant@google.com>
4056
4057 * script_sections.cc (class Memory_region): Remove "NULL" from
4058 vector initializations.
4059
793990de
CC
40602010-09-15 Cary Coutant <ccoutant@google.com>
4061
4062 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
4063 Resolve forwarding symbols.
4064
81e015e2
DK
40652010-09-15 Doug Kwan <dougkwan@google.com>
4066
4067 * gold/testsuite/script_test_3.t: Add ARM special sections.
4068 * gold/testsuite/script_test_4.t: Same.
4069 * gold/testsuite/script_test_5.t: Same.
4070 * gold/testsuite/script_test_6.t: Same.
4071 * gold/testsuite/script_test_7.t: Same.
4072 * gold/testsuite/script_test_7.t: Same.
4073 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
4074
36171d64
CC
40752010-09-14 Cary Coutant <ccoutant@google.com>
4076
4077 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
4078 (Target_x86_64::Relocate::relocate_tls): Replace check for
4079 saw_tls_block_reloc_ with test for executable section.
4080
d89051bd
CC
40812010-09-12 Cary Coutant <ccoutant@google.com>
4082
4083 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
4084 position-independent executables to shared libraries need dynamic
4085 relocations.
4086 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
4087 position-independent executables.
4088 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
4089 * testsuite/Makefile.in: Regenerate.
4090
fca41f0f
NC
40912010-09-10 Nick Clifton <nickc@redhat.com>
4092
4093 PR gold/11997
4094 * testsuite/memory_test.t: Discard any sections that are not
4095 needed.
4096
6695e4b3
L
40972010-09-09 H.J. Lu <hongjiu.lu@intel.com>
4098
4099 PR gold/11996
4100 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
4101 "This::" to work around a bug in gcc 4.2.
4102
4103 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
4104
0f72bf6f
RÁE
41052010-09-09 Rafael Espindola <espindola@google.com>
4106
4107 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
4108 sections with different PF_X flags in the same segment.
4109 (Layout::find_first_load_seg): Search all segments to find the first
4110 one.
4111 * options.h (rosegment): New.
4112
41132010-09-08 Rafael Espindola <espindola@google.com>
a6577478 4114
05a79166 4115 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 4116
aa98ff75
DK
41172010-09-08 Doug Kwan <dougkwan@google.com>
4118
4119 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
4120 (Arm_relobj::do_relocate_sections): Add new parameter for output
4121 file to match the parent.
4122 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
4123 of local symbols instead of input values. Update code to track
4124 changes in gold::relocate_section.
4125 * object.cc (Sized_relobj::compute_final_local_value): New methods.
4126 (Sized_relobj::compute_final_local_value_internal): New methods.
4127 (Sized_relobj::do_finalize_local_symbols): Move code from loop
4128 body into private version of Sized_relobj::compute_final_local_value.
4129 Call the inline method.
4130 * object.h (Symbol_value::Symbol_value): Define destructor. Free
4131 merged symbol value if there is one.
4132 (Symbol_value::has_output_value): New method defintiion.
4133 (Sized_relobj::Compute_final_local_value_status): New enum type.
4134 (Sized_relobj::compute_final_local_value): New methods.
4135 (Sized_relobj::compute_final_local_value_internal): New methods.
4136 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
4137 and arm_cortex_a8.sh.
4138 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
4139 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
4140 New tests.
4141 * Makefile.in: Regenerate.
4142 * testsuite/arm_bl_out_of_range.s: Update test.
4143 * testsuite/thumb_bl_out_of_range.s: Ditto.
4144 * testsuite/thumb_blx_out_of_range.s: Ditto.
4145 * testsuite/arm_branch_out_of_range.sh: New file.
4146 * testsuite/arm_cortex_a8.sh: Ditto.
4147 * testsuite/arm_cortex_a8_b.s: Ditto.
4148 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
4149 * testsuite/arm_cortex_a8_b_local.s: Ditto.
4150 * testsuite/arm_cortex_a8_bl.s: Ditto.
4151 * testsuite/arm_cortex_a8_blx.s: Ditto.
4152 * testsuite/arm_cortex_a8_local.s: Ditto.
4153 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
4154 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
4155
05a79166
L
41562010-09-08 Rafael Espindola <espindola@google.com>
4157
4158 * Makefile.am (memory_test.stdout): Run readelf with -W.
4159 * Makefile.in: Regenerate.
4160 * testsuite/memory_test.sh: Make the regexps accept both 32 and
4161 64 bit output.
4162
33dbc701
RÁE
41632010-09-08 Rafael Espindola <espindola@google.com>
4164
4165 * script-sections.cc (Script_sections::add_memory_region): Convert
4166 field precision to int.
4167 * script.cc (script_set_section_region, script_set_section_region):
4168 Convert field precision to int.
4169
731ca54a
RÁE
41702010-09-08 Rafael Espindola <espindola@google.com>
4171
4172 * arm.cc (do_finalize_sections): Create the __exidx_start and
4173 __exdix_end symbols even when the section is missing.
4174
7f8cd844
NC
41752010-09-08 Nick Clifton <nickc@redhat.com>
4176
4177 * README: Remove claim that MEMORY is not supported.
4178 * expression.cc (script_exp_function_origin)
4179 (script_exp_function_length): Move from here to ...
4180 * script.cc: ... here.
4181 (script_set_section_region, script_add_memory)
4182 (script_parse_memory_attr, script_include_directive): New
4183 functions.
4184 * script-sections.cc
4185 (class Memory_region): New class.
4186 (class Output_section_definition): Add set_memory_region,
4187 set_section_vma, set_section_lma and get_section_name methods.
4188 (class Script_Sections): Add add_memory_region,
4189 find_memory_region, find_memory_region_origin,
4190 find_memory_region_length and set_memory_region methods.
4191 Have set_section_addresses method walk the list of set memory
4192 regions.
4193 Extend the print methos to display memory regions.
4194 * script-sections.h: Add prototypes for new methods.
4195 Add enum for MEMORY region attributes.
4196 * yyscript.y: Add support for parsing MEMORY regions.
4197 * script-c.h: Add prototypes for new functions.
4198 * testsuite/Makefile.am: Add test of MEMORY region functionality.
4199 * testsuite/Makefile.in: Regenerate.
4200 * testsuite/memory_test.sh: New script.
4201 * testsuite/memory_test.s: New assembler source file.
4202 * testsuite/memory_test.t: New linker script.
4203
a4649286
DK
42042010-08-27 Doug Kwan <dougkwan@google.com>
4205
4206 * gold/resolve.cc (Symbol_table::should_override): Let a weak
4207 reference override an existing dynamic weak reference.
4208 * testsuite/Makefile.am: Add new test dyn_weak_ref.
4209 * testsuite/Makefile.in: Regenerate.
4210 * testsuite/dyn_weak_ref.sh: New file.
4211 * testsuite/dyn_weak_ref_1.c: Ditto.
4212 * testsuite/dyn_weak_ref_2.c: Ditto.
4213
b56648ad
ILT
42142010-08-27 Ian Lance Taylor <iant@google.com>
4215
4216 * incremental.h (class Incremental_input_entry): Add virtual
4217 destructor.
4218
809313cb
ILT
42192010-08-27 Ian Lance Taylor <iant@google.com>
4220
4221 * testsuite/start_lib_test_3.c: Mark t3 as used.
4222
11e32464
NC
42232010-08-27 Nick Clifton <nickc@redhat.com>
4224
4225 * options.cc (version_script): Fix small typo in previous
4226 whitespace tidyup.
4227
ca09d69a
NC
42282010-08-25 Nick Clifton <nickc@redhat.com>
4229
4230 * archive.cc: Formatting fixes: Remove whitespace between
4231 typename and following asterisk. Remove whitespace between
4232 function name and opening parenthesis.
4233 * archive.h: Likewise.
4234 * arm.cc: Likewise.
4235 * attributes.cc: Likewise.
4236 * attributes.h: Likewise.
4237 * common.cc: Likewise.
4238 * copy-relocs.cc: Likewise.
4239 * dirsearch.h: Likewise.
4240 * dynobj.cc: Likewise.
4241 * ehframe.cc: Likewise.
4242 * ehframe.h: Likewise.
4243 * expression.cc: Likewise.
4244 * fileread.cc: Likewise.
4245 * fileread.h: Likewise.
4246 * gc.h: Likewise.
4247 * gold-threads.cc: Likewise.
4248 * gold.cc: Likewise.
4249 * i386.cc: Likewise.
4250 * icf.h: Likewise.
4251 * incremental-dump.cc: Likewise.
4252 * incremental.cc: Likewise.
4253 * layout.cc: Likewise.
4254 * layout.h: Likewise.
4255 * main.cc: Likewise.
4256 * merge.cc: Likewise.
4257 * merge.h: Likewise.
4258 * object.cc: Likewise.
4259 * object.h: Likewise.
4260 * options.cc: Likewise.
4261 * options.h: Likewise.
4262 * output.cc: Likewise.
4263 * output.h: Likewise.
4264 * plugin.cc: Likewise.
4265 * plugin.h: Likewise.
4266 * powerpc.cc: Likewise.
4267 * reloc.cc: Likewise.
4268 * script-c.h: Likewise.
4269 * script-sections.cc: Likewise.
4270 * script.cc: Likewise.
4271 * stringpool.cc: Likewise.
4272 * symtab.cc: Likewise.
4273 * symtab.h: Likewise.
4274 * target.cc: Likewise.
4275 * timer.cc: Likewise.
4276 * timer.h: Likewise.
4277 * version.cc: Likewise.
4278 * x86_64.cc: Likewise.
4279
b8fa8750
NC
42802010-08-24 Nick Clifton <nickc@redhat.com>
4281
4282 PR 11899
4283 * layout.cc (segment_precedes): Sort segments by their physical
4284 addresses, if they have been set.
4285
9919d93b
CC
42862010-08-23 Cary Coutant <ccoutant@google.com>
4287
4288 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
4289 symbols data.
4290 (Lib_group::include_member): Unlock object after deleting its
4291 symbols data.
4292 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
4293 the bug fixed here.
4294
97b4be1c
CC
42952010-08-19 Neil Vachharajani <nvachhar@google.com>
4296 Cary Coutant <ccoutant@google.com>
4297
4298 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
4299 constructor, and set_blocker.
4300 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
4301 readsyms_blocker_.
4302 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
4303 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
4304 * testsuite/Makefile.am (start_lib_test): New test case.
4305 * testsuite/Makefile.in: Regenerate.
4306 * testsuite/start_lib_test_main.c: New file.
4307 * testsuite/start_lib_test_1.c: New file.
4308 * testsuite/start_lib_test_2.c: New file.
4309 * testsuite/start_lib_test_3.c: New file.
4310
dd0b1884
ILT
43112010-08-19 Ian Lance Taylor <iant@google.com>
4312
4313 * Makefile.in: Rebuild with automake 1.11.1.
4314 * aclocal.m4: Likewise.
4315 * testsuite/Makefile.in: Likewise.
4316
7223e9ca
ILT
43172010-08-19 Ian Lance Taylor <iant@google.com>
4318
4319 PR 10893
4320 * i386.cc (class Output_data_plt_i386): Update declarations.
4321 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
4322 local_ifuncs_ fields.
4323 (Target_i386::do_plt_section_for_global): New function.
4324 (Target_i386::do_plt_section_for_local): New function.
4325 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
4326 parameter; change all callers. Initialize global_ifuncs_ and
4327 local_ifuncs_. If doing a static link define __rel_iplt_start and
4328 __rel_iplt_end.
4329 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
4330 (Output_data_plt_i386::add_local_ifunc_entry): New function.
4331 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
4332 symbols.
4333 (Target_i386::make_plt_section): New function, broken out of
4334 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
4335 (Target_i386::make_plt_entry): Call make_plt_section.
4336 (Target_i386::make_local_ifunc_plt_entry): New function.
4337 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
4338 (Target_i386::Scan::local): Handle IFUNC symbols. Add
4339 R_386_IRELATIVE to switch.
4340 (Target_i386::Scan::global): Likewise.
4341 (Target_i386::Relocate::relocate): Likewise.
4342 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
4343 switch.
4344 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
4345 (Target_x86_64::do_plt_section_for_global): New function.
4346 (Target_x86_64::do_plt_section_for_local): New function.
4347 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
4348 parameter; change all callers. If doing a static link define
4349 __rela_iplt_start and __rela_iplt_end.
4350 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
4351 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
4352 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
4353 to point to .plt.
4354 (Target_x86_64::make_local_ifunc_plt_entry): New function.
4355 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
4356 switch.
4357 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
4358 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
4359 R_X86_64_IRELATIVE to switch.
4360 (Target_x86_64::Scan::global): Likewise.
4361 (Target_x86_64::Relocate::relocate): Likewise.
4362 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
4363 switch.
4364 * target.h (class Target): Add plt_section_for_global and
4365 plt_section_for_local functions. Add do_plt_section_for_global
4366 and do_plt_section_for_local virtual functions.
4367 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
4368 clarifying comments.
4369 (Symbol::use_plt_offset): Handle IFUNC symbol.
4370 * object.cc (Sized_relobj::Sized_relobj): Initialize
4371 local_plt_offsets_.
4372 (Sized_relobj::local_has_plt_offset): New function.
4373 (Sized_relobj::local_plt_offset): New function.
4374 (Sized_relobj::set_local_plt_offset): New function.
4375 (Sized_relobj::do_count): Handle IFUNC symbol.
4376 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
4377 a bit away from input_shndx_ field. Add set_is_func_symbol and
4378 is_ifunc_symbol functions.
4379 (class Sized_relobj): Update declarations. Remove Tls_got_entry
4380 and Local_tls_got_offsets. Define Local_plt_offsets. Add
4381 local_plt_offsets_ field.
4382 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
4383 * output.h (class Output_section_data): Add non-const
4384 output_section function.
4385 (class Output_data_got): Update declarations.
4386 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
4387 Add use_plt_offset parameter to global and local constructors.
4388 Change all callers. Change local_sym_index_ field to 31 bits.
4389 Change GSYM_CODE and CONSTANT_CODE accordingly.
4390 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
4391 doing a static link don't set sh_link field.
4392 (Output_data_got::Got_entry::write): Use PLT offset if
4393 appropriate.
4394 (Output_data_got::add_global_plt): New function.
4395 (Output_data_got::add_local_plt): New function.
4396 * target-reloc.h (relocate_section): Handle IFUNC symbol.
4397 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
4398 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
4399 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
4400 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
4401 IFUNC conditional.
4402 * testsuite/ifunc-sel.h: New file.
4403 * testsuite/ifuncmain1.c: New file.
4404 * testsuite/ifuncmain1vis.c: New file.
4405 * testsuite/ifuncmod1.c: New file.
4406 * testsuite/ifuncdep2.c: New file.
4407 * testsuite/ifuncmain2.c: New file.
4408 * testsuite/ifuncmain3.c: New file.
4409 * testsuite/ifuncmod3.c: New file.
4410 * testsuite/ifuncmain4.c: New file.
4411 * testsuite/ifuncmain5.c: New file.
4412 * testsuite/ifuncmod5.c: New file.
4413 * testsuite/ifuncmain6pie.c: New file.
4414 * testsuite/ifuncmod6.c: New file.
4415 * testsuite/ifuncmain7.c: New file.
4416 * configure, testsuite/Makefile.in: Rebuild.
4417
56f75c03
ILT
44182010-08-18 Ian Lance Taylor <iant@google.com>
4419
4420 * incremental.cc
4421 (Output_section_incremental_inputs::write_input_files): Add cast
4422 to avoid signed/unsigned comparison warning.
4423 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4424
55455f89
CC
44252010-08-12 Cary Coutant <ccoutant@google.com>
4426
4427 * common.cc (Sort_commons::operator()): Remove unnecessary code.
4428
e2054bcb
ILT
44292010-08-13 Ian Lance Taylor <iant@google.com>
4430
4431 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
4432
74f67560
DK
44332010-08-12 Cary Coutant <ccoutant@google.com>
4434 Doug Kwan <dougkwan@google.com>
4435
4436 * resolve.cc (Symbol_table::should_override): When a weak dynamic
4437 defintion overrides non-weak undef, remember that the original undef
4438 is not weak.
4439 * symtab.cc (Symbol_table::sized_write_global): For undef without
4440 an original weak binding, set binding to global in output.
4441 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
4442 * testsuite/Makefile.in: Regenerate.
4443 * testsuite/strong_ref_weak_def.sh: New file.
4444 * testsuite/strong_ref_weak_def_1.c: Ditto.
4445 * testsuite/strong_ref_weak_def_2.c: Ditto.
4446
d1238d12
CC
44472010-08-12 Cary Coutant <ccoutant@google.com>
4448
4449 * testsuite/incremental_test.sh: Rewrite.
4450 * testsuite/incremental_test_1.c: Rewrite.
4451 * testsuite/incremental_test_2.c: Rewrite.
4452
0e70b911
CC
44532010-08-12 Cary Coutant <ccoutant@google.com>
4454
4455 * arm.cc (Target_arm::got_size): Add const.
4456 (Target_arm::got_entry_count): New function.
4457 (Target_arm::plt_entry_count): New function.
4458 (Target_arm::first_plt_entry_offset): New function.
4459 (Target_arm::plt_entry_size): New function.
4460 (Output_data_plt_arm::entry_count): New function.
4461 (Output_data_plt_arm::first_plt_entry_offset): New function.
4462 (Output_data_plt_arm::get_plt_entry_size): New function.
4463 * i386.cc (Target_i386::got_size): Add const.
4464 (Target_i386::got_entry_count): New function.
4465 (Target_i386::plt_entry_count): New function.
4466 (Target_i386::first_plt_entry_offset): New function.
4467 (Target_i386::plt_entry_size): New function.
4468 (Output_data_plt_i386::entry_count): New function.
4469 (Output_data_plt_i386::first_plt_entry_offset): New function.
4470 (Output_data_plt_i386::get_plt_entry_size): New function.
4471 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
4472 find_incremental_inputs_sections. Dump incremental_got_plt section.
4473 * incremental.cc: Include target.h.
4474 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
4475 parameter. Adjust all callers. Find incremental_got_plt section.
4476 (Incremental_inputs::create_data_sections): Create incremental_got_plt
4477 section.
4478 (Output_section_incremental_inputs::set_final_data_size): Calculate
4479 size of incremental_got_plt section.
4480 (Output_section_incremental_inputs::do_write): Write the
4481 incremental_got_plt section.
4482 (Got_plt_view_info): New struct.
4483 (Local_got_offset_visitor): New class.
4484 (Global_got_offset_visitor): New class.
4485 (Global_symbol_visitor_got_plt): New class.
4486 (Output_section_incremental_inputs::write_got_plt): New function.
4487 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
4488 Add parameter. Adjust all callers.
4489 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4490 (Incremental_inputs::got_plt_section): New function.
4491 (Incremental_inputs::got_plt_section_): New data member.
4492 (Incremental_got_plt_reader): New class.
4493 * layout.cc (Layout::create_incremental_info_sections): Add the
4494 incremental_got_plt section.
4495 * object.h (Got_offset_list::get_list): New function.
4496 (Got offset_list::for_all_got_offsets): New function.
4497 (Sized_relobj::local_got_offset_list): New function.
4498 * powerpc.cc (Target_powerpc::got_size): Add const.
4499 (Target_powerpc::got_entry_count): New function.
4500 (Target_powerpc::plt_entry_count): New function.
4501 (Target_powerpc::first_plt_entry_offset): New function.
4502 (Target_powerpc::plt_entry_size): New function.
4503 (Output_data_plt_powerpc::entry_count): New function.
4504 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
4505 (Output_data_plt_powerpc::get_plt_entry_size): New function.
4506 * sparc.cc (Target_sparc::got_size): Add const.
4507 (Target_sparc::got_entry_count): New function.
4508 (Target_sparc::plt_entry_count): New function.
4509 (Target_sparc::first_plt_entry_offset): New function.
4510 (Target_sparc::plt_entry_size): New function.
4511 (Output_data_plt_sparc::entry_count): New function.
4512 (Output_data_plt_sparc::first_plt_entry_offset): New function.
4513 (Output_data_plt_sparc::get_plt_entry_size): New function.
4514 * symtab.h (Symbol::got_offset_list): New function.
4515 (Symbol_table::for_all_symbols): New function.
4516 * target.h (Sized_target::got_entry_count): New function.
4517 (Sized_target::plt_entry_count): New function.
4518 (Sized_target::plt_entry_size): New function.
4519 * x86_64.cc (Target_x86_64::got_size): Add const.
4520 (Target_x86_64::got_entry_count): New function.
4521 (Target_x86_64::plt_entry_count): New function.
4522 (Target_x86_64::first_plt_entry_offset): New function.
4523 (Target_x86_64::plt_entry_size): New function.
4524 (Output_data_plt_x86_64::entry_count): New function.
4525 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
4526 (Output_data_plt_x86_64::get_plt_entry_size): New function.
4527
09ec0418
CC
45282010-08-12 Cary Coutant <ccoutant@google.com>
4529
4530 * archive.cc: Include incremental.h.
4531 (Archive::Archive): Initialize incremental_info_.
4532 (Archive::include_member): Record archive members in incremental info.
4533 (Add_archive_symbols::run): Record begin and end of an archive in
4534 incremental info.
4535 (Lib_group::include_member): Record objects in incremental info.
4536 * archive.h (Incremental_archive_entry): Forward declaration.
4537 (Archive::set_incremental_info): New member function.
4538 (Archive::incremental_info): New member function.
4539 (Archive::Unused_symbol_iterator): New class.
4540 (Archive::unused_symbols_begin): New member function.
4541 (Archive::unused_symbols_end): New member function.
4542 (Archive::incremental_info_): New data member.
4543 * incremental-dump.cc (find_input_containing_global): New function.
4544 (dump_incremental_inputs): Dump new incremental info sections.
4545 * incremental.cc: Include symtab.h.
4546 (Output_section_incremental_inputs): New class.
4547 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
4548 new incremental info sections.
4549 (Sized_incremental_binary::do_check_inputs): Likewise.
4550 (Incremental_inputs::report_archive): Remove.
4551 (Incremental_inputs::report_archive_begin): New function.
4552 (Incremental_inputs::report_archive_end): New function.
4553 (Incremental_inputs::report_object): New function.
4554 (Incremental_inputs::finalize_inputs): Remove.
4555 (Incremental_inputs::report_input_section): New function.
4556 (Incremental_inputs::report_script): Rewrite.
4557 (Incremental_inputs::finalize): Do nothing but finalize string table.
4558 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
4559 (Incremental_inputs::sized_create_inputs_section_data): Remove.
4560 (Incremental_inputs::create_data_sections): New function.
4561 (Incremental_inputs::relocs_entsize): New function.
4562 (Output_section_incremental_inputs::set_final_data_size): New function.
4563 (Output_section_incremental_inputs::do_write): New function.
4564 (Output_section_incremental_inputs::write_header): New function.
4565 (Output_section_incremental_inputs::write_input_files): New function.
4566 (Output_section_incremental_inputs::write_info_blocks): New function.
4567 (Output_section_incremental_inputs::write_symtab): New function.
4568 * incremental.h (Incremental_script_entry): Forward declaration.
4569 (Incremental_object_entry): Forward declaration.
4570 (Incremental_archive_entry): Forward declaration.
4571 (Incremental_inputs): Forward declaration.
4572 (Incremental_inputs_header_data): Remove.
4573 (Incremental_inputs_header): Remove.
4574 (Incremental_inputs_header_write): Remove.
4575 (Incremental_inputs_entry_data): Remove.
4576 (Incremental_inputs_entry): Remove.
4577 (Incremental_inputs_entry_write): Remove.
4578 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
4579 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
4580 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4581 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
4582 Likewise.
4583 (Incremental_input_entry): New class.
4584 (Incremental_script_entry): New class.
4585 (Incremental_object_entry): New class.
4586 (Incremental_archive_entry): New class.
4587 (Incremental_inputs::Incremental_inputs): Initialize new data members.
4588 (Incremental_inputs::report_inputs): Remove.
4589 (Incremental_inputs::report_archive): Remove.
4590 (Incremental_inputs::report_archive_begin): New function.
4591 (Incremental_inputs::report_archive_end): New function.
4592 (Incremental_inputs::report_object): Change prototype.
4593 (Incremental_inputs::report_input_section): New function.
4594 (Incremental_inputs::report_script): Change prototype.
4595 (Incremental_inputs::get_reloc_count): New function.
4596 (Incremental_inputs::set_reloc_count): New function.
4597 (Incremental_inputs::create_data_sections): New function.
4598 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
4599 (Incremental_inputs::inputs_section): New function.
4600 (Incremental_inputs::symtab_section): New function.
4601 (Incremental_inputs::relocs_section): New function.
4602 (Incremental_inputs::get_stringpool): Add const.
4603 (Incremental_inputs::command_line): Add const.
4604 (Incremental_inputs::inputs): Remove.
4605 (Incremental_inputs::command_line_key): New function.
4606 (Incremental_inputs::input_file_count): New function.
4607 (Incremental_inputs::input_files): New function.
4608 (Incremental_inputs::relocs_entsize): New function.
4609 (Incremental_inputs::sized_create_inputs_section_data): Remove.
4610 (Incremental_inputs::finalize_inputs): Remove.
4611 (Incremental_inputs::Input_info): Remove.
4612 (Incremental_inputs::lock_): Remove.
4613 (Incremental_inputs::inputs_): Change type.
4614 (Incremental_inputs::inputs_map_): Remove.
4615 (Incremental_inputs::current_object_entry_): New data member.
4616 (Incremental_inputs::inputs_section_): New data member.
4617 (Incremental_inputs::symtab_section_): New data member.
4618 (Incremental_inputs::relocs_section_): New data member.
4619 (Incremental_inputs::reloc_count_): New data member.
4620 (Incremental_inputs_reader): New class.
4621 (Incremental_symtab_reader): New class.
4622 (Incremental_relocs_reader): New class.
4623 * layout.cc (Layout::finalize): Move finalization of incremental info
4624 and creation of incremental info sections to follow finalization of
4625 symbol table. Set offsets for postprocessing sections.
4626 (Layout::create_incremental_info_sections): Call
4627 Incremental_inputs::create_data_sections. Add incremental symtab
4628 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
4629 sections to layout after input sections.
4630 * layout.h (struct Timespec): Forward declaration.
4631 (Layout::incremental_inputs): Add const.
4632 (Layout::create_incremental_info_sections): Add parameter.
4633 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
4634 * object.cc: Include incremental.h.
4635 (Relobj::finalize_incremental_relocs): New function.
4636 (Sized_relobj::do_layout): Record input sections in incremental info.
4637 * object.h (Object::output_section): New function.
4638 (Object::output_section_offset): Moved from Relobj.
4639 (Object::get_incremental_reloc_base): New function.
4640 (Object::get_incremental_reloc_count): New function.
4641 (Object::do_output_section): New function.
4642 (Object::do_output_section_offset): Moved from Relobj.
4643 (Object::do_get_incremental_reloc_base): New function.
4644 (Object::do_get_incremental_reloc_count): New function.
4645 (Object::Object): Initialize new data members.
4646 (Relobj::output_section): Renamed do_output_section and moved to
4647 protected.
4648 (Relobj::output_section_offset): Moved to Object.
4649 (Relobj::do_get_incremental_reloc_base): New function.
4650 (Relobj::do_get_incremental_reloc_count): New function.
4651 (Relobj::allocate_incremental_reloc_counts): New function.
4652 (Relobj::count_incremental_reloc): New function.
4653 (Relobj::finalize_incremental_relocs): New function.
4654 (Relobj::next_incremental_reloc_index): New function.
4655 (Relobj::reloc_counts_): New data member.
4656 (Relobj::reloc_bases_): New data member.
4657 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
4658 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
4659 (Sized_relobj::incremental_relocs_scan): New function.
4660 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4661 (Sized_relobj::incremental_relocs_write): New function.
4662 (Sized_relobj::incremental_relocs_write_reltype): New function.
4663 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
4664 incremental link.
4665 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
4666 archives and object files elsewhere.
4667 (Add_symbols::run): Report object files here.
4668 (Finish_group::run): Report end of archive at end of group.
4669 * reloc.cc: Include layout.h, incremental.h.
4670 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
4671 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
4672 (Sized_relobj::incremental_relocs_scan): New function.
4673 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4674 (Sized_relobj::do_relocate_sections): Write incremental relocations.
4675 (Sized_relobj::incremental_relocs_write): New function.
4676 (Sized_relobj::incremental_relocs_write_reltype): New function.
4677 * script.cc (read_input_script): Rewrite test for incremental link.
4678 Change call to Incremental_inputs::report_script.
4679 * symtab.h (Symbol_table::first_global_index): New function.
4680 (Symbol_table::output_count): New function.
4681
ce0d1972
DK
46822010-08-12 Doug Kwan <dougkwan@google.com>
4683
4684 * arm.cc (Target_arm::merge_object_attributes): Check command line
4685 options --no-wchar-size-warning and --no-enum-size-warning.
4686 * options.h (General_options): Add ld-compatible options
4687 --no-enum-size-warning and --no-wchar-size-warning.
4688
6e5710ce
ILT
46892010-08-04 Ian Lance Taylor <iant@google.com>
4690
4691 * x86_64.cc (Target_x86_64::Scan::local): Use
4692 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
4693 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
4694 (Target_x86_64::Scan::global): Likewise.
4695 (Target_x86_64::Relocate::relocate): Likewise.
4696 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
4697 Likewise.
4698
fef830db
CC
46992010-08-03 Cary Coutant <ccoutant@google.com>
4700
4701 * merge.cc (Output_merge_string::do_add_input_section): Count strings
4702 to reserve space in merged_strings vector. Keep total input size
4703 for stats.
4704 (Output_merge_string::do_print_merge_stats): Print total input size.
4705 * merge.h (Output_merge_string): Add input_size_ field.
4706 * stringpool.cc (Stringpool_template::string_length): Move
4707 implementations out of Stringpool_template class and place in
4708 stringpool.h.
4709 * stringpool.h (string_length): Move out of Stringpool_template.
4710
1e3811b0
ILT
47112010-08-03 Ian Lance Taylor <iant@google.com>
4712
4713 PR 11712
4714 * layout.cc (relaxation_loop_body): If address of load segment is
4715 set, adjust address to include headers if possible.
4716
7af0c620
ILT
47172010-08-03 Ian Lance Taylor <iant@google.com>
4718
4719 * version.cc (version_string): Bump to 1.10.
4720
22f0da72
ILT
47212010-08-03 Ian Lance Taylor <iant@google.com>
4722
4723 PR 11805
4724 * layout.h (enum Output_section_order): Define.
4725 (class Layout): Update declarations.
4726 * layout.cc (Layout::get_output_section): Add order parameter.
4727 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
4728 is_first_non_relro parameters. Change all callers.
4729 (Layout::choose_output_section): Likewise.
4730 (Layout::add_output_section_data): Likewise.
4731 (Layout::make_output_section): Likewise. Set order.
4732 (Layout::default_section_order): New function.
4733 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
4734 * output.cc (Output_section::Output_section): Initialize order_.
4735 Don't initialize deleted fields.
4736 (Output_segment::Output_segment): Don't initialize deleted
4737 fields.
4738 (Output_segment::add_output_section_to_load): New function
4739 replacing add_output_section. Change all callers to call this or
4740 add_output_section_to_nonload.
4741 (Output_segment::add_output_section_to_nonload): New function.
4742 (Output_segment::remove_output_section): Rewrite.
4743 (Output_segment::add_initial_output_data): Likewise.
4744 (Output_segment::has_any_data_sections): Likewise.
4745 (Output_segment::is_first_section_relro): Likewise.
4746 (Output_segment::maximum_alignment): Likewise.
4747 (Output_segment::has_dynamic_reloc): New function replacing
4748 dynamic_reloc_count. Change all callers.
4749 (Output_segment::has_dynamic_reloc_list): New function replacing
4750 dynamic_reloc_count_list. Change all callers.
4751 (Output_segment::set_section_addresses): Rewrite.
4752 (Output_segment::set_offset): Rewrite.
4753 (Output_segment::find_first_and_last_list): Remove.
4754 (Output_segment::set_tls_offsets): Rewrite.
4755 (Output_segment::first_section_load_address): Likewise.
4756 (Output_segment::output_section_count): Likewise.
4757 (Output_segment::section_with_lowest_load_address): Likewise.
4758 (Output_segment::write_section_headers): Likewise.
4759 (Output_segment::print_sections_to_map): Likewise.
4760 * output.h (class Output_data): Remove dynamic_reloc_count_
4761 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
4762 (Output_data::add_dynamic_reloc): Rewrite.
4763 (Output_data::has_dynamic_reloc): New function.
4764 (Output_data::dynamic_reloc_count): Remove.
4765 (class Output_section): Add order_ field. Remvoe is_relro_local_,
4766 is_last_relro_, is_first_non_relro_, is_interp_,
4767 is_dynamic_linker_section_ fields. Add order and set_order
4768 functions. Remove is_relro_local, set_is_relro_local,
4769 is_last_relro, set_is_last_relro, is_first_non_relro,
4770 set_is_first_non_relro functions, is_interp, set_is_interp,
4771 is_dynamic_linker_section, and set_is_dynamic_linker_section
4772 functions.
4773 (class Output_segment): Change Output_data_list from std::list to
4774 std:;vector. Add output_lists_ field. Remove output_data_ and
4775 output_bss_ fields. Update declarations.
4776
3ff2ccb0
ILT
47772010-08-02 Ian Lance Taylor <iant@google.com>
4778
4779 * arm.cc (Target_arm::gc_process_relocs): Use typename.
4780 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
4781 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
4782
88a4108b
ILT
47832010-08-02 Ian Lance Taylor <iant@google.com>
4784
4785 PR 11855
4786 * script.cc (Script_options::Script_options): Initialize
4787 symbol_definitions_ and symbol_references_.
4788 (Script_options::add_symbol_assignment): Update
4789 symbol_definitions_ and symbol_references_.
4790 (Script_options::add_symbol_reference): New function.
4791 (script_symbol): New function.
4792 * script.h (class Script_options): Add symbol_definitions_ and
4793 symbol_references_ fields.
4794 (Script_options::referenced_const_iterator): New type.
4795 (Script_options::referenced_begin): New function.
4796 (Script_options::referenced_end): New function.
4797 (Script_options::is_referenced): New function.
4798 (Script_options::any_unreferenced): New function.
4799 * script-c.h (script_symbol): Declare.
4800 * yyscript.y (exp): Call script_symbol.
4801 * symtab.cc: Include "script.h".
4802 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
4803 Change all callers. Check symbols referenced by scripts.
4804 (Symbol_table::add_undefined_symbols_from_command_line): Add
4805 layout parameter. Change all callers.
4806 (Symbol_table::do_add_undefined_symbols_from_command_line):
4807 Likewise. Break out loop body. Check symbols referenced by
4808 scripts.
4809 (Symbol_table::add_undefined_symbol_from_command_line): New
4810 function broken out of
4811 do_add_undefined_symbols_from_command_line.
4812 * symtab.h (class Symbol_table): Update declarations.
4813 * archive.cc: Include "layout.h".
4814 (Archive::should_include_member): Add layout parameter. Change
4815 all callers. Check for symbol mentioned in expression.
4816 * archive.h (class Archive): Update declaration.
4817 * object.cc (Sized_relobj::do_should_include_member): Add layout
4818 parameter.
4819 * object.h (Object::should_include_member): Add layout parameter.
4820 Change all callers.
4821 (Object::do_should_include_member): Add layout parameter.
4822 (class Sized_relobj): Update declaration.
4823 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
4824 parameter.
4825 * dynobj.h (class Sized_dynobj): Update declaration.
4826 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
4827 layout parameter.
4828 * plugin.h (class Sized_pluginobj): Update declaration.
4829
5f1ab67a
ILT
48302010-08-02 Ian Lance Taylor <iant@google.com>
4831
4832 PR 11866
4833 * output.cc (Output_segment::set_offset): Search for the first and
4834 last sections rather than assuming that the list is in order.
4835 (Output_segment::find_first_and_last_list): New function.
4836 * output.h (class Output_segment): Update declarations.
4837 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
4838 (relro_strip_test_SOURCES): New variable.
4839 (relro_strip_test_DEPENDENCIES): New variable.
4840 (relro_strip_test_LDFLAGS): New variable.
4841 (relro_strip_test_LDADD): New variable.
4842 (relro_strip_test.so): New target.
4843
a8df5856
ILT
48442010-08-02 Ian Lance Taylor <iant@google.com>
4845
4846 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
4847 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
4848 (Target_i386::got_tlsdesc_section): New function.
4849 (Target_i386::got_section): Create space for GOT entries for
4850 TLSDESC relocations.
4851 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
4852 R_386_TLS_GOTDESC.
4853 (Target_i386::Scan::global): Likewise.
4854 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
4855 using TLSDESC GOT.
4856 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
4857 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
4858 (Target_x86_64::got_tlsdesc_section): New function.
4859 (Target_x86_64::got_section): Create space for GOT entries for
4860 TLSDESC relocations.
4861 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
4862 R_386_TLS_GOTDESC.
4863 (Target_x86_64::Scan::global): Likewise.
4864 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
4865 using TLSDESC GOT.
4866
0c10a0a6
ILT
48672010-08-02 Ian Lance Taylor <iant@google.com>
4868
4869 * testsuite/final_layout.sh: Use dc to convert from hex to
4870 decimal.
4871
41cbeecc
ST
48722010-07-29 Sriraman Tallam <tmsriram@google.com>
4873
4874 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
4875 paramter to the call to gold::gc_process_relocs.
4876 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
4877 paramter to the call to gold::gc_process_relocs.
4878 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
4879 parameter to the call to gold::gc_process_relocs.
4880 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
4881 template parameter to the call to gold::gc_process_relocs.
4882 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
4883 paramter to the call to gold::gc_process_relocs.
4884 * gc.h (get_embedded_addend_size): New function.
4885 (gc_process_relocs): Save the size of the reloc for use by ICF.
4886 * icf.cc (get_section_contents): Get the addend from the text section
4887 for SHT_REL relocation sections.
4888 * icf.h (Icf::Reloc_addend_size_info): New typedef.
4889 (Icf::Reloc_info): Add new member reloc_addend_size_info.
4890 * int_encoding.h (read_from_pointer): New overloaded function.
4891 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
4892 * testsuite/icf_sht_rel_addend_test.sh: New file.
4893 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
4894 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
4895
6ea55b82
RW
48962010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4897
4898 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
4899 * Makefile.in: Regenerate.
4900 * testsuite/Makefile.in: Regenerate.
4901
9691462b
ILT
49022010-07-27 Jeffrey Yasskin <jyasskin@google.com>
4903
4904 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
4905 * gold/testsuite/debug_msg.cc: Likewise.
4906 * gold/testsuite/odr_violation1.cc
4907 * gold/testsuite/odr_violation2.cc
4908
76897331
CC
49092010-07-21 Cary Coutant <ccoutant@google.com>
4910
4911 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
4912 string, and length fields.
4913 (Output_merge_string::Merged_strings_list): New type.
4914 (Output_merge_string::Merged_strings_lists): New typedef.
4915 (Output_merge_string): Replace merged_strings_ with
4916 merged_strings_lists_.
4917 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
4918 Merged_strings_list per input object and section. Don't store pointer
4919 to the string. Don't store length with each merged string entry.
4920 (Output_merge_string::finalize_merged_data): Loop over list of merged
4921 strings lists. Recompute length of each merged string.
4922
78384e8f
CC
49232010-07-15 Cary Coutant <ccoutant@google.com>
4924
4925 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
4926 here.
4927
783659f9
ILT
49282010-07-14 Ian Lance Taylor <iant@google.com>
4929
4930 * descriptors.cc (Descriptors::open): Report correct name in error
4931 message.
4932
131687b4
DK
49332010-07-13 Doug Kwan <dougkwan@google.com>
4934
4935 * arm.cc (Arm_input_section::Arm_input_section): For a
4936 SHT_ARM_EXIDX section, always keeps the input sections.
4937 (Arm_input_section::set_exidx_section_link): New method.
4938 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
4939 has_errors_ to false.
4940 (Arm_exidx_input_section::has_errors,
4941 Arm_exidx_input_section::set_has_errors): New methods.
4942 (Arm_exidx_input_section::has_errors_): New data member.
4943 (Arm_relobj::get_exidx_shndx_list): New method.
4944 (Arm_output_section::append_text_sections_to_list): Do not skip
4945 section without SHF_EXECINSTR.
4946 (Arm_output_section::fix_exidx_coverage): Skip input sections with
4947 errors.
2e702c99 4948 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
4949 section header. Make error messages more verbose. Check for
4950 a non-executable section linked to an EXIDX section.
4951 (Arm_relobj::do_read_symbols): Remove error checking, which has been
4952 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
4953 check that there is no deferred EXIDX section if we exit early.
4954 Instead of not making an EXIDX section in case of an error, make one
4955 and set the has_errors flag of it.
4956 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
4957 in a relocatable link.
4958 (Target_arm::do_relax): Look for the EXIDX output section instead of
4959 assuming that it is called .ARM.exidx.
2e702c99 4960 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
4961 section list. Do not check for SHF_EXECINSTR section flags but
4962 skip any input section with errors.
4963 * output.cc (Output_section::Output_section): Initialize
4964 always_keeps_input_sections_ to false.
4965 (Output_section::add_input_section): Check for
4966 always_keeps_input_sections_.
4967 * output.h (Output_section::always_keeps_input_sections,
4968 Output_section::set_always_keeps_input_sections): New methods.
4969 (Output_section::always_keeps_input_sections): New data member.
4970
69517287
RÁE
49712010-07-13 Rafael Espindola <espindola@google.com>
4972
4973 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
4974 * fileread.h (Input_file): Add try_extra_search_path and find_file.
4975
82742395
ILT
49762010-07-13 Philip Herron <herron.philip@googlemail.com>
4977 Ian Lance Taylor <iant@google.com>
4978
4979 * output.h (Output_section_lookup_maps::add_merge_section):
4980 Correct check of whether value was inserted.
4981 (Output_section_lookup_maps::add_merge_input_section): Likewise.
4982 (Output_section_lookup_maps::add_relaxed_input_section):
4983 Likewise.
4984 * arm.cc (Target_arm::got_section): Remove used local os.
4985 * i386.cc (Target_i386::got_section): Likewise.
4986 * x86_64.cc (Target_x86_64::got_section): Likewise.
4987 * sparc.cc (Target_sparc::got_section): Likewise.
4988 (Target_sparc::relocate): Remove unused local have_got_offset.
4989 * powerpc.cc (Target_powerpc::relocate): Likewise.
4990
f2d707b5
ILT
49912010-07-13 Ian Lance Taylor <iant@google.com>
4992
241531d6
ILT
4993 * compressed_output.cc (zlib_decompress): Fix signature in
4994 !HAVE_ZLIB_H case.
4995
f2d707b5
ILT
4996 * archive.cc (Archive::include_member): Unlock an external member
4997 of a thin archive. Don't bother to delete an object we know is
4998 NULL.
4999
a2e47362
CC
50002010-07-12 Cary Coutant <ccoutant@google.com>
5001
5002 * compressed_output.cc (zlib_decompress): New function.
5003 (get_uncompressed_size): New function.
5004 (decompress_input_section): New function.
5005 * compressed_output.h (get_uncompressed_size): New function.
5006 (decompress_input_section): New function.
5007 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
5008 Handle compressed debug sections.
5009 * layout.cc (is_compressed_debug_section): New function.
5010 (Layout::output_section_name): Map compressed section names to
5011 canonical names.
5012 * layout.h (is_compressed_debug_section): New function.
5013 (is_debug_info_section): Recognize compressed debug sections.
5014 * merge.cc: Include compressed_output.h.
5015 (Output_merge_data::do_add_input_section): Handle compressed
5016 debug sections.
5017 (Output_merge_string::do_add_input_section): Handle compressed
5018 debug sections.
5019 * object.cc: Include compressed_output.h.
5020 (Sized_relobj::Sized_relobj): Initialize new data members.
5021 (build_compressed_section_map): New function.
5022 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
5023 * object.h (Object::section_is_compressed): New method.
5024 (Object::do_section_is_compressed): New method.
5025 (Sized_relobj::Compressed_section_map): New type.
5026 (Sized_relobj::do_section_is_compressed): New method.
5027 (Sized_relobj::compressed_sections_): New data member.
5028 * output.cc (Output_section::add_input_section): Handle compressed
5029 debug sections.
5030 * reloc.cc: Include compressed_output.h.
5031 (Sized_relobj::write_sections): Handle compressed debug sections.
5032
ce279a62
CC
50332010-07-08 Cary Coutant <ccoutant@google.com>
5034
5035 * resolve.cc (Symbol_table::resolve): Remember whether undef was
5036 weak when resolving to a dynamic def.
5037 (Symbol_table::should_override): Add adjust_dyndef flag; set it
5038 for weak undef/dynamic def cases. Adjust callers.
5039 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
5040 undef_binding_weak_.
5041 (Symbol_table::sized_write_globals): Adjust symbol binding.
5042 (Symbol_table::sized_write_symbol): Add binding parameter.
5043 * symtab.h (Symbol::set_undef_binding): New method.
5044 (Symbol::is_undef_binding_weak): New method.
5045 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
5046 (Symbol_table::should_override): Add new parameter.
5047 (Symbol_table::sized_write_symbol): Add new parameter.
5048
5049 * testsuite/weak_undef_file1.cc: Add new test case.
5050 * testsuite/weak_undef_file2.cc: Fix header comment.
5051 * testsuite/weak_undef_test.cc: Add new test case.
5052
b2286c10
DK
50532010-06-29 Doug Kwan <dougkwan@google.com>
5054
5055 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
5056 Initialize USE_SYMBOL_.
5057 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
5058 definition.
5059 (Arm_reloc_property::uses_symbol_): New data member declaration.
5060 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
5061 uses symbol value and symbol is undefined but not weakly undefined.
5062
4802450a
RÁE
50632010-06-28 Rafael Espindola <espindola@google.com>
5064
5065 * plugin.cc (Plugin::load): Use dlerror.
5066
e5ca47ba
ILT
50672010-06-26 Jeffrey Yaskin <jyasskin@google.com>
5068
5069 * symtab.cc (detect_odr_violations): When reporting an ODR
5070 violation, report an object where the symbol is defined.
5071
8a75a161
DK
50722010-06-25 Doug Kwan <dougkwan@google.com>
5073
5074 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
5075 (Target_arm::section_may_have_icf_unsafe_pointers): New method
5076 definition.
5077 (Target_arm::Scan::local_reloc_may_be_function_pointer,
5078 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
5079 target hook to detect function points.
5080 (Target_arm::Scan::possible_function_pointer_reloc): New method.
5081 * icf.h (Icf::check_section_for_function_pointers): Change type of
5082 parameter SECTION_NAME to const reference to std::string. Use
5083 target hook to determine if section may have unsafe pointers.
5084 * target.h (Target::section_may_have_icf_unsafe_pointers): New
5085 method definition.
5086
42218b9f
RÁE
50872010-06-21 Rafael Espindola <espindola@google.com>
5088
5089 * fileread.cc (Input_file::find_fie): New
5090 (Input_file::open): Use Input_file::find_fie.
5091 * fileread.h (Input_file::find_fie): New
5092 * plugin.cc (set_extra_library_path): New.
5093 (Plugin::load): Add set_extra_library_path to the transfer vector.
5094 (Plugin_manager::set_extra_library_path): New.
5095 (Plugin_manager::add_input_file): Use the extra search path if set.
5096 (set_extra_library_path(): New.
5097 * plugin.h (Plugin_manager): Add set_extra_library_path and
5098 extra_search_path_.
5099
a0506cca
CC
51002010-06-19 Cary Coutant <ccoutant@google.com>
5101
5102 * layout.cc (gdb_sections): Add .debug_types.
5103 (lines_only_debug_sections): Likewise.
5104
6508b958
RÁE
51052010-06-18 Rafael Espindola <espindola@google.com>
5106
5107 * plugin.cc (add_input_file,add_input_library)
5108 (Plugin_manager::add_input_file): Make filename arguments const.
5109 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
5110 const.
5111
3e235302
DK
51122010-06-16 Doug Kwan <dougkwan@google.com>
5113
5114 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
5115 .ARM.attributes section if we have not merged any input
5116 attributes sections.
5117
106e8a6c
DK
51182010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5119
5120 * arm.cc: Allow combining objects with no EABI version
5121 information.
5122
91ff43fe
RÁE
51232010-06-15 Rafael Espindola <espindola@google.com>
5124
5125 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
5126
68ed838c
ILT
51272010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5128
5129 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
5130 (struct iovec): Correct !HAVE_READV definition.
5131
f3a2388f
CC
51322010-06-10 Cary Coutant <ccoutant@google.com>
5133
5134 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
5135 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
5136 reloc sections.
5137 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
5138
5139 PR 11683
5140 * symtab.h (Symbol::is_placeholder): New member function.
5141 * target-reloc.h (relocate_section): Check for placeholder symbols.
5142
5143 * testsuite/Makefile.am (plugin_test_8): New test.
5144 (plugin_test_9): New test.
5145 * testsuite/Makefile.in: Regenerate.
5146
e1df38aa
NC
51472010-06-09 Nick Clifton <nickc@redhat.com>
5148
5149 * yyscript.y (input_list_element): Allow strings prefixed with
5150 the '-' character. Treat these as libraries.
5151 * script.cc (script_add_library): New function. Adds a library
5152 specified by "-l<name>" found in an input script.
5153 * script-c.h: Add prototype for script_add_library.
5154
25bbe950
DK
51552010-06-07 Doug Kwan <dougkwan@google.com>
5156
5157 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
5158 Restrict stub-group size to be within long conditional branch
5159 range when working around cortex-A8 erratum.
5160
0f32ea4c
ILT
51612010-06-07 Damien Diederen <dd@crosstwine.com>
5162
5163 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
5164 #ifdef typo.
5165
8fe2a369
ST
51662010-06-03 Sriraman Tallam <tmsriram@google.com>
5167
5168 PR gold/11658
5169 * output.cc
5170 (Output_section::Input_section_sort_entry::compare_section_ordering):
5171 Change to return non-zero correctly.
5172 (Output_section::Input_section_sort_section_order_index_compare
5173 ::operator()): Change to fix ambiguity in comparisons.
5174
6e9ba2ca
ST
51752010-06-01 Sriraman Tallam <tmsriram@google.com>
5176
5177 * gold.h (is_wildcard_string): New function.
5178 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
5179 (Layout::layout_eh_frame): Ditto.
5180 (Layout::find_section_order_index): New method.
5181 (Layout::read_layout_from_file): New method.
5182 * layout.h (Layout::find_section_order_index): New method.
5183 (Layout::read_layout_from_file): New method.
5184 (Layout::input_section_position_): New private member.
5185 (Layout::input_section_glob_): New private member.
5186 * main.cc (main): Call read_layout_from_file here.
5187 * options.h (--section-ordering-file): New option.
5188 * output.cc (Output_section::input_section_order_specified_): New
5189 member.
5190 (Output_section::Output_section): Initialize new member.
5191 (Output_section::add_input_section): Add new parameter.
5192 Keep input sections when --section-ordering-file is used.
5193 (Output_section::set_final_data_size): Sort input sections when
5194 section ordering file is specified.
5195 (Output_section::Input_section_sort_entry): Add new parameter.
5196 Check sorting type.
5197 (Output_section::Input_section_sort_entry::compare_section_ordering):
5198 New method.
5199 (Output_section::Input_section_sort_compare::operator()): Change to
5200 consider section_order_index.
5201 (Output_section::Input_section_sort_init_fini_compare::operator()):
5202 Change to consider section_order_index.
5203 (Output_section::Input_section_sort_section_order_index_compare
5204 ::operator()): New method.
5205 (Output_section::sort_attached_input_sections): Change to sort
5206 according to section order when specified.
e1df38aa
NC
5207 (Output_section::add_input_section<32, true>): Add new parameter.
5208 (Output_section::add_input_section<64, true>): Add new parameter.
5209 (Output_section::add_input_section<32, false>): Add new parameter.
5210 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
5211 * output.h (Output_section::add_input_section): Add new parameter.
5212 (Output_section::input_section_order_specified): New
5213 method.
5214 (Output_section::set_input_section_order_specified): New method.
5215 (Input_section::Input_section): Initialize section_order_index_.
5216 (Input_section::section_order_index): New method.
5217 (Input_section::set_section_order_index): New method.
5218 (Input_section::section_order_index_): New member.
5219 (Input_section::Input_section_sort_section_order_index_compare): New
5220 struct.
5221 (Output_section::input_section_order_specified_): New member.
5222 * script-sections.cc (is_wildcard_string): Delete and move modified
5223 method to gold.h.
5224 (Output_section_element_input::Output_section_element_input): Modify
5225 call to is_wildcard_string.
5226 (Output_section_element_input::Input_section_pattern
5227 ::Input_section_pattern): Ditto.
5228 (Output_section_element_input::Output_section_element_input): Ditto.
5229 * testsuite/Makefile.am (final_layout): New test case.
5230 * testsuite/Makefile.in: Regenerate.
5231 * testsuite/final_layout.cc: New file.
5232 * testsuite/final_layout.sh: New file.
5233
3537c84b
RÁE
52342010-06-01 Rafael Espindola <espindola@google.com>
5235
5236 * plugin.cc (Plugin::load): Pass the output name to the plugin.
5237
105b6afd
RÁE
52382010-06-01 Rafael Espindola <espindola@google.com>
5239
5240 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
5241 visibility of symbols.
5242
29e11421
DK
52432010-05-27 Doug Kwan <dougkwan@google.com>
5244
5245 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
5246 from start of output section instead of address for a local symbol
5247 in a merged or relaxed section when doing a relocatable link.
5248
5e0f337e
RÁE
52492010-05-26 Rafael Espindola <espindola@google.com>
5250
5251 PR 11604
5252 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
5253 adding sections the garbage collector removed.
5254 * gold/testsuite/Makefile.am: Add test.
5255 * gold/testsuite/Makefile.in: Regenerate.
5256 * gold/testsuite/plugin_test_7.sh: New.
5257 * gold/testsuite/plugin_test_7_1.c: New.
5258 * gold/testsuite/plugin_test_7_2.c: New.
5259
f4187277
RÁE
52602010-05-26 Rafael Espindola <espindola@google.com>
5261
5262 * script-sections.cc (Output_section_definition::set_section_addresses):
5263 Check for --section-start.
5264
5c388529
DK
52652010-05-26 Doug Kwan <dougkwan@google.com>
5266
5267 * arm.cc (Arm_scan_relocatable_relocs): New class.
5268 (Target_arm::relocate_special_relocatable): New method.
5269 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
5270 (Arm_relocate_functions::thumb_branch_common): Same.
5271 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
5272 instead of Default_scan_relocatable_relocs.
5273 * target-reloc.h (relocate_for_relocatable): Let target handle
5274 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
5275 * target.h (Sized_target::relocate_special_relocatable): New method.
5276
bca1c3ae
ILT
52772010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5278
5279 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
5280
0439c796
DK
52812010-05-23 Doug Kwan <dougkwan@google.com>
5282
5283 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
5284 instead of a cast.
5285 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
5286 with a direct branch, not a conditional branch, to a stub.
5287 * merge.cc (Output_merge_base::record_input_section): New method
5288 defintion.
5289 (Output_merge_data::do_add_input_section): Record input section if
5290 keeps-input-sections flag is set.
5291 (Output_merge_string::do_add_input_section): Ditto.
5292 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
5293 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
5294 INPUT_SECTIONS_.
5295 (Output_merge_base::keeps_input_sections,
5296 Output_merge_base::set_keeps_input_sections,
5297 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
5298 method definitions.
5299 (Output_merge_base::Input_sections): New type declaration.
5300 (Output_merge_base::input_sections_begin,
5301 Output_merge_base::input_sections_end,
5302 Output_merge_base::do_set_keeps_input_sections): New method definitions.
5303 (Output_merge_base::bool keeps_input_sections_,
5304 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
5305 Output_merge_base::input_sections_): New data members.
5306 (Output_merge_data::do_set_keeps_input_sections): New method
5307 defintion.
5308 (Output_merge_string::do_set_keeps_input_sections): Ditto.
5309 * output.cc (Output_section::Input_section::relobj): Move method
5310 defintion from class declaration to here and handle merge sections.
5311 (Output_section::Input_section::shndx): Ditto.
5312 (Output_section::Output_section): Remove initializations of removed
5313 data members and initialize new data member LOOKUP_MAPS_.
5314 (Output_section::add_input_section): Set keeps-input-sections flag
5315 for a newly created merge output section as appropriate. Adjust code
5316 to use Output_section_lookup_maps class.
5317 (Output_section::add_relaxed_input_section): Adjst code for lookup
5318 maps code refactoring.
2e702c99 5319 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
5320 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
5321 class. If adding input section to a newly created merge output
5322 section fails, remove the new merge section.
5323 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 5324 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 5325 (Output_section::find_merge_section): Ditto.
0439c796 5326 (Output_section::build_lookup_maps): New method defintion.
2e702c99 5327 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
5328 Output_section_lookup_maps class.
5329 (Output_section::get_input_sections): Export merge sections. Adjust
5330 code to use Output_section_lookup_maps class.
5331 (Output_section:::add_script_input_section): Adjust code to use
5332 Output_section_lookup_maps class. Update lookup maps for merge
5333 sections also.
5334 (Output_section::discard_states): Use Output_section_lookup_maps.
5335 (Output_section::restore_states): Same.
5336 * output.h (Merge_section_properties): Move class defintion out of
5337 Output_section.
5338 (Output_section_lookup_maps): New class.
5339 (Output_section::Input_section::is_merge_section): New method
5340 defintion.
5341 (Output_section::Input_section::relobj): Move defintion out of class
5342 defintion. Declare method only.
5343 (Output_section::Input_section::shndx): Ditto.
5344 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 5345 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
5346 (Output_section::Merge_section_by_properties_map,
5347 Output_section::Output_section_data_by_input_section_map,
5348 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
5349 Remove types.
2e702c99 5350 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
5351 KEEPS_INPUT_SECTIONS.
5352 (Output_section::build_lookup_maps): New method declaration.
5353 (Output_section::merge_section_map_,
5354 Output_section::merge_section_by_properties_map_,
5355 Output_section::relaxed_input_section_map_,
5356 Output_section::is_relaxed_input_section_map_valid_): Remove data
5357 members.
5358 (Output_section::lookup_maps_): New data member.
5359
76295588
L
53602010-05-21 Doug Kwan <dougkwan@google.com>
5361
5362 PR gold/11619
5363 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
5364 avoid a compilation error.
5365
d103a984
RÁE
53662010-05-19 Rafael Espindola <espindola@google.com>
5367
5368 * script-sections.cc (Output_section_definition::allocate_to_segment):
5369 Update the phdrs_list even when the output section is NULL.
5370 * testsuite/Makefile.am: Add test.
5371 * testsuite/Makefile.in: Regenerate.
5372 * testsuite/script_test_9.cc: New.
5373 * testsuite/script_test_9.sh: New.
5374 * testsuite/script_test_9.t: New.
5375
6625d24e
DK
53762010-05-19 Doug Kwan <dougkwan@google.com>
5377
5378 * arm.cc (Arm_input_section::original_size): New method.
5379 (Arm_input_section::do_addralign): Add a cast.
5380 (Arm_input_section::do_output_offset): Remove static cast.
5381 (Arm_input_section::original_addralign,
5382 Arm_input_section::original_size_): Change type to uint32_t.
5383 (Arm_input_section::init): Add safe casts for section alignment
5384 and size.
5385 (Arm_input_section::set_final_data_size): Do not set address and
5386 offset of stub table.
5387 (Arm_output_section::fix_exidx_coverage): Change use of of
5388 Output_section::Simple_input_section to that of
5389 Output_section::Input_section.
5390 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
5391 except for the first pass.
5392 * output.cc (Output_section::get_input_sections): Change type of
5393 input_sections to std::list<Input_section>.
5394 (Output_section::add_script_input_section): Rename from
5395 Output_section::add_simple_input_section. Change type of SIS
5396 parameter from Simple_input_section to Input_section.
5397 * output.h (Output_section::Simple_input_section): Remove class.
5398 (Output_section::Input_section): Change class visibility to public.
5399 (Output_section::Input_section::addralign): Use stored alignments
5400 for special input sections if set.
5401 (Output_section::Input_section::set_addralign): New method.
5402 (Output_section::get_input_sections): Change parameter type from
5403 list of Simple_input_section to list of Input_section.
5404 (Output_section::add_script_input_section): Rename from
5405 Output_section::add_simple_input_section. Change first parameter's
5406 type from Simple_input_section to Input_section and remove the
5407 second and third parameters.
5408 * script-sections.cc (Input_section::Input_section_list): Change
5409 type to list of Output_section::Input_section/
5410 (Input_section_info::Input_section_info): Change parameter type of
5411 INPUT_SECTION to Output_section::Input_section.
5412 (Input_section_info::input_section): Change return type.
5413 (Input_section_info::input_section_): Change type to
5414 Output_section::Input_section.
5415 (Output_section_element_input::set_section_addresses): Adjust code
5416 to use Output_section::Input_section instead of
5417 Output_section::Simple_input_section. Adjust code for renaming
5418 of Output_section::add_simple_input_section.
5419 (Orphan_output_section::set_section_addresses): Ditto.
5420
e1e82ea4
RW
54212010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5422
5423 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
5424 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
5425
91e75c8a
RÁE
54262010-05-18 Rafael Espindola <espindola@google.com>
5427
5428 * options.cc (General_options::finalize): Handle -nostdlib.
5429 * options.h (nostdlib): New option.
5430 * script.cc (script_add_search_dir): Handle -nostdlib.
5431
da59ad79
DK
54322010-05-12 Doug Kwan <dougkwan@google.com>
5433
5434 * arm.cc (Target_arm::do_finalize_sections): Create an empty
5435 attributes section only if there no attributes section after merging.
5436 (Target_arm::merge_object_attributes): Move value of
e1df38aa 5437 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
5438 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
5439 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
5440 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
5441 and arm_attr_merge_7.stdout.
5442 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
5443 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
5444 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
5445 arm_attr_merge_7b.o): New rules.
5446 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
5447 arm_attr_merge_7
5448 * testsuite/Makefile.in: Regenerate.
5449 * testsuite/arm_attr_merge.sh: New file.
5450 * testsuite/arm_attr_merge_[67][ab].s: Same.
5451
3e01a7fd
NC
54522010-05-05 Nick Clifton <nickc@redhat.com>
5453
5454 * po/es.po: Updated Spanish translation.
5455
7ad2014a
L
54562010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5457
5458 * Makefile.am (install-exec-local): Properly install gold as
5459 default cross linker.
5460 * Makefile.in: Regenerated.
5461
4fda8867
NC
54622010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5463 Nick Clifton <nickc@redhat.com>
5464
5465 * configure.ac (install_as_default): Define and set to false
5466 unless --enable-gold or --enable-gold=both/gold has been
5467 specified.
5468 * configure: Regenerate.
5469
5470 * Makefile.am (install-exec-local): Install the executable as
5471 'ld.gold'. If install_as_default is true then also install it as
5472 'ld'.
5473 * Makefile.in: Regenerated.
5474
bd288ea2
ILT
54752010-04-24 Ian Lance Taylor <iant@google.com>
5476
5477 * layout.cc (Layout::layout_reloc): In relocatable link don't
5478 combine reloc sections for grouped sections.
5479
ef38fd8a
ST
54802010-04-23 Sriraman Tallam <tmsriram@google.com>
5481
5482 * gc.h (gc_process_relocs): Pass information on relocs pointing to
5483 sections that are not ordinary to icf.
5484 * icf.cc (get_section_contents): Handle relocation pointing to section
5485 with no object or shndx information.
5486 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
5487 * testsuite/Makefile.in: Regenerate.
5488 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
5489 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
5490
f6973bdc
ILT
54912010-04-22 Ian Lance Taylor <iant@google.com>
5492
5493 * expression.cc (Expression::Expression_eval_info): Add
5494 result_alignment_pointer field.
5495 (Expression::eval_with_dot): Add result_alignment_pointer
5496 parameter. Change all callers.
5497 (Expression::eval_maybe_dot): Likewise.
5498 (class Binary_expression): Add alignment_pointer parameter to
5499 left_value and right_value. Change all callers.
5500 (BINARY_EXPRESSION): Set result alignment.
5501 (class Trinary_expression): Add alignment_pointer parameter to
5502 arg2_value and arg3_value. Change all callers.
5503 (Trinary_cond::value): Set result alignment.
5504 (Max_expression::value, Min_expression::value): Likewise.
5505 (Align_expression::value): Likewise.
5506 * script-sections.cc (class Sections_element): Add dot_alignment
5507 parameter to set_section_addresses virtual function. Update
5508 instantiations.
5509 (class Output_section_element): Likewise.
5510 (Script_sections::create_segments): Add dot_alignment parameter.
5511 Change all callers.
5512 (Script_sections::create_segments_from_phdrs_clause): Likewise.
5513 (Script_sections::set_phdrs_clause_addresses): Likewise.
5514 * script-sections.h: Update declarations.
5515 * script.h: Update declarations.
5516 * output.h (Output_segment::set_minimum_p_align): Don't decrease
5517 min_p_align.
5518 * testsuite/script_test_3.t: Set large alignment.
5519 * testsuite/script_test_3.sh: Make sure that at least one LOAD
5520 segment has expected alignment.
5521
9c9c98a5
NC
55222010-04-22 Nick Clifton <nickc@redhat.com>
5523
5524 * po/gold.pot: Updated by the Translation project.
5525 * po/vi.po: Updated Vietnamese translation.
5526
2253bfba
L
55272010-04-22 H.J. Lu <hongjiu.lu@intel.com>
5528
5529 * testsuite/Makefile.am (check_PROGRAMS): Add
5530 icf_virtual_function_folding_test.
5531 * testsuite/Makefile.in: Regenerated.
5532
85fdf906
AH
55332010-04-15 Andrew Haley <aph@redhat.com>
5534
5535 * options.h (merge_exidx_entries): New option.
5536 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
5537 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
5538 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
5539 (Target_arm::merge_exidx_entries): New function.
5540 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
5541 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
5542 to Arm_exidx_fixup constructor.
5543 Add new arg, merge_exidx_entries.
5544 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
5545 Arm_output_section::fix_exidx_coverage.
5546
ce97fa81
ST
55472010-04-18 Sriraman Tallam <tmsriram@google.com>
5548
5549 * icf.cc (get_section_contents): Check for preemptible functions.
5550 Ignore addend when appropriate.
5551 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
5552 section folded.
5553 (add_from_relobj): Check for section folded.
5554 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
5555 * symtab.h (should_add_dynsym_entry): Add new parameter.
5556 * target-reloc.h (scan_relocs): Check for section folded.
5557 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
5558 Check reloc types for function pointers in shared objects.
5559 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
5560 case.
5561 (icf_preemptible_functions_test): New test case.
5562 (icf_string_merge_test): New test case.
5563 * testsuite.Makefile.in: Regenerate.
5564 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
5565 bar_glob. Refactor code.
5566 * testsuite/icf_preemptible_functions_test.cc: New file.
5567 * testsuite/icf_preemptible_functions_test.sh: New file.
5568 * testsuite/icf_string_merge_test.cc: New file.
5569 * testsuite/icf_string_merge_test.sh: New file.
5570 * testsuite/icf_virtual_function_folding_test.cc: New file.
5571 * testsuite/icf_virtual_function_folding_test.sh: New file.
5572
04ceb17c
DK
55732010-04-14 Doug Kwan <dougkwan@google.com>
5574
5575 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
5576 for local symbol recounting if we remove a section due to ICF.
5577 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
5578 there are no regular objects in input.
5579
153e7da4
DK
55802010-04-13 Doug Kwan <dougkwan@google.com>
5581
5582 * arm.cc (Arm_input_section::set_final_data_size): Compute
5583 accurate final data size instead of using current data size.
5584
4dbd9faf
DK
55852010-04-09 Doug Kwan <dougkwan@google.com>
5586
5587 * layout.cc (Layout::choose_output_section): Handle script section
5588 types.
5589 (Layout::make_output_section_for_script): Add section type parameter.
5590 Handle script section types.
5591 * layout.h (Layout::make_output_section_for_script): Add section
5592 type parameter.
5593 * output.cc (Output_section::Output_section): Initialize data member
5594 is_noload_.
5595 (Output_section::do_reset_address_and_file_offset): Do not set address
5596 to 0 if section is a NOLOAD section.
5597 * output.h (Output_section::is_noload): New method.
5598 (Output_section::set_is_noload): Ditto.
5599 (Output_section::is_noload_): New data member.
5600 * script-c.h (Script_section_type): New enum type.
5601 (struct Parser_output_section_header): Add new file section_type.
5602 * script-sections.cc (Sections_element::output_section_name): Add
5603 parameter for returning script section type.
5604 (Output_section_definition::output_section_name): Ditto.
5605 (Output_section_definition::section_type)P; New method.
5606 (Output_section_definiton::script_section_type_name): Ditto.
5607 (Output_section_definition::script_section_type_): New data member.
5608 (Output_section_definition::Output_section_definition): Initialize
5609 data member Output_section_definition::script_section_type_.
5610 (Output_section_definition::create_sections): Pass script section type
5611 to Layout::make_output_section_for_script.
5612 (Output_section_definition::output_section_name): Return script
5613 section type to caller.
5614 (Output_section_definition::set_section_address): Do not advance
5615 dot value and load address if section type is NOLOAD. Set address
5616 of NOLOAD sections regardless of section flags.
5617 (Output_section_definition::print): Print section type if it is
5618 not SCRIPT_SECTION_TYPE_NONE.
5619 (Output_section_definition::section_type): New method.
5620 (Output_section_definition::script_section_type_name): Ditto.
5621 (Script_sections::output_section_name): Add new parameter
5622 PSECTION_TYPE for returning script section type. Pass it to
5623 section elements. Handle discard sections.
5624 (Sort_output_sections::operator()): Handle NOLOAD sections.
5625 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 5626 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
5627 returning script section type.
5628 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
5629 INFO and NOLOAD.
5630 * yyscript.y (union): Add new field SECTION_TYPE.
5631 (COPY, DSECT, INFO, NOLOAD): New tokens.
5632 (opt_address_and_section_type): Change type to output_section_header.
5633 (section_type): New non-terminal
5634 (section_header): Handle section type.
2253bfba 5635 (opt_address_and_section_type): Return section type value.
4dbd9faf 5636
721ea635
L
56372010-04-09 H.J. Lu <hongjiu.lu@intel.com>
5638
5639 * testsuite/plugin_common_test_1.c (foo): Add prototype.
5640 * testsuite/plugin_common_test_2.c (foo): Likewise.
5641
6bf924b0
DK
56422010-04-08 Doug Kwan <dougkwan@google.com>
5643
5644 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
5645 Output_merge_data.
5646 * output.cc (Output_section::add_merge_input_section): Simplify
5647 code and return status of Output_merge_base::add_input_section.
e1df38aa 5648 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
5649 returns true.
5650
24af6f92
DK
56512010-04-07 Doug Kwan <dougkwan@google.com>
5652
5653 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
5654 if section is marked as containing instructions but has no mapping
5655 symbols.
5656 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
5657 correct section index.
5658 (Arm_relobj::find_linked_text_section): Ditto.
5659
00698fc5
CC
56602010-04-07 Cary Coutant <ccoutant@google.com>
5661
5662 * archive.cc (include_member): Destroy Read_symbols_data object before
5663 releasing file.
5664 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
5665 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
5666 (Read_symbols_data::~Read_symbols_data) New destructor.
5667 (Section_relocs::Section_relocs) New constructor.
5668 (Section_relocs::~Section_relocs) New destructor.
5669 (Read_relocs_data::Read_relocs_data) New constructor.
5670 (Read_relocs_data::~Read_relocs_data) New destructor.
5671 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
5672 pointers to NULL after deleting.
5673
7296d933
DK
56742010-04-07 Doug Kwan <dougkwan@google.com>
5675
5676 * arm.cc: Replace "endianity" with "endianness" in comments.
5677 (Arm_exidx_cantunwind): Ditto.
5678 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
5679 (Arm_relobj::merge_flags_and_attributes): New method.
5680 (Arm_relobj::merge_flags_and_attributes_): New data member.
5681 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
5682 (Arm_relobj::scan_sections_for_stubs): Ditto.
5683 (Arm_relobj::do_read_symbols): Check to see if we really want to
5684 merge processor-specific flags and attributes. Exit early if
5685 an object is empty except for section names and the undefined symbol.
5686 (Target_arm::do_finalize_sections): Move check for ELF format to
5687 Arm_relobj::do_read_symbols. Merge processor specific flags and
5688 attributes from a regular object only when we have determined that
5689 it is aapropriate. Do not create an .ARM.attributes section in
5690 output if there is no regular input object.
5691 (Target_arm::merge_processor_specific_flags): Check
5692 --warn-mismatch before printing any error.
5693 (Target_arm::merge_object_attributes): Ditto.
5694 * gold.cc (queue_middle_tasks): Handle the case in which there is
5695 no regular object in input.
5696 * options.cc (General_options::parse_EB): New method.
5697 (General_options::parse_EL): Same.
5698 (General_options::General_options): Initialize endianness_.
5699 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
5700 New options.
5701 (General_options::Endianness): New enum.
5702 (General_options::endianness): New method.
5703 (General_options::endianness_): New data member.
5704 * parameters.cc (Parameters::set_options): Check target endianness.
5705 (Parameters::set_target_once): Ditto.
5706 (Parameters::check_target_endianness): New method.
5707 (parameters_force_valid_target): If either -EL or -EB is specified,
5708 use it to define endianness of default target.
5709 * parameters.h (Parameters::check_target_endianness): New method
5710 declaration.
5711 * target.h (class Target): Change "endianity" to "endianness"
5712 in comments.
5713
efc8d4f2
RW
57142010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5715
5716 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
5717 * configure: Regenerate.
5718 * Makefile.in: Regenerate.
5719 * testsuite/Makefile.in: Regenerate.
5720
be234d88
CC
57212010-04-06 Cary Coutant <ccoutant@google.com>
5722
5723 gcc PR lto/42757
5724 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
5725 prevailing definitions of common symbols.
5726 * testsuite/plugin_test_6.sh: New test case.
5727 * testsuite/plugin_common_test_1.c: New test case.
5728 * testsuite/plugin_common_test_2.c: New test case.
5729 * testsuite/Makefile.am (plugin_test_6): New test case.
5730 * testsuite/Makefile.in: Regenerate.
5731
bd32c6bd
NC
57322010-04-06 Nick Clifton <nickc@redhat.com>
5733
5734 * po/vi.po: New Vietnamese translation.
5735
323c532f
DK
57362010-03-30 Doug Kwan <dougkwan@google.com>
5737
5738 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
5739
4fcd97eb
DK
57402010-03-25 Doug Kwan <dougkwan@google.com>
5741
5742 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
5743 to avoid a conversion warning on a 32-bit host.
5744
4ebf39db
ILT
57452010-03-24 Ian Lance Taylor <iant@google.com>
5746
5747 * testsuite/script_test_3.t: Add a TLS segment.
5748 * testsuite/Makefile.am (check_PROGRAMS): Add
5749 tls_phdrs_script_test.
5750 (tls_phdrs_script_test_SOURCES): Define.
5751 (tls_phdrs_script_test_DEPENDENCIES): Define.
5752 (tls_phdrs_script_test_LDFLAGS): Define.
5753 (tls_phdrs_script_test_LDADD): Define.
5754 * testsuite/Makefile.in: Rebuild.
5755
4a599bdd
CC
57562010-03-23 Cary Coutant <ccoutant@google.com>
5757
5758 * fileread.cc (find_or_make_view): Fix comment.
5759
6c93b22c
ILT
57602010-03-23 Ian Lance Taylor <iant@google.com>
5761
5762 * script-sections.cc (class Orphan_section_placement): Define
5763 PLACE_TLS and PLACE_TLS_BSS.
5764 (Orphan_section_placement::Orphan_section_placement): Initialize
5765 new places.
5766 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
5767 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
5768 (tls_script_test_SOURCES): Define.
5769 (tls_script_test_DEPENDENCIES): Define.
5770 (tls_script_test_LDFLAGS): Define.
5771 (tls_script_test_LDADD): Define.
5772 * testsuite/Makefile.in: Rebuild.
5773
a2c7281b
DK
57742010-03-22 Doug Kwan <dougkwan@google.com>
5775
5776 * arm.cc (Arm_relocate_functions::abs8,
5777 Arm_relocate_functions::abs16): Use correct check for overflow
5778 specified in the ARM ELF specs.
5779 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
5780 target of a BLX instruction specially.
5781 (Reloc_stub::stub_type_for_reloc): Ditto.
5782 (Relocate::relocate): Use symbolic names instead of numeric relocation
5783 codes to report error.
5784 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
5785 workaround.
5786 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
5787 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
5788 thumb2_blx_out_of_range.stdout
5789 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
5790 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
5791 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
5792 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
5793 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
5794 thumb2_blx_in_range, thumb2_blx_in_range.o,
5795 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
5796 thumb2_blx_out_of_range.o): New rules.
2e702c99 5797 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
5798 thumb2_blx_in_range and thumb2_blx_out_of_range.
5799 * testsuite/Makefile.in: Regenerate.
5800 * arm_branch_in_range.sh: Add tests for THUMB BLX.
5801 * testsuite/thumb_blx_in_range.s: New file.
5802 * testsuite/thumb_blx_out_of_range.s: New file.
5803
b0193076
RÁE
58042010-03-22 Rafael Espindola <espindola@google.com>
5805
5806 * archive.cc (Should_include): Move to archive.h.
5807 (should_include_member): Make it a member of Archive.
5808 (Lib_group): New.
5809 (Add_lib_group_symbols): New.
5810 * archive.h: Include options.h.
5811 (Archive_member): Moved from Archive.
5812 (Should_include): Moved from archive.cc.
5813 (Lib_group): New.
5814 (Add_lib_group_symbols): New.
5815 * dynobj.cc (do_should_include_member): New.
5816 * dynobj.h (do_should_include_member): New.
5817 * gold.cc (queue_initial_tasks): Update call to queue.
5818 * main.cc (main): Print lib group stats.
5819 * object.cc (do_should_include_member): New.
5820 * object.h: Include archive.h.
5821 (Object::should_include_member): New.
5822 (Object::do_should_include_member): New.
5823 (Sized_relobj::do_should_include_member): New.
5824 * options.cc (General_options::parse_start_lib): New.
5825 (General_options::parse_end_lib): New.
5826 (Input_arguments::add_file): Handle lib groups.
5827 (Input_arguments::start_group): Check we are not in a lib.
5828 (Input_arguments::start_lib): New.
5829 (Input_arguments::end_lib): New.
5830 * options.h (General_options): Add start_lib and end_lib.
5831 (Input_argument::lib_): New.
5832 (Input_argument::lib): New.
5833 (Input_argument::is_lib): New.
5834 (Input_file_lib): New.
5835 (Input_arguments::in_lib_): New.
5836 (Input_arguments::in_lib): New.
5837 (Input_arguments::start_lib): New.
5838 (Input_arguments::end_lib_): New.
5839 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
5840 in unused members as preempted.
5841 (Sized_pluginobj::do_should_include_member): New.
5842 * plugin.h (Sized_pluginobj::do_should_include_member): New.
5843 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
5844 return the blocker.
5845 (Read_symbols::do_whole_lib_group): New.
5846 (Read_symbols::do_lib_group): New.
5847 (Read_symbols::do_read_symbols): Handle lib groups.
5848 (Read_symbols::get_name): Handle lib groups.
5849 * readsyms.h (Read_symbols): Add an archive member pointer.
5850 (Read_symbols::do_whole_lib_group): New.
5851 (Read_symbols::do_lib_group): New.
5852 (Read_symbols::member_): New.
5853 * script.cc (read_input_script): Update call to queue_soon.
5854
d099120c
DK
58552010-03-19 Doug Kwan <dougkwan@google.com>
5856
5857 * arm.cc (Stub_table::Stub_table): Initialize new data members
5858 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
5859 (Stub_table::add_reloc_stub): Assign stub offset and update
5860 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
5861 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
5862 New data members.
2e702c99 5863 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
5864 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
5865 instead of going over all reloc stubs.
2e702c99 5866 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
5867 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
5868 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 5869 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
5870 Stringpool_template::offset_.
5871 * stringpool.h (Stringpool_template::set_no_zero_null): Set
5872 Stringpool_template::offset_ to zero.
5873
1aa37384
DK
58742010-03-15 Doug Kwan <dougkwan@google.com>
5875
5876 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
5877 offset_.
5878 (Stringpool_template::new_key_offset): New method.
5879 (Stringpool_template::add_string): Assign offsets when adding new
5880 strings.
5881 (Stringpool_template::set_string_offsets): Do not set string offsets
5882 when not optimizing.
5883 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
5884 member size_.
2e702c99
RM
5885 (Chunked_vector::clear): Clear size_.
5886 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
5887 (Chunked_vector::size): Return size_.
5888 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 5889 (Chunked_vector::size_): New data member.
1aa37384
DK
5890 (Stringpool_template::set_no_zero_null): Assert string set is empty.
5891 (Stringpool_template::new_key_offset): New method declaration.
5892 (Stringpool_template::offset_): New data member.
5893
b672b057
RÁE
58942010-03-15 Rafael Espindola <espindola@google.com>
5895
5896 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
5897 Add_symbols' constructor.
5898 * readsyms.h (Add_symbols): Remove the input_group member.
5899
b6848d3c
ILT
59002010-03-10 Ian Lance Taylor <iant@google.com>
5901
5902 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
5903 target to ask whether a reference to a symbol requires a stack
5904 split.
5905 * target.h (Target::is_call_to_non_split): New function.
5906 (Target::do_is_call_to_non_split): Declare virtual function.
5907 * target.cc: Include "symtab.h".
5908 (Target::do_is_call_to_non_split): New function.
5909 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
5910
a2a5469e
CC
59112010-03-10 Cary Coutant <ccoutant@google.com>
5912
5913 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
5914 (File_read::open[1]): Remove initial mapping of whole_file_view_.
5915 (File_read::open[2]): Add whole_file_view_ to list of views.
5916 (File_read::make_view): Remove test of whole_file_view_.
5917 (File_read::find_or_make_view): Create whole_file_view_ if
5918 necessary.
5919 (File_read::clear_views): Replace bool parameter with enum;
5920 adjust all callers. Don't delete views with permanent data;
5921 do delete cached views and views from archives if
5922 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
5923 if clearing the corresponding view.
5924 * fileread.h (File_read::Clear_views_mode): New enum.
5925 (File_read::View::is_permanent_view): New method.
5926 (File_read::clear_views): Replace bool parameter
5927 with enum; adjust all callers.
5928 * options.h (General_options): Change keep_files_mapped option;
5929 add map_whole_files.
5930 * readsyms.cc (Add_symbols::run): Delete sd_ object before
5931 releasing the file.
5932 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
5933 the file.
5934
8861f32b
DM
59352010-03-10 David S. Miller <davem@davemloft.net>
5936
5937 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
5938
d62d0f5f
ST
59392010-03-09 Sriraman Tallam <tmsriram@google.com>
5940
5941 * icf.cc (get_section_contents): Add '@' marker after processing the
5942 merge reloc.
5943
9177756d
DK
59442010-03-08 Doug Kwan <dougkwan@google.com>
5945
5946 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
5947 due to a conversion warning.
5948 (Arm_relobj::update_output_local_symbol_count): Check for local
5949 symbol with unset output index.
5950
9e9e071b
ILT
59512010-03-05 Ian Lance Taylor <iant@google.com>
5952
5953 * options.h (class General_options): Add --spare-dynamic-tags.
5954 * output.cc (Output_data_dynamic::set_final_data_size): Implement
5955 --spare-dynamic-tags.
5956
a81ee015
ILT
59572010-03-05 Ian Lance Taylor <iant@google.com>
5958
5959 * incremental.cc: Include "libiberty.h".
5960
44ec90b9
RO
59612010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
5962
5963 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
5964 function, is_info_ member.
5965 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
5966 (Versions::Versions): Update caller.
5967 (Versions::define_base_version): Likewise.
5968 (Versions::add_def): Likewise.
5969
0897ed3b
ST
59702010-03-03 Sriraman Tallam <tmsriram@google.com>
5971
5972 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
5973 (Scan::possible_function_pointer_reloc): New function.
5974 (Scan::local_reloc_may_be_function_pointer): Change to call
5975 possible_function_pointer_reloc.
5976 (Scan::global_reloc_may_be_function_pointer): Ditto.
5977 * icf.h (Icf::check_section_for_function_pointers): Change to reject
5978 relocations in ".data.rel.ro._ZTV" section.
5979 * testsuite/icf_safe_so_test.sh: Change to pass i386.
5980 * testsuite/icf_safe_so_test.cc: Ditto.
5981 * testsuite/icf_safe_test.cc: Ditto.
5982 * testsuite/icf_safe_test.sh: Ditto.
5983
d3bbad62
ILT
59842010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5985 Ian Lance Taylor <iant@google.com>
5986
5987 * target-reloc.h (relocate_section): Check the symbol table index
5988 for -1U before setting the local symbol index.
5989 (scan_relocatable_relocs): If copying the relocation, record that
5990 the local symbol is required.
5991 * object.h (Symbol_value::is_output_symtab_index_set): New
5992 function.
5993 (Symbol_value::may_be_discarded_from_output_symtab): New
5994 function.
5995 (Symbol_value::has_output_symtab_entry): New function.
5996 (Symbol_value::needs_output_symtab_entry): Remove.
5997 (Symbol_value::output_symtab_index): Make sure the symbol index is
5998 set.
5999 (Symbol_value::set_output_symtab_index): Make sure the symbol
6000 index is not set. Make sure the new index is valid.
6001 (Symbol_value::set_must_have_output_symtab_entry): New function.
6002 (Symbol_value::has_output_dynsym_entry): New function.
6003 (Symbol_value::set_output_dynsym_index): Make sure the new index
6004 is valid.
6005 (Sized_relobj::set_must_have_output_symtab_entry): New function.
6006 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
6007 local symbol if permitted.
6008 (Sized_relobj::do_finalize_local_symbols): Call
6009 is_output_symtab_index_set rather than needs_output_symtab_entry.
6010 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
6011 rather than needs_output_symtab_entry. Call
6012 has_output_dynsym_entry rather than needs_output_dynsym_entry.
6013 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
6014 is_output_symtab_index_set rather than needs_output_symtab_entry.
6015 * testsuite/discard_locals_relocatable_test.c: New file.
6016 * testsuite/discard_locals_test.sh: Test -r.
6017 * testsuite/Makefile.am (check_DATA): Add
6018 discard_locals_relocatable_test1.syms,
6019 discard_local_relocatable_test2.syms.
6020 (MOSTLYCLEANFILES): Likewise. Also add
6021 discard_locals_relocatable_test1.lout and
6022 discard_locals_relocatable_test2.out.
6023 (discard_locals_relocatable_test1.syms): New target.
6024 (discard_locals_relocatable_test.o): New target.
6025 (discard_locals_relocatable_test1.out): New target.
6026 (discard_locals_relocatable_test2.syms): New target.
6027 (discard_locals_relocatable_test2.out): New target.
6028 (various): Add missing ../ld-new dependencies.
6029 * testsuite/Makefile.in: Rebuild.
6030
7e8ccf26
NC
60312010-03-03 Nick Clifton <nickc@redhat.com>
6032
6033 * po/fi.po: New Finnish translation.
6034
2a0ff005
DK
60352010-03-01 Doug Kwan <dougkwan@google.com>
6036
6037 * layout.cc (Layout::Layout): Force section types of .init_array*,
6038 .preinit_array* and .fini_array* sections.
6039 * output.cc (Output_section::Input_section_sort_entry::has_priority):
6040 Fix check of return value of std::string::find.().
6041 (Output_section::Input_section_sort_compare::operator()): Remove
6042 comment about .init_array.
6043 (Output_section::Input_section_sort_init_fini_compare::operator()):
6044 New method.
6045 (Output_section::sort_attached_input_sections): Handle .init_array
6046 and .fini_array specially.
6047 * output.h (Output_section::Inut_section_sort_compare): Update
6048 comment.
6049 (Output_section::Input_section_sort_init_fini_compare): New struct.
6050
c3e4ae29
DK
60512010-02-26 Doug Kwan <dougkwan@google.com>
6052
6053 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
6054 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
6055 * testsuite/debug_msg.sh: Avoid matching source line number for
6056 use of global variable undef_int.
6057
2fd9ae7a
DK
60582010-02-26 Doug Kwan <dougkwan@google.com>
6059
6060 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
6061 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
6062 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
6063 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
6064 * options.cc (General_options::General_options): Initialize member
6065 fix_v4bx_.
6066 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
6067 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
6068 and rm_no_fix_v4bx.stdout
6069 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
6070 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
6071 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
6072 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
6073 and arm_no_fix_v4bx.
6074 * Makefile.in: Regenerate.
6075 * testsuite/arm_fix_v4bx.s: New file.
6076 * testsuite/arm_fix_v4bx.sh: Ditto.
6077
67ec7d0b
DK
60782010-02-24 Doug Kwan <dougkwan@google.com>
6079
6080 * arm.cc (Target_arm::got_section): Make the .got section the first
6081 non RELRO section in the data segment.
6082 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
6083 suffixes of section names.
6084
10165461
DK
60852010-02-24 Doug Kwan <dougkwan@google.com>
6086
6087 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
6088 flags and attributes merging if an input file is a binary file.
6089 * fileread.cc (Input_file::open): Record format of original file.
6090 * fileread.h (Input_file::Format): New enum type.
2e702c99 6091 (Input_file::Input_file): Initialize data member format_.
10165461
DK
6092 (Input_file::format): New method definition.
6093 (Input_file::format_):: New data member.
6094
4a54abbb
DK
60952010-02-24 Doug Kwan <dougkwan@google.com>
6096
6097 * arm.cc (Arm_output_data_got): New class.
6098 (ARM_TCB_SIZE): New constant
6099 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
6100 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
6101 If user uses a script with a SECTIONS clause, issue only a warning
6102 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 6103 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
6104 garbage collection.
6105 (Target_arm::got_mode_index_entry): Handle static linking.
6106 (Target_arm::Scan::local): Ditto.
6107 (Target_arm::Scan::global): Ditto.
6108 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
6109 all incorrectly implemented relocations.
e1df38aa 6110 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
6111 Arm_output_section::fix_exidx_coverage.
6112 * layout.cc (Layout::section_name_mapping): Remove trailing dots
6113 from ".ARM.exidx." and ".ARM.extab.".
6114
ca419a6f
ILT
61152010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6116
6117 * arm.cc (Target_arm::do_finalize_sections): Create attribute
6118 section if it does not already exist.
6119 * attributes.cc (Attributes_section_data::Attributes_section_data):
6120 Don't crash if size is zero.
6121
135b9c78
ILT
61222010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6123 Ian Lance Taylor <iant@google.com>
6124
6125 * gold.cc (queue_middle_tasks): If no input files were opened,
6126 exit.
6127 * workqueue.h (Task_function::Task_function): Assert that there is
6128 a blocker.
6129
bb0bfe4f
DK
61302010-02-22 Doug Kwan <dougkwan@google.com>
6131
6132 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
6133 * icf.cc (get_section_contents): Cast snprintf arguments to long long
6134 types to avoid warnings due to different uint64_t implementations
6135 on different hosts.
6136
2a2b6d42
DK
61372010-02-21 Doug Kwan <dougkwan@google.com>
6138
6139 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
6140 handling of the maximum backward branch offset.
2e702c99 6141 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
6142 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
6143 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 6144 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
6145 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
6146 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
6147 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
6148 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
6149 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
6150 thumb_bl_out_of_range thumb_bl_out_of_range.o,
6151 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
6152 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
6153 thumb2_bl_out_of_range.o): New rules.
6154 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
6155 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
6156 thumb2_bl_out_of_range
6157 * testsuite/Makefile.in: Regenerate.
6158 * testsuite/arm_bl_in_range.s: New file.
6159 * testsuite/arm_bl_out_of_range.s: Ditto.
6160 * testsuite/arm_branch_in_range.sh: Ditto.
6161 * testsuite/arm_branch_range.t: Ditto.
6162 * testsuite/thumb2_branch_range.t: Ditto.
6163 * testsuite/thumb_bl_in_range.s: Ditto.
6164 * testsuite/thumb_bl_out_of_range.s: Ditto.
6165 * testsuite/thumb_branch_range.t: Ditto.
6166
b487ad64
ST
61672010-02-20 Sriraman Tallam <tmsriram@google.com>
6168
6169 * gc.h (gc_process_relocs): Change vectors to point to the new list.
6170 Add reloc offset information.
6171 * icf.cc (get_section_contents): Change iterators to point to the new
6172 vectors. Add reloc offset information to the contents.
6173 * icf.h (Icf::Sections_reachable_info): New typedef.
6174 (Icf::Sections_reachable_list): New typedef.
6175 (Icf::Offset_info): New typedef.
6176 (Icf::Reloc_info): New struct typedef.
6177 (Icf::Reloc_info_list): New typedef.
6178 (Icf::symbol_reloc_list): Delete method.
6179 (Icf::addend_reloc_list): Delete method.
6180 (Icf::section_reloc_list): Delete method.
6181 (Icf::reloc_info_list): New method.
6182 (Icf::reloc_info_list_): New member.
6183
f96accdf
DK
61842010-02-19 Doug Kwan <dougkwan@google.com>
6185
6186 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
6187 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
6188 * arm.cc (Arm_relocation_functions): New forward declaration.
6189 (Target_arm::Target_arm): Initialize new data members
6190 got_mod_index_offset_ and tls_base_symbol_defined_.
6191 (Target_arm::Relocate::relocate_tls): New method.
6192 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
6193 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
6194 New methods.
2e702c99 6195 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
6196 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
6197 (Target_arm::got_mod_index_offset_,
6198 Target_arm::tls_base_symbol_defined_): New data members.
6199 (Target_arm::Scan::local, Target::Scan::global,
6200 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
6201 relocations.
6202
c8761b9a
DK
62032010-02-18 Doug Kwan <dougkwan@google.com>
6204
6205 * arm.cc (Arm_relobj::find_linked_text_section): New method.
6206 (Arm_relobj::make_exidx_input_section): Pass section index of linked
6207 text section as a parameter becuase some broken tools may not set
6208 the link in section header.
6209 (Target_arm::has_got_section): New method.
6210 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
6211 without any mapping symbol as data only. Remove warning.
6212 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
6213 link in its section header, try to discover the link by inspecting the
6214 REL31 relocation at the beginning of the section.
6215 (Target_arm::Scan::check_non_pic): Report name of offending relocation
6216 in error message.
6217 (Target_arm::Scan::global): Treat any reference to the symbol
6218 _GLOBAL_OFFSET_TABLE_ as a GOT access.
6219
21bb3914
ST
62202010-02-12 Sriraman Tallam <tmsriram@google.com>
6221
6222 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
6223 (Scan::global_reloc_may_be_function_pointer): New function.
6224 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6225 (Scan::global_reloc_may_be_function_pointer): New function.
6226 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6227 (Scan::global_reloc_may_be_function_pointer): New function.
6228 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
6229 (Scan::global_reloc_may_be_function_pointer): New function.
6230 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
6231 (Scan::global_reloc_may_be_function_pointer): New function.
6232 (Scan::possible_function_pointer_reloc): New function.
6233 (Target_x86_64::can_check_for_function_pointers): New function.
6234 * gc.h (gc_process_relocs): Scan relocation types to determine if
6235 function pointers were taken for targets that support it.
6236 * icf.cc (Icf::find_identical_sections): Include functions for
6237 folding in safe ICF whose pointer is not taken.
6238 * icf.h (Secn_fptr_taken_set): New typedef.
6239 (fptr_section_id_): New member.
6240 (section_has_function_pointers): New function.
6241 (set_section_has_function_pointers): New function.
6242 (check_section_for_function_pointers): New function.
6243 * options.h: Fix comment for safe ICF option.
6244 * target.h (can_check_for_function_pointers): New function.
6245 * testsuite/Makefile.am: Add icf_safe_so_test test case.
6246 Modify icf_safe_test for X86-64.
6247 * testsuite/Makefile.in: Regenerate.
6248 * testsuite/icf_safe_so_test.cc: New file.
6249 * testsuite/icf_safe_so_test.sh: New file.
6250 * testsuite/icf_safe_test.cc (kept_func_3): New function.
6251 (main): Change to take pointer to function kept_func_3.
6252 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
6253 folding is done correctly for X86-64.
6254
0da6fa6c
DM
62552010-02-12 David S. Miller <davem@davemloft.net>
6256
6257 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
6258 is_symbolless parameter.
6259 (Output_reloc<SHT_REL>::is_symbolless): New.
6260 (Output_reloc<SHT_REL>::is_symbolless_): New.
6261 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
6262 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
6263 (Output_reloc<SHT_RELA>::is_symbolless): New.
6264 (Output_data_reloc::add_global): Handle is_symbolless.
6265 (Output_data_reloc::add_global_relative): Likewise.
6266 (Output_data_reloc::add_local): Likewise.
6267 (Output_data_reloc::add_local_relative): Likewise.
6268 (Output_data_reloc::add_symbolless_global_addend): New.
6269 (Output_data_reloc::add_symbolless_local_addend): New.
6270 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
6271 is_symbolless.
6272 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
6273 instead of ->is_relative_
6274 (Output_reloc::write): Likewise.
6275 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
6276 (Output_reloc::write_rel): Simplify.
6277
6278 * sparc.cc (Target_sparc::Scan::local): Use
6279 ->add_symbolless_local_addend as needed.
6280 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
6281 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
6282 based upon relocation offset.
6283
e4782e83
DK
62842010-02-11 Doug Kwan <dougkwan@google.com>
6285
6286 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
6287 (Target_arm::Scan::global): Ditto. Also remove a comment before the
6288 beginning of function.
6289 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
6290 and MOVT_ABS relocations. Those are non issued in scanning. Fix
6291 parameter is_32bit in calls to should_apply_static_reloc.
6292 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
6293 (check_DATA): Add arm_abs_global.stdout.
6294 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
6295 arm_abs_global.stdout): New rules.
6296 (MOSTLLYCLEANFILES): Add arm_abs_global
6297 * Makefile.in: Regenerate.
6298 * testsuite/arm_abs_global.s: New file.
6299 * testsuite/arm_abs_global.sh: Ditto.
6300 * testsuite/arm_abs_lib.s: Ditto.
6301
93ceb764
ILT
63022010-02-11 Ian Lance Taylor <iant@google.com>
6303
6304 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
6305 Read_relocs task.
6306 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
6307 Allocate_commons_task first.
6308 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
6309 task, rather than symtab_lock_.
6310 (Gc_process_relocs::~Gc_process_relocs): New function.
6311 (Gc_process_relocs::is_runnable): Check this_blocker_.
6312 (Gc_process_relocs::locks): Use next_blocker_ rather than
6313 blocker_.
6314 (Scan_relocs::~Scan_relocs): New function.
6315 (Scan_relocs::is_runnable): Check this_blocker_ rather than
6316 symtab_lock_.
6317 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
6318 next_blocker_.
6319 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
6320 fields. Add this_blocker_ and next_blocker_ fields. Adjust
6321 constructor accordingly.
6322 (class Gc_process_relocs): Likewise.
6323 (class Scan_relocs): Likewise.
6324 * common.h (class Allocate_commons_task): Remove symtab_lock_
6325 field, and corresponding constructor parameter.
6326 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
6327 symtab_lock_.
6328 (Allocate_commons_task::locks): Likewise.
6329
114dfbe1
ILT
63302010-02-11 Ian Lance Taylor <iant@google.com>
6331
6332 * gold-threads.h (class Once): Define.
6333 (class Initialize_lock): Rewrite as child of Once.
6334 * gold-threads.cc (class Once_initialize): Define.
6335 (once_pointer_control): New static variable.
6336 (once_pointer, once_arg): New static variables.
6337 (c_run_once): New static function.
6338 (Once::Once, Once::run_once, Once::internal_run): New functions.
6339 (class Initialize_lock_once): Remove.
6340 (initialize_lock_control): Remove.
6341 (initialize_lock_pointer): Remove.
6342 (initialize_lock_once): Remove.
6343 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
6344 (Initialize_lock::initialize): Rewrite.
6345 (Initialize_lock::do_run_once): New function.
6346 * archive.cc (Archive::interpret_header): Only clear name if it is
6347 not already empty.
6348 * fileread.cc: Include "gold-threads.h"
6349 (file_counts_lock): New static variable.
6350 (file_counts_initialize_lock): Likewise.
6351 (File_read::release): Only increment counts when using --stats.
6352 Use a lock around the increment.
6353 * parameters.cc (class Set_parameters_target_once): Define.
6354 (set_parameters_target_once): New static variable.
6355 (Parameters::Parameters): Move here from parameters.h.
6356 (Parameters::set_target): Rewrite.
6357 (Parameters::set_target_once): New function.
6358 (Parameters::clear_target): Move here and rewrite.
6359 * parameters.h (class Parameters): Update declarations. Add
6360 set_parameters_target_once_ field.
6361 (Parameters::Parameters): Move to parameters.cc.
6362 (Parameters::clear_target): Likewise.
6363 * readsyms.cc (Read_symbols::do_group): Create a Start_group
6364 task.
6365 (Start_group::~Start_group): New function.
6366 (Start_group::is_runnable): New function.
6367 (Start_group::locks, Start_group::run): New functions.
6368 (Finish_group::run): Change saw_undefined to size_t.
6369 * readsyms.h (class Start_group): Define.
6370 (class Finish_group): Change saw_undefined_ field to size_t.
6371 (Finish_group::Finish_group): Remove saw_undefined and
6372 this_blocker parameters. Change all callers.
6373 (Finish_group::set_saw_undefined): New function.
6374 (Finish_group::set_blocker): New function.
6375 * symtab.h (class Symbol_table): Change saw_undefined to return
6376 size_t. Change saw_undefined_ field to size_t.
6377 * target-select.cc (Set_target_once::do_run_once): New function.
6378 (Target_selector::Target_selector): Initialize set_target_once_
6379 field. Don't initialize lock_ and initialize_lock_ fields.
6380 (Target_selector::instantiate_target): Rewrite.
6381 (Target_selector::set_target): New function.
6382 * target-select.h (class Set_target_once): Define.
6383 (class Target_selector): Update declarations. Make
6384 Set_target_once a friend. Remove lock_ and initialize_lock_
6385 fields. Add set_target_once_ field.
6386
fa17a3f4
ILT
63872010-02-10 Ian Lance Taylor <iant@google.com>
6388
6389 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
6390 queueing any tasks.
6391 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
6392 (queue_middle_tasks): Add all blockers before queueing any tasks.
6393 (queue_final_tasks): Likewise.
6394 * token.h (Task_token::add_blockers): New function.
6395 * object.h (Input_objects::number_of_relobjs): New function.
6396
c7177d31
ILT
63972010-02-10 Ian Lance Taylor <iant@google.com>
6398
5de0e392
ILT
6399 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
6400 shared, not if not position independent.
6401 * x86_64.cc (Relocate::relocate_tls): Likewise.
6402 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
6403 (tls_pie_pic_test): New target.
6404 * testsuite/Makefile.in: Rebuild.
6405
c7177d31
ILT
6406 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
6407 (tls_test_main_pie.o, tls_test_pie.o): New targets.
6408 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
6409 * testsuite/Makefile.in: Rebuild.
6410
684b268a
DM
64112010-02-09 David S. Miller <davem@davemloft.net>
6412
6413 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
6414 R_SPARC_RELATIVE using ->add_local_relative().
6415 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
6416
612a8d3d
DM
6417 * output.h (Output_data_dynamic::add_section_size): New method
6418 that takes two Output_data objects.
6419 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
6420 entry param. Handle it in initializers.
6421 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
6422 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
6423 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
6424 arg.
6425 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
6426 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
6427 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
6428 for dynrel_includes_plt.
6429 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6430 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6431 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
6432 before .rela.plt
6433 (Target_sparc::do_finalize_sections): Update to pass true for
6434 dynrel_includes_plt.
6435 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
6436 output before .rela.plt
6437 (Target_powerpc::do_finalize_sections): Update to pass true for
6438 dynrel_includes_plt when 32-bit.
6439
cb1be87e
DK
64402010-02-08 Doug Kwan <dougkwan@google.com>
6441
6442 * arm.cc (Arm_relobj::simple_input_section_output_address): New
6443 method.
6444 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
6445 Arm_relobj::scan_section_for_cortex_a8_stubs,
6446 Arm_relobj::do_relocation_section): Instead of calling
6447 Output_section::output_address, use faster
6448 Arm_relobj::simple_input_section_output_address.
6449
705b5121
DM
64502010-02-08 David S. Miller <davem@davemloft.net>
6451
6452 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
6453 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
6454 relocation helper function.
6455
024c4466
DM
6456 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
6457 just like R_SPARC_GOT{10,13,22}.
6458 (Target_sparc::Scan::local): Likewise.
6459 (Target_sparc::Relocate:relocate): Likewise.
6460
9109c078
ILT
64612010-02-06 Ian Lance Taylor <iant@google.com>
6462
6463 * configure.ac: Rewrite targetobjs duplicate removal code to use
6464 only shell constructs.
6465 * configure: Rebuild.
6466
cf846138
DK
64672010-02-05 Doug Kwan <dougkwan@google.com>
6468
6469 PR 11247
6470 * arm.cc (Arm_relobj::section_is_scannable): New method.
6471 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
6472 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
6473
6cfaf60b
DK
64742010-02-04 Doug Kwan <dougkwan@google.com>
6475
6476 PR 11247
6477 * arm-reloc-property.cc (cstdio): Include.
6478 * configure.ac (targetobjs): Remove duplicates.
6479 * configure: Regenerate.
6480 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
6481 big and little endian version for a given address size.
6482
5c57f1be
DK
64832010-02-03 Doug Kwan <dougkwan@google.com>
6484
6485 * arm-reloc-property.cc
6486 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6487 definition.
6488 * arm-reloc-property.h
6489 (Arm_reloc_property_table::get_implemented_static_reloc_property):
6490 New method definition.
6491 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6492 declaration.
6493 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
6494 overflow to N.
6495 (GOT_PREL): Change implemented to Y.
6496 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
6497 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
6498 (Arm_relocate_functions::movw_abs_nc): Remove method.
6499 (Arm_relocate_functions::movt_abs): Ditto.
6500 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
6501 (Arm_relocate_functions::thm_movt_abs): Ditto.
6502 (Arm_relocate_functions::movw_rel_nc): Ditto.
6503 (Arm_relocate_functions::movw_rel): Ditto.
6504 (Arm_relocate_functions::movt_rel): Ditto.
6505 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
6506 (Arm_relocate_functions:thm_movw_rel): Ditto.
6507 (Arm_relocate_functions:thm_movt_rel): Ditto.
6508 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
6509 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
6510 New method definitions.
6511 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
6512 (Arm_relocation_functions::arm_grp_ldr): Ditto.
6513 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
6514 (Arm_relocation_functions::arm_grp_ldc): Ditto.
6515 (Target_arm::Relocate::relocate): Check for non-static or
6516 unimplemented relocation code and exit early. Change calls to
6517 Target_arm::reloc_uses_thumb_bit and
6518 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
6519 instead. Refactor code to handle similar relocations to increase
6520 code sharing. Remove check for unsupported relocation code in switch
6521 statement.
6522 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
6523 relocation property table to find out size. Change error message to
6524 print out the name of a relocation code instead of the numeric value.
6525 (Target_arm::scan_reloc_for_stub): Use relocation property table
6526 instead of calling Target_arm::reloc_uses_thumb_bit().
6527
218c5831
DK
65282010-02-02 Doug Kwan <dougkwan@google.com>
6529
6530 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
6531 types of relaxed input section.
6532
0d31c79d
DK
65332010-02-02 Doug Kwan <dougkwan@google.com>
6534
6535 * Makefile.am (HFILES): Add arm-reloc-property.h.
6536 (DEFFILES): New.
2e702c99
RM
6537 (TARGETSOURCES): Add arm-reloc-property.cc
6538 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
6539 (libgold_a_SOURCES): $(DEFFILES)
6540 * Makefile.in: Regenerate.
6541 * arm-reloc-property.cc: New file.
6542 * arm-reloc-property.h: New file.
6543 * arm-reloc.def: New file.
6544 * arm.cc: Update comments.
6545 (arm-reloc-property.h): New included header.
6546 (arm_reloc_property_table): New global variable.
6547 (Target_arm::do_select_as_default_target): New method definition.
6548 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
6549 arm-reloc-property to targ_extra_obj.
6550 * parameters.cc (set_parameters_target): Call
6551 Target::select_as_default_target().
6552 * target.h (Target::select_as_default_target): New method definition.
6553 (Target::do_select_as_default_target): Same.
6554
546c7457
DK
65552010-02-01 Doug Kwan <dougkwan@google.com>
6556
6557 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
6558 first_output_text_section_.
6559 (Arm_exidx_fixup::first_output_text_section): New method definition.
6560 (Arm_exidx_fixup::first_output_text_section_): New data member.
6561 (Arm_exidx_fixup::process_exidx_section): Record the first text
6562 output section seen.
6563 (Arm_output_section::fix_exidx_coverage): Set correct linked section
6564 and entsize in output section header.
6565
11b861d5
DK
65662010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6567
6568 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
6569 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
6570 (Arm_relocate_functions::thm_alu11): New Method.
6571 (Arm_relocate_functions::thm_pc8): New Method.
6572 (Arm_relocate_functions::thm_pc12): New Method.
6573 (Target_arm::Scan::local): Handle the relocations.
6574 (Target_arm::Scan::global): Likewise.
6575 (Target_arm::Relocate::relocate): Likewise.
6576 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6577
c9a2c125
DK
65782010-01-29 Doug Kwan <dougkwan@google.com>
6579
6580 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
6581 of relocation types as ld.
6582
1521477a
DK
65832010-01-29 Doug Kwan <dougkwan@google.com>
6584
6585 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
6586 to public.
6587 (Arm_relocate_functions::thumb_branch_common): Ditto.
6588 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
6589 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
6590 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
6591 Arm_relocate_functions::jump24): Remove.
6592 (Target_arm::Relocate::relocate): Adjust code to call
6593 Arm_relocation_functions::arm_branch_common and
6594 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 6595 wrappers. Merge switch-cases together to reduce source code size.
1521477a 6596
e7eca48c
DK
65972010-01-29 Doug Kwan <dougkwan@google.com>
6598
6599 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
6600 output_local_symbol_count_needs_update_.
6601 (Arm_relobj::output_local_symbol_count_needs_update,
6602 Arm_relobj::set_output_local_symbol_count_needs_update,
6603 Arm_relobj::update_output_local_symbol_count): New methods.
6604 (Arm_relobj::output_local_symbol_count_needs_update_): New data
6605 member.
6606 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
6607 of pointed function as in a R_ARM_PREL31 relocation.
6608 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
6609 for output local symbol count updating.
6610 (Target_arm::do_relax): Update output local symbol counts in objects
6611 if necessary.
6612 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
6613
02961d7e
ILT
66142010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6615
6616 * arm.cc: Added support for the ARM relocations:
6617 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
6618 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
6619 (Arm_relocate_functions::movw_rel_nc): Renamed (was
6620 movw_prel_nc).
6621 (Arm_relocate_functions::movw_rel): New method.
6622 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
6623 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
6624 thm_movw_prel_nc).
6625 (Arm_relocate_functions::thm_movw_rel): New method.
6626 (Arm_relocate_functions::thm_movt_rel): Renamed (was
6627 thm_movt_prel).
6628 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
6629 relocations.
6630 (Target_arm::Scan::global): Likewise.
6631 (Target_arm::Relocate::relocate): Likewise.
6632 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6633 Likewise.
6634
b10d2873
ILT
66352010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6636
6637 * arm.cc: Added support for ARM group relocations.
6638 (Target_arm::reloc_needs_sym_origin): New method.
6639 (Arm_relocate_functions::calc_grp_kn): New method.
6640 (Arm_relocate_functions::calc_grp_residual): New method.
6641 (Arm_relocate_functions::calc_grp_gn): New method.
6642 (Arm_relocate_functions::arm_grp_alu): New Method.
6643 (Arm_relocate_functions::arm_grp_ldr): New Method.
6644 (Arm_relocate_functions::arm_grp_ldrs): New Method.
6645 (Arm_relocate_functions::arm_grp_ldc): New Method.
6646 (Target_arm::Scan::local): Handle the ARM group relocations.
6647 (Target_arm::Scan::global): Likewise.
6648 (Target_arm::Relocate::relocate): Likewise.
6649 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6650 Likewise.
6651
2b328d4e
DK
66522010-01-26 Doug Kwan <dougkwan@google.com>
6653
6654 * arm.cc (set): Include.
6655 (class Arm_exidx_fixup): Change type of last_input_section_ to const
6656 pointer type.
2e702c99 6657 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
6658 (Arm_output_section::append_text_sections_to_list): New method.
6659 (Arm_output_section::fix_exidx_coverage): Ditto.
6660 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 6661 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
6662 Relobj::set_section_offset() instead of
6663 Sized_relobj::invalidate_section_offset().
2e702c99 6664 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
6665 parameter for section headers. Ignore relocation sections for
6666 unallocated sections and EXIDX sections.
6667 (Target_arm::fix_exidx_coverage): New method.
6668 (Target_arm::output_section_address_less_than): New type.
6669 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
6670 linked text section instead of the EXIDX section.
6671 (Arm_output_section::create_stub_group): Add an assertion to check
6672 that this is not an EXIDX output section.
6673 (Arm_output_section::append_text_sections_to_list): New method.
6674 (Arm_output_section::fix_exidx_coverage): Ditto.
6675 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 6676 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
6677 (Target_arm::do_relax): Fix EXIDX output section coverage in the
6678 first pass.
6679 (Target_arm::fix_exidx_coverage): New method.
6680 * object.h (Relobj::set_output_section): New method.
6681 (Sized_relobj::invalidate_section_offset): Remove method.
6682 (Sized_relobj::do_invalidate_section_offset): Remove method.
6683 (Sized_relobj::do_set_section_offset): Handle offset value -1.
6684
c7f3c371
DK
66852010-01-25 Doug Kwan <dougkwan@google.com>
6686
6687 * arm.cc (Arm_exidx_merged_section::do_output_offset):
6688 Fix warning due to signed and unsigned comparison on a 32-bit host.
6689
8923b24c
DK
66902010-01-22 Doug Kwan <dougkwan@google.com>
6691
6692 * arm.cc (Target_arm::do_relax): Record an output section for section
6693 offset adjustment it contains any stub table that has changed.
6694 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
6695 offsets in an output section if necessary.
6696 * output.cc (Output_section::Output_section): Initialize
6697 section_offsets_need_adjustments_.
6698 (Output_section::add_input_section_for_script): Renamed to
6699 Output_section::add_simple_input_section.
6700 (Output_section::save_states): Add a comment.
6701 (Output_section::discard_states): New method defintion.
6702 (Output_section::adjust_section_offsets): Same.
6703 * output.h (Output_section::add_input_section_for_script): Renamed to
6704 Output_section::add_simple_input_section.
6705 (Output_section::discard_states): New method declaration.
6706 (Output_section::adjust_section_offsets): Same.
6707 (Output_section::section_offsets_need_adjustment,
6708 Output_section::set_section_offsets_need_adjustment): New method
6709 definitions.
6710 (Output_section::section_offsets_need_adjustment_): New data member.
6711 * script-sections.cc
6712 (Output_section_element_input::set_section_address): Adjust code for
6713 renaming of Output_section::add_input_section_for_script.
6714 (Orphan_output_section::set_section_address): Same.
6715
9b2fd367
DK
67162010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6717
6718 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
6719 Fix_v4bx enum values .
6720 * gold/options.h (General_options): New option definitions.
6721 (General_options::fix_v4bx): New method.
6722 (General_options::Fix_v4bx): New enum.
6723 * gold/options.cc (General_options::parse_fix_v4bx): New method.
6724 (General_options::parse_fix_v4bx_interworking): New method.
6725
80d0d023
DK
67262010-01-22 Doug Kwan <dougkwan@google.com>
6727
6728 * arm.cc (Arm_exidx_fixup): New class.
6729
af2cdeae
DK
67302010-01-21 Doug Kwan <dougkwan@google.com>
6731
6732 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
6733 classes.
6734 (Arm_exidx_section_offset_map): New type.
6735
993d07c1
DK
67362010-01-21 Doug Kwan <dougkwan@google.com>
6737
6738 * arm.cc (Arm_exidx_input_section): New class.
6739 (Arm_relobj::exidx_input_section_by_link,
6740 Arm_relobj::exidx_input_section_by_shndx,
6741 Arm_relobj::make_exidx_input_section): New methods.
6742 (read_arm_attributes_section): Remove.
6743 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
6744 information about them.
6745 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
6746 to here.
6747
5ac169d4
DK
67482010-01-20 Doug Kwan <dougkwan@google.com>
6749
6750 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
6751 Input_section_specifier to Section_id.
6752 (Target_arm::new_arm_input_section: Adjust code for change of key
6753 type.
6754 (Target_arm::find_arm_input_section): Ditto.
6755 * gc.h (object.h): Include for Section_id nand Section_id_hash.
6756 (Section_id): Remove.
6757 (Garbage_collection::Section_id_hash): Remove.
6758 * icf.h (object.h): Include for Section_id nand Section_id_hash.
6759 (Section_id): Remove.
6760 (Icf::Section_id_hash): Remove.
6761 * object.h (Section_id, Const_section_id, Section_id_hash,
6762 Const_section_id_hash): New type definitions.
6763 * output.cc (Output_section::add_relaxed_input_section): Change to
6764 use Const_section_id instead of Input_section_specifier as key type.
6765 (Output_section::add_merge_input_section): Ditto.
6766 (Output_section::build_relaxation_map): Change to use Section_id
6767 instead of Input_section_specifier as key type.
2e702c99 6768 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
6769 Ditto.
6770 (Output_section::convert_input_sections_to_relaxed_sections): Change
6771 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 6772 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
6773 (Output_section::find_relaxed_input_section): Ditto.
6774 * output.h (Input_section_specifier): Remove class.
6775 (Output_section::Output_section_data_by_input_section_map): Change
6776 key type to Const_section_id.
6777 (Output_section::Output_relaxed_input_section_by_input_section_map):
6778 Ditto.
6779 (Output_section::Relaxation_map): Change key type to Section_id.
6780
a2162063
ILT
67812010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6782
6783 * gold/arm.cc: Added support for R_ARM_V4BX relocation
6784 (class Arm_v4bx_stub): New class.
6785 (DEF_STUBS): Updated definition to support v4_veneer_bx.
6786 (Stub_factory::make_arm_v4bx_stub): New method.
6787 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
6788 (Stub_table::empty): Handle v4bx stubs.
6789 (Stub_table::add_arm_v4bx_stub): New method.
6790 (Stub_table::find_arm_v4bx_stub): New method.
6791 (Arm_relocate_functions::v4bx): New method.
6792 (Target_arm::fix_v4bx): New method.
6793 (Target_arm::Target_arm): Handle R_ARM_V4BX.
6794 (Stub_table::relocate_stubs): Likewise.
6795 (Stub_table::do_write): Likewise.
6796 (Stub_table::update_data_size_and_addralign): Likewise.
6797 (Stub_table::finalize_stubs): Likewise.
6798 (Target_arm::Scan::local): Likewise.
6799 (Target_arm::Scan::global): Likewise.
6800 (Target_arm::do_finalize_sections): Likewise.
6801 (Target_arm::Relocate::relocate): Likewise.
6802 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6803 Likewise.
6804 (Target_arm::scan_reloc_for_stub): Likewise.
6805 (Target_arm::scan_reloc_section_for_stubs): Likewise.
6806
5696ab0b
ILT
68072010-01-19 Ian Lance Taylor <iant@google.com>
6808
6809 * output.cc (Output_section_headers::do_sized_write): Write large
6810 segment count to sh_info field.
6811 (Output_file_header::do_sized_write): For large segment count,
6812 write PN_XNUM to e_phnum field.
6813
800d0f56
ILT
68142010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6815
6816 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
6817 (Arm_relocate_functions::thm_jump8): New function.
6818 (Arm_relocate_functions::thm_jump11): New function.
6819 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
6820 R_ARM_THM_JUMP11.
6821 (Target_arm::Scan::global): Likewise.
6822 (Target_arm::Relocate::relocate): Likewise.
6823 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6824 Likewise.
6825
41263c05
DK
68262010-01-14 Doug Kwan <dougkwan@google.com>
6827
6828 * arm.cc (map, utility): Include headers.
6829 (Target_arm::apply_cortex_a8_workaround): New method.
6830 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
6831 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
6832 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
6833 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
6834 the --[no-]fix-cortex-a8 command line options.
6835 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
6836 (Target_arm::relocate_stub): Use addend in instruction template.
6837 * options.h (DEFINE_bool): Set the user-set flag.
6838 (General_options): Add --[no-]-fix-cortex options.
6839 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 6840 : Update fast look-up map after conversion.
41263c05 6841
459e9b03
ST
68422010-01-14 Sriraman Tallam <tmsriram@google.com>
6843
6844 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
6845 in the first pass of do_layout.
6846
b521dfe4
DK
68472010-01-13 Doug Kwan <dougkwan@google.com>
6848
6849 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
6850 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
6851 apparent compiler problem of not folding static constant integral
6852 data members of elfcpp::Elf_sizes<32>.
6853
44272192
DK
68542010-01-13 Doug Kwan <dougkwan@google.com>
6855
6856 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
6857 Arm_relobj::section_needs_cortex_a8_stub_scanning,
6858 Arm_relobj::scan_section_for_cortex_a8_erratum,
6859 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
6860 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
6861 sections to scan for relocation stubs into a new method
6862 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
6863 relocation and Cortex-A8 stub scanning.
6864 (Target_arm::do_relax): Force stubs to be after stubbed sections
6865 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 6866 the beginning of a new relaxation pass. Update a comment.
44272192
DK
6867 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
6868
44b71ece
ILT
68692010-01-12 Ian Lance Taylor <iant@google.com>
6870
6871 * target-reloc.h (visibility_error): New inline function.
6872 (relocate_section): Call visibility_error.
6873 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
6874 (MOSTLYCLEANFILES): Likewise.
6875 (protected_4_pic.o, protected_3.err): New targets.
6876 * testsuite/protected_4.cc: New file.
6877
a120bc7f
DK
68782010-01-12 Doug Kwan <dougkwan@google.com>
6879
6880 * arm.cc (Cortex_a8_reloc): New class.
6881 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
6882 and cortex_a8_relocs_info_.
6883 (Target_arm::fix_cortex_a8): New method definition.
6884 (Target_arm::Cortex_a8_relocs_info): New type.
6885 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
6886 New data member declarations.
6887 (Target_arm::scan_reloc_for_stub): Record information about
6888 relocations for THUMB branches that might be exempted from the
6889 Cortex-A8 workaround.
6890 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
6891 at the beginning of a relaxation pass.
6892
20138696
DK
68932010-01-12 Doug Kwan <dougkwan@google.com>
6894
6895 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
6896 (Arm_relobj::Mapping_symbol_position,
6897 Arm_reloj::Mapping_symbol_position_less,
6898 Arm_relobj::Mapping_symbols_info): New types.
6899 (Target_arm::is_mapping_symbol_name): New method definition.
6900 (Arm_relobj::do_count_local_symbols): Save information about mapping
6901 symbols.
6902
089d69dc
DK
69032010-01-11 Doug Kwan <dougkwan@google.com>
6904
6905 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
6906 Arm_relocate_functions::thumb32_branch_upper,
6907 Arm_relocate_functions::thumb32_branch_lower,
6908 Arm_relocate_functions::thumb32_cond_branch_offset,
6909 Arm_relocate_functions::thumb32_cond_branch_upper,
6910 Arm_relocate_functions::thumb32_cond_branch_lower,
6911 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
6912 branch offset encoding.
6913 (Arm_relocate_functions::thumb_branch_common): Use new branch
6914 offset encoding methods to avoid code duplication.
6915 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
6916 (Stub_addend_reader::operator()): Use new branch encoding method
6917 to avoid code duplication.
6918
99e5bff2
DK
69192010-01-11 Doug Kwan <dougkwan@google.com>
6920
6921 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
6922 (Target_arm::do_finalize_sections): Define special EXIDX section
6923 symbols only if referenced.
6924 * gc.h (Garbage_collection::add_reference): New method.
6925 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
6926 code duplication.
6927
98e090bd
ILT
69282010-01-11 Ian Lance Taylor <iant@google.com>
6929
d0a91bd8
ILT
6930 * script.cc (Version_script_info::build_expression_list_lookup):
6931 Change complaing about duplicate wildcard match from error to
6932 warning.
6933
98e090bd
ILT
6934 * script.cc (class Lazy_demangler): Recreate--revert part of patch
6935 of 2009-12-30.
6936 (Version_script_info::Version_script_info): Initialize globs_,
6937 default_version_, default_is_global_, and exact_. Don't
6938 initialize globals_ or locals_.
6939 (Version_script_info::build_lookup_tables): Build local symbols
6940 first.
6941 (Version_script_info::unquote): New function.
6942 (Version_script_info::add_exact_match): New function.
6943 (Version_script_info::build_expression_list_lookup): Remove lookup
6944 parameter. Add is_global parameter. Change all callers. Handle
6945 wildcard pattern specially. Unquote pattern. Call
6946 add_exact_match.
6947 (Version_script_info::get_name_to_match): New function.
6948 (Version_script_info::get_symbol_version): New function.
6949 (Version_script_info::get_symbol_version_helper): Remove.
6950 (Version_script_info::check_unmatched_names): Call unquote.
6951 * script.h (class Version_script_info): Change get_symbol_version
6952 to be non-inline and add is_global parameter; change all callers.
6953 Rewrite symbol_is_local. Update declarations. Define struct
6954 Version_tree_match, Exact, Globs. Don't define struct Lookup.
6955 Remove globals_ and locals_ members. Add exact_, globs_,
6956 default_version_, is_global_.
6957 (Version_script_info::Glob): Remove pattern, add expression and
6958 is_global. Update constructor. Change all callers.
6959 * dynobj.cc (Versions::finalize): Mark the version symbol as the
6960 default version.
6961 (Versions::symbol_section_contents): If a symbol is undefined, or
6962 defined in a dynamic object, set the version index to
6963 VER_NDX_LOCAL.
6964 * symtab.cc (Symbol_table::add_from_relobj): Don't call
6965 symbol_is_local.
6966 (Symbol_table::add_from_pluginobj): Likewise.
6967 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
6968
d56962d3
DK
69692010-01-11 Doug Kwan <dougkwan@google.com>
6970
6971 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
6972 (incremental_dump_LDADD): Add linking option for libintl.
6973 * Makefile.in: Regenerate.
6974
94e6ee91
L
69752010-01-11 H.J. Lu <hongjiu.lu@intel.com>
6976
6977 PR gold/11144
6978 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
6979 instead of -Ds.
6980 * testsuite/Makefile.in: Regenerated.
6981
e96c574b
DK
69822010-01-10 Doug Kwan <dougkwan@google.com>
6983
6984 * options.h (DEFINE_var): Use parentheses around argument varname__
6985 in macro body to avoid any unintended subsequent substitutions.
6986
7198066b
ILT
69872010-01-10 Ian Lance Taylor <iant@google.com>
6988
ba4d53bf
ILT
6989 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
6990 candidates before doing symbol resolution.
6991
7198066b
ILT
6992 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
6993 ODR candidates if only one is weak.
6994
a2beed37
ILT
69952010-01-08 Ian Lance Taylor <iant@google.com>
6996
6997 * script.cc (Version_script_info::build_expression_list_lookup):
6998 Don't warn about ambiguous version, just record the ambiguity.
6999 (Version_script_info::get_symbol_version_helper): Give error if
7000 version is ambiguous.
7001
2fb7225c
DK
70022010-01-08 Doug Kwan <dougkwan@google.com>
7003
7004 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
7005 prev_data_size_ and prev_addralign_. Remove initializer for
7006 deleted data member has_been_changed_.
7007 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
7008 to determine if the table is empty.
7009 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
7010 Remove.
7011 (Stub_table::add_reloc_stub): Define method in class definition
7012 instead of just declaring it there.
7013 (Stub_table::add_cortex_a8_stub): New method definition.
7014 (Stub_table::update_data_size_and_addralign): Ditto.
7015 (Stub_table::finalize_stubs): Ditto.
7016 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
7017 (Stub_table::do_addralign_): Return address alignment in the
7018 (Stub_table::do_reset_address_and_file_offset): Define method in
7019 class definition instead of declaring it there. Set current data
7020 size to be the data size of the previous pass.
7021 (Stub_table::set_final_data_size): Use current data size as the
7022 final data size.
7023 (Stub_table::relocate_stub): Change parameter type of stub from
7024 Reloc_stub pointer to Stub pointer.
7025 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
7026 (Stub_table::Cortex_a8_stub_list): New typedef.
7027 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
7028 Stub_table::prev_addralign_): New data member.
7029 (Arm_relobj::Arm_relobj): Initialize data member
7030 section_has_cortex_a8_workaround_.
7031 (Arm_relobj::section_has_cortex_a8_workaround,
7032 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
7033 definitions.
7034 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
7035 declarations.
7036 (Target_arm::relocate_stub): Change parameter type of stub from
7037 Reloc_stub pointer to Stub pointer.
7038 (Insn_template::size, Insn_template::alignment): Handle
7039 THUMB16_SPECIAL_TYPE.
7040 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
7041 Stub_table::update_data_size_and_addralign,
7042 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
7043 definitions.
2e702c99 7044 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
2fb7225c
DK
7045 (Stub_table::do_write): Ditto.
7046 (Target_arm::do_relax): Adjust code for changes in Stub_table.
7047
880cd20d
ILT
70482010-01-08 Ian Lance Taylor <iant@google.com>
7049
7050 PR 11108
7051 * symtab.h (class Symbol): Remove fields is_target_special_ and
7052 has_plt_offset_. Add field is_defined_in_discarded_section_.
7053 (Symbol::is_defined_in_discarded_section): New function.
7054 (Symbol::set_is_defined_in_discarded_section): New function.
7055 (Symbol::has_plt_offset): Rewrite.
7056 (Symbol::set_plt_offset): Verify that new offset is not -1U.
7057 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
7058 Don't initialize is_target_special_ or has_plt_offset_.
7059 Initialize is_defined_in_discarded_section_.
7060 (Symbol_table::add_from_relobj): If appropriate, set
7061 is_defined_in_discarded_section.
7062 * resolve.cc (Symbol::override_base_with_special): Don't test
7063 is_target_special_. Change has_plt_offset_ to has_plt_offset().
7064 * target-reloc.h (relocate_section): Do special handling for
7065 symbols defined in discarded sections for global symbols as well
7066 as local symbols.
7067
2703e3eb
ILT
70682010-01-08 Ian Lance Taylor <iant@google.com>
7069
7070 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
7071 the SHT_SYMTAB case.
7072
339d40a3
ILT
70732010-01-08 Ian Lance Taylor <iant@google.com>
7074
7075 * object.cc (Sized_relobj::do_layout): Don't get confused if
7076 layout_eh_frame returns NULL.
7077
abecea76
ILT
70782010-01-08 Ian Lance Taylor <iant@google.com>
7079
7080 PR 11084
7081 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
7082 dynamic symbol table, use the normal symbol table.
7083 (Sized_dynobj::do_read_symbols): Remove assertion about type of
7084 symbol table.
7085
6b7dd3f3
ILT
70862010-01-08 Ian Lance Taylor <iant@google.com>
7087
7088 PR 11072
7089 * layout.cc (Layout::include_section): Remove .gnu_debuglink
7090 sections.
7091
36c50e63
L
70922010-01-08 H.J. Lu <hongjiu.lu@intel.com>
7093
7094 * version.cc (print_version): Change to "Copyright 2010".
7095
e291e7b9
ILT
70962010-01-08 Ian Lance Taylor <iant@google.com>
7097
7098 PR 10287
7099 PR 11063
7100 * i386.cc (class Target_i386): Change return type of plt_section
7101 to be non-const.
7102 (class Output_data_plt_i386): Add tls_desc_rel_ field.
7103 (Output_data_plt_i386::Output_data_plt_i386): Initialize
7104 tls_desc_rel_ field.
7105 (Output_data_plt_i386::rel_tls_desc): New function.
7106 (Target_i386::rel_tls_desc_section): New function.
7107 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
7108 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
7109 R_386_TLS_DESC reloc in rel_tls_desc_section.
7110 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
7111 Define struct Tlsdesc_info.
7112 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
7113 (Target_x86_64::do_reloc_symbol_index): New function.
7114 (Target_x86_64::add_tlsdesc_info): New function.
7115 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
7116 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
7117 tlsdesc_rel_ field.
7118 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
7119 all callers.
7120 (Output_data_plt_x86_64::rela_tlsdesc): New function.
7121 (Target_x86_64::rela_tlsdesc_section): New function.
7122 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
7123 handling.
7124 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
7125 (Target_x86_64::do_reloc_addend): New function.
7126 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
7127 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
7128 declarations. Define TARGET_CODE. Add arg field to u1_ union.
7129 (Output_reloc::type): New function.
7130 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
7131 (Output_reloc::is_target_specific): New function.
7132 (Output_reloc::target_arg): New function.
7133 (class Output_reloc) [SHT_RELA]: Add four new constructors for
7134 absolute relocs and target specific relocs.
7135 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
7136 add_target_specific.
7137 (class Output_data_reloc) [SHT_RELA]: Likewise.
7138 * output.cc (Output_reloc::Output_reloc): Add four new versions
7139 for absolute relocs and target specific relocs.
7140 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
7141 (Output_reloc::get_symbol_index): Likewise.
7142 (Output_reloc::local_section_offset): Check that local_sym_index_
7143 is not TARGET_CODE or 0.
7144 (Output_reloc::symbol_value): Likewise.
7145 (Output_reloc::write) [SHT_RELA]: Call target for target specific
7146 reloc.
7147 * target.h (class Target): Add reloc_symbol_index and reloc_addend
7148 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
7149 functions.
7150 * layout.cc (add_target_dynamic_tags): Use output section for
7151 DT_PLTRELSZ and DT_JMPREL.
7152
3a44184e
ILT
71532010-01-07 Ian Lance Taylor <iant@google.com>
7154
7155 PR 11061
7156 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
7157 function.
7158 (class Output_data_reloc_generic): Define.
7159 (class Output_data_reloc_base): Change base class to
7160 Output_data_reloc_generic. Change add() method to call
7161 bump_relative_reloc_count for a relative reloc. Remove
7162 sort_relocs_ field.
7163 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
7164 to sort_relocs().
7165 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
7166 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
7167 appropriate.
7168 * layout.h (class Layout): Update declaration.
7169
ea715a34
ILT
71702010-01-07 Ian Lance Taylor <iant@google.com>
7171
7172 * output.h (class Output_data): Add const version of
7173 output_section and do_output_section.
7174 (class Output_section_data): Add const version of
7175 do_output_section.
7176 (class Output_section): Likewise.
7177 * layout.cc (Layout::add_target_dynamic_tags): New function.
7178 * layout.h (class Layout): Update declarations.
7179 * arm.cc (Target_arm::do_finalize_sections): Use
7180 add_target_dynamic_tags.
7181 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7182 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
7183 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
7184 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7185
659948a4
ILT
71862010-01-07 Ian Lance Taylor <iant@google.com>
7187
7188 PR 11042
7189 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
7190 object as needed.
7191
9d3b86f6
ILT
71922010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
7193 Ian Lance Taylor <iant@google.com>
7194
7195 PR 11019
7196 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
7197 Xindex::read_symtab_xindex.
7198
bb0d3eb0
DK
71992010-01-07 Doug Kwan <dougkwan@google.com>
7200
7201 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
7202 (Insn_template::thumb16_bcond_insn): New method declaration.
7203 (Insn_template): Fix spelling.
7204 (Stub::thumb16_special): New method declaration.
7205 (Stub::do_write): Define virtual method which was previously pure
7206 virtual.
7207 (Stub::do_thumb16_special): New method declaration.
7208 (Stub::do_fixed_endian_write): New template member.
7209 (Reloc_stub::do_write): Remove.
7210 (Reloc_stub::do_fixed_endian_write): Remove.
7211 (Cortex_a8_stub): New class definition.
7212 (Stub_factory::make_cortex_a8_stub): New method definition.
7213 (Stub_factory::Stub_factory): Add missing static storage class
7214 qualifier for elf32_arm_stub_a8_veneer_blx.
7215
ffeef7df
ILT
72162010-01-07 Ian Lance Taylor <iant@google.com>
7217
dc3f80fe
ILT
7218 PR 10980
7219 * options.h (class General_options): Add --warn-unresolved-symbols
7220 and --error-unresolved-symbols.
7221 * errors.cc (Errors::undefined_symbol): Implement
7222 --warn-unresolved-symbols.
7223
ffeef7df
ILT
7224 * options.h (class General_options): Add -z text and -z textoff.
7225 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
7226
f1ec9ded
ST
72272010-01-06 Sriraman Tallam <tmsriram@google.com>
7228
7229 * gc.h (Garbage_collection::Cident_section_map): New typedef.
7230 (Garbage_collection::cident_sections): New function.
7231 (Garbage_collection::add_cident_section): New function.
7232 (Garbage_collection::cident_sections_): New member.
7233 (gc_process_relocs): Add references to sections whose names are C
7234 identifiers.
7235 * gold.h (cident_section_start_prefix): New constant.
7236 (cident_section_stop_prefix): New constant.
7237 (is_cident): New function.
7238 * layout.cc (Layout::define_section_symbols): Replace string constants
7239 with the newly defined constants.
7240 * object.cc (Sized_relobj::do_layout): Track sections whose names are
7241 C identifiers.
7242 * testsuite/Makefile.am: Add gc_orphan_section_test.
7243 * testsuite/Makefile.in: Regenerate.
7244 * testsuite/gc_orphan_section_test.cc: New file.
7245 * testsuite/gc_orphan_section_test.sh: New file.
7246
6eda8c29
ILT
72472010-01-06 Ian Lance Taylor <iant@google.com>
7248
b9674e17
ILT
7249 PR 10980
7250 * options.h (class General_options): Add --warn-shared-textrel.
7251 * layout.cc (Layout::finish_dynamic_section): Implement
7252 --warn-shared-textrel.
7253
6eda8c29
ILT
7254 PR 10980
7255 * options.h (class General_options): Add --warn-multiple-gp.
7256
32dcd44e
ILT
72572010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7258
7259 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
7260 $(THREADSLIB) and $(LIBDL).
7261 * Makefile.in: Rebuild.
7262
a192ba05
ILT
72632010-01-06 Ian Lance Taylor <iant@google.com>
7264
7265 PR 10980
7266 * options.cc (General_options::parse_section_start): New function.
7267 (General_options::section_start): New function.
7268 (General_options::General_options): Initialize all members.
7269 * options.h: Include <map>
7270 (class General_options): Add --section-start. Add section_starts_
7271 member.
7272 * layout.cc (Layout::attach_allocated_section_to_segment): If
7273 --section-start was used, set the address of the segment. Remove
7274 local sort_sections.
7275 (Layout::relaxation_loop_body): If the address of the load segment
7276 has been set by --section-start, don't use it.
7277 * output.h (Output_segment::update_flags_for_output_section): New
7278 function.
7279 * output.cc (Output_segment::add_output_section): Call
7280 update_flags_for_output_section.
7281
dde3f402
ILT
72822010-01-05 Ian Lance Taylor <iant@google.com>
7283
62dfdd4d
ILT
7284 PR 10980
7285 * options.h (class General_options): Add --undefined-version.
7286 * script.cc (struct Version_expression): Add was_matched_by_symbol
7287 field.
7288 (Version_script_info::matched_symbol): New function.
7289 (Version_script_info::get_symbol_version_helper): Call
7290 matched_symbol.
7291 (Version_script_info::check_unmatched_names): New function.
7292 * script.h (class Version_script_info): Update declarations.
7293 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
7294
9c4ae156
ILT
7295 * options.h (class General_options): Use DEFINE_bool_alias for
7296 allow_multiple_definition.
7297 * resolve.cc (Symbol_table::should_override): Don't test
7298 allow_multiple_definition.
7299
dde3f402
ILT
7300 PR 10980
7301 * options.h (class General_options): Add --cref.
7302 * main.cc (main): Print cref table if --cref. Don't close mapfile
7303 until after printing cref table.
7304 * cref.cc: Include "symtab.h".
7305 (class Cref_inputs): Define Cref_table_compare and Cref_table.
7306 (Cref_table_compare::operator()): New function.
7307 (Cref_inputs::gather_cref): New function.
7308 (filecol): New static const.
7309 (Cref_inputs::print_cref): New function.
7310 (Cref::print_cref): New function.
7311 * cref.h: Include <cstdio>.
7312 (class Cref): Update declarations.
7313 * mapfile.h (Mapfile::file): New function.
7314 * object.h (class Object): Define Symbols. Declare virtual
7315 do_get_global_symbols.
7316 (Object::get_global_symbols): New function.
7317 * object.cc (Input_objects::add_object): Pass object to cref_ if
7318 --cref.
7319 (Input_objects::archive_start): Likewise.
7320 (Input_objects::archive_stop): Likewise.
7321 (Input_objects::print_cref): New function.
7322 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
7323 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
7324 --cref.
7325 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
7326 function.
7327 * plugin.h (class Sized_pluginobj): Update declarations.
7328
8781f709
ILT
73292010-01-05 Ian Lance Taylor <iant@google.com>
7330
7331 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
7332 to is_default_version. Rename insdef to insdefault.
7333 (Symbol_table::add_from_relobj): Rename def to is_default_version
7334 and local to is_forced_local.
7335 (Symbol_table::add_from_pluginobj): Likewise.
7336 (Symbol_table::add_from_dynobj): Likewise.
7337 (Symbol_table::define_special_symbol): Rename insdef to
7338 insdefault.
7339
fe35d28d
ILT
73402010-01-04 Ian Lance Taylor <iant@google.com>
7341
30bc8c46
ILT
7342 PR 10980
7343 * options.h (class General_options): Add
7344 --allow-multiple-definition and -z muldefs.
7345 * resolve.cc (Symbol_table::should_override): Don't warn about a
7346 multiple symbol definition if --allow-multiple-definition or -z
7347 muldefs.
7348
7eaea549
ILT
7349 PR 10980
7350 * options.h (class General_options): Add --add-needed and
7351 --copy-dt-needed-entries. Tweak --as-needed help entry.
7352 * object.cc (Input_objects::check_dynamic_dependencies): Give an
7353 error if --copy-dt-needed-entries aka --add-needed is used and
7354 would cause a change in behaviour.
7355
fe35d28d
ILT
7356 PR 10980
7357 * options.h (class General_options): Add -G as a short version of
7358 --shared. Add no-op options -assert, -g, and -i.
7359
55a2bb35
ST
73602010-01-04 Sriraman Tallam <tmsriram@google.com>
7361
7362 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
7363 check for .text or .gnu.linkonce.t sections.
7364 * icf.cc (Icf::find_identical_sections): Ditto.
7365 Change the detection for mangled function name within the section
7366 name.
7367 * icf.h (is_section_foldable_candidate): New function.
7368
719328e1
ILT
73692009-12-30 Ian Lance Taylor <iant@google.com>
7370
7371 PR 10980
7372 * options.h (class General_options): Permit two dashes with
7373 --retain-symbols-file.
7374
d7bb5745
ILT
73752009-12-30 Ian Lance Taylor <iant@google.com>
7376
403a15dd
ILT
7377 PR 10979
7378 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
7379 don't put the file header and segment headers in the text
7380 segment.
7381
eda294df
ILT
7382 PR 10979
7383 * common.cc (Sort_commons::operator()): Stabilize sort when both
7384 entries are NULL.
7385 (Symbol_table::do_allocate_commons_list): When allocating common
7386 symbols, skip a symbol which is no longer common.
7387 * symtab.h (Symbol::is_common): Test whether the symbol comes from
7388 an object before checking its type.
7389 * testsuite/common_test_2.c: New file.
7390 * testsuite/common_test_3.c: New file.
7391 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
7392 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
7393 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
7394 (common_test_2_pic.o, common_test_2.so): New targets.
7395 (common_test_3_pic.o, common_test_3.so): New targets.
7396 * testsuite/Makefile.in: Rebuild.
7397
d7bb5745
ILT
7398 PR 10979
7399 * script.cc (read_input_script): If we see a new SECTIONS clause,
7400 and we have added an input section, give an error.
7401 * layout.h (class Layout): Add have_added_input_section function.
7402 Add have_added_input_section_ field.
7403 * layout.cc (Layout::Layout): Initialize
7404 have_added_input_section_.
7405 (Layout::layout): Set have_added_input_section_.
7406 (Layout::layout_eh_frame): Likewise.
7407
fc59c572
ILT
74082009-12-30 Ian Lance Taylor <iant@google.com>
7409
7410 PR 10931
7411 * options.h (class General_options): Add --sort-common option.
7412 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
7413 * common.cc (Sort_common): Add sort_order parameter to
7414 constructor. Add sort_order_ field.
7415 (Sort_commons::operator): Check sort_order_.
7416 (Symbol_table::allocate_commons): Determine the sort order.
7417 (Symbol_table::do_allocate_commons): Add sort_order parameter.
7418 Change all callers.
7419 (Symbol_table::do_allocate_commons_list): Likewise.
7420
1c74fab0
ILT
74212009-12-30 Ian Lance Taylor <iant@google.com>
7422
7423 PR 10916
7424 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
7425 symbols from this object, don't change the visibility of an
7426 undefined symbol.
7427 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
7428
6affe781
ILT
74292009-12-30 Ian Lance Taylor <iant@google.com>
7430
7431 PR 10861
7432 * script.h (class Version_script_info): Define Language enum.
7433 Update declarations. Define Glob, Exact, and Lookup types. Add
7434 new fields globals_, locals_, and is_finalized_.
7435 * script.cc: Various formatting fixes.
7436 (class Parser_closure): Change language_stack_ from a vector of
7437 std::string to one of Version_script_info::Language. Adjust all
7438 uses accordingly.
7439 (class Lazy_demangler): Remove.
7440 (struct Version_expression): Change language from std::string to
7441 Version_script_info::Language.
7442 (Version_script_info::Version_script_info): New function.
7443 (Version_script_info::~Version_script_info): Don't call clear.
7444 (Version_script_info::finalize): New function.
7445 (Version_script_info::build_lookup_tables): New function.
7446 (Version_script_info::build_expression_list_lookup): New
7447 function.
7448 (Version_script_info::get_symbol_version_helper): Rewrite to use
7449 lookup tables.
7450 (Version_script_info::print_expression_list): Adjust to use
7451 Version_script_info::Language.
7452 (script_push_lex_into_version_mode): Check that the version script
7453 has not been finalized.
7454 (version_script_push_lang): Change language string to
7455 Version_script_info::Language.
7456 * options.cc (Command_line::version_script): New function.
7457 * options.h (class General_options): Add finalize_dynamic_list
7458 function. Change version_script from declaration to definition.
7459 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
7460 * testsuite/version_script.map: Remove duplicate def of foo.
7461 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
7462 version_script.map.
7463 * testsuite/Makefile.in: Rebuild.
7464
818bf354
ILT
74652009-12-30 Ian Lance Taylor <iant@google.com>
7466
7467 PR 10843
7468 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
7469 if the input symbol index is 0, make the output symbol index 0.
7470
ebcc8304
ILT
74712009-12-30 Ian Lance Taylor <iant@google.com>
7472
7473 PR 10670
7474 * options.h (class General_options): Add -x/--discard-all.
7475 * object.cc (Sized_relobj::do_count_local_symbols): Handle
7476 --discard-all. If the local symbol needs a dynamic entry, check
7477 that before handling --discard-locals.
7478
176fe33f
ILT
74792009-12-30 Ian Lance Taylor <iant@google.com>
7480
bb321bb1
ILT
7481 PR 10450
7482 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
7483 flags to PF_R.
7484 (Output_segment::add_output_section): Don't change the flags if
7485 the type is PT_TLS.
7486
176fe33f
ILT
7487 PR 10450
7488 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
7489 GNU hash table if they need a dynamic value. Otherwise, don't add
7490 them if they are defined in a dynamic object or are forced local.
7491
e8cd95c7
ILT
74922009-12-29 Ian Lance Taylor <iant@google.com>
7493
1b81fb71
ILT
7494 PR 10450
7495 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
7496 .gnu.hash table for a 32-bit target.
7497
8d6d383d
ILT
7498 PR 10450
7499 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
7500 regular and a dynamic object only needs a dynamic symbol table
7501 entry if it is externally visible.
7502
e785ec03
ILT
7503 PR 10450
7504 * i386.cc (class Target_i386): Initialize global_offset_table_ in
7505 constructor. Add global_offset_table_ field.
7506 (Target_i386::got_section): Set global_offset_table_.
7507 (Target_i386::do_finalize_sections): Set global_offset_table_
7508 size.
7509 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
7510 in constructor. Add global_offset_table_ field.
7511 (Target_x86_64::got_section): Set global_offset_table_.
7512 (Target_x86_64::do_finalize_sections): Set global_offset_table_
7513 size.
7514
1a2dff53
ILT
7515 * layout.cc (Layout::Layout): Initialize increase_relro_.
7516 (Layout::get_output_section): Add is_relro, is_last_relro, and
7517 is_first_non_relro parameters. Change all callers.
7518 (Layout::choose_output_section): Likewise.
7519 (Layout::add_output_section_data): Likewise.
7520 (Layout::make_output_section): Likewise.
7521 (Layout::set_segment_offsets): Clear increase_relro when using a
7522 linker script.
7523 * layout.h (class Layout): Add increase_relro method. Add
7524 increase_relro_ field. Update declarations.
7525 * output.cc (Output_section::Output_section): Initialize
7526 is_last_relro_ and is_first_non_relro_.
7527 (Output_segment::add_output_section): Group relro sections is
7528 do_sort is true. Handle is_last_relro and is_first_non_relro.
7529 (Output_segment::maximum_alignment): Remove relro handling.
7530 (Output_segment::set_section_addresses): Add increase_relro
7531 parameter. Change all callers. Add initial alignment to align
7532 relro sections on separate page. Remove old relro handling.
7533 (Output_segment::set_section_list_addresses): Remove in_relro
7534 parameter. Change all callers.
7535 (Output_segment::set_offset): Add increase parameter. Change all
7536 callers. Remove old relro handling.
7537 * output.h (class Output_section): Add new methods: is_last_relro,
7538 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
7539 Add is_last_relro_ and is_first_non_relro_ fields.
7540 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
7541 Create separate .got.plt section. Call increase_relro.
7542 * x86_64.cc (Target_x86_64::got_section): Likewise.
7543 * testsuite/relro_script_test.t: Add .got.plt.
7544
f0ba79e2
ILT
7545 PR 10450
7546 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
7547 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
7548 (Layout::finalize): Call set_dynamic_symbol_size.
7549 (Layout::set_dynamic_symbol_size): New function.
7550 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
7551 set_dynamic_symbol_size.
7552
e8cd95c7
ILT
7553 PR 10450
7554 * output.h (class Output_section): Add is_entsize_zero_ field.
7555 * output.cc (Output_section::Output_section): Initialize
7556 is_entsize_zero_.
7557 (Output_section::set_entsize): If two different entsizes are
7558 requested, force it to zero.
7559 (Output_section::add_input_section): Set flags for .debug_str
7560 before updating section flags. Set entsize.
7561 (Output_section::update_flags_for_input_section): Set SHF_MERGE
7562 and SHF_STRING if all input sections have those flags.
7563
3e1b9a8a
RÁE
75642009-12-29 Rafael Espindola <espindola@google.com>
7565
7566 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
7567 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
7568 reporting.
3e1b9a8a 7569
3dcad376
ST
75702009-12-29 Sriraman Tallam <tmsriram@google.com>
7571
7572 * options.cc (General_options::parse_version): Allow -v to exit
7573 without an error if there is nothing to link.
7574
084e2665
ILT
75752009-12-29 Ian Lance Taylor <iant@google.com>
7576
7577 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
7578 using a version of gcc before 4.1.
7579 * configure: Rebuild.
7580
250acde3
CD
75812009-12-28 Chris Demetriou <cgd@google.com>
7582
7583 * attributes.cc (Output_attributes_section_data::do_write): Use
7584 std::vector::front rather than std::vector::data.
7585
99fff23b
ILT
75862009-12-28 Ian Lance Taylor <iant@google.com>
7587
7588 * symtab.h (class Symbol_table): Add enum Defined.
7589 * resolve.cc (Symbol_table::should_override): Add defined
7590 parameter. Change all callers. Test whether object is NULL
7591 before calling a method on it.
7592 (Symbol_table::report_resolve_problem): Add defined parameter.
7593 Change all callers.
7594 (Symbol_table::should_override_with_special): Likewise.
7595 * symtab.cc (Symbol_table::define_in_output_data): Add defined
7596 parameter. Change all callers.
7597 (Symbol_table::do_define_in_output_data): Likewise.
7598 (Symbol_table::define_in_output_segment): Likewise.
7599 (Symbol_table::do_define_in_output_segment): Likewise.
7600 (Symbol_table::define_as_constant): Likewise.
7601 (Symbol_table::do_define_as_constant): Likewise.
7602 * script.h (class Symbol_assignment): Add is_defsym parameter to
7603 constructor; change all callers.
7604 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
7605 parameter. Change all callers. Add is_defsym_ field.
7606 (class Parser_closure): Add parsing_defsym parameter to
7607 constructor; change all callers. Add parsing_defsym accessor
7608 function. Add parsing_defsym_ field.
7609
556bd683
ILT
76102009-12-28 Ian Lance Taylor <iant@google.com>
7611
7612 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 7613 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 7614
1782c879
ILT
76152009-12-23 Ian Lance Taylor <iant@google.com>
7616
7617 * i386.cc (Target_i386::do_calls_non_split): Recognize
7618 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
7619 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
7620 -fsplit-stack prologue when using %r11.
1782c879 7621
329ca2b1
ST
76222009-12-21 Sriraman Tallam <tmsriram@google.com>
7623
7624 * options.cc (General_options::parse_version): Make -v continue and do
7625 the link like GNU ld does.
7626
d675ff46
RÁE
76272009-12-17 Rafael Avila de Espindola <espindola@google.com>
7628
7629 * Makefile.am (CCFILES): Add timer.cc.
7630 (HFILES): Add timer.h.
7631 * configure.ac: Check for sysconf and times.
7632 * main.cc: include timer.h.
7633 (main): Use Timer instead of get_run_time.
7634 * timer.cc: New.
7635 * timer.h: New.
7636 * workqueue.cc: include timer.h.
7637 (Workqueue::find_and_run_task):
7638 Report user, sys and wall time.
7639 * Makefile.in: Regenerate.
7640 * config.in: Regenerate.
7641 * configure: Regenerate.
7642
d6344fb5
DK
76432009-12-16 Doug Kwan <dougkwan@google.com>
7644
7645 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
7646 sections.
7647 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
7648 relaxed input sections.
7649 * output.cc (Output_section::find_relaxed_input_section): Change
7650 return type to Output_relaxed_input_section pointer. Adjust code
7651 for new type of relaxed_input_section_map_.
7652 * output.h (Output_section::find_relaxed_input_section): Change
7653 return type to Output_relaxed_input_section pointer.
7654 (Output_section::Output_relaxed_input_section_by_input_section_map):
7655 New type.
7656 (Output_section::relaxed_input_section_map_): Change type to
7657 Output_section::Output_relaxed_input_section_by_input_section_map.
7658 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
7659 input section.
7660
0e0d5469
ILT
76612009-12-15 Ian Lance Taylor <iant@google.com>
7662
7663 * layout.cc (Layout::create_shstrtab): Only write out after input
7664 sections if we are compressing debug sections.
7665
0649a889
ILT
76662009-12-15 Ian Lance Taylor <iant@google.com>
7667
7668 * archive.cc (Archive::add_symbols): Only look up a symbol without
7669 a version if there is, in fact, a version.
7670
2ea97941
ILT
76712009-12-14 Ian Lance Taylor <iant@google.com>
7672
7673 Revert -Wshadow changes, all changes from:
7674 2009-12-11 Doug Kwan <dougkwan@google.com>
7675 2009-12-11 Nick Clifton <nickc@redhat.com>
7676 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
7677
b0eec2cc
DK
76782009-12-11 Doug Kwan <dougkwan@google.com>
7679
7680 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
7681 due to -Wshadow.
7682 * attributes.cc (Object_attribute::size): Ditto.
7683 (Attributes_section_data::size): Ditto.
7684 (Attributes_section_data::Attributes_section_data): Ditto.
7685 (Output_attributes_section_data::do_write): Ditto.
7686 * attributes.h (Object_attribute::set_type): Ditto.
7687 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
7688
91d6fa6a
NC
76892009-12-11 Nick Clifton <nickc@redhat.com>
7690
7691 * archive.cc: Fix shadowed variable warnings.
7692 * arm.cc: Likewise.
7693 * compressed_output.cc: Likewise.
7694 * compressed_output.h: Likewise.
7695 * configure: Likewise.
7696 * dwarf_reader.cc: Likewise.
7697 * dynobj.cc: Likewise.
7698 * dynobj.h: Likewise.
7699 * ehframe.cc: Likewise.
7700 * ehframe.h: Likewise.
7701 * errors.cc: Likewise.
7702 * expression.cc: Likewise.
7703 * fileread.cc: Likewise.
7704 * fileread.h: Likewise.
7705 * freebsd.h: Likewise.
7706 * i386.cc: Likewise.
7707 * icf.cc: Likewise.
7708 * incremental.h: Likewise.
7709 * layout.cc: Likewise.
7710 * layout.h: Likewise.
7711 * mapfile.cc: Likewise.
7712 * merge.cc: Likewise.
7713 * merge.h: Likewise.
7714 * object.cc: Likewise.
7715 * object.h: Likewise.
7716 * options.h: Likewise.
7717 * output.cc: Likewise.
7718 * output.h: Likewise.
7719 * parameters.cc: Likewise.
7720 * plugin.cc: Likewise.
7721 * powerpc.cc: Likewise.
7722 * reduced_debug_output.cc: Likewise.
7723 * reduced_debug_output.h: Likewise.
7724 * reloc.cc: Likewise.
7725 * reloc.h: Likewise.
7726 * resolve.cc: Likewise.
7727 * script-sections.cc: Likewise.
7728 * script.cc: Likewise.
7729 * script.h: Likewise.
7730 * sparc.cc: Likewise.
7731 * symtab.cc: Likewise.
7732 * symtab.h: Likewise.
7733 * target-select.cc: Likewise.
7734 * target-select.h: Likewise.
7735 * token.h: Likewise.
7736 * workqueue.cc: Likewise.
7737 * workqueue.h: Likewise.
7738 * x86_64.cc: Likewise.
7739
a0351a69
DK
77402009-12-10 Doug Kwan <dougkwan@google.com>
7741
7742 * arm.cc (attributes.h): New include.
7743 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
7744 (Arm_relobj::~Arm_relobj): Delete object pointed by
7745 attributes_section_data_.
7746 (Arm_relobj::attributes_section_data): New method definition.
7747 (Arm_relobj::attributes_section_data_): New data member declaration.
7748 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
7749 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
7750 attributes_section_data_.
7751 (Arm_dynobj::attributes_section_data): New method definition.
7752 (Arm_dynobj::attributes_section_data_): New data member declaration.
7753 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
7754 initialization value of may_use_blx_ to false.
2e702c99 7755 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
7756 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
7757 object attributes to compute results instead of hard-coding.
7758 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
7759 Target_arm::get_secondary_compatible_arch,
7760 Target_arm::set_secondary_compatible_arch
7761 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7762 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
7763 New method declarations.
7764 (Target_arm::get_aeabi_object_attribute): New method definition.
7765 (Target_arm::attributes_section_data_): New data member declaration.
7766 (read_arm_attributes_section): New template definition.
7767 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
7768 (Arm_dynobj::do_read_symbols): Ditto.
7769 (Target_arm::do_finalize_sections): Merge attributes sections from
7770 input. Check for BLX use after attributes section merging.
7771 Fix __exidx_start and __exidx_end visibility. Create an
7772 .ARM.attributes section if necessary.
7773 (Target_arm::get_secondary_compatible_arch,
7774 Target_arm::set_secondary_compatible_arch,
7775 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7776 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 7777 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
7778 New method definitions.
7779
b59befec
ILT
77802009-12-09 Ian Lance Taylor <iant@google.com>
7781
7782 * plugin.cc (Plugin::load): Don't cast from void* to a function
7783 pointer.
7784
1276bc89
ILT
77852009-12-09 Ian Lance Taylor <iant@google.com>
7786
7787 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
7788 information fields.
7789
2f2de248
L
77902009-12-09 H.J. Lu <hongjiu.lu@intel.com>
7791
7792 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
7793 Replace two_file_shared_1.so with two_file_shared_2.so.
7794 * testsuite/Makefile.in: Regenerated.
7795
4f787271
DK
77962009-12-08 Doug Kwan <dougkwan@google.com>
7797
7798 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
7799 (HFILES): Add attributes.h and int_encoding.h.
7800 * Makefile.in: Regenerate.
7801 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
7802 function definitions to int_encoding.cc
7803 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
7804 prototypes to int_encoding.h
7805 * reduced_debug_output.cc (int_encoding.h): New include.
7806 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
7807 function definitions to int_encoding.cc
7808 (insert_into_vector, read_from_pointer): Move template definitions to
7809 int_encoding.h
7810 * attributes.cc: New file.
7811 * attributes.h: New file.
7812 * int_encoding.cc: New file.
7813 * int_encoding.h: New file.
7814
20b52f1a
RÁE
78152009-12-07 Rafael Avila de Espindola <espindola@google.com>
7816
7817 PR gold/11055
7818 * incremental-dump.cc (dump_incremental_inputs): New.
7819 (main): Use dump_incremental_inputs.
7820
53d7974c
L
78212009-12-07 H.J. Lu <hongjiu.lu@intel.com>
7822
7823 PR gold/10893
7824 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
7825 checking elfcpp::STT_FUNC.
7826 (Target_i386::Relocate::relocate): Likewise.
7827 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
7828
7829 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
7830 symbols from shared libraries into normal FUNC symbols.
7831
7832 * symtab.h (Symbol): Add is_func and use it.
7833
05a352e6
DK
78342009-12-05 Doug Kwan <dougkwan@google.com>
7835
7836 * arm.cc (Target_arm::arm_info): Initialize new fields
7837 attributes_section and attributes_vendor.
7838 * i386.cc (Target_i386::i386_info): Same.
7839 * object.cc (Sized_relobj::do_layout): Skip attribute section.
7840 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
7841 fields attributes_section and attributes_vendor.
53d7974c 7842 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
7843 * target.h (Target::attributes_section, Target::attributes_vendor,
7844 Target::is_attributes_section, Target::attribute_arg_type,
7845 Target::attributes_order): New method definitions.
7846 (Target::Target_info::attributes_section,
7847 Target::Target_info::attributes_vendor): New fields.
7848 (Target::do_attribute_arg_type, Target::do_attributes_order): New
7849 virtual method definitions.
7850 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
7851 attributes_section and attributes_vendor.
7852 * testsuite/testfile.cc (Target_test::test_target_info): Same.
7853
f4e5969c
DK
78542009-12-05 Doug Kwan <dougkwan@google.com>
7855
7856 * arm.cc: Update comments about interworking and stub generation.
7857 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
7858 considered as non-PIC.
7859 (Arm_relocate_functions::base_abs): Fix formatting.
7860 (Arm_relocate_functions::got_prel): Fix comment. Change interface
7861 of function to use GOT entry address instead of offset.
7862 (Target_arm::Scan::global): Issue an error if a symbol would need a
7863 PLT does not get one because it is untyped. Remove code to create
7864 dynamic symbols for relative branches.
7865 (Target_arm::Relocate::relocate: Use 0 instead of false since function
7866 takes unsigned integer instead of boolean.
7867
1abce4a6
L
78682009-12-05 H.J. Lu <hongjiu.lu@intel.com>
7869
7870 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
7871 (two_file_test_LDADD): Likewise.
7872 (common_test_1_LDADD): Likewise.
7873 (exception_test_LDADD) Likewise.
7874 (weak_test_LDADD): Likewise.
7875 (many_sections_test_LDADD): Likewise.
7876 (initpri1_LDADD): Likewise.
7877 (script_test_1_LDADD): Likewise.
7878 (script_test_2_LDADD): Likewise.
7879 (justsyms_LDADD): Likewise.
7880 (binary_test_LDADD): Likewise.
7881 (large_LDADD): Likewise.
7882 * testsuite/Makefile.in: Regenerated.
7883
adcf2816 78842009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 7885
adcf2816
L
7886 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
7887 (Symbol_table::override_with_special): Likewise.
7888 (Symbol_table::add_from_object): Likewise.
7889
28e67f5d
RÁE
78902009-12-04 Rafael Avila de Espindola <espindola@google.com>
7891
7892 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
7893 Don't set the data_offset twice.
7894
ae10a101
RÁE
78952009-12-04 Rafael Avila de Espindola <espindola@google.com>
7896
7897 * testsuite/Makefile.in: Regenerate.
7898
f59f41f3
DK
78992009-12-03 Doug Kwan <dougkwan@google.com>
7900
7901 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
7902 (Target_arm::do_finalize_sections): Add parameter for symbol table
7903 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
7904 * i386.cc (Target_i386::do_finalize_sections): Add an additional
7905 parameter for symbol table pointer.
7906 * layout.cc (Layout::finalize): Call Target::finalize_sections with
7907 an additional parameter for a pointer to symbol table.
7908 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
7909 parameter for a symbol table pointer.
7910 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
7911 * target.h (Target::finalize_sections, Target::do_finalize_sections):
7912 Ditto.
7913 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
7914 parameter for a symbol table pointer.
7915
ca55d848
RÁE
79162009-12-03 Rafael Avila de Espindola <espindola@google.com>
7917
7918 * incremental.cc (Incremental_inputs_header)
7919 (Incremental_inputs_header_write, Incremental_inputs_entry)
7920 (Incremental_inputs_entry_write): Move ...
7921 * incremental.h (Incremental_inputs_header)
7922 (Incremental_inputs_header_write, Incremental_inputs_entry)
7923 (Incremental_inputs_entry_write): here.
7924
3aec4f9c
RÁE
79252009-12-02 Rafael Avila de Espindola <espindola@google.com>
7926
7927 * incremental.cc (make_sized_incremental_binary): Set the target.
7928 Error if it is incompatible.
7929 * output.h (Output_file): Add filename method.
7930
9c0ae74d
RÁE
79312009-12-02 Rafael Avila de Espindola <espindola@google.com>
7932
7933 * incremental.cc (Incremental_inputs_entry): Remove unused argument
7934 from the get_* methods.
7935
a45500ae
RÁE
79362009-12-02 Rafael Avila de Espindola <espindola@google.com>
7937
7938 * incremental-dump.cc (main): Check that the offeset of a script is 0.
7939 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
7940 Write 0 for the data_offset of scripts.
7941
325e6408
RÁE
79422009-12-02 Rafael Avila de Espindola <espindola@google.com>
7943
7944 * testsuite/Makefile.am: Add the incremental_test.sh test.
7945 * testsuite/incremental_test.sh: New.
7946 * testsuite/incremental_test_1.c: New.
7947 * testsuite/incremental_test_2.c: New.
7948
954c3e2e
RÁE
79492009-12-01 Rafael Avila de Espindola <espindola@google.com>
7950
7951 * incremental-dump.cc (main): Fix typos.
7952
f8086623
RÁE
79532009-11-27 Rafael Avila de Espindola <espindola@google.com>
7954
7955 PR gold/11025
7956 * incremental-dump.cc (main): Use llu to print 64 bit values.
7957
3b0dd6ac
L
79582009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
7959 H.J. Lu <hongjiu.lu@intel.com>
7960
7961 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
7962 $(LIBDL).
7963 (incremental_dump_LDADD): Likewise.
7964 * Makefile.in: Regenerated.
7965
a6d1ef57 79662009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 7967
a6d1ef57
DK
7968 Revert:
7969
7970 2009-11-25 Doug Kwan <dougkwan@google.com>
7971
7972 * arm.cc (Target_arm::Target_arm): Move method definition
7973 outside of class definition. Add code to handle
7974 --target1-rel, --target1-abs and --target2= options.
7975 (Target_arm::get_reloc_reloc_type): Change method to be
7976 non-static and const.
7977 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
7978 New data member declaration.
7979 (Target_arm::Scan::local, Target_arm::Scan::global,
7980 Target_arm::Relocate::relocate,
7981 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7982 Adjust call to Target_arm::get_real_reloc_type.
7983 (Target_arm::get_real_reloc_type): Use command line options
7984 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
7985 * options.h (--target1-rel, --target1-abs, --target2): New
7986 ARM-only options.
7987
50aeb7d4
DK
79882009-11-25 Doug Kwan <dougkwan@google.com>
7989
7990 * arm.cc (Target_arm::Target_arm): Move method definition outside of
7991 class definition. Add code to handle --target1-rel, --target1-abs
7992 and --target2= options.
7993 (Target_arm::get_reloc_reloc_type): Change method to be non-static
7994 and const.
7995 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
7996 member declaration.
7997 (Target_arm::Scan::local, Target_arm::Scan::global,
7998 Target_arm::Relocate::relocate,
7999 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
8000 call to Target_arm::get_real_reloc_type.
8001 (Target_arm::get_real_reloc_type): Use command line options to
8002 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8003 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
8004 options.
8005
51938283
DK
80062009-11-25 Doug Kwan <dougkwan@google.com>
8007
8008 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
8009 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
8010 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
8011 formatting.
8012 (Arm_relocate_functions::thm_call): Replace body with a call to
8013 Arm_relocate_functions::thumb_branch_common.
8014 (Arm_relocate_functions::thm_jump24,
8015 Arm_relocate_functions::thm_xpc22): New method definitions.
8016 (Arm_relocate_functions::thumb_branch_common): New method definition.
8017 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
8018 operator.
8019 (Target_arm::Relocate::relocate): Adjust call to thm_call.
8020 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
8021
e2b8f3c4
RÁE
80222009-11-24 Rafael Avila de Espindola <espindola@google.com>
8023
8024 * Makefile.am: Build incremental-dump
8025 * Makefile.in: Regenerate.
8026 * incremental-dump.cc: New.
8027 * incremental.cc (Incremental_inputs_header_data,
8028 Incremental_inputs_entry_data): Move to incremental.h
8029 * incremental.h: (Incremental_inputs_header_data,
8030 Incremental_inputs_entry_data): Move from incremental.cc
8031
bcba9aec
RÁE
80322009-11-24 Rafael Avila de Espindola <espindola@google.com>
8033
8034 * incremental.cc (Incremental_inputs_header,
8035 Incremental_inputs_header_write, Incremental_inputs_entry,
8036 Incremental_inputs_entry_write): Add a typedef with the data type.
8037
7c3afe08
RÁE
80382009-11-24 Rafael Avila de Espindola <espindola@google.com>
8039
8040 * incremental.cc (Incremental_inputs_header,
8041 Incremental_inputs_header_write, Incremental_inputs_entry,
8042 Incremental_inputs_entry_write): Update comment about which
8043 type has the filed descriptions.
8044
d204b6e9
DK
80452009-11-15 Doug Kwan <dougkwan@google.com>
8046
8047 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
8048 (Arm_relocate_functions::arm_branch_common): Change method defintion
8049 in class definition to a method declaration and update list of formal
8050 parameters.
8051 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
8052 Arm_relocation_functions::jump24): Adjust call to
8053 Arm_relocate_functions::arm_branch_common. Update list of formal
8054 parameters.
8055 (Arm_relocate_functions::xpc25): New method definition.
8056 (Arm_relocate_functions::arm_branch_common): Move method defintion
8057 out from class definition. Use stubs for mode-switching and extending
8058 branch ranges.
8059 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
8060 specially. Change code to enable use of stubs in ARM branches.
8061
43d12afe
DK
80622009-11-10 Doug Kwan <dougkwan@google.com>
8063
8064 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
8065 in method declaration.
8066 (Target_arm::relocate_stub): New method declaration.
8067 (Target_arm::default_target): Change to return a pointer instead of
8068 a const reference.
8069 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
8070 Target_arm::default_target.
8071 (Arm_Relobj::do_relocate_sections): Remove options paramater in
8072 method definition.
8073 (Target_arm::relocate_section): Adjust view.
8074 (Target_arm::relocate_stub): New method definition.
8075
ac33a407
DK
80762009-11-10 Doug Kwan <dougkwan@google.com>
8077
8078 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
8079 a format warning.
8080 * incremental.cc (open_incremental_binary): Initialized local
8081 variables to avoid warnings.
8082 * object.cc (make_elf_object): Ditto.
8083 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
8084 a format warning.
e1df38aa 8085
88ee28e9
L
8086009-11-09 H.J. Lu <hongjiu.lu@intel.com>
8087
8088 PR gold/10930
8089 * testsuite/plugin_test.c: Include "config.h".
8090
2daedcd6
DK
80912009-11-09 Doug Kwan <dougkwan@google.com>
8092
8093 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
8094 (arm_symbol_value): Remove.
8095 (Arm_relocate_functions::arm_branch_common,
8096 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
8097 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
8098 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
8099 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
8100 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
8101 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
8102 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
8103 Arm_relocate_functions::thm_mobw_abs_nc,
8104 Arm_relocate_functions::thm_mov_abs,
8105 Arm_relocate_functions::movw_prel_nc,
8106 Arm_relocate_functions::thm_movt_abs,
8107 Arm_relocate_functions::movt_prel,
8108 Arm_relocate_functions::thm_movw_prel_nc,
8109 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
8110 (Target_arm::Relocate::relocate): Only decompose address into two
8111 parts if relocation type uses the thumb-bit and pass the actual
8112 bit instead of a flag indicating that the thumb-bit is used. Adjust
8113 calls to methods in Arm_relocate_functions for this change.
8114
1276bc89 81152009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
8116
8117 PR 10925
8118 * reloc.cc: Instantiate
8119 Sized_relobj::initialize_input_to_output_maps and
8120 Sized_relobj:free_input_to_output_maps.
8121
e53ad1b5
ILT
81222009-11-06 Ian Lance Taylor <iant@google.com>
8123
8124 PR 10876
8125 * defstd.cc (in_segment): Set only_if_ref true for "end".
8126
eb44217c
DK
81272009-11-06 Doug Kwan <dougkwan@google.com>
8128
8129 * arm.cc (class Reloc_stub): Correct a comment.
8130 (Target_arm::Target_arm): Initialize arm_input_section_map_.
8131 (Target_arm::scan_section_for_stubs): New method declaration.
8132 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
8133 Change methods from private to protected.
8134 (Target_arm::do_may_relax): New method definition.
8135 (Target_arm::do_relax, Target_arm::group_sections,
8136 Target_arm::scan_reloc_for_stub,
8137 Target_arm::scan_reloc_section_for_stubs): New method declarations.
8138 (Target_arm::arm_input_section_map_): New data member declaration.
8139 (Target_arm::scan_reloc_for_stub,
8140 Target_arm::scan_reloc_section_for_stubs,
8141 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
8142 Target_arm::do_relax): New method definitions.
8143
5d329b7d
ILT
81442009-11-06 Mikolaj Zalewski <mikolaj@google.com>
8145
8146 * configure.ac: Check for (struct stat)::st_mtim
8147 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
8148 * config.in: Regenerate.
8149 * configure: Regenerate.
8150
96a0d71b
ILT
81512009-11-05 Ian Lance Taylor <iant@google.com>
8152
8153 PR 10910
8154 * output.cc (Output_segment::add_output_section): Add missing
8155 return statement.
8156
594c8e5e
ILT
81572009-11-04 Ian Lance Taylor <iant@google.com>
8158
8159 PR 10880
8160 * object.h (class Object): Add is_needed and set_is_needed
8161 methods. Add is_needed_ field. Make bool fields into bitfields.
8162 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
8163 defined in a dynamic object and referenced by a regular object,
8164 set is_needed for the dynamic object.
8165 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
8166 if the file is marked with as_needed and it is not needed.
8167
22b127cc
ILT
81682009-11-04 Ian Lance Taylor <iant@google.com>
8169
8170 PR 10887
8171 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
8172 tags if data is discarded by linker script.
8173 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8174 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
8175 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
8176 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8177
f5c870d2
ILT
81782009-11-04 Ian Lance Taylor <iant@google.com>
8179
8180 * layout.cc (Layout::get_output_section): Add is_interp and
8181 is_dynamic_linker_section parameters. Change all callers.
8182 (Layout::choose_output_section): Likewise.
8183 (Layout::make_output_section): Likewise.
8184 (Layout::add_output_section_data): Add is_dynamic_linker_section
8185 parameter. Change all callers.
8186 * layout.h (class Layout): Update declarations.
8187 * output.h (class Output_section): Add is_interp, set_is_interp,
8188 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
8189 Add is_interp_, is_dynamic_linker_section_ fields. Change
8190 generate_code_fills_at_write_ to a bitfield.
8191 * output.cc (Output_section::Output_sections): Initialize new
8192 fields.
8193 (Output_segment::add_output_section): Add do_sort parameter.
8194 Change all callers.
8195
1ae4d23b
ILT
81962009-11-03 Ian Lance Taylor <iant@google.com>
8197
8198 PR 10860
8199 * options.h (class General_options): Add --warn-common.
8200 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
8201 merging two common symbols.
8202 (Symbol_table::should_override): Handle --warn-common when merging
8203 a common symbol with a defined symbol. Use report_resolve_problem
8204 for multiple definitions.
8205 (Symbol_table::report_resolve_problem): New function.
8206 * symtab.h (class Symbol_table): Declare report_resolve_problem.
8207
55da9579
DK
82082009-11-03 Doug Kwan <dougkwan@google.com>
8209
8210 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
8211 stub_factory_.
8212 (Target_arm::stub_factory): New method definition.
8213 (Target_arm::new_arm_input_section,
8214 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
8215 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 8216 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
8217 New type definitions.
8218 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
8219 member declarations.
8220 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
8221 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
8222 New method definitions.
8223
37a9ac43
ILT
82242009-11-03 Ian Lance Taylor <iant@google.com>
8225
8226 * options.h (class General_options): Add --warn_constructors.
8227
b3d6a3d4
ILT
82282009-11-03 Ian Lance Taylor <iant@google.com>
8229
8230 PR 10893
8231 * defstd.cc (in_section): Add entries for __rel_iplt_start,
8232 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
8233
934b01dd
ILT
82342009-11-03 Ian Lance Taylor <iant@google.com>
8235
8236 PR 10895
8237 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
8238 --msgid-bugs-address.
8239 (install-pdf): New target.
8240 (install-data_yes): Look up one directory to find mkinstalldirs.
8241
03c1939b
L
82422009-11-03 H.J. Lu <hongjiu.lu@intel.com>
8243
8244 * po/Make-in (.po.gmo): Don't generate .gmo files in source
8245 tree.
8246
ebd95253
DK
82472009-10-30 Doug Kwan <dougkwan@google.com>
8248
8249 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
8250
e9bbb538
DK
82512009-10-30 Doug Kwan <dougkwan@google.com>
8252
8253 * arm.cc (Stub_addend_reader): New struct template definition
8254 and partial specializations.
8255 (Stub_addend_reader::operator()): New method definition for a
8256 partially specialized template.
8257
d5b40221
DK
82582009-10-30 Doug Kwan <dougkwan@google.com>
8259
8260 * arm.cc (Arm_relobj::processor_specific_flags): New method
8261 definition.
8262 (Arm_relobj::do_read_symbols): New method declaration.
8263 (Arm_relobj::processor_specific_flags_): New data member declaration.
8264 (Arm_dynobj): New class definition.
8265 (Target_arm::do_finalize_sections): Add input_objects parameter.
8266 (Target_arm::do_adjust_elf_header): New method declaration.
8267 (Target_arm::are_eabi_versions_compatible,
8268 (Target_arm::merge_processor_specific_flags): New method declaration.
8269 (Target_arm::do_make_elf_object): New overloaded method definitions
8270 and declaration.
8271 (Arm_relobj::do_read_symbols): New method definition.
8272 (Arm_dynobj::do_read_symbols): Ditto.
8273 (Target_arm::do_finalize_sections): Add input_objects parameters.
8274 Merge processor-specific flags from all input objects.
8275 (Target_arm::are_eabi_versions_compatible,
8276 Target_arm::merge_processor_specific_flags,
8277 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
8278 New method definitions.
8279 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
8280 Input_objects pointer type parameter.
8281 * layout.cc (Layout::finalize): Pass input objects to target's.
8282 finalize_sections function.
8283 * output.cc (Output_file_header::do_sized_write): Set ELF file
8284 header's processor-specific flags.
8285 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
8286 Input_objects pointer type parameter.
8287 * sparc.cc (Target_sparc::do_finalize_sections): Same.
8288 * target.h (Input_objects): New forward class declaration.
8289 (Target::processor_specific_flags,
8290 Target::are_processor_specific_flags_sect): New method definitions.
8291 (Target::finalize_sections): Add input_objects parameter.
8292 (Target::Target): Initialize processor_specific_flags_ and
8293 are_processor_specific_flags_set_.
8294 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
8295 parameter.
8296 (Target::set_processor_specific_flags): New method definition.
8297 (Target::processor_specific_flags_,
8298 Target::are_processor_specific_flags_set_): New data member
8299 declarations.
8300 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
8301 Input_objects pointer type parameter.
8302
ebabffbd
DK
83032009-10-30 Doug Kwan <dougkwan@google.com>
8304
8305 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
8306
ad0f2072
ILT
83072009-10-28 Ian Lance Taylor <iant@google.com>
8308
8309 * object.h (class Relobj): Drop options parameter from
8310 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
8311 do_scan_relocs, do_relocate. Change all callers.
8312 (class Sized_relobj): Drop options parameters from
8313 do_gc_process_relocs, do_scan_relocs, do_relocate,
8314 do_relocate_sections, relocate_sections, emit_relocs_scan,
8315 emit_relocs_scan_reltype. Change all callers.
8316 (struct Relocate_info): Remove options field and all references to
8317 it.
8318 * reloc.h (class Read_relocs): Remove options constructor
8319 parameter and options_ field. Change all callers.
8320 (class Gc_process_relocs, class Scan_relocs): Likewise.
8321 (class Relocate_task): Likewise.
8322 * target-reloc.h (scan_relocs): Remove options parameter. Change
8323 all callers.
8324 (scan_relocatable_relocs): Likewise.
8325 * target.h (class Sized_target): Remove options parameter from
8326 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
8327 all callers.
8328 * gc.h (gc_process_relocs): Remove options parameter. Change all
8329 callers.
8330 * arm.cc: Update functions to remove options parameters.
8331 * i386.cc: Likewise.
8332 * powerpc.cc: Likewise.
8333 * sparc.cc: Likewise.
8334 * x86_64.cc: Likewise.
8335 * testsuite/testfile.cc: Likewise.
8336
8ffa3667
DK
83372009-10-28 Doug Kwan <dougkwan@google.com>
8338
8339 * arm.cc (Arm_relobj): New class definition.
e1df38aa 8340 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
8341 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
8342 New method definitions.
8343
40f36857
CC
83442009-10-28 Cary Coutant <ccoutant@google.com>
8345
8346 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
8347 (Plugin::cleanup_done_): New member.
8348 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
8349 (Plugin_manager::cleanup_done_): Remove.
8350 (Plugin_manager::add_input_file): Edit error message.
8351 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
8352 (Plugin_manager::cleanup): Remove use of cleanup_done_.
8353
2c849493
ILT
83542009-10-27 Mikolaj Zalewski <mikolajz@google.com>
8355
8356 * fileread.cc: (File_read::View::~View): Use the new
8357 data_ownership_ filed.
8358 (File_read::~File_read): Dispose the new whole_file_view_.
8359 (File_read::open): Mmap the whole file if needed.
8360 (File_read::open): Use whole_file_view_ instead of contents_.
8361 (File_read::find_view): Use whole_file_view_ if applicable.
8362 (File_read::do_read): Use whole_file_view_ instead of contents_.
8363 (File_read::make_view): Use whole_file_view_ instead of contents_,
8364 update File_read::View::View call.
8365 (File_read::find_or_make_view): Update File_read::View::View
8366 call.
8367 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
8368 remove contents_
8369 (File_read::View::Data_ownership): New enum.
8370 (File_read::View::View): Replace bool mapped_ with Data_ownership
8371 argument.
8372 (File_read::View::mapped_): Remove (replaced by data_ownership_).
8373 (File_read::View::data_ownership_): New field.
8374 (File_read::contents_): Remove (replaced by whole_file_view_).
8375 (File_read::whole_file_view_): New field.
8376 * options.h (class General_options): Add --keep-files-mapped.
8377
24998053
CC
83782009-10-27 Cary Coutant <ccoutant@google.com>
8379
8380 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
8381 * testsuite/Makefile.am (plugin_test_5): New test case.
8382 * testsuite/Makefile.in: Regenerate.
8383
72adc4fa
DK
83842009-10-25 Doug Kwan <dougkwan@google.com>
8385
8386 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
8387 from private to protected to allow access by child class.
8388 (Sized_relobj::do_relocate_sections): New method declaration.
8389 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 8390 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
8391 Sized_relobj::relocate_sections. Instantiate template explicitly
8392 for different target sizes and endianity.
8393
07f508a2
DK
83942009-10-24 Doug Kwan <dougkwan@google.com>
8395
8396 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
8397 (Arm_input_section::as_arm_input_section): New method.
8398 (Arm_output_section): New class definition.
8399 (Arm_output_section::create_stub_group,
8400 Arm_output_section::group_sections): New method definitions.
8401
10ad9fe5
DK
84022009-10-22 Doug Kwan <dougkwan@google.com>
8403
8404 * arm.cc (Arm_input_section): New class definition.
8405 (Arm_input_section::init, Arm_input_section:do_write,
8406 Arm_input_section::set_final_data_size,
8407 Arm_input_section::do_reset_address_and_file_offset): New method
8408 definitions.
8409
56ee5e00
DK
84102009-10-21 Doug Kwan <dougkwan@google.com>
8411
8412 * arm.cc (Stub_table, Arm_input_section): New forward class
8413 declarations.
8414 (Stub_table): New class defintion.
8415 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
8416 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
8417 New method definition.
8418
b569affa
DK
84192009-10-21 Doug Kwan <dougkwan@google.com>
8420
8421 * arm.cc: Update copyright comments.
8422 (Target_arm): New forward class template declaration.
8423 (Arm_address): New type.
8424 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
8425 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
8426 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
8427 constants.
8428 (Insn_template): Same.
8429 (DEF_STUBS): New macro.
8430 (Stub_type): New enum type.
8431 (Stub_template): New class definition.
8432 (Stub): Same.
8433 (Reloc_stub): Same.
8434 (Stub_factory): Same.
8435 (Target_arm::Target_arm): Initialize may_use_blx_ and
8436 should_force_pic_veneer_.
8437 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
8438 Target_arm::should_force_pic_veneer,
8439 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
8440 Target_arm::using_thumb_only, Target_arm:;default_target): New
8441 method defintions.
8442 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
8443 New data member declarations.
8444 (Insn_template::size, Insn_template::alignment): New method defintions.
8445 (Stub_template::Stub_template): New method definition.
8446 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
8447 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
8448 (Stub_factory::Stub_factory): New method definition.
8449 * gold.h (string_hash): New template.
8450 * output.h (Input_section_specifier::hash_value): Use
8451 gold::string_hash.
8452 (Input_section_specifier::string_hash): Remove.
8453 * stringpool.cc (Stringpool_template::string_hash): Use
8454 gold::string_hash.
8455
6c172549
DK
84562009-10-20 Doug Kwan <dougkwan@google.com>
8457
8458 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
8459 symbols of relaxed input sections.
8460 * output.h (Output_section::find_relaxed_input_section): Make
8461 method public.
8462
c5617f2f
DK
84632009-10-16 Doug Kwan <dougkwan@google.com>
8464
8465 * dynobj.cc (Versions::Versions): Initialize version_script_.
8466 Only insert base version symbol definition for a shared object
8467 if version script defines any version versions.
8468 (Versions::define_base_version): New method definition.
8469 (Versions::add_def): Check that base version is not needed.
8470 (Versions::add_need): Define base version lazily.
8471 * dynobj.h (Versions::define_base_version): New method declaration.
8472 (Versions::needs_base_version_): New data member declaration.
8473 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
8474 (check_DATA): Add no_version_test.stdout.
8475 (libno_version_test.so, no_version_test.o no_version_test.stdout):
8476 New make rules.
8477 * testsuite/Makefile.in: Regenerate.
8478 * testsuite/no_version_test.c: New file.
8479 * testsuite/no_version_test.sh: Ditto.
8480
3c12dcdb
DK
84812009-10-16 Doug Kwan <dougkwan@google.com>
8482
8483 * expression.cc (class Segment_start_expression): New class definition.
8484 (Segment_start_expression::value): New method definition.
8485 (script_exp_function_segment_start): Return a new
8486 Segment_start_expression.
8487 * gold/script-c.h (script_saw_segment_start_expression): New function
8488 prototype.
8489 * script-sections.cc (Script_sections::Script_sections): Initialize
8490 SAW_SEGMENT_START_EXPRESSION_ to false.
8491 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
8492 and -Tbbs options to specify section addresses if given in
8493 command line and no SEGMENT_START expression is seen in a script.
8494 * script-sections.h (Script_sections::saw_segment_start_expression,
8495 Script_sections::set_saw_segment_start_expression): New method
8496 definition.
8497 (Script_sections::saw_segment_start_expression_): New data member
8498 declaration.
8499 * script.cc (script_saw_segment_start_expression): New function.
8500 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
8501 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
8502 script_test_7.sh and script_test_8.sh.
8503 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
8504 script_test_8.stdout.
8505 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
8506 (script_test_6, script_test_6.stdout, script_test_7,
8507 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
8508 * Makefile.in: Regenerate.
8509 * testsuite/script_test_6.sh: New file.
8510 * testsuite/script_test_6.t: Same.
8511 * testsuite/script_test_7.sh: Same.
8512 * testsuite/script_test_7.t: Same.
8513 * testsuite/script_test_8.sh: Same.
8514
64b1ae37
DK
85152009-10-16 Doug Kwan <dougkwan@google.com>
8516
8517 * output.cc (Output_segment::set_section_list_address): Cast
8518 expressions to unsigned long long type to avoid format warnings.
8519
661be1e2
ILT
85202009-10-15 Ian Lance Taylor <iant@google.com>
8521
12edd763 8522 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 8523 dot assignment to script_sections_.
12edd763
ILT
8524 * script-sections.cc (Script_sections::add_dot_assignment):
8525 Initialize if necessary.
8526
68b6574b
ILT
8527 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
8528 program headers with no load segment if there is a linker script.
8529
661be1e2
ILT
8530 * layout.cc (Layout::set_segment_offsets): Align the file offset
8531 to the segment aligment for -N or -n with no load segment.
8532 * output.cc (Output_segment::add_output_section): Don't crash if
8533 the first section is a TLS section.
8534 (Output_segment::set_section_list_addresses): Print an error
8535 message if the address moves backward in a linker script.
8536 * script-sections.cc
8537 (Output_section_element_input::set_section_addresses): Don't
8538 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
8539 (Orphan_output_section::set_section_addresses): Likewise.
8540
f15f61a7
DK
85412009-10-15 Doug Kwan <dougkwan@google.com>
8542
8543 * layout.cc (Layout::finish_dynamic_section): Generate tags
8544 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
8545 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
8546 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
8547
82bb573a
ILT
85482009-10-14 Ian Lance Taylor <iant@google.com>
8549
8550 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
8551 fields.
8552 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
8553 data_shdr fields of relinfo.
8554 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
8555 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
8556 R_386_TLS_LDO_32, adjust based on section flags.
8557 (Target_i386::Relocate::fix_up_ldo): Remove.
8558
374ad285
ILT
85592009-10-13 Ian Lance Taylor <iant@google.com>
8560
8561 Add support for -pie.
8562 * options.h (class General_options): Add -pie and
8563 --pic-executable.
8564 (General_options::output_is_position_independent): Test -pie.
8565 (General_options::output_is_executable): Return true if not shared
8566 and not relocatable.
8567 (General_options::output_is_pie): Remove.
8568 * options.cc (General_options::finalize): Reject incompatible uses
8569 of -pie.
8570 * gold.cc (queue_middle_tasks): A -pie link is not static.
8571 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
8572 * symtab.cc (Symbol::final_value_is_known): Return false if
8573 output_is_position_independent.
8574 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
8575 output_is_position_independent.
8576 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
8577 output_is_position_independent.
8578 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
8579 output_is_position_independent.
8580 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
8581 two_file_pie_test.
8582 (basic_pie_test.o, basic_pie_test): New targets.
8583 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
8584 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
8585 (two_file_pie_test): New target.
8586 * testsuite/Makefile.in: Rebuild.
8587 * README: Remove note saying that -pie is not supported.
8588
c6585162
ILT
85892009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
8590
8591 * options.h (class General_options): Add -init and -fini.
8592 * layout.cc (Layout::finish_dynamic_section): Emit
8593 given init and fini functions.
8594
032ce4e9
ST
85952009-10-13 Sriraman Tallam <tmsriram@google.com>
8596
8597 * gc.h (gc_process_relocs): Check if icf is enabled using new
8598 function.
8599 * gold.cc (queue_initial_tasks): Likewise.
8600 (queue_middle_tasks): Likewise.
8601 * object.cc (do_layout): Likewise.
8602 * symtab.cc (is_section_folded): Likewise.
8603 * main.cc (main): Likewise.
8604 * reloc.cc (Read_relocs::run): Likewise.
8605 (Sized_relobj::do_scan_relocs): Likewise.
8606 * icf.cc (is_function_ctor_or_dtor): New function.
8607 (Icf::find_identical_sections): Check if function is ctor or dtor when
8608 safe icf is chosen.
8609 * options.h (General_options::icf): Change option to be an enum.
8610 (Icf_status): New enum.
8611 (icf_enabled): New method.
8612 (icf_safe_folding): New method.
8613 (set_icf_status): New method.
8614 (icf_status_): New variable.
8615 * (options.cc) (General_options::finalize): Set icf_status_.
8616 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
8617 icf_test and icf_keep_unique_test to use the --icf enum flag.
8618 * testsuite/icf_safe_test.sh: New file.
e1df38aa 8619 * testsuite/icf_safe_test.cc: New file.
032ce4e9 8620
f345227a
ST
86212009-10-12 Sriraman Tallam <tmsriram@google.com>
8622
8623 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
8624 includes to gc.h and icf.h.
8625 * arm.cc: Include gc.h.
8626 * gold.cc: Likewise.
8627 * i386.cc: Likewise.
8628 * powerpc.cc: Likewise.
8629 * sparc.cc: Likewise.
8630 * x86_64.cc: Likewise.
8631 * gc.h: Include icf.h.
8632
1c7814ed
ILT
86332009-10-11 Ian Lance Taylor <iant@google.com>
8634
8635 * plugin.cc: Include "gold.h" before other header files.
8636
ae3b5189
CD
86372009-10-10 Chris Demetriou <cgd@google.com>
8638
8639 * options.h (Input_file_argument::Input_file_type): New enum.
8640 (Input_file_argument::is_lib_): Replace with...
8641 (Input_file_argument::type_): New member.
8642 (Input_file_argument::Input_file_argument): Take Input_file_type
8643 'type' rather than boolean 'is_lib' as second argument.
8644 (Input_file_argument::is_lib): Use type_.
8645 (Input_file_argument::is_searched_file): New function.
8646 (Input_file_argument::may_need_search): Handle is_searched_file.
8647 * options.cc (General_options::parse_library): Support -l:filename.
8648 (General_options::parse_just_symbols): Update for Input_file_argument
8649 changes.
8650 (Command_line::process): Likewise.
8651 * archive.cc (Archive::get_file_and_offset): Likewise.
8652 * plugin.cc (Plugin_manager::release_input_file): Likewise.
8653 * script.cc (read_script_file, script_add_file): Likewise.
8654 * fileread.cc (Input_file::Input_file): Likewise.
8655 (Input_file::will_search_for): Handle is_searched_file.
8656 (Input_file::open): Likewise.
8657 * readsyms.cc (Read_symbols::get_name): Likewise.
8658 * testsuite/Makefile.am (searched_file_test): New test.
8659 * testsuite/Makefile.in: Regenerate.
8660 * testsuite/searched_file_test.cc: New file.
8661 * testsuite/searched_file_test_lib.cc: New file.
8662
f3048a1d
ILT
86632009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8664 Ian Lance Taylor <iant@google.com>
8665
8666 * descriptor.cc: Include <cstdio> and "binary-io.h".
8667 (Descriptors::open): Open the files in binary mode always.
8668 * script.cc (Lex::get_token): Treat \r as whitespace.
8669
d4780e57
ILT
86702009-10-09 Ian Lance Taylor <iant@google.com>
8671
8672 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
8673
d9a893b8
ILT
86742009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8675 Ian Lance Taylor <iant@google.com>
8676
8677 * configure.ac: Check for readv function also.
8678 * fileread.cc (readv): Define if not HAVE_READV.
8679 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
8680 does not exist.
8681 * config.in: Regenerate.
8682 * configure: Regenerate.
8683
c0a62865
DK
86842009-10-09 Doug Kwan <dougkwan@google.com>
8685
8686 * layout.cc (Layout::make_output_section): Call target hook to make
8687 ordinary output section.
8688 (Layout::finalize): Adjust parameter list of call the
8689 Target::may_relax().
8690 * layout.h (class Layout::section_list): New method.
8691 * merge.h (Output_merge_base::entsize): Change visibility to public.
8692 (Output_merge_base::is_string, Output_merge_base::do_is_string):
8693 New methods.
8694 (Output_merge_string::do_is_string): New method.
8695 * object.cc (Sized_relobj::do_setup): renamed from
8696 Sized_relobj::set_up.
8697 * object.h (Sized_relobj::adjust_shndx,
8698 Sized_relobj::initializ_input_to_output_maps,
8699 Sized_relobj::free_input_to_output_maps): Change visibilities to
8700 protected.
8701 (Sized_relobj::setup): Virtualize.
8702 (Sized_relobj::do_setup): New method declaration.
8703 (Sized_relobj::invalidate_section_offset,
8704 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
8705 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
8706 * options.cc (parse_int): New function.
8707 * options.h (parse_int): New declaration.
8708 (DEFINE_int): New macro.
8709 (stub_group_size): New option.
8710 * output.cc (Output_section::Output_section): Initialize memebers
8711 merge_section_map_, merge_section_by_properties_map_,
8712 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
8713 (Output_section::add_input_section): Handled deferred code-fill
8714 generation and remove an old comment.
8715 (Output_section::add_relaxed_input_section): New method definition.
8716 (Output_section::add_merge_input_section): Use merge section by
8717 properties map to speed to search. Update merge section maps
8718 as appropriate.
8719 (Output_section::build_relaxation_map): New method definition.
8720 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8721 Same.
8722 (Output_section::relax_input_section): Renamed to
8723 Output_section::convert_input_sections_to_relaxed_sections and change
8724 interface to take a vector of pointers to relaxed sections.
8725 (Output_section::find_merge_section,
8726 Output_section::find_relaxed_input_section): New method definitions.
8727 (Output_section::is_input_address_mapped,
8728 Output_section::output_offset, Output_section::output_address):
8729 Use output section data maps to speed up searching.
8730 (Output_section::find_starting_output_address): Add comments.
8731 (Output_section::do_write,
8732 Output_section::write_to_postprocessing_buffer): Do code-fill
8733 generation as appropriate.
8734 (Output_section::get_input_sections): Invalidate relaxed input section
8735 map.
8736 (Output_section::restore_states): Adjust type of checkpoint .
8737 Invalidate relaxed input section map.
8738 * output.h (Output_merge_base): New class declaration.
8739 (Input_section_specifier): New class defintion.
8740 (class Output_relaxed_input_section) Change base class to
8741 Output_section_data_build.
8742 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
8743 base class initializer.
8744 (Output_section::add_relaxed_input_section): New method declaration.
8745 (Output_section::Input_section): Change visibility to protected.
2e702c99 8746 (Output_section::Input_section::relobj,
c0a62865
DK
8747 Output_section::Input_section::shndx): Handle relaxed input sections.
8748 Output_section::input_sections) Change visibility to protected. Also
8749 define overload to return a non-const pointer.
8750 (Output_section::Merge_section_properties): New class defintion.
8751 (Output_section::Merge_section_by_properties_map,
8752 Output_section::Output_section_data_by_input_section_map,
8753 Output_section::Relaxation_map): New types.
8754 (Output_section::relax_input_section): Rename method to
8755 Output_section::convert_input_sections_to_relaxed_sections and change
8756 interface to take a vector of relaxed section pointers.
8757 (Output_section::find_merge_section,
8758 Output_section::find_relaxed_input_section,
8759 Output_section::build_relaxation_map,
8760 Output_section::convert_input_sections_in_list_to_relaxed_sections):
8761 New method declarations.
8762 (Output_section::merge_section_map_
8763 Output_section::merge_section_by_properties_map_,
8764 Output_section::relaxed_input_section_map_,
8765 Output_section::is_relaxed_input_section_map_valid_,
8766 Output_section::generate_code_fills_at_write_): New data members.
8767 * script-sections.cc
8768 (Output_section_element_input::set_section_addresses): Call
8769 current_data_size and addralign methods of relaxed input sections.
8770 (Orphan_output_section::set_section_addresses): Call current_data_size
8771 and addralign methods of relaxed input sections.
8772 * symtab.cc (Symbol_table::compute_final_value): Extract template
8773 from the body of Symbol_table::sized_finalize_symbol.
8774 (Symbol_table::sized_finalized_symbol): Call
8775 Symbol_table::compute_final_value.
8776 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
8777 (Symbol_table::compute_final_value): New templated method declaration.
8778 * target.cc (Target::do_make_output_section): New method defintion.
8779 * target.h (Target::make_output_section): New method declaration.
8780 (Target::relax): Add more parameters for input objects, symbol table
8781 and layout. Adjust call to do_relax.
8782 (Target::do_make_output_section): New method declaration.
8783 (Target::do_relax): Add parameters for input objects, symbol table
8784 and layout.
8785
d446d6c4
ILT
87862009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8787
8788 * pread.c: Include stdio.h.
8789
bc06c745
ILT
87902009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8791
8792 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
8793 defined.
8794
75aea3d0
ILT
87952009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8796
8797 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8798 Change read_shndx type to unsigned int.
8799 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
8800 int.
8801 (Sized_dwarf_line_info::read_line_mappings): Likewise.
8802 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
8803 Change read_shndx type to unsigned int.
8804 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
8805 int.
8806 (Sized_dwarf_line_info::read_line_mappings): Likewise.
8807 * layout.cc (Layout::create_symtab_sections): Cast the result of
8808 local_symcount * symsize to off_t in the gold_assert.
8809
be8fcb75
ILT
88102009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8811
8812 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
8813 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
8814 R_ARM_BASE_ABS.
8815 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
8816 (Arm_relocate_functions::thm_abs5): New function.
8817 (Arm_relocate_functions::abs12): New function.
8818 (Arm_relocate_functions::abs16): New function.
8819 (Arm_relocate_functions::base_abs): New function.
8820 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
8821 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
8822 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
8823 R_ARM_BASE_ABS.
8824 (Scan::global): Likewise.
8825 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
8826 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
8827 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
8828 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
8829 R_ARM_BASE_ABS.
8830
c2a122b6
ILT
88312009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8832
8833 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
8834 (Arm_relocate_functions::movt_prel): New function.
8835 (Arm_relocate_functions::thm_movw_prel_nc): New function.
8836 (Arm_relocate_functions::thm_movt_prel): New function.
8837 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
8838 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
8839 (Scan::global, Relocate::relocate): Likewise.
8840 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8841
c4aa1e2d
ILT
88422009-10-09 Mikolaj Zalewski <mikolajz@google.com>
8843
8844 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
8845 Incremental_checker.
8846 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
8847 unsigned int.
8848 (class Incremental_inputs_header): New class.
8849 (Incremental_inputs_header_writer): Edit comment.
8850 (Incremental_inputs_entry): New class.
8851 (Incremental_inputs_entry_writer): Edit comment.
8852 (Sized_incremental_binary::do_find_incremental_inputs_section):
8853 Add *strtab_shndx parameter, fill it.
8854 (Sized_incremental_binary::do_check_inputs): New method.
8855 (Incremental_checker::can_incrementally_link_output_file): Use
8856 Sized_incremental_binary::check_inputs.
8857 (Incremental_inputs::report_command_line): Save command line in
8858 command_line_.
8859 * incremental.h:
8860 (Incremental_binary::find_incremental_inputs_section): New
8861 method.
8862 (Incremental_binary::do_find_incremental_inputs_section): Add
8863 strtab_shndx parameter.
8864 (Incremental_binary::do_check_inputs): New pure virtual method.
8865 (Sized_incremental_binary::do_check_inputs): Declare.
8866 (Incremental_checker::Incremental_checker): Add incremental_inputs
8867 parameter, use it to initialize incremental_inputs_.
8868 (Incremental_checker::incremental_inputs_): New field.
8869 (Incremental_checker::command_line): New method.
8870 (Incremental_checker::inputs): New method.
8871 (Incremental_checker::command_line_): New field.
8872
c549a694
ILT
88732009-10-09 Mikolaj Zalewski <mikolajz@google.com>
8874
8875 * incremental.cc: Include <cstdarg> and "target-select.h".
8876 (vexplain_no_incremental): New function.
8877 (explain_no_incremental): New function.
8878 (Incremental_binary::error): New method.
8879 (Sized_incremental_binary::do_find_incremental_inputs_section): New
8880 method.
8881 (make_sized_incremental_binary): New function.
8882 (open_incremental_binary): New function.
8883 (can_incrementally_link_file): Add checks if output is ELF and has
8884 inputs section.
8885 * incremental.h: Include "elfcpp_file.h" and "output.h".
8886 (Incremental_binary): New class.
8887 (Sized_incremental_binary): New class.
8888 (open_incremental_binary): Declare.
8889 * object.cc (is_elf_object): Use
8890 elfcpp::Elf_recognizer::is_elf_file.
8891 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
8892 * output.h (Output_file::filesize): New method.
8893
fd3c5f0b
ILT
88942009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8895
8896 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
8897 New function.
8898 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
8899 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
8900 function.
8901 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
8902 function.
8903 (Arm_relocate_functions::movw_abs_nc): New function.
8904 (Arm_relocate_functions::movt_abs): New function.
8905 (Arm_relocate_functions::thm_movw_abs_nc): New function.
8906 (Arm_relocate_functions::thm_movt_abs): New function.
8907 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
8908 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
8909 (Scan::global): Likewise.
8910 (Relocate::relocate): Likewise.
8911 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8912
7f5309a5
ILT
89132009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8914
8915 * arm.cc (Arm_relocate_functions::got_prel) New function.
8916 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
8917 (Relocate::relocate): Likewise.
8918 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8919
364c7fa5
ILT
89202009-10-06 Ian Lance Taylor <iant@google.com>
8921
8922 * options.h (class General_options): Define
8923 split_stack_adjust_size parameter.
8924 * object.h (class Object): Add uses_split_stack_ and
8925 has_no_split_stack_ fields. Add uses_split_stack and
8926 has_no_split_stack accessor functions. Declare
8927 handle_split_stack_section.
8928 (class Reloc_symbol_changes): Define.
8929 (class Sized_relobj): Define Function_offsets. Declare
8930 split_stack_adjust, split_stack_adjust_reltype, and
8931 find_functions.
8932 * object.cc (Object::handle_split_stack_section): New function.
8933 (Sized_relobj::do_layout): Call handle_split_stack_section.
8934 * dynobj.cc (Sized_dynobj::do_layout): Call
8935 handle_split_stack_section.
8936 * reloc.cc (Sized_relobj::relocate_sections): Call
8937 split_stack_adjust for executable sections in split_stack
8938 objects. Pass reloc_map to relocate_section.
8939 (Sized_relobj::split_stack_adjust): New function.
8940 (Sized_relobj::split_stack_adjust_reltype): New function.
8941 (Sized_relobj::find_functions): New function.
8942 * target-reloc.h: Include "object.h".
8943 (relocate_section): Add reloc_symbol_changes parameter. Change
8944 all callers.
8945 * target.h (class Target): Add calls_non_split method. Declare
8946 do_calls_non_split virtual method. Declare match_view and
8947 set_view_to_nop.
8948 * target.cc: Include "elfcpp.h".
8949 (Target::do_calls_non_split): New function.
8950 (Target::match_view): New function.
8951 (Target::set_view_to_nop): New function.
8952 * gold.cc (queue_middle_tasks): Give an error if mixing
8953 split-stack and non-split-stack objects with -r.
8954 * i386.cc (Target_i386::relocate_section): Add
8955 reloc_symbol_changes parameter.
8956 (Target_i386::do_calls_non_split): New function.
8957 * x86_64.cc (Target_x86_64::relocate_section): Add
8958 reloc_symbol_changes parameter.
8959 (Target_x86_64::do_calls_non_split): New function.
8960 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
8961 parameter.
8962 * powerpc.cc (Target_powerpc::relocate_section): Add
8963 reloc_symbol_changes parameter.
8964 * sparc.cc (Target_sparc::relocate_section): Add
8965 reloc_symbol_changes parameter.
8966 * configure.ac: Call AM_CONDITIONAL for the default target.
8967 * configure: Rebuild.
8968 * testsuite/Makefile.am (TEST_AS): New variable.
8969 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
8970 (check_DATA): Add split_i386 and split_x86_64 files.
8971 (SPLIT_DEFSYMS): Define.
8972 (split_i386_[1234n].o): New targets.
8973 (split_i386_[124]): New targets.
8974 (split_i386_[1234r].stdout): New targets.
8975 (split_x86_64_[1234n].o): New targets.
8976 (split_x86_64_[124]): New targets.
8977 (split_x86_64_[1234r].stdout): New targets.
8978 (MOSTLYCLEANFILES): Add new executables.
8979 * testsuite/split_i386.sh: New file.
8980 * testsuite/split_x86_64.sh: New file.
8981 * testsuite/split_i386_1.s: New file.
8982 * testsuite/split_i386_2.s: New file.
8983 * testsuite/split_i386_3.s: New file.
8984 * testsuite/split_i386_4.s: New file.
8985 * testsuite/split_i386_n.s: New file.
8986 * testsuite/split_x86_64_1.s: New file.
8987 * testsuite/split_x86_64_2.s: New file.
8988 * testsuite/split_x86_64_3.s: New file.
8989 * testsuite/split_x86_64_4.s: New file.
8990 * testsuite/split_x86_64_n.s: New file.
8991 * testsuite/testfile.cc (Target_test): Update relocation_section
8992 function.
8993 * testsuite/Makefile.in: Rebuild.
8994
e8a9fcda
ILT
89952009-10-06 Ian Lance Taylor <iant@google.com>
8996
8997 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
8998 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
8999 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
9000 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
9001 the address on ldo_addrs_.
9002 (Target_i386::Relocate::fix_up_ldo): New function.
9003
e99daf92
ILT
90042009-10-06 Rafael Espindola <espindola@google.com>
9005
9006 * plugin.cc (add_input_library): New.
9007 (Plugin::load): Add add_input_library to tv.
9008 (Plugin_manager::add_input_file): Add the is_lib argument.
9009 (add_input_file): Update call to Plugin_manager::add_input_file.
9010 (add_input_library): New.
9011 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
9012
966d4097
DK
90132009-09-30 Doug Kwan <dougkwan@google.com>
9014
9015 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
9016 symbol and call Symbol::may_need_copy_reloc to determine if
9017 a copy reloc is needed.
9018 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
9019 nocopyreloc is given in command line.
9020 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
9021 given in command line.
9022 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
9023 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
9024 of the removed Target_i386::may_need_copy_reloc.
9025 * options.h (copyreloc): New option with default value false.
9026 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9027 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
9028 instead of the removed Target_powerpc::may_need_copy_reloc.
9029 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9030 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
9031 instead of the removed Target_sparc::may_need_copy_reloc.
9032 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
9033 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
9034 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
9035 instead of the removed Target_x86_64::may_need_copy_reloc.
9036
029ba973
ILT
90372009-09-30 Ian Lance Taylor <iant@google.com>
9038
9039 * object.h (class Object): Remove target_ field, and target,
9040 sized_target, and set_target methods.
9041 (Object::sized_target): Remove.
9042 (class Sized_relobj): Update declarations. Remove sized_target.
9043 * object.cc (Sized_relobj::setup): Remove target parameter.
9044 Change all callers.
9045 (Input_objects::add_object): Don't do anything with the target.
9046 (make_elf_sized_object): Add punconfigured parameter. Change all
9047 callers. Set or test parameter target.
9048 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
9049 Change all callers.
9050 * parameters.cc (Parameters::set_target): Change parameter type to
9051 be non-const.
9052 (Parameters::default_target): Remove.
9053 (set_parameters_target): Change parameter type to be non-const.
9054 (parameters_force_valid_target): New function.
9055 (parameters_clear_target): New function.
9056 * parameters.h (class Parameters): Update declarations. Remove
9057 default_target method. Add sized_target and clear_target
9058 methods. Change target_ to be non-const.
9059 (set_parameters_target): Update declaration.
9060 (parameters_force_valid_target): Declare.
9061 (parameters_clear_target): Declare.
9062 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
9063 as NULL if we aren't searching.
9064 (Add_symbols::run): Don't check for compatible target.
9065 * fileread.cc (Input_file::open_binary): Call
9066 parameters_force_valid_target.
9067 * gold.cc (queue_middle_tasks): Likewise.
9068 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
9069 set_target on object.
9070 * dynobj.h (class Sized_dynobj): Update declarations.
9071 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
9072 make_elf_object returns NULL.
9073 (Archive::include_member): Don't check whether object target is
9074 compatible.
9075 * output.cc (Output_section::add_input_section): Get target from
9076 parameters.
9077 (Output_section::relax_input_section): Likewise.
9078 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
9079 parameters.
9080 (Sized_relobj::do_scan_relocs): Likewise.
9081 (Sized_relobj::relocate_sections): Likewise.
9082 * resolve.cc (Symbol_table::resolve): Likewise.
9083 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
9084 parameter. Change all callers.
9085 (Symbol_table::add_from_object): Get target from parameters.
9086 (Symbol_table::add_from_relobj): Don't check object target.
9087 (Symbol_table::add_from_dynobj): Likewise.
9088 (Symbol_table::define_special_symbol): Get target from
9089 parameters.
9090 * symtab.h (class Symbol_table): Update declaration.
9091 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
9092 parameter. Change all callers. Clear parameter target.
9093 (Binary_test): Test target here.
9094 * testsuite/object_unittest.cc (gold_testsuite): Remove
9095 target_test_pointer parameter. Change all callers.
9096 (Object_test): Test target here.
9097
a6a22b83
ILT
90982009-09-26 Ian Lance Taylor <iant@google.com>
9099
9100 * testsuite/initpri1.c: Don't try to use constructor priorities if
9101 compiling with gcc before 4.3.
9102
6a8f49fe
ILT
91032009-09-22 Mikolaj Zalewski <mikolajz@google.com>
9104
9105 * testsuite/retain_symbols_file_test.sh (check_present): Change
9106 output file name to retain_symbols_file_test.stdout.
9107 (check_absent): Likewise.
9108
8c604651
CS
91092009-09-18 Craig Silverstein <csilvers@google.com>
9110
9111 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
9112 * options.cc: Include <cerrno> and <fstream>.
9113 (General_options::finalize): Parse -retain-symbols-file tag.
9114 * options.h: New flag.
9115 (General_options): New method should_retain_symbol, new
9116 variable symbols_to_retain.
9117 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
9118 should_retain_symbol map.
9119 * testsuite/Makefile.am (retain_symbols_file_test): New test.
9120 * testsuite/Makefile.in: Regenerate.
9121 * testsuite/retain_symbols_file_test.sh: New file.
9122
ca58b19f
NC
91232009-09-18 Nick Clifton <nickc@redhat.com>
9124
9125 * po/es.po: Updated Spanish translation.
9126
20e6d0d6
DK
91272009-09-17 Doug Kwan <dougkwan@google.com>
9128
9129 * debug.h (DEBUG_RELAXATION): New constant.
9130 (DEBUG_ALL): Add DEBUG_RELAXATION.
9131 (debug_string_to_enum): Add relaxation debug option.
9132 * layout.cc
9133 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
9134 Layout::Relaxation_debug_check::read_sections,
9135 Layout::Relaxation_debug_check::read_sections): New method definitions.
9136 (Layout::Layout): Initialize data members
9137 record_output_section_data_from_scrips_,
9138 script_output_section_data_list_ and relaxation_debug_check_.
9139 (Layout::save_segments, Layout::restore_segments,
9140 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9141 Layout::relaxation_loop_body): New method definitions.
9142 (Layout::finalize): Support relaxation. Move section layout code to
9143 Layout::relaxation_loop_body.
9144 (Layout::set_asection_address_from_script): Move code for orphan
9145 section placement out.
9146 (Layout::place_orphan_sections_in_script): New method definition.
9147 * layout.h (Output_segment_headers, Output_file_header):
9148 New forward class declarations.
9149 (Layout::~Layout): Define.
9150 (Layout::new_output_section_data_from_script): New method definition.
9151 (Layout::place_orphan_sections_in_script): New method declaration.
9152 (Layout::Segment_states): New type declaration.
9153 (Layout::save_segments, Layout::restore_segments,
9154 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9155 Layout::relaxation_loop_body): New method declarations.
9156 (Layout::Output_section_data_list): New type declaration.
9157 (Layout::Relaxation_debug_check): New class definition.
9158 (Layout::record_output_section_data_from_script_,
9159 Layout::script_output_section_data_list_, Layout::segment_states_,
9160 Layout::relaxation_debug_check_): New data members.
9161 * output.cc: (Output_section_headers::do_size): New method definition.
9162 (Output_section_headers::Output_section_headers): Move size
9163 computation to Output_section_headers::do_size.
9164 (Output_segment_headers::do_size): New method definition.
e1df38aa 9165 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
9166 Output_file_header::do_size and call it.
9167 (Output_file_header::do_size): New method definition.
9168 (Output_data_group::Output_data_group): Adjust call to
9169 Output_section_data.
9170 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
9171 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 9172 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
9173 RELAXED_INPUT_SECTION_CODE.
9174 (Output_section::Output_section): Initialize data member checkpoint_.
9175 (Output_section::~Output_section): Delete checkpoint object pointed
9176 by checkpoint_.
9177 (Output_section::add_input_section): Always add an Input_section if
9178 relaxing.
9179 (Output_section::add_merge_input_section): Add assert.
9180 (Output_section::relax_input_section): New method definition.
9181 (Output_section::set_final_data_size): Set load address to zero for
9182 an unallocated section.
9183 (Output_section::do_address_and_file_offset_have_reset_values):
9184 New method definition.
9185 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
9186 Handle relaxed input section.
9187 (Output_section::sort_attached_input_sections): Checkpoint input
9188 section list lazily.
9189 (Output_section::get_input_sections): Change type of input_sections to
9190 list of Simple_input_section pointers. Checkpoint input section list
9191 lazily. Also handle relaxed input sections.
9192 (Output_section::add_input_section_for_script): Take a reference to
9193 a Simple_input_section object instead of Relobj pointer and section
9194 index as parameter. Handle relaxed input sections.
9195 (Output_section::save_states, Output_section::restore_states): New
9196 method definitions.
9197 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
9198 (Output_data::is_data_size_fixed): New method definition.
9199 (Output_data::reset_addresss_and_file_offset): Do not reset data size
9200 if it is fixed.
9201 (Output_data::address_and_file_offset_have_reset_values): New method
9202 definition.
9203 (Output_data::do_address_and_file_offset_have_reset_values): New method
9204 definition.
9205 (Output_data::set_data_size): Check that data size is not fixed.
9206 (Output_data::fix_data_size): New method definition.
9207 (Output_data::is_data_size_fixed_): New data member.
9208 (Output_section_headers::set_final_data_size): New method definition.
9209 (Output_section_headers::do_size): New method declaration.
9210 (Output_segment_headers::set_final_data_size): New method definition.
9211 (Output_segment_headers::do_size): New method declaration.
9212 (Output_file_header::set_final_data_size)::New method definition.
9213 (Output_file_header::do_size)::New method declaration.
9214 (Output_section_data::Output_section_data): Add new parameter
9215 is_data_size_fixed and use it to fix data size.
9216 (Output_data_const::Output_data_const): Adjust call to base class
9217 constructor and fix data size.
9218 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
9219 base class constructor and fix data size.
9220 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
9221 base class constructor and fix data size.
9222 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
9223 class constructor and fix data size.
9224 (Output_data_group::set_final_data_size): New method definition.
9225 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
9226 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
9227 class constructor and fix data size.
9228 (Output_relaxed_input_section): New class definition.
9229 (Output_section::Simple_input_section): New class definition.
9230 (Output_section::get_input_sections): Adjust parameter list.
9231 (Output_section::add_input_section_for_script): Same.
9232 (Output_section::save_states, Output_section::restore_states,
9233 Output_section::do_address_and_file_offset_have_reset_values,
9234 (Output_section::Input_section::Input_section): Handle
9235 RELAXED_INPUT_SECTION_CODE. Add new overload for
9236 Output_relaxed_input_section.
9237 (Output_section::Input_section::is_input_section,
9238 Output_section::Input_section::set_output_section): Handle relaxed
9239 input section.
9240 (Output_section::Input_section::is_relaxed_input_section,
9241 Output_section::Input_section::output_section_data,
9242 Output_section::Input_section::relaxed_input_section): New method
9243 definitions.
9244 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
9245 value.
9246 (Output_section::Input_section::u1_): Update comments.
9247 (Output_section::Input_section::u2_): Add new union member poris.
9248 (Output_section::Checkpoint_output_section): New classs definition.
9249 (Output_section::relax_input_section): New method declaration.
9250 (Output_section::checkpoint_): New data member.
9251 (Output_segment): Update comments.
9252 (Output_segment::Output_segment): Un-privatize copy constructor.
9253 (Output_segment::operator=): Un-privatize.
9254 * script-sections.cc (Output_section_element::Input_section_list):
9255 Change element type to Output_section::Simple_input_section.
9256 (Output_section_element_dot_assignment::set_section_addresses):
9257 Register output section data for relaxation clean up.
9258 (Output_data_exression::Output_data_expression): Adjust call to base
9259 constructor to fix data size.
9260 (Output_section_element_data::set_section_addresses): Register
9261 Output_data_expression object for relaxation clean up.
9262 (struct Input_section_info): Replace Relobj pointer and section index
9263 pair with Output_section::Simple_input_section and Convert struct to a
9264 class.
9265 (Input_section_sorter::operator()): Adjust access to
e1df38aa 9266 Input_section_info data member to use accessors.
20e6d0d6
DK
9267 (Output_section_element_input::set_section_addresses): Use layout
9268 parameter. Adjust code to use Output_section::Simple_input_section
9269 and Input_secction_info classes. Register filler for relaxation
9270 clean up.
9271 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
9272 and section index pair with Output_section::Simple_input_section
9273 class. Adjust code accordingly.
9274 (Phdrs_element::release_segment): New method definition.
9275 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
9276 segment list.
9277 (Script_sections::release_segments): New method definition.
9278 * gold/script-sections.h (Script_sections::release_segments): New
9279 method declaration.
9280 * gold/target.h (Target::may_relax, Target::relax,
9281 Target::do_may_relax, Target::do_relax): New method definitions.
9282
5e445df6
ILT
92832009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9284
9285 * arm.cc (has_signed_unsigned_overflow): New function.
9286 (Arm_relocate_functions::abs8): New function.
9287 (Target_arm::Scan::local): Handle R_ARM_ABS8.
9288 (Target_arm::Scan::global): Likewise.
9289 (Target_arm::relocate::relocate): Likewise.
9290 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9291 Likewise.
9292
8c604651 92932009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
9294
9295 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
9296 * testsuite/Makefile.in: Regenerate.
9297
1e9cc1c2
NC
92982009-09-11 Nick Clifton <nickc@redhat.com>
9299
9300 * po/gold.pot: Updated by the Translation project.
9301
6a89f575
CC
93022009-09-08 Cary Coutant <ccoutant@google.com>
9303
9304 * output.cc (Output_file::open): Add execute permission to empty file.
9305 * testsuite/Makefile.am (permission_test): New test.
9306 * testsuite/Makefile.in: Regenerate.
9307
fdcac5af
ILT
93082009-09-02 Ian Lance Taylor <iant@google.com>
9309
9310 * output.cc (Output_file::resize): Call map_no_anonymous rather
9311 than map.
9312
44453f85
ILT
93132009-09-01 Mikolaj Zalewski <mikolajz@google.com>
9314
9315 * gold.cc: Include "incremental.h".
9316 (queue_initial_tasks): Call Incremental_checker methods.
9317 * incremental.cc: Include "output.h".
9318 (Incremental_checker::can_incrementally_link_output_file): New
9319 method.
9320 * incremental.h (Incremental_checker): New class.
9321
9322 * output.cc (Output_file::open_for_modification): New method.
9323 (Output_file::map_anonymous): Changed return type to bool. Record
9324 map in base_ field.
9325 (Output_file::map_no_anonymous): New method, broken out of map.
9326 (Output_file::map): Use map_no_anonymous and map_anonymous.
9327 * output.h (class Output_file): Update declarations.
9328
293c1386
CC
93292009-08-24 Cary Coutant <ccoutant@google.com>
9330
9331 * options.h (Command_line::Pre_options): New class.
9332 (Command_line::pre_options): New member.
9333 * options.cc (gold::options::ready_to_register): New variable.
9334 (One_option::register_option): Do nothing if not registering options.
9335 Assert if same short option registered twice.
9336 (General_options::General_options): Turn off option registration when
9337 done constructing.
9338 (Command_line::Pre_options::Pre_options): New constructor.
9339
f773f3d2
CC
93402009-08-24 Cary Coutant <ccoutant@google.com>
9341
06a73cfe
CC
9342 * options.h (General_options::no_keep_memory): Remove incorrect
9343 short option.
f773f3d2 9344
a15af8e2
RW
93452009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9346
9347 * Makefile.am (am__skiplex, am__skipyacc): New.
9348 * Makefile.in: Regenerate.
9349
c462b41b
RW
93502009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9351
14ec8efd
RW
9352 * Makefile.am (AM_CPPFLAGS): Renamed from ...
9353 (INCLUDES): ... this.
9354 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
9355 (AM_CPPFLAGS): Renamed from ...
9356 (INCLUDE): ... this.
9357 * Makefile.in, testsuite/Makefile.in: Regenerate.
9358
81ecdfbb
RW
9359 * Makefile.in: Regenerate.
9360 * aclocal.m4: Likewise.
9361 * config.in: Likewise.
9362 * configure: Likewise.
9363 * testsuite/Makefile.in: Likewise.
9364
c462b41b
RW
9365 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9366 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9367 * Makefile.in: Regenerate.
9368 * testsuite/Makefile.in: Regenerate.
9369
2da73f13
CC
93702009-08-19 Cary Coutant <ccoutant@google.com>
9371
9372 * resolve.cc (Symbol_table::resolve): Don't complain about defined
9373 symbols in shared libraries overridden by hidden or internal symbols
9374 in the main program.
9375
2db70501
CD
93762009-08-19 Chris Demetriou <cgd@google.com>
9377
9378 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
9379 checking source file names in error messages.
9380
f733487b
DK
93812009-08-18 Doug Kwan <dougkwan@google.com>
9382
9383 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
9384 an elcpp::Ehdr as parameter. Adjust call to set_target.
9385 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
9386 an elfcpp::Ehdr as parameter.
9387 * object.cc (Object::set_target): Remove the version that looks up
9388 a target and sets it.
9389 (Sized_relobj::setup): Take a Target object instead of
9390 an elfcpp::Ehdr as parameter. Adjust call to set_target.
9391 (make_elf_sized_object): Find target and ask target to
9392 make an ELF object.
9393 * object.h: (Object::set_target): Remove the version that looks up
9394 a target and sets it.
9395 (Sized_relobj::setup): Take a Target object instead of
9396 an elfcpp:Ehdr as parameter.
9397 * target.cc: Include dynobj.h.
9398 (Target::do_make_elf_object_implementation): New.
2e702c99 9399 (Target::do_make_elf_object): New.
f733487b
DK
9400 * target.h (Target::make_elf_object): New template declaration.
9401 (Target::do_make_elf_object): New method declarations.
9402 (Target::do_make_elf_object_implementation): New template declaration.
9403
cc70f101
ILT
94042009-08-14 Ian Lance Taylor <iant@google.com>
9405
9406 * gold.h (FUNCTION_NAME): Define.
9407 (gold_unreachable): Use FUNCTION_NAME.
9408
ef5e0cb1
ST
94092009-08-12 Sriraman Tallam <tmsriram@google.com>
9410
9411 * icf.cc (Icf::find_identical_sections): Issue a warning when a
9412 symbol in the --keep-unique list is not found.
9413
48c187ce
ST
94142009-08-12 Sriraman Tallam <tmsriram@google.com>
9415
9416 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
9417 been maked as --keep-unique.
9418 (Icf::unfold_section): New function.
9419 * icf.h (Icf::unfold_section): New function.
9420 * options.h (General_options::keep_unique): New option.
9421 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
9422 * testsuite/Makefile.in: Regenerate.
9423 * testsuite/icf_keep_unique_test.sh: New file.
9424 * testsuite/icf_keep_unique_test.cc: New file.
9425
645afe0c
CC
94262009-08-12 Cary Coutant <ccoutant@google.com>
9427
9428 PR 10471
9429 * resolve.cc (Symbol_table::resolve): Check for references from
9430 dynamic objects to hidden and internal symbols.
9431 * testsuite/Makefile.am (hidden_test.sh): New test.
9432 * testsuite/Makefile.in: Regenerate.
9433 * testsuite/hidden_test.sh: New script.
9434 * testsuite/hidden_test_1.c: New test source.
9435 * testsuite/hidden_test_main.c: New test source.
9436
11af873f
DK
94372009-08-11 Doug Kwan <dougkwan@google.com>
9438
9439 * arm.cc: Update comments.
9440 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
9441 segment to locate the .ARM.exidx section if present.
9442
b9f7d72d
DK
94432009-08-09 Doug Kwan <dougkwan@google.com>
9444
9445 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
9446 patch.
9447
ddd3c53c
ST
94482009-08-07 Sriraman Tallam <tmsriram@google.com>
9449 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
9450 compiler warnings.
9451
27721062
ST
94522009-08-06 Sriraman Tallam <tmsriram@google.com>
9453
9454 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
9455 valid tls_segment only for non-debug-section relocations.
9456 * testsuite/Makefile.am: Add gc_tls_test.
9457 * testsuite/Makefile.in: Regenerate.
9458 * testsuite/gc_tls_test.cc: New file.
9459 * testsuite/gc_tls_test.sh: New file.
9460
ef15dade 94612009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 9462
ef15dade
ST
9463 * icf.cc: New file.
9464 * icf.h: New file.
9465 * Makefile.am (CCFILES): Add icf.cc.
9466 (HFILES): Add icf.h
9467 * Makefile.in: Regenerate.
9468 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
9469 * gc.h (gc_process_relocs): Populate lists used by icf to contain
9470 section, symbol and addend information for the relocs.
9471 * gold.cc (queue_middle_tasks): Call identical code folding.
9472 * gold.h: Add defines for multimap.
9473 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
9474 to the call of finalize_local_symbols.
9475 * main.cc (main): Create object of class Icf.
9476 * object.cc (Sized_relobj::do_layout): Allow this function to be
9477 called twice during icf.
9478 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
9479 to sections marked as identical by icf.
9480 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
9481 when available.
9482 (Sized_relobj::do_section_entsize): New function.
9483 * object.h (Object::section_entsize): New function.
9484 (Object::do_section_entsize): New pure virtual function.
9485 (Relobj::finalize_local_symbols): Add new parameter.
9486 (Relobj::do_section_entsize): New function.
9487 * options.h (General_options::icf): New option.
9488 (General_options::icf_iterations): New option.
9489 (General_options::print_icf_sections): New option.
9490 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
9491 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
9492 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
9493 icf.
9494 * symtab.cc (Symbol_table::is_section_folded): New function.
9495 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
9496 to sections marked as identical by icf.
9497 * symtab.h (Symbol_table::set_icf): New function.
9498 (Symbol_table::icf): New function.
9499 (Symbol_table::is_section_folded): New function.
9500 (Symbol_table::icf_): New data member.
9501 * target-reloc.h (relocate_section): Ignore sections folded by icf.
9502 * testsuite/Makefile.am: Add commands to build icf_test.
9503 * testsuite/Makefile.in: Regenerate.
9504 * testsuite/icf_test.sh: New file.
9505 * testsuite/icf_test.cc: New file.
9506
c3b65ac4
CD
95072009-07-24 Chris Demetriou <cgd@google.com>
9508
9509 * layout.cc (is_compressible_debug_section): Fix incorrect
9510 comment about compressed section names.
9511
1caf2c51
ILT
95122009-07-20 Ian Lance Taylor <ian@airs.com>
9513
9514 PR 10419
9515 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
9516
1ef4d87f
ILT
95172009-07-16 Ian Lance Taylor <iant@google.com>
9518
9519 PR 10400
9520 * layout.h: #include <map>.
9521 (class Kept_section): Change from struct to class. Add accessors
9522 and setters. Add section size to Comdat_group mapping. Change
9523 Comdat_group to std::map. Add is_comdat_ field. Add
9524 linkonce_size field in union.
9525 (class Layout): Update declaration of find_or_add_kept_section.
9526 Don't declare find_kept_object.
9527 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
9528 parameter. Add object, shndx, is_comdat, and is_group_name
9529 parameters. Change all callers. Adjust for new Kept_section.
9530 (Layout::find_kept_object): Remove.
9531 * object.cc (Sized_relobj::include_section_group): Update use of
9532 Kept_section. Rename secnum to shndx. Only record
9533 Kept_comdat_section if sections are the same size.
9534 (Sized_relobj::include_linkonce_section): Update use of
9535 Kept_section. Only record Kept_comdat_section if sections are the
9536 same size. Set size of linkonce section.
9537 (Sized_relobj::map_to_kept_section): Update call to
9538 get_kept_comdat_section.
9539 * object.h (class Sized_relobj): Rename fields in
9540 Kept_comdat_section to drop trailing underscores; change object
9541 field to Relobj*. Change Kept_comdat_section_table to store
9542 struct rather than pointer.
9543 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
9544 Add kept_object and kept_shndx parameters. Change all callers.
9545 (Sized_relobj::get_kept_comdat_section): Change return type to
9546 bool. Add kept_object and kept_shndx parameters. Change all
9547 callers.
9548 * plugin.cc (Pluginobj::include_comdat_group): Update call to
9549 Layout::find_or_add_kept_section.
9550
37c3b7b0
ILT
95512009-07-09 Ian Lance Taylor <iant@google.com>
9552
9553 * merge.cc (Object_merge_map::initialize_input_to_output_map):
9554 Reserve space in the hash table.
9555
98fa85cb
ILT
95562009-07-06 Mikolaj Zalewski <mikolajz@google.com>
9557
9558 * fileread.cc (File_read::get_mtime): New method.
9559 * fileread.h (Timespec): New structure.
9560 (File_read::get_mtime): New method.
9561 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
9562 Renamed from timestamp_nsec.
9563 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
9564 Elf_Xword.
e1df38aa 9565 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 9566 timestamp_nsec.
e1df38aa 9567 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
9568 (Incremental_inputs::report_obejct): Save mtime; style fix.
9569 (Incremental_inputs::report_script): Save mtime; style fix.
9570 (Incremental_inputs::finalize_inputs): Style fix.
9571 (Incremental_inputs::finalize): Style fix.
9572 (Incremental_inputs::create_input_section_data): Store inputs
9573 mtime.
9574 * incremental.h (Incremental_inputs::report_script): Add mtime
9575 argument.
9576 (Incremental_inputs::Input_info::Input_info): Intialize only one
9577 union member.
9578 (Incremental_inputs::Input_info::archive): Move to nameless
9579 union.
9580 (Incremental_inputs::Input_info::obejct): Move to nameless union.
9581 (Incremental_inputs::Input_info::script): Move to nameless union.
9582 (Incremental_inputs::mtime): New field.
9583 * script.cc (read_input_script): Pass file mtime to
9584 Incremental_input.
9585 * script.h (Script_info::inputs): Style fix.
9586
c9d70757
ILT
95872009-07-01 Ian Lance Taylor <ian@airs.com>
9588
9589 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
9590 instead of 32.
9591
9c547ec3
ILT
95922009-06-24 Ian Lance Taylor <iant@google.com>
9593
9594 PR 10156
9595 * layout.cc (Layout::choose_output_section): If we find an
9596 existing section, update the flags.
9597 (Layout::create_notes): New function, broken out of
9598 Layout::finalize.
9599 (Layout::finalize): Don't create note sections.
9600 (Layout::create_note): Don't crash if linker script discards
9601 section.
9602 (Layout::create_gold_note): Likewise.
9603 (Layout::create_build_id): Likewise. Don't set
9604 after_input_sections on the section.
9605 (Layout::create_executable_stack_info): Remove target parameter.
9606 Change caller.
9607 * layout.h (class Layout): Declare create_notes. Update
9608 declaration of create_executable_stack_info.
9609 * gold.cc (queue_middle_tasks): Call create_notes.
9610 * output.cc (Output_section::update_flags_for_input_section): Move
9611 here from output.h. If SHF_ALLOC flag is newly set, mark address
9612 invalid.
9613 * output.h (Output_data::mark_address_invalid): New function.
9614 (class Output_section): Only declare, not define,
9615 update_flags_for_input_section. Remove set_flags.
9616
55458500
ILT
96172009-06-24 Ian Lance Taylor <iant@google.com>
9618
9619 * script-sections.cc (Output_section_definition::
9620 set_section_addresses): Rename shadowing local load_address to
9621 laddr.
9622
1307d6cd
ILT
96232009-06-24 Ian Lance Taylor <iant@google.com>
9624
9625 PR 10244
9626 * reloc.cc (relocate_sections): Skip empty relocation sections.
9627
ec3f783e
ILT
96282009-06-23 Ian Lance Taylor <iant@google.com>
9629
9630 PR 10156
9631 * layout.cc (Layout::create_note): Use choose_output_section
9632 rather than make_output_section.
9633
459c9f1c
ILT
96342009-06-23 Ian Lance Taylor <iant@google.com>
9635
9636 PR 10237
9637 * options.cc (General_options::parse_V): Set printed_version_.
9638 (General_options::General_options): Initialize printed_version_.
9639 * options.h (class General_options): Add printed_version_ field.
9640 * gold.cc (queue_initial_tasks): If there are no input files,
9641 don't give a fatal error if we printed the version information.
9642 (queue_middle_tasks): If using -r with a shared object, give a
9643 fatal error rather than an ordinary error.
9644
1518dc8f
ILT
96452009-06-23 Ian Lance Taylor <iant@google.com>
9646
9647 PR 10219
9648 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
9649 (Layout::make_output_section): Set have_stabstr_section_ if we see
9650 a .stab*str section.
9651 (Layout::finalize): Call link_stabs_sections.
9652 (Layout::link_stabs_sections): New file.
9653 * layout.h (class Layout): Add have_stabstr_section_ field.
9654 Declare link_stabs_sections.
9655
3d857b98
DK
96562009-06-23 Doug Kwan <dougkwan@google.com>
9657
9658 * Makefile.am (libgold_a_LIBADD): New.
9659 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 9660 * Makefile.in: Regenerate.
3d857b98
DK
9661 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
9662 * configure: Regenerate.
9663 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
9664 * fileread.cc: Include sys/state.h
9665 * gold.h: Declare memmem and strndup if found missing.
9666 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
9667
0639a6f6
ILT
96682009-06-23 Ian Lance Taylor <iant@google.com>
9669
9670 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
9671 * configure: Rebuild.
9672
8d63875c
ILT
96732009-06-23 Ian Lance Taylor <iant@google.com>
9674
9675 PR 10147
9676 * object.cc (Object::section_contents): Don't try to get a view if
9677 the section has length zero.
9678 (Object::handle_gnu_warning_section): If the section is empty, use
9679 the name of the section as the warning.
9680
f7c8a183
ILT
96812009-06-23 Ian Lance Taylor <iant@google.com>
9682
9683 PR 10133
9684 * stringpool.h (class Stringpool_template): Add optimize_ field.
9685 (Stringpool_template::set_optimize): New function.
9686 * stringpool.cc (Stringpool_template::Stringpool_template):
9687 Initialize optimize_ field.
9688 (Stringpool_template::set_string_offsets): Test local optimize
9689 fild rather than parameter.
9690 * layout.cc (Layout::Layout): Call set_optimize on the section
9691 name stringpool.
9692
e6a307ba
ILT
96932009-06-22 Ian Lance Taylor <iant@google.com>
9694
9695 PR 10030
9696 * yyscript.y: Parse TARGET.
9697 * script.cc (script_set_target): New function.
9698 * script-c.h (script_set_target): Declare.
9699 * options.cc (General_options::string_to_object_format): Rename
9700 from string_to_object_format in anonymous namespace. Change
9701 callers.
9702 * options.h (class General_options): Declare
9703 string_to_object_format.
9704
3ee173de
ILT
97052009-06-22 Ian Lance Taylor <iant@google.com>
9706
9707 * script-sections.cc (Script_sections::create_segments): Don't put
9708 program headers in a PT_LOAD segment if -n or -N.
9709
97102009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
9711
9712 PR 10141
9713 * options.h (class General_options): Add -z lazy and -z now. Sort
9714 -z options into alphabetical order.
9715 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
9716
cd6739a1 97172009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
9718
9719 * layout.cc (Layout::make_output_section): Call
9720 Target::new_output_section.
9721 (Layout::attach_allocated_section_to_segment): Put large section
9722 sections in a separate load segment with the large segment flag
9723 set.
9724 (Layout::segment_precedes): Sort large data segments after other
9725 load segments.
9726 (align_file_offset): New static function.
9727 (Layout::set_segment_offsets): Use align_file_offset.
9728 * output.h (class Output_section): Add is_small_section_ and
9729 is_large_section_ fields.
9730 (Output_section::is_small_section): New function.
9731 (Output_section::set_is_small_section): New function.
9732 (Output_section::is_large_section): New function.
9733 (Output_section::set_is_large_section): New function.
9734 (Output_section::is_large_data_section): New function.
9735 (class Output_segment): Add is_large_data_segment_ field.
9736 (Output_segment::is_large_data_segment): New function.
9737 (Output_segment::set_is_large_data_segment): New function.
9738 * output.cc (Output_section::Output_section): Initialize new
9739 fields.
9740 (Output_segment::Output_segment): Likewise.
9741 (Output_segment::add_output_section): Add assertion that large
9742 data sections always go in large data segments. Force small data
9743 sections to the end of the list of data sections. Force small BSS
9744 sections to the start of the list of BSS sections. For large BSS
9745 sections to the end of the list of BSS sections.
9746 * symtab.h (class Symbol): Declare is_common_shndx.
9747 (Symbol::is_defined): Check Symbol::is_common_shndx.
9748 (Symbol::is_common): Likewise.
9749 (class Symbol_table): Define enum Commons_section_type. Update
9750 declarations. Add small_commons_ and large_commons_ fields.
9751 * symtab.cc (Symbol::is_common_shndx): New function.
9752 (Symbol_table::Symbol_table): Initialize new fields.
9753 (Symbol_table::add_from_object): Put small and large common
9754 symbols in the right list.
9755 (Symbol_table::sized_finalized_symbol): Check
9756 Symbol::is_common_shndx.
9757 (Symbol_table::sized_write_globals): Likewise.
9758 * common.cc (Symbol_table::do_allocate_commons): Allocate new
9759 common symbol lists. Don't call do_allocate_commons_list if the
9760 list is empty.
9761 (Symbol_table::do_allocate_commons_list): Remove is_tls
9762 parameter. Add comons_section_type parameter. Change all
9763 callers. Handle small and large common symbols.
9764 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
9765 Symbol::is_common_shndx.
9766 * resolve.cc (symbol_to_bits): Likewise.
9767 * target.h (Target::small_common_shndx): New function.
9768 (Target::small_common_section_flags): New function.
9769 (Target::large_common_shndx): New function.
9770 (Target::large_common_section_flags): New function.
9771 (Target::new_output_section): New function.
9772 (Target::Target_info): Add small_common_shndx, large_common_shndx,
9773 small_common_section_flags, and large_common_section_flags
9774 fields.
9775 (Target::do_new_output_section): New virtual function.
9776 * arm.cc (Target_arm::arm_info): Initialize new fields.
9777 * i386.cc (Target_i386::i386_info): Likewise.
9778 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
9779 Likewise.
9780 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
9781 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
9782 (Target_x86_64::do_new_output_section): New function.
9783 * configure.ac: Define conditional MCMODEL_MEDIUM.
9784 * testsuite/Makefile.am (check_PROGRAMS): Add large.
9785 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
9786 (large_LDFLAGS): Define.
9787 * testsuite/large.c: New file.
9788 * testsuite/testfile.cc (Target_test::test_target_info):
9789 Initialize new fields.
9790 * configure, testsuite/Makefile.in: Rebuild.
9791
bb04269c
DK
97922009-06-05 Doug Kwan <dougkwan@google.com>
9793
9794 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 9795 * Makefile.in: Regenerate.
bb04269c
DK
9796 * i386.cc (class Target_i386): Define new virtual method to
9797 override do_is_local_label_name in parent.
9798 * object.cc (Sized_relobj::do_count_local_symbols): Discard
9799 local symbols if --discard-locals or -X is given.
9800 * options.h (class General_options): Declare new options
9801 '--discard-locals' and '-X' for discarding locals.
9802 * target.h (class Target): Define new methods is_local_label_name.
9803 Declare new virtual method do_is_local_label_name.
9804 * target.cc: New file.
9805 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
9806 (check_SCRIPTS): Add discard_locals_test.sh.
9807 (check_DATA): Add discard_local_tests.syms.
9808 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
9809 (discard_local_tests.syms, discard_locals_test.o): New make rules.
9810 * testsuite/Makefile.in: Regenerate.
9811 * testsuite/discard_locals_test.c: New file.
9812 * testsuite/discard_locals_test.sh: Same.
9813
805bb01c
DK
98142009-06-05 Doug Kwan <dougkwan@google.com>
9815
9816 * object.cc (Sized_relobj::Sized_relobj): Initialize
9817 discarded_eh_frame_shndx_ to -1U.
9818 (Sized_relobj::do_layout): Record index of a discard .eh_frame
9819 section.
9820 (Sized_relobj::do_count_local_symbols): Skip local symbols in
9821 a discarded .eh_frame section.
9822 (Sized_relobj::do_finalize_local_symbols): Ditto.
9823 * object.h (class Sized_relobj): Declare new member
9824 discarded_eh_frame_shndx_.
9825 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
9826 (local_labels_test.o, local_labels_test): New rules.
9827 * testsuite/Makefile.in: Regenerate.
9828
1dcd334d
DK
98292009-06-04 Doug Kwan <dougkwan@google.com>
9830
9831 * layout.cc (Layout::section_name_mapping): Add mapping for
9832 special ARM sections.
9833
96d49306
DK
98342009-06-03 Doug Kwan <dougkwan@google.com>
9835
9836 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
9837 (utils::has_overflow): Same.
9838
dff16297
ILT
98392009-06-03 Ian Lance Taylor <iant@google.com>
9840
9841 * layout.cc (Layout::section_name_mapping): New array, replacing
9842 Layout::linkonce_mapping.
9843 (Layout::section_name_mapping_count): New variable, replacing
9844 Layout::linkonce_mapping_count.
9845 (Layout::linkonce_output_name): Remove.
9846 (Layout::output_section_name): Rewrite.
9847 * layout.h (class Layout): Rename Linkonce_mapping to
9848 Section_name_mapping, linkonce_mapping to section_name_mapping,
9849 linkonce_mapping_count to section_name_mapping_count. Don't
9850 declare linkonce_output_name.
9851
c121c671
DK
98522009-06-03 Doug Kwan <dougkwan@google.com>
9853
9854 * gold/arm.cc (namespace utils): New.
9855 (Target_arm::reloc_is_non_pic): Define new method.
9856 (class Arm_relocate_functions): New.
9857 (Target_arm::Relocate::relocate): Handle relocation types used by
9858 Android.
9859
07800fab
ILT
98602009-06-03 Ian Lance Taylor <iant@google.com>
9861
9862 * arm.cc (Target_arm::scan::global): Use || instead of |.
9863
c121c671
DK
98642009-06-02 Doug Kwan <dougkwan@google.com>
9865
9866 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
9867 issued_non_pic_error_.
9868 (class Target_arm::Scan): Declare new method check_non_pic.
9869 Define new method symbol_needs_plt_entry.
9870 Declare new data member issued_non_pic_error_.
9871 (class Target_arm::Relocate): Declare new method
9872 should_apply_static_reloc.
9873 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
9874 (Target_arm::Scan::check_non_pic): Define new method.
9875 (Target_arm::Scan::local): Handle a small subset of reloc types used
9876 by Android.
9877 (Target_arm::Scan::local): Same.
9878 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
9879
b19b0c6d
ILT
98802009-05-31 Mikolaj Zalewski <mikolajz@google.com>
9881
9882 * incremental.cc (Incremental_inputs::report_command_line): Filter
9883 out --incremental-* options.
9884
94cdfcff
DK
98852009-05-29 Doug Kwan <dougkwan@google.com>
9886
9887 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
9888 template class.
9889 (class Target_arm): Update comment.
9890 (Target_arm::Target_arm): Initialize new data members GOT_,
9891 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
9892 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
9893 and Target_arm::rel_dyn_section.
9894 Declare new_enum Target_arm::Got_type.
9895 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
9896 and DYNBSS_.
9897 Update commments for member do_dynsym_value.
9898 (Target_arm::got_size, Target_arm::plt_section,
9899 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
9900 new methods inside class defintion.
9901 (Target_arm::got_section): Define new method.
9902 (Target_arm::rel_dyn_section): Same.
9903 (Output_data_plt_arm): New template class.
9904 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
9905 (Output_data_plt_arm:do_adjust_output_section): Define new method.
9906 (Output_data_plt_arm::add_entry): Same.
9907 (Output_data_plt_arm::first_plt_entry): Define new
9908 static data member for PLT instruction template.
9909 (Output_data_plt_arm::plt_entry): Same.
9910 (Output_data_plt_arm::do_write): Define new method.
9911 (Target_arm::make_plt_entry): Same.
9912 (Target_arm::do_finalize_sections): Same.
9913 (Target_arm::do_dynsym_value): Same.
9914
4a657b0d
DK
99152009-05-28 Doug Kwan <dougkwan@google.com>
9916
9917 * Makefile.am (TARGETSOURCES): Add arm.cc.
9918 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
9919 * Makefile.in: Regenerate.
9920 * arm.cc: New file.
9921 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
9922
e7ae8c36
DK
99232009-05-26 Doug Kwan <dougkwan@google.com>
9924
9925 * options.cc (General_options::parse_exclude_libs). Fix a comment.
9926 (General_options::check_excluded_libs): Strip off directories in
9927 archive name before matching like GNU ld does.
9928 * testsuite/Makefile.am (MOSTLYCLEANFILES,
9929 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
9930 (exclude_libs_test_LDFLAGS): Add linker option
9931 -Wl,--exclude-libs,libexclude_libs_test_3
9932 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
9933 an explicit archive without using -l.
9934 (alt/libexclude_libs_test_3.a): New make rule.
9935 * testsuite/Makefile.in: Regenerate.
9936 * testsuite/exclude_libs_test.c : Declare lib3_default().
9937 (main): Call it.
9938 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
9939 * exclude_libs_test_3.c: New file.
9940
f12e7348
NC
99412009-05-26 Nick Clifton <nickc@redhat.com>
9942
9943 * po/id.po: New Indonesian translation.
9944 * po/gold.pot: Updated template file.
9945
4daadc0d
ST
99462009-05-22 Sriraman Tallam <tmsriram@google.com>
9947
e1df38aa 9948 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
9949 gc_comdat_test files. Add -Wl,--gc-sections to build
9950 gc_comdat_test.
9951 * testsuite/Makefile.in: Regenerate.
9952 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
9953
531813ad
ST
99542009-05-21 Sriraman Tallam <tmsriram@google.com>
9955
9956 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
9957 kept comdat section was garbage collected.
9958 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
9959 * testsuite/Makefile.in: Regenerate.
9960 * testsuite/gc_comdat_test.sh: New file.
9961 * testsuite/gc_comdat_test_1.cc: New file.
9962 * testsuite/gc_comdat_test_2.cc: New file.
9963
65514900
CC
99642009-05-19 Doug Kwan <dougkwan@google.com>
9965
9966 * archive.cc (Archive::Archive): Move constructor from archive.h
9967 to here. Initialize no_export_.
9968 (Archive::get_elf_object_for_member): Set no_export flag of object.
9969 * archive.h (Archive::Archive): Move constructor body to
9970 archive.cc.
9971 (Archive::no_export): New method.
9972 (Archive::no_export_): New field.
9973 * object.h (Object::Object): Initialize no_export_ to false.
9974 (Object::no_export, Object::set_no_export): New methods.
9975 (Object::no_export_): New field.
9976 * options.cc (General_options::parse_exclude_libs): New method.
9977 (General_options::check_excluded_libs) Same.
9978 * options.h (exclude_libs): New option.
9979 (General_options::check_excluded_libs): New method declaration.
9980 (General_options::excluded_libs_): New field.
9981 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
9982 default or protected visibility if an object has no-export flag set.
9983 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
9984 (check_SCRIPTS): Add exclude_libs_test.sh.
9985 (check_DATA): Add exclude_libs_test.syms.
9986 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
9987 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
9988 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
9989 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
9990 (exclude_libs_test.syms, libexclude_libs_test_1.a,
9991 libexclude_libs_test_2.a): New rules.
9992 * testsuite/Makefile.in: Regenerate.
9993 * testsuite/exclude_libs_test.c: New file.
9994 * testsuite/exclude_libs_test.sh: Ditto.
9995 * testsuite/exclude_libs_test_1.c: Ditto.
9996 * testsuite/exclude_libs_test_2.c: Ditto.
9997
1b77ea50
ILT
99982009-05-15 Ian Lance Taylor <iant@google.com>
9999
10000 * configure.ac: Check for declarations for cases where libiberty.h
10001 checks HAVE_DECL_xxx.
10002 * configure, config.in: Rebuild.
10003
072fe7ce
ILT
100042009-05-15 Mikolaj Zalewski <mikolajz@google.com>
10005
10006 * gold.h (Incremental_argument_list): Remove (invalid) forward
10007 declaration.
10008 * incremental.cc (Incremental_inputs::report_achive): New method.
10009 (Incremental_inputs::report_object): New method.
10010 (Incremental_inputs::report_script): New method.
10011 (Incremental_inputs::finalize_inputs): New method.
10012 (Incremental_inputs::finalize): Call finalize_inputs().
10013 (Incremental_inputs::sized_create_incremental_inputs_section_data):
10014 Create inputs entries.
10015 * incremental.h (Incremental_input_type): New enum.
10016 (Incremental_inputs::Incremental_input): Initialize new fields.
10017 (Incremental_inputs::report_inputs): New method.
10018 (Incremental_inputs::report_achive): New method.
10019 (Incremental_inputs::report_object): New method.
10020 (Incremental_inputs::report_script): New method.
10021 (Incremental_inputs::finalize_inputs): New method.
10022 (Incremental_inputs::Input_info): New struct.
10023 (Incremental_inputs::Input_info_map): New typedef.
10024 (Incremental_inputs::lock_): New field.
10025 (Incremental_inputs::Inputs_): New field.
10026 (Incremental_inputs::Inputs_map): New field.
10027 * main.cc (main): Call Incremental_input::report_inputs.
10028 * options.h (Input_argument_list): Typedef moved from
10029 Input_arguments.
10030 (Input_file_group::Files): Remove, use ::Input_argument_list.
10031 (Input_file_group::Input_argument_list): Remove, use
10032 ::Input_argument_list.
10033 * plugin.cc (Plugin_manager::add_input_file): Add error in
10034 incremental build.
10035 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
10036 functions.
10037 * script.cc (read_input_script): Call
10038 Incremental_input::report_script.
10039 * script.h (Script_info): New class.
10040
b0481b0b
ILT
100412009-04-27 Ian Lance Taylor <iant@google.com>
10042
10043 * x86_64.cc (do_adjust_output_section): Set entsize to
10044 plt_entry_size.
10045
b22a5a41 100462009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
10047
10048 * output.cc (Output_file::close): After short writes, continue
10049 writing from the correct offset in the buffer being written.
10050
40fde488
CD
100512009-04-23 Chris Demetriou <cgd@google.com>
10052
10053 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
10054 * configure: Regenerate.
10055 * config.in: Regenerate.
10056 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
10057 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
10058
3ce2c28e
ILT
100592009-04-21 Mikolaj Zalewski <mikolajz@google.com>
10060
10061 * incremental.cc (Incremental_inputs_header_data): Renamed from
10062 Incremental_input_header_data.
10063 (Incremental_inputs_header_data::data_size): New field.
10064 (Incremental_inputs_header_data::put_input_file_count): Renamed
10065 from input_file_count.
10066 (Incremental_inputs_header_data::put_command_line_offset): Renamed
10067 from command_line_offset.
10068 (Incremental_inputs_header_data::put_reserved): Renamed from
10069 put_reserved.
10070 (Incremental_inputs_entry_data): Renamed from
10071 Incremental_input_entry_data.
10072 (Incremental_inputs_entry_data::data_size): New field.
10073 (Incremental_inputs::report_command_line): New method.
10074 (Incremental_inputs::finalize): New method.
10075 (Incremental_inputs::create_incremental_inputs_data): New method.
10076 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
10077 * incremental.h: New file.
10078 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
10079 (Layout::finalize): Create incremental inputs section in
10080 incremental builds.
10081 (Layout::create_incremental_info_sections): New method.
10082 * layout.h (Layout::incremental_inputs): New method.
10083 (Layout::create_incremental_info_sections): New method.
10084 (Layout::incremental_inputs_): New field.
10085 * main.cc (main): Notify Incremental_input of the command line.
10086
e55bde5e
ILT
100872009-04-01 Ian Lance Taylor <iant@google.com>
10088 Mikolaj Zalewski <mikolajz@google.com>
10089
10090 * gold.h (reserve_unordered_map): Define, three versions, one for
10091 each version of Unordered_map.
10092 * layout.cc (Layout::Layout): Remove options parameter. Add
10093 number_of_input_files parameter. Don't initialize options_.
10094 Initialize number_of_input_files_ and resized_signatures_. Move
10095 sections_are_attached_.
10096 (Layout::layout_group): Reserve space for group_signatures_.
10097 (Layout::find_or_add_kept_section): Change name parameter to be a
10098 reference. Resize signatures_ map when it gets large enough.
10099 (Layout::layout_eh_frame): Use parameters->options() instead of
10100 this->options_.
10101 (Layout::make_output_section): Likewise.
10102 (Layout::attach_allocated_section_to_segment): Likewise.
10103 (Layout::finalize, Layout::create_executable_stack): Likewise.
10104 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
10105 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
10106 * layout.h (class Layout): Update declarations. Remove options_
10107 field. Add number_of_input_files_ and resized_signatures_
10108 fields. Move sections_are_attached_ field.
10109 * main.cc (main): Pass number of input files to Layout
10110 constructor. Don't pass options.
10111
154b857c
ILT
101122009-03-30 Ian Lance Taylor <iant@google.com>
10113
10114 * ffsll.c (ffsll): Correct implementation.
10115
2f35ab9b
ILT
101162009-03-27 Ian Lance Taylor <iant@google.com>
10117
fd03461a
ILT
10118 * ffsll.c: New file.
10119 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
10120 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
10121 * ftruncate.c (ftruncate): Declare before definition.
10122 * mremap.c (mremap): Likewise.
10123 * pread.c (pread): Likewise.
10124 * configure, Makefile.in, config.in: Rebuild.
10125
2f35ab9b
ILT
10126 * mremap.c: New file.
10127 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
10128 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
10129 (mremap): Declare if HAVE_MREMAP is not defined.
10130 * configure, Makefile.in, config.in: Rebuild.
10131
33aea2fd
CC
101322009-03-27 Cary Coutant <ccoutant@google.com>
10133
10134 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
10135 position independent.
10136 * sparc.cc (Target_sparc::check_non_pic): Likewise.
10137 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
10138
6d479619
CC
101392009-03-24 Cary Coutant <ccoutant@google.com>
10140
10141 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
10142 an executable.
10143 (needs_dynamic_reloc): Likewise.
10144
afc06bb8
ILT
101452009-03-24 Ian Lance Taylor <iant@google.com>
10146
10147 * yyscript.y (file_cmd): Recognize EXTERN.
10148 (extern_name_list, extern_name_list_body): New nonterminals.
10149 * script.cc (script_add_extern): Define.
10150 * script-c.h (script_add_extern): Declare.
10151
f6060a4d
ILT
101522009-03-24 Rafael Avila de Espindola <espindola@google.com>
10153
10154 * object.cc (is_elf_object): Define.
10155 * object.h (is_elf_object): Declare.
10156 * archive.cc (Archive::get_elf_object_for_member): Call
10157 is_elf_object.
33aea2fd 10158 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 10159
26736d8e
ILT
101602009-03-24 Elliott Hughes <enh@google.com>
10161
10162 * output.cc (Output_file::map_anonymous): Define.
10163 (Output_file::map): Use map_anonymous. If the regular mmap fails,
10164 try an anonymous one. Report the size if the mmap fails.
10165 * output.h (class Output_file): Declare map_anonymous.
10166
22fd9730
ILT
101672009-03-24 Ian Lance Taylor <iant@google.com>
10168
10169 * target-select.cc (instantiate_target): Don't acquire the lock if
10170 the instantiated_target_ field has already been set.
10171
cb010894
ILT
101722009-03-23 Ian Lance Taylor <iant@google.com>
10173
7f055c20
ILT
10174 * gold-threads.h (class Initialize_lock): Define.
10175 * gold-threads.cc (class Initialize_lock_once): Define.
10176 (initialize_lock_control): New static variable.
10177 (initialize_lock_pointer): New static variable.
10178 (initialize_lock_once): New static function.
10179 (Initialize_lock::Initialize_lock): Define.
10180 (Initialize_lock::initialize): Define.
10181 * target-select.h: Include "gold-threads.h".
10182 (class Target_selector): Add lock_ and initialize_lock_ fields.
10183 Don't define instantiate_target, just declare it.
10184 * target-select.cc (Target_selector::Target_selector): Initialize
10185 new fields.
10186 (Target_selector::instantiate_target): Define.
10187 * descriptors.h: Include "gold-threads.h".
10188 (class Descriptors): Add initialize_lock_ field.
10189 * descriptors.cc (Descriptors::Descriptors): Initialize new
10190 field.
10191 (Descriptors::open): Use initialize_lock_ field
10192 * errors.h (class Errors): Add initialize_lock_ field.
10193 * errors.cc (Errors::Errors): Initialize new field.
10194 (Errors::initialize_lock): Use initialize_lock_ field.
10195 * powerpc.cc (class Target_selector_powerpc): Remove
10196 instantiated_target_ field. In do_recognize call
10197 instantiate_target rather than do_instantiate_target. In
10198 do_instantiate_target just allocate a new target.
10199 * sparc.cc (class Target_selector_sparc): Likewise.
10200
36959681
ILT
10201 * freebsd.h: New file.
10202 * i386.cc: Include "freebsd.h".
10203 (Target_i386): Derive from Target_freebsd rather than
10204 Sized_target.
10205 (Target_selector_i386): Derive from Target_selector_freebsd rather
10206 than Target_selector.
10207 * x86_64.cc: Include "freebsd.h".
10208 (Target_x86_64): Derive from Target_freebsd rather than
10209 Sized_target.
10210 (Target_selector_x86_64): Derive from Target_selector_freebsd
10211 rather than Target_selector.
10212 * target.h (class Target): Add adjust_elf_header and
10213 do_adjust_elf_header.
10214 * output.cc (Output_file_header:: do_sized_write): Call target
10215 adjust_elf_header routine.
10216 * configure.tgt: Set targ_osabi.
10217 * configure.ac: Define GOLD_DEFAULT_OSABI.
10218 * parameters.cc (Parameters::default_target): Pass
10219 GOLD_DEFAULT_OSABI to select_target.
10220 * target-select.h (class Target_selector): Make instantiate_target
10221 protected rather than private.
10222 * Makefile.am (HFILES): Add freebsd.h.
10223 * configure, Makefile.in, config.in: Rebuild.
10224
cb010894
ILT
10225 * merge.cc (do_add_input_section): Correct pend value. Change
10226 message about last entry not being null terminated from error to
10227 warning.
10228
0e879927
ILT
102292009-03-20 Mikolaj Zalewski <mikolajz@google.com>
10230
10231 * incremental.cc: New file.
10232 * Makefile.am (CCFILES): Add incremental.cc.
10233 * Makefile.in: Rebuild.
10234
41105937
PP
102352009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
10236
10237 * layout.cc (Layout::output_section_name): Preserve names
10238 of '.note.' sections.
e1df38aa 10239
60439920
ILT
102402009-03-19 Ian Lance Taylor <iant@google.com>
10241
10242 * descriptors.cc (Descriptors::open): Check that the options are
10243 valid before using them.
10244
0d371ad3
ILT
102452009-03-18 Ian Lance Taylor <iant@google.com>
10246
10247 * script-sections.h: Include <list>.
10248 (class Script_sections): Change Sections_elements from std::vector
10249 to std::list. Typedef public Elements_iterator. Add
10250 orphan_section_placement_, data_segment_align_start_, and
10251 saw_data_segment_align_ fields. Remove data_segment_align_index_
10252 field.
10253 * script-sections.cc (class Orphan_section_placement): New class.
10254 (class Sections_element): Add virtual functions is_relro and
10255 orphan_section_init. Remove virtual function place_orphan_here.
10256 (class Output_section_definition): Add is_relro and
10257 orphan_section_init. Remove place_orphan_here.
10258 (class Orphan_output_section): Likewise.
10259 (Script_sections::Script_sections): Update for field changes.
10260 (Script_sections::data_segment_align): Set saw_data_segment_align_
10261 and data_segment_align_start_, not data_segment_align_index.
10262 (Script_sections::data_segment_relro_end): Check
10263 saw_data_segment_align_. Use data_segment_align_start_ rather
10264 than data_segment_align_index_.
10265 (Script_sections::place_orphan): Rewrite to use
10266 Orphan_section_placement.
10267
9201d894
ILT
102682009-03-17 Ian Lance Taylor <iant@google.com>
10269
9c5b8369
ILT
10270 * archive.cc (Archive::add_symbols): Check for a version attached
10271 to the symbol name in the archive map.
10272 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
10273 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
10274 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
10275 (ver_test_11.a): New target.
10276 * testsuite/Makefile.in: Rebuild.
10277
9201d894
ILT
10278 * configure.ac: Check for chsize and posix_fallocate. Replace
10279 ftruncate.
10280 * ftruncate.c: New file, from gnulib.
10281 * output.cc (posix_fallocate): Define dummy version if not
10282 HAVE_POSIX_FALLOCATE.
10283 (Output_file::map): Call posix_fallocate rather than lseek and
10284 write.
10285 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
10286 * configure, Makefile.in, config.in: Rebuild.
10287
ef4ab7a8 102882009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 10289
ef4ab7a8
PP
10290 * layout.h (Layout::create_note): Add section_name parameter.
10291 * layout.cc (Layout::create_note): Likewise.
10292 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 10293
8c500701
ILT
102942009-03-17 Ian Lance Taylor <iant@google.com>
10295
e85b18e1
ILT
10296 * descriptors.cc: Include "options.h".
10297 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
10298 (Descriptors::open): Always use O_CLOEXEC when opening a new
10299 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
10300 then set FD_CLOEXEC.
10301
9efe6174
ILT
10302 * sparc.cc (class Target_sparc): Add has_got_section.
10303 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
10304 make sure we have a GOT section.
10305
10306 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
10307 (Target_sparc::Scan::local): Likewise.
10308 (Target_sparc::Scan::global): Likewise.
10309 (Target_sparc::Relocate::relocate): Likewise.
10310 (Target_sparc::Relocate::relocate_tls): Likewise.
10311
8c500701
ILT
10312 * symtab.cc (Symbol_table::define_default_version): New function,
10313 broken out of add_from_object.
10314 (Symbol_table::add_from_object): Call define_default_version.
10315 (Symbol_table::define_special_symbol): Add resolve_oldsym
10316 parameter. Change all callers. If the version for a symbol comes
10317 from a version script, resolve it with the symbol with the same
10318 name with no version. Also add the symbol without a version if
10319 appropriate.
10320 (do_define_in_output_data): If resolving with oldsym, don't delete
10321 sym.
10322 (do_define_in_output_segment): Likewise.
10323 (do_define_as_constant): Likewise.
10324 * symtab.h (class Symbol_table): Update declarations.
10325
f1ed28fb
ILT
103262009-03-13 Ian Lance Taylor <iant@google.com>
10327
15f8229b
ILT
10328 * readsyms.cc (Read_symbols::incompatible_warning): New function.
10329 (Read_symbols::requeue): New function.
10330 (Read_symbols::do_read_symbols): If make_elf_object fails because
10331 the target type is not configured, and the file was searched for,
10332 issue a warning and retry with the next directory.
10333 (Add_symbols::run): If the file has an incompatible format, and
10334 it was searched for, requeue the Read_symbols task. On error,
10335 release the object.
10336 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
10337 dirindex parameter to constructor. Change all callers. Declare
10338 incompatible_warning and requeue.
10339 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
10340 input_argument_ and input_group_ fields. Add them to
10341 constructor. Change all callers.
10342 (class Read_script): Add dirindex_ field. Add it to constructor.
10343 Change all callers.
10344 * archive.cc (Archive::setup): Remove input_objects parameter.
10345 Change all callers.
10346 (Archive::get_file_and_offset): Likewise.
10347 (Archive::read_all_symbols): Likewise.
10348 (Archive::read_symbols): Likewise.
10349 (Archive::get_elf_object_for_member): Remove input_objects
10350 parameter. Add punconfigured parameter. Change all callers.
10351 (Archive::add_symbols): Change return type to bool. Check return
10352 value of include_member.
10353 (Archive::include_all_members): Likewise.
10354 (Archive::include_member): Change return type to bool. Return
10355 false if first included object has incompatible target. Set
10356 included_member_ field.
10357 (Add_archive_symbols::run): If add_symbols returns false, requeue
10358 Read_symbols task.
10359 * archive.h (class Archive): Add included_member_ field.
10360 Initialize it in constructor. Add input_file and searched_for
10361 methods. Update declarations.
10362 (class Add_archive_symbols): Add dirpath_, dirindex_, and
10363 input_argument_ fields. Add them to constructor. Change all
10364 callers.
10365 * script.cc: Include "target-select.h".
10366 (class Parser_closure): Add skip_on_incompatible_target_ and
10367 found_incompatible_target_ fields. Add
10368 skip_on_incompatible_target parameter to constructor. Change all
10369 callers. Add methods skip_on_incompatible_target,
10370 clear_skip_on_incompatible_target, found_incompatible_target, and
10371 set_found_incompatible_target.
10372 (read_input_script): Add dirindex parameter. Change all callers.
10373 If parser finds an incompatible target, requeue Read_symbols
10374 task.
10375 (script_set_symbol): Clear skip_on_incompatible_target in
10376 closure.
10377 (script_add_assertion, script_parse_option): Likewise.
10378 (script_start_sections, script_add_phdr): Likewise.
10379 (script_check_output_format): New function.
10380 * script.h (read_input_script): Update declaration.
10381 * script-c.h (script_check_output_format): Declare.
10382 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
10383 (ignore_cmd): Remove OUTPUT_FORMAT.
10384 * fileread.cc (Input_file::Input_file): Add explicit this.
10385 (Input_file::will_search_for): New function.
10386 (Input_file::open): Add pindex parameter. Change all callers.
10387 * fileread.h (class Input_file): Add input_file_argument method.
10388 Declare will_search_for. Update declarations.
10389 * object.cc (make_elf_object): Add punconfigured parameter.
10390 Change all callers.
10391 * object.h (class Object): Make input_file public. Add
10392 searched_for method.
10393 (make_elf_object): Update declaration.
10394 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
10395 restart search.
10396 * dirsearch.h (class Dirsearch): Update declaration.
10397 * options.h (class General_options): Add --warn-search-mismatch.
10398 * parameters.cc (Parameters::is_compatible_target): New function.
10399 * parameters.h (class Parameters): Declare is_compatible_target.
10400 * workqueue.cc (Workqueue::add_blocker): New function.
10401 * workqueue.h (class Workqueue): Declare add_blocker.
10402
f1ed28fb
ILT
10403 * fileread.cc (Input_file::open): Remove options parameter.
10404 Change all callers.
10405 (Input_file::open_binary): Likewise.
10406 * script.cc (read_input_script): Likewise.
10407 * readsyms.h (class Read_symbols): Remove options_ field. Remove
10408 options parameter from constructor. Change all callers.
10409 (class Read_script): Likewise.
10410 * fileread.h (class Input_file): Update declarations.
10411 * script.h (read_input_script): Update declaration.
10412
34dd024a
NC
104132009-03-10 Nick Clifton <nickc@redhat.com>
10414
10415 * po/es.po: New Spanish translation.
10416
6d71b17c
CC
104172009-03-06 Cary Coutant <ccoutant@google.com>
10418
10419 * options.cc (parse_short_option): Keep dash_z from registering itself.
10420
031cdbed
ILT
104212009-03-03 Ian Lance Taylor <iant@google.com>
10422
10423 PR 9918
10424 * target-reloc.h (relocate_section): Pass output_section to
10425 relocate.
10426 * i386.cc (Target_i386::should_apply_static_reloc): Add
10427 output_section parameter. Change all callers.
10428 (Target_i386::Relocate::relocate): Add output_section parameter.
10429 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10430 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
10431 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
10432 * testsuite/two_file_shared.sh: New script.
10433 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
10434 (check_DATA): Add two_file_shared.dbg.
10435 (two_file_shared.dbg): New target.
10436 * testsuite/Makefile.in: Rebuild.
10437
15d5fa16
ILT
104382009-03-01 Ian Lance Taylor <iant@google.com>
10439
10440 * configure.ac: Check for byteswap.h.
10441 * configure: Rebuild.
10442 * config.in: Rebuild.
10443
8a4c0b0d
ILT
104442009-03-01 Mikolaj Zalewski <mikolajz@google.com>
10445
10446 * layout.cc (Layout::find_or_add_kept_section): New function.
10447 (Layout::add_comdat): Removed.
10448 * layout.h (struct Kept_section): Move out of class Layout.
10449 Remove trailing underscores from field names. Add group_sections
10450 field. Rename group_ field to is_group. Change all uses.
10451 (class Layout): Declare find_or_add_kept_section, not add_comdat.
10452 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
10453 comdat_groups_ field.
10454 (Sized_relobj::include_section_group): Use
10455 find_or_add_kept_section and Kept_section::group_sections.
10456 (Sized_relobj::include_linkonce_section): Likewise.
10457 * object.cc (class Sized_relobj): Don't define Comdat_group or
10458 Comdat_group_table. Remove find_comdat_group and
10459 add_comdat_group. Remove comdat_groups_ field.
10460 * plugin.cc (include_comdat_group): Use
10461 Layout::find_or_add_kept_section.
10462
b4ecf66b
ILT
104632009-02-28 Ian Lance Taylor <iant@google.com>
10464
14359ca0
ILT
10465 * README: --gc-sections and map files are now supported. Document
10466 some build requirements.
10467
b4ecf66b
ILT
10468 PR 6992
10469 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
10470 relocatable link set the value of the section symbol to zero.
10471 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
10472 relocatable link don't include the section address in the local
10473 symbol value.
10474
0602e05a
ILT
104752009-02-27 Ian Lance Taylor <iant@google.com>
10476
fd9d194f
ILT
10477 PR 6811
10478 * options.h (class Search_directory): Add is_system_directory.
10479 (class General_options): Declare is_in_system_directory.
10480 * options.cc (get_relative_sysroot): Make static.
10481 (get_default_sysroot): Make static.
10482 (General_optoins::is_in_system_directory): New function.
10483 * fileread.cc (Input_file::is_in_system_directory): New function.
10484 * fileread.h (class Input_file): Declare is_in_system_directory.
10485 * object.h (class Object): Add is_in_system_directory.
10486 (class Input_objects): Remove system_library_directory_ field.
10487 * object.cc (Input_objects::add_object): Don't set
10488 system_library_directory_.
10489 (input_objects::found_in_system_library_directory): Remove.
10490 * symtab.cc (Symbol_table::write_globals): Remove input_objects
10491 parameter. Change all callers.
10492 (Symbol_table::sized_write_globals): Likewise.
10493 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
10494 Call Object::is_in_system_directory.
10495 * symtab.h (class Symbol_table): Update declarations.
10496
61edd21f
ILT
10497 PR 5990
10498 * descriptors.h (Open_descriptor): Add is_on_stack field.
10499 * descriptors.cc (Descriptors::open): If the descriptor is on the
10500 top of the stack, remove it. Initialize is_on_stack field.
10501 (Descriptors::release): Only add pod to stack if it is not on the
10502 stack already.
10503 (Descriptors::close_some_descriptor): Clear stack_next and
10504 is_on_stack fields.
10505
e29e076a
ILT
10506 PR 7091
10507 * output.cc (Output_section::find_starting_output_address): Rename
10508 from starting_output_address; add PADDR parameter; change return
10509 type.
10510 * output.h (class Output_section): Declare
10511 find_starting_output_address instead of starting_output_address.
10512 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
10513 section symbol for which we can't find a merge section.
10514
0602e05a
ILT
10515 PR 9836
10516 * symtab.cc (Symbol_table::add_from_object): If the visibility is
10517 hidden or internal, force the symbol to be local.
10518 * resolve.cc (Symbol::override_visibility): Define.
10519 (Symbol::override_base): Use override_visibility.
10520 (Symbol_table::resolve): Likewise.
10521 (Symbol::override_base_with_special): Likewise.
10522 (Symbol_table::override_with_special): If the visibility is hidden
10523 or internal, force the symbol to be local.
10524 * symtab.h (class Symbol): Add set_visibility and
10525 override_visibility.
10526 * testsuite/ver_test_1.sh: New file.
10527 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
10528 (check_DATA): Add ver_test_1.syms.
10529 (ver_test_1.syms): New target.
10530 * testsuite/Makefile.in: Rebuild.
10531
401a9a73
CC
105322009-02-25 Cary Coutant <ccoutant@google.com>
10533
10534 * layout.cc (Layout::choose_output_section): Don't rename sections
10535 when using a linker script that has a SECTIONS clause.
10536 * Makefile.in: Regenerate.
10537
10538 * testsuite/Makefile.am (script_test_5.sh): New test case.
10539 * testsuite/Makefile.in: Regenerate.
10540 * testsuite/script_test_5.cc: New file.
10541 * testsuite/script_test_5.sh: New file.
10542 * testsuite/script_test_5.t: New file.
10543
f488e4b0
CC
105442009-02-13 Rafael Avila de Espindola <espindola@google.com>
10545
10546 * archive.cc (Archive::include_member): Update calls to add_symbols.
10547 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
10548 the Layout argument.
10549 * dynobj.h (do_add_symbols): Add the Layout argument.
10550 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
10551 Layout argument.
10552 * object.h (Object::add_symbols): Add the Layout argument.
10553 (Object::do_add_symbols): Add the Layout argument.
10554 (Sized_relobj::do_add_symbols): Add the Layout argument.
10555 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
10556 Unify the two versions.
10557 (Add_plugin_symbols): Remove.
10558 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
10559 (Sized_pluginobj::do_add_symbols): Unify the two versions.
10560 (Add_plugin_symbols): Remove.
10561 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
10562 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
10563 (Add_symbols::run): Make it work with Pulginobj.
10564
89dd1680
ILT
105652009-02-06 Ian Lance Taylor <iant@google.com>
10566
10567 * object.cc (Sized_relobj::do_layout): Make info message start
10568 with lower case letter.
10569
266d0a74
ILT
105702009-02-06 Mikolaj Zalewski <mikolajz@google.com>
10571
602b464e
ILT
10572 * binary.cc: Fix file comment.
10573
266d0a74
ILT
10574 * options.h (enum Incremental_disposition): Define.
10575 (class General_options): Add new options: --incremental,
10576 --incremental_changed, --incremental_unchanged,
10577 --incremental_unknown. Add incremental_disposition_ and
10578 implicit_incremental_ fields.
10579 (General_options::incremental_disposition): New function.
10580 (class Position_dependent_options): Add incremental_disposition
10581 option.
10582 (Position_dependent_options::copy_from_options): Set incremental
10583 dispositions.
10584 * options.cc (General_options::parse_incremental_changed): New
10585 function.
2e702c99
RM
10586 (General_options::parse_incremental_unchanged): New function.
10587 (General_options::parse_incremental_unknown): New function.
10588 (General_options::General_options): Initialize new fields
266d0a74 10589 incremental_disposition_ and implicit_incremental_.
2e702c99 10590 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
10591 without --incremental.
10592
f073bbf7
CD
105932009-02-06 Chris Demetriou <cgd@google.com>
10594
10595 * gold.h (gold_undefined_symbol): Change to take only a Symbol
10596 pointer and to report location as the file name associated with
10597 the symbol.
10598 (gold_undefined_symbol_at_location): New function to replace the
10599 old gold_undefined_symbol functionality.
10600 * target-reloc.h (relocate_section): Update to use
10601 gold_undefined_symbol_at_location.
10602 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
10603 Call gold_undefined_symbol function rather than gold_error.
10604 * errors.h (Errors::undefined_symbol): Take location as a
10605 string, rather than calculating it from a relocation.
10606 * errors.cc (Errors::fatal): Print "fatal error:" before the
10607 formatted message.
10608 (Errors::error, Errors::error_at_location): Print "error: "
10609 before the formatted message.
10610 (Errors::undefined_symbol): Take location as a string, rather
10611 than calculating it from a relocation.
10612 (gold_undefined_symbol_at_location): New function akin to
10613 old gold_undefined_symbol, calculates location from relocation.
10614 (gold_undefined_symbol): Change to take only a Symbol pointer
10615 and to report location as the file name associated with the symbol.
10616 * testsuite/debug_msg.sh: Update for changed error messages.
10617 * testsuite/undef_symbol.sh: Likewise.
10618
8e94a90c
ILT
106192009-02-04 Duncan Sands <baldrick@free.fr>
10620
10621 PR 9812
10622 * reduced_debug_output.h
10623 (Output_reduced_debug_abbrev_section::failed): Use format for
10624 gold_warning.
10625 (Output_reduced_debug_info_section::faild): Likewise.
10626
88a0e15b
ILT
106272009-01-31 Mikolaj Zalewski <mikolajz@google.com>
10628
10629 * script.cc (Lazy_demangler): New class.
2e702c99 10630 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
10631 symbol only once.
10632
5efc7cd2
CC
106332009-01-29 Cary Coutant <ccoutant@google.com>
10634
10635 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
10636 to __tls_get_addr.
10637 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10638
e0ebcf42
ILT
106392009-01-28 Ian Lance Taylor <iant@google.com>
10640
5efc7cd2 10641 * version.cc (version_string): Bump to 1.9.
75fe7426 10642
e0ebcf42
ILT
10643 * gold.h: Include <cstring> and <stdint.h>.
10644 * version.cc: Include <cstdio>.
10645 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
10646 warning.
10647 * reduced_debug_output.cc (insert_into_vector): Rename from
10648 Insert_into_vector; change all callers. Use Swap_unaligned to
10649 avoid aliasing issue; remove union since it is unnecessary.
10650
8e2813be 106512009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
10652
10653 * Makefile.am (CCFILES): Add gc.cc.
10654 (HFILES): Add gc.h.
10655 * Makefile.in: Regenerate.
10656 * gold.cc (Gc_runner): New class.
10657 (queue_initial_tasks): Call garbage collection related tasks
10658 when corresponding options are invoked.
10659 (queue_middle_gc_tasks): New function.
10660 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
10661 processed early before laying out sections during garbage collection.
10662 * gold.h (queue_middle_gc_tasks): New function.
10663 (is_prefix_of): Move from "layout.cc".
10664 * i386.cc (Target_i386::gc_process_relocs): New function.
10665 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
10666 * main.cc (main): Create object of class "Garbage_collection".
10667 * object.cc (Relobj::copy_symbols_data): New function.
10668 (Relobj::is_section_name_included): New function.
e1df38aa
NC
10669 (Sized_relobj::do_layout): Allow this function to be called twice
10670 during garbage collection and defer layout of section during the
6d03d481
ST
10671 first call.
10672 * object.h (Relobj::get_symbols_data): New function.
10673 (Relobj::is_section_name_included): New function.
10674 (Relobj::copy_symbols_data): New function.
10675 (Relobj::set_symbols_data): New function.
10676 (Relobj::get_relocs_data): New function.
10677 (Relobj::set_relocs_data): New function.
10678 (Relobj::is_output_section_offset_invalid): New pure virtual function.
10679 (Relobj::gc_process_relocs): New function.
10680 (Relobj::do_gc_process_relocs): New pure virtual function.
10681 (Relobj::sd_): New data member.
10682 (Sized_relobj::is_output_section_offset_invalid): New function.
10683 (Sized_relobj::do_gc_process_relocs): New function.
10684 * options.h (General_options::gc_sections): Modify to not be a no-op.
10685 (General_options::print_gc_sections): New option.
10686 * plugin.cc (Plugin_finish::run): Remove function call to
10687 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
10688 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
10689 * reloc.cc (Read_relocs::run): Add task to process relocs and
10690 determine unreferenced sections when doing garbage collection.
10691 (Gc_process_relocs): New class.
10692 (Sized_relobj::do_gc_process_relocs): New function.
10693 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
10694 sections that are garbage collected.
10695 * reloc.h (Gc_process_relocs): New class.
10696 * sparc.cc (Target_sparc::gc_process_relocs): New function.
10697 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
10698 symbols whose corresponding sections are garbage collected.
10699 (Symbol_table::Symbol_table): Add new parameter for the garbage
10700 collection object.
10701 (Symbol_table::gc_mark_undef_symbols): New function.
10702 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10703 (Symbol_table::gc_mark_dyn_syms): New function.
10704 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
10705 as garbage.
10706 (Symbol_table::add_from_object): Likewise.
10707 (Symbol_table::add_from_relobj): When building shared objects, do not
10708 treat externally visible symbols as garbage.
10709 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
10710 table information for static and relocatable links.
10711 * symtab.h (Symbol_table::set_gc): New function.
10712 (Symbol_table::gc): New function.
10713 (Symbol_table::gc_mark_undef_symbols): New function.
10714 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10715 (Symbol_table::gc_mark_dyn_syms): New function.
10716 (Symbol_table::gc_): New data member.
e1df38aa 10717 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
10718 function.
10719 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
10720 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
10721
3b293544
CF
107222009-01-20 Chris Faylor <me.sourceware@sourceware.org>
10723
10724 * options.h (General_options::gc_sections): Define as a no-op for now.
10725 (General_options::no_keep_memory): Ditto.
10726 (General_options::Bshareable): Define.
10727 * options.cc (General_options::finalize): Honor -Bshareable.
10728
83d22aa8
AS
107292009-01-20 Andreas Schwab <schwab@suse.de>
10730
10731 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
10732 read the value in the contents, since we don't use it. Use the
10733 template endianness when writing.
10734 (Relocate::relocate): Use it for R_PPC_REL16_HA.
10735
cd536b21
AS
107362009-01-19 Andreas Schwab <schwab@suse.de>
10737
10738 * configure.tgt (powerpc64-*): Fix targ_obj.
10739
99e9a495
ILT
107402009-01-15 Ian Lance Taylor <iant@google.com>
10741
10742 * object.cc (Sized_relobj::write_local_symbols): Don't write out
10743 local symbols when stripping all symbols.
10744
bbbfea06
CC
107452009-01-14 Cary Coutant <ccoutant@google.com>
10746
99e9a495 10747 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 10748
0f7c0701
CC
107492009-01-14 Cary Coutant <ccoutant@google.com>
10750
10751 * archive.cc (Archive::get_elf_object_for_member): Remove call
10752 to File_read::claim_for_plugin.
10753 * descriptors.cc (Descriptors::open): Remove reference to
10754 is_claimed.
10755 (Descriptors::claim_for_plugin): Remove.
10756 * descriptors.h (Descriptors::claim_for_plugin): Remove.
10757 (Descriptors::is_claimed): Remove.
10758 (claim_descriptor_for_plugin): Remove.
10759 * fileread.cc (File_read::claim_for_plugin): Remove.
10760 * fileread.h (File_read::claim_for_plugin): Remove.
10761 (File_read::descriptor): Reopen descriptor if necessary.
10762 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
10763 (Plugin_manager::all_symbols_read): Add task parameter. Change
10764 all callers.
10765 (Plugin_manager::get_input_file): New function.
10766 (Plugin_manager::release_input_file): New function.
10767 (Pluginobj::Pluginobj): Add filesize parameter and initialize
10768 corresponding data member.
10769 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
10770 and pass to base constructor. Change all callers.
10771 (get_input_file, release_input_file): New functions.
10772 (make_sized_plugin_object): Add filesize parameter. Change all callers.
10773 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
10774 (Plugin_manager::all_symbols_read): Add task parameter.
10775 (Plugin_manager::get_input_file): New function.
10776 (Plugin_manager::release_input_file): New function.
10777 (Plugin_manager::task_): New data member.
10778 (Pluginobj::Pluginobj): Add filesize parameter.
10779 (Pluginobj::filename): New function.
10780 (Pluginobj::descriptor): New function.
10781 (Pluginobj::filesize): New function.
10782 (Pluginobj::filesize_): New data member.
10783 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
10784 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
10785 File_read::claim_for_plugin; use Object::unlock to unlock the file.
10786
10787 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
10788 with archive libraries.
10789 * testsuite/Makefile.in: Regenerate.
10790 * testsuite/plugin_test.c (struct sym_info): New type.
10791 (get_input_file, release_input_file): New static variables.
10792 (onload): Capture new transfer vector entries.
10793 (claim_file_hook): Stop reading at end of file according to filesize.
10794 Factor out parsing of readelf output into separate function.
10795 (all_symbols_read_hook): Exercise get_input_file and release_input_file
10796 APIs and get the source file name from the symbol table. Convert
10797 source file name to corresponding object file name. Print info
10798 message when adding new input files.
10799 (parse_readelf_line): New function.
10800 * testsuite/plugin_test_1.sh: Add checks for new info messages.
10801 * testsuite/plugin_test_2.sh: Likewise.
10802 * testsuite/plugin_test_3.sh: Likewise.
10803 * testsuite/plugin_test_4.sh: New test case.
10804
62a6d109
ILT
108052009-01-07 Ian Lance Taylor <iant@google.com>
10806
10807 * version.cc (version_string): Bump to 1.8.
10808
483620e8
CC
108092008-12-23 Cary Coutant <ccoutant@google.com>
10810
10811 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
10812 * plugin.cc (Plugin_manager::finish): Rename as
10813 layout_deferred_objects. Move cleanup to separate function.
10814 (Plugin_manager::cleanup): New function.
10815 (Plugin_finish::run): Call layout_deferred_objects and cleanup
10816 separately.
10817 * plugin.h (Plugin_manager::finish): Rename as
10818 layout_deferred_objects.
10819 (Plugin_manager::cleanup): New function.
10820 (Plugin_manager::cleanup_done): New field.
10821
d66a9eb3
CC
108222008-12-23 Cary Coutant <ccoutant@google.com>
10823
10824 * plugin.cc (is_visible_from_outside): New function.
10825 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
10826 so we don't return "IR only" status for exported symbols or -r links.
10827
10828 * testsuite/Makefile.am (plugin_test_3): New test case.
10829 * testsuite/Makefile.in: Regenerate.
10830 * testsuite/plugin_test_3.sh: New file.
10831
5995b570
CC
108322008-12-22 Cary Coutant <ccoutant@google.com>
10833
10834 * object.cc (Sized_relobj::layout_section): New function.
10835 (Sized_relobj::do_layout): Defer layout of input sections until after
10836 plugin has provided replacement files.
10837 (Sized_relobj::do_layout_deferred_sections): New function.
10838 * object.h (Relobj::set_section_offset): Remove virtual keyword.
10839 (Relobj::layout_deferred_sections): New function.
10840 (Relobj::do_layout_deferred_sections): New function.
10841 (Sized_relobj::do_layout_deferred_sections): New function.
10842 (Sized_relobj::layout_section): New function.
10843 (Sized_relobj::Deferred_layout): New structure.
10844 (Sized_relobj::deferred_layout_): New field.
10845 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
10846 Change all callers. Layout deferred sections.
10847 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
10848 references.
10849 (Plugin_hook::run): Move code from do_plugin_hook inline.
10850 (Plugin_hook::do_plugin_hook): Remove.
10851 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
10852 (Plugin_manager::finish): Renamed, was cleanup.
10853 (Plugin_manager::should_defer_layout): New function.
10854 (Plugin_manager::add_deferred_layout_object): New function.
10855 (Plugin_manager::Deferred_layout_list): New type.
10856 (Plugin_manager::deferred_layout_objects_): New field.
10857 (Plugin_hook::do_plugin_hook): Remove.
10858
ee769c88
ILT
108592008-12-17 Ian Lance Taylor <iant@google.com>
10860
10861 * options.h (class General_options): Add --no case for
10862 --export-dynamic.
10863
abc8dcba
CC
108642008-12-16 Cary Coutant <ccoutant@google.com>
10865
10866 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
10867 vector.
10868 (Plugin_manager::claim_file): Create plugin object even if
10869 plugin did not call the add_symbols callback.
10870 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
10871 asking for more symbols than were added.
10872 * testsuite/Makefile.am (plugin_test_1): Add test case with
10873 no global symbols.
10874 (empty.syms): New target.
10875 * testsuite/Makefile.in: Regenerate.
10876 * testsuite/plugin_test.c (claim_file_hook): Add new debug
10877 message. Don't call add_symbols if no globals.
10878 (all_symbols_read_hook): Don't provide replacement for empty
10879 claimed file.
10880
b0074644
ILT
108812008-12-12 Ian Lance Taylor <iant@google.com>
10882
68943102
ILT
10883 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
10884 r_type == 0 for a local symbol with r_sym == 0.
10885 (scan_relocatable_relocs): Pass r_sym to
10886 local_non_section_strategy.
10887 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
10888 r_sym parameter.
10889
b0074644
ILT
10890 * configure.ac: Update test for TLS descriptors: they are
10891 supported as of glibc 2.9.
10892 * configure: Rebuild.
10893
c2508178
ILT
108942008-12-11 Ian Lance Taylor <iant@google.com>
10895
10896 PR 7091
10897 * target-reloc.h (Default_scan_relocatable_relocs): For each
10898 function, map r_type == 0 to RELOC_DISCARD.
10899
2756a258
CC
109002008-12-10 Cary Coutant <ccoutant@google.com>
10901
10902 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
10903 object to override a kept COMDAT group from a plugin object.
10904
bb6f53d3
ILT
109052008-12-09 Ian Lance Taylor <iant@google.com>
10906
fbc558e1
ILT
10907 PR 7088
10908 * yyscript.y (file_cmd): Handle INPUT.
10909
bb6f53d3
ILT
10910 * testsuite/initpri1.c: Change all declarations to be full
10911 prototypes by adding void, to avoid compiler warnings.
10912
4674ecfc
CC
109132008-12-05 Rafael Avila de Espindola <espindola@google.com>
10914
10915 * options.cc (General_options::parse_plugin_opt): New.
10916 (General_options::add_plugin): The argument now is just the filename.
10917 (General_options::add_plugin_option): New.
10918 * options.h (plugin_opt): New.
10919 (add_plugin): Change argument name.
10920 (add_plugin_option): New.
10921 * plugin.cc (Plugin::load): Don't parse the plugin option.
10922 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
10923 (Plugin::add_option): New.
10924 (Plugin::args_): Change type.
10925 (Plugin::filename_): New.
10926 (Plugin_manager::add_plugin_option): New.
10927 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
10928 * testsuite/Makefile.in: Regenerate.
10929
fd06b4aa
CC
109302008-12-05 Cary Coutant <ccoutant@google.com>
10931
10932 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
10933 Handle --strip-lto-sections option.
10934 * options.h (strip_lto_sections): New option.
10935
6c52134c
CC
109362008-12-01 Cary Coutant <ccoutant@google.com>
10937
10938 * plugin.cc (ld_plugin_message): Change format parameter to const.
10939 Fix mismatch between new[] and delete.
10940
a45248e0
CC
109412008-11-14 Cary Coutant <ccoutant@google.com>
10942
10943 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
10944 instead of -1U.
10945
c82fbeee
CS
109462008-11-05 Craig Silverstein <csilvers@google.com>
10947
10948 * options.cc (General_options::parse_dynamic_list): New function.
10949 * options.h (General_options): New flags dynamic_list,
10950 dynamic_list_data, dynamic_list_cpp_new, and
10951 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
10952 (General_options::in_dynamic_list): New function.
10953 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
10954 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
10955 (Lex::can_continue_name): Likewise.
10956 (yylex): Likewise.
10957 (read_script_file): New parameter script_options.
10958 (read_dynamic_list): New function.
10959 (Script_options::define_dynamic_list): New function.
10960 (dynamic_list_keyword_parsecodes): New variable.
10961 (dynamic_list_keywords): New variable.
10962 * script.h (Script_options::define_dynamic_list): New function
10963 prototype.
10964 (read_dynamic_list): New function prototype.
10965 * symtab.cc (strprefix): New macro.
10966 (Symbol::should_add_dynsym_entry): Support dynamic_list,
10967 dynamic_list_data, dynamic_list_cpp_new, and
10968 dynamic_list_cpp_typeinfo.
10969 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
10970 (dynamic_list_expr): New rule.
10971 (dynamic_list_nodes): Likewise.
10972 (dynamic_list_node): Likewise.
10973 * testsuite/Makefile.am (dynamic_list): New test.
10974 * testsuite/Makefile.in: Regenerated.
10975 * testsuite/dynamic_list.t: New file.
10976 * testsuite/dynamic_list.sh: New file.
10977
e0bb29a5
CS
109782008-11-05 Craig Silverstein <csilvers@google.com>
10979
10980 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
10981 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
10982 (t11_last): Likewise.
10983 * testsuite/ver_test_6.c (main): Likewise.
10984
4e1e25e0
CC
109852008-10-07 Cary Coutant <ccoutant@google.com>
10986
10987 * options.c (General_options::finalize): Add check for -static and
10988 -shared.
10989 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
10990 is not empty.
10991
92f03fcb
CC
109922008-10-02 Cary Coutant <ccoutant@google.com>
10993
10994 * plugin.cc (make_sized_plugin_object): Fix conditional
10995 compilation to work when not all targets are enabled.
10996
fbd8a257
CC
109972008-09-29 Cary Coutant <ccoutant@google.com>
10998
10999 * archive.cc (Archive::get_file_and_offset): Use filename instead
11000 of name to get library path.
11001 (Archive::include_member): Unlock external member of a thin archive.
11002
11003 * testsuite/Makefile.am (TEST_AR): New variable.
11004 (thin_archive_test_1): New test.
11005 (thin_archive_test_2): New test.
81636b3f
CC
11006 * testsuite/Makefile.in: Regenerate.
11007 * testsuite/thin_archive_main.cc: New file.
11008 * testsuite/thin_archive_test_1.cc: New file.
11009 * testsuite/thin_archive_test_2.cc: New file.
11010 * testsuite/thin_archive_test_3.cc: New file.
11011 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 11012
eff45813
CC
110132008-09-29 Cary Coutant <ccoutant@google.com>
11014
11015 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
11016 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
11017 instead of -1U.
11018 (Sized_relobj::do_finalize_local_symbols): Likewise.
11019 (Sized_relobj::map_to_kept_section): Likewise.
11020 * object.h (Sized_relobj::invalid_address): New constant.
11021 (Sized_relobj::do_output_section_offset): Check for invalid_address
11022 and return -1ULL.
11023 * output.cc (Output_reloc::local_section_offset): Use constant
11024 invalid_address instead of -1U.
11025 (Output_reloc::get_address): Likewise.
11026 (Output_section::output_address): Change -1U to -1ULL.
11027 * output.h (Output_reloc::invalid_address): New constant.
11028 * reloc.cc (Sized_relobj::write_sections): Use constant
11029 invalid_address instead of -1U.
11030 (Sized_relobj::relocate_sections): Likewise.
11031 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
11032 values for merge sections.
11033 * target-reloc.h (relocate_for_relocatable): Use constant
11034 invalid_address instead of -1U.
11035
89fc3421
CC
110362008-09-19 Cary Coutant <ccoutant@google.com>
11037
11038 Add plugin functionality for link-time optimization (LTO).
11039 * configure.ac (plugins): Add --enable-plugins option.
11040 * configure: Regenerate.
11041 * config.in: Regenerate.
11042 * Makefile.am (LIBDL): New variable.
11043 (CCFILES): Add plugin.cc.
11044 (HFILES): Add plugin.h.
11045 (ldadd_var): Add LIBDL.
11046 * Makefile.in: Regenerate.
11047
11048 * archive.cc: Include "plugin.h".
11049 (Archive::setup): Don't preread archive symbols when using a plugin.
11050 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
11051 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
11052 files.
11053 (Archive::include_member): Add symbols from plugin objects.
11054 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
11055 * descriptors.cc (Descriptors::open): Check for file descriptors
11056 abandoned by plugins.
11057 (Descriptors::claim_for_plugin): New function.
11058 * descriptors.h (Descriptors::claim_for_plugin): New function.
11059 (Open_descriptor::is_claimed): New field.
11060 (claim_descriptor_for_plugin): New function.
11061 * fileread.cc (File_read::claim_for_plugin): New function.
11062 * fileread.h (File_read::claim_for_plugin): New function.
11063 (File_read::descriptor): New function.
11064 * gold.cc: Include "plugin.h".
11065 (queue_initial_tasks): Add task to call plugin hooks for generating
11066 new object files.
11067 * main.cc: Include "plugin.h".
11068 (main): Load plugin libraries.
11069 * object.h (Pluginobj): Declare.
11070 (Object::pluginobj): New function.
11071 (Object::do_pluginobj): New function.
11072 (Object::set_target): New function.
11073 * options.cc: Include "plugin.h".
11074 (General_options::parse_plugin): New function.
11075 (General_options::General_options): Initialize plugins_ field.
11076 (General_options::add_plugin): New function.
11077 * options.h (Plugin_manager): Declare.
11078 (General_options): Add --plugin option.
11079 (General_options::has_plugins): New function.
11080 (General_options::plugins): New function.
11081 (General_options::add_plugin): New function.
11082 (General_options::plugins_): New field.
11083 * plugin.cc: New file.
11084 * plugin.h: New file.
11085 * readsyms.cc: Include "plugin.h".
11086 (Read_symbols::do_read_symbols): Check for archive before checking
11087 for ELF file. Call plugin hooks to claim files.
11088 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
11089 from a real object file; force override when processing replacement
11090 files.
11091 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
11092 (Symbol::init_base_object): Likewise.
11093 (Symbol::init_base_output_data): Likewise.
11094 (Symbol::init_base_output_segment): Likewise.
11095 (Symbol::init_base_constant): Likewise.
11096 (Symbol::init_base_undefined): Likewise.
11097 (Symbol::output_section): Assert that object is not a plugin.
11098 (Symbol_table::add_from_pluginobj): New function.
11099 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
11100 undefined.
11101 (Symbol_table::sized_write_globals): Likewise.
11102 (Symbol_table::add_from_pluginobj): Instantiate template.
11103 * symtab.h (Sized_pluginobj): Declare.
11104 (Symbol::in_real_elf): New function.
11105 (Symbol::set_in_real_elf): New function.
11106 (Symbol::in_real_elf_): New field.
11107 (Symbol_table::add_from_pluginobj): New function.
11108
11109 * testsuite/Makefile.am (AM_CFLAGS): New variable.
11110 (LIBDL): New variable.
11111 (LDADD): Add LIBDL.
11112 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
11113 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
11114 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
11115 (MOSTLYCLEANFILES): Likewise.
11116 * testsuite/Makefile.in: Regenerate.
11117 * testsuite/plugin_test.c: New file.
11118 * testsuite/plugin_test_1.sh: New file.
11119 * testsuite/plugin_test_2.sh: New file.
11120
de31bda5
ILT
111212008-09-16 Ian Lance Taylor <iant@google.com>
11122
9c2d0ef9
ILT
11123 * target-reloc.h (relocate_section): Check whether a symbol is
11124 defined by the ABI before reporting an undefined symbol error.
11125 * target.h (Target::is_defined_by_abi): Make parameter const.
11126 (Target::do_is_defined_by_abi): Likewise.
11127 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
11128 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
11129 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
11130 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
11131 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
11132 * testsuite/Makefile.in: Rebuild.
11133
de31bda5
ILT
11134 * fileread.cc (make_view): Add casts to avoid warning.
11135
9fa33bee
AO
111362008-09-16 Alexandre Oliva <aoliva@redhat.com>
11137
11138 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
11139 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11140
183fd0e3
AO
111412008-09-16 Alexandre Oliva <aoliva@redhat.com>
11142
11143 * options.h (General_options::output_is_executable): New.
11144 (General_options::output_is_pie): New.
11145 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
11146 for shared libraries.
11147 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11148
7be8330a
CD
111492008-09-11 Chris Demetriou <cgd@google.com>
11150
11151 * options.h (origin): New -z option.
11152 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
11153 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
11154 in DT_FLAGS_1.
11155
a9caad02
CC
111562008-09-05 Cary Coutant <ccoutant@google.com>
11157
11158 * fileread.cc (File_read::make_view): Add check for attempt to map
11159 beyond end of file.
11160
ae6dce4d
CC
111612008-09-05 Cary Coutant <ccoutant@google.com>
11162
11163 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
11164 explicit instantiations.
11165
d7ab2a47
KVH
111662008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
11167
11168 PR gold/6858
11169 * options.cc (General_options::finalize): Allow undefined symbols
11170 in shlibs if linking -shared.
11171
11172 PR gold/6859
11173 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
11174 symbols as not needing a dynsym entry.
11175
1e52a9c1
CS
111762008-08-20 Craig Silverstein <csilvers@google.com>
11177
11178 * fileread.cc (File_read::open): Do not lock the file unless it
11179 was successfully opened.
11180
d85c80a3
CC
111812008-08-14 Cary Coutant <ccoutant@google.com>
11182
11183 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
11184 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
11185 * testsuite/tls_test.cc (struct int128): 128-bit struct
11186 for testing TLS relocs with non-zero addend.
11187 (v12): New TLS variable.
11188 (t12): New test.
11189 (t_last): Add check for v12.
11190 * testsuite/tls_test.h (t12): New function.
11191 * testsuite/tls_test_main.cc (thread_routine): Call new test.
11192
2d924fd9
ILT
111932008-08-13 Ian Lance Taylor <iant@google.com>
11194
11195 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
11196 set tls_segment_ or relro_segment_.
11197 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
11198 when appropriate.
11199 * output.h (Output_section::clear_is_relro): New function.
11200 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
11201 sections specially even when output_data_ is empty.
11202 (Output_segment::maximum_alignment): When first section is relro,
11203 only force alignment for PT_LOAD segments.
11204 * script.cc (script_data_segment_align): New function.
11205 (script_data_segment_relro_end): New function.
11206 * script-c.h (script_data_segment_align): Declare.
11207 (script_data_segment_relro_end): Declare.
11208 * script-sections.h (class Script_sections): Declare
11209 data_segment_align and data_segment_relro_end. Add fields
11210 segment_align_index_ and saw_relro_end_.
11211 * script-sections.cc (class Sections_element): Add set_is_relro
11212 virtual function. Add new bool* parameter to place_orphan_here.
11213 Add get_output_section virtual function.
11214 (class Output_section_definition): Add set_is_relro. Add new
11215 bool* parameter to place_orphan_here. Add get_output_section.
11216 Add is_relro_ field.
11217 (Output_section_definition::Output_section_definition): Initialize
11218 evaluated_address_, evaluated_load_address, evaluated_addralign_,
11219 and is_relro_ fields.
11220 (Output_section_definition::place_orphan_here): Add is_relro
11221 parameter.
11222 (Output_section_definition::set_section_addresses): Set relro for
11223 output section.
11224 (Output_section_definition::alternate_constraint): Likewise.
11225 (class Orphan_output_section): Add new bool* parameter to
11226 place_orphan_here. Add get_output_section.
11227 (Orphan_output_section::place_orphan_here): Add is_relro
11228 parameter.
11229 (Script_sections::Script_sections): Initialize
11230 data_segment_align_index_ and saw_relro_end_.
11231 (Script_sections::data_segment_align): New function.
11232 (Script_sections::data_segment_relro_end): New function.
11233 (Script_sections::place_orphan): Set or clear is_relro.
11234 (Script_sections::set_section_addresses): Force alignment of first
11235 TLS section.
11236 * yyscript.y (exp): Call script_data_segment_align and
11237 script_data_segment_relro_end.
11238 * testsuite/relro_script_test.t: New file.
11239 * testsuite/relro_test.cc (using_script): Declare.
11240 (t1, t2): Test using_script.
11241 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
11242 (relro_script_test_SOURCES): Define.
11243 (relro_script_test_DEPENDENCIES): Define.
11244 (relro_script_test_LDFLAGS): Define.
11245 (relro_script_test_LDADD): Define.
11246 (relro_script_test.so): New target.
11247 * testsuite/Makefile.in: Rebuild.
11248
f827c9a9
CC
112492008-08-06 Cary Coutant <ccoutant@google.com>
11250
11251 * archive.cc (Archive::total_archives, Archive::total_members)
11252 (Archive::total_members_loaded): New variables.
11253 (Archive::setup): Add parameter. Add option to preread
11254 archive symbols.
11255 (Archive::read_armap): Add counter.
11256 (Archive::get_file_and_offset): New function.
11257 (Archive::get_elf_object_for_member): New function.
11258 (Archive::read_all_symbols): New function.
11259 (Archive::read_symbols): New function.
11260 (Archive::add_symbols): Add counters.
11261 (Archive::include_all_members): Use armap to find members if it's
11262 already built.
11263 (Archive::include_member): Skip reading symbols if already read.
11264 Factored code into Archive::get_file_and_offset and
11265 Archive::get_elf_object_for_member. Changed call to
11266 Mapfile::report_include_archive_member.
11267 (Archive::print_stats): New function.
11268 * archive.h: Declare Object and Read_symbols_data classes.
11269 (Archive::Archive): Add initializers for new members.
11270 (Archive::setup): Add parameter.
11271 (Archive::print_stats): New function.
11272 (Archive::total_archives, Archive::total_members)
11273 (Archive::total_members_loaded): New variables.
11274 (Archive::get_file_and_offset): New function.
11275 (Archive::get_elf_object_for_member): New function.
11276 (Archive::read_all_symbols): New function.
11277 (Archive::read_symbols): New function.
11278 (Archive::Archive_member): New class.
11279 (Archive::members_): New member.
11280 (Archive::num_members_): New member.
11281 * main.cc: Include archive.h.
11282 (main): Call Archive::print_stats.
11283 * mapfile.cc (Mapfile::report_include_archive_member): Delete
11284 archive parameter; member_name is now the fully-decorated name.
11285 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
11286 * options.h: (General_options): Add --preread-archive-symbols option.
11287 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
11288 Archive::setup.
11289
de4c45bd
ILT
112902008-08-04 Ian Lance Taylor <iant@google.com>
11291
11292 * symtab.h (Symbol::use_plt_offset): New function.
11293 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
11294 * powerpc.cc (Relocate::relocate): Likewise.
11295 * sparc.cc (Relocate::relocate): Likewise.
11296 * x86_64.cc (Relocate::relocate): Likewise.
11297 * testsuite/weak_plt.sh: New test.
11298 * testsuite/weak_plt_main.cc: New test.
11299 * testsuite/weak_plt_shared.cc: New test.
11300 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
11301 (check_PROGRAMS): Add weak_plt.
11302 (check_DATA): Add weak_plt_shared.so.
11303 (weak_plt_main_pic.o, weak_plt): New targets.
11304 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
11305 * testsuite/Makefile.in: Rebuild.
11306
11307 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
11308 gcctestdir/ld.
11309 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
11310 * testsuite/Makefile.in: Rebuild.
11311
323ee3f4
AM
113122008-08-04 Alan Modra <amodra@bigpond.net.au>
11313
11314 * Makefile.am (POTFILES.in): Set LC_ALL=C.
11315 * Makefile.in: Regenerate.
11316 * po/POTFILES.in: Regenerate.
11317
7c07ecec
ILT
113182008-07-29 Ian Lance Taylor <iant@google.com>
11319
11320 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
11321 symbols before other symbols.
11322 * testsuite/script_test_2.cc (test_addr): Declare.
11323 (test_addr_alias): Declare.
11324 (main): Check that test_addr and test_addr_alias have the right
cd536b21 11325 values.
7c07ecec
ILT
11326 * testsuite/script_test_2.t: Define test_addr_alias and
11327 test_addr.
11328
5778530e
ILT
113292008-07-24 Ian Lance Taylor <iant@google.com>
11330
2a00e4fb
ILT
11331 PR 5990
11332 * descriptors.cc: New file.
11333 * descriptors.h: New file.
11334 * gold-threads.h (class Hold_optional_lock): New class.
11335 * fileread.cc: Include "descriptors.h".
11336 (File_read::~File_read): Release descriptor rather than closing
11337 it.
11338 (File_read::open) [file]: Call open_descriptor rather than open.
11339 Set is_descriptor_opened_.
11340 (File_read::open) [memory]: Assert that descriptor is not open.
11341 (File_read::reopen_descriptor): New function.
11342 (File_read::release): Release descriptor.
11343 (File_read::do_read): Make non-const. Reopen descriptor.
11344 (File_read::read): Make non-const.
11345 (File_read::make_view): Reopen descriptor.
11346 (File_read::do_readv): Likewise.
11347 * fileread.h (class File_read): Add is_descriptor_opened_ field.
11348 Update declarations.
11349 * layout.cc: Include "descriptors.h".
11350 (Layout::create_build_id): Use open_descriptor rather than open.
11351 * output.cc: Include "descriptors.h".
11352 (Output_file::open): Use open_descriptor rather than open.
11353 * archive.cc (Archive::const_iterator): Change Archive to be
11354 non-const.
11355 (Archive::begin, Archive::end): Make non-const.
11356 (Archive::count_members): Likewise.
11357 * archive.h (class Archive): Update declarations.
11358 * object.h (Object::read): Make non-const.
11359 * Makefile.am (CCFILES): Add descriptors.cc.
11360 (HFILES): Add descriptors.h.
11361 * Makefile.in: Rebuild.
11362
801647d1
ILT
11363 PR 6716
11364 * gold.h: Always include <clocale>. Add Solaris workarounds
11365 following code in binutils/sysdep.h.
11366
5edd166e
ILT
11367 PR 6048
11368 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
11369 this->eh_frame_hdr_ is NULL before using it.
11370
c89ad728
ILT
11371 * dynobj.cc (Versions::Versions): Update comment.
11372
aa86f06b
ILT
11373 * dynobj.cc (Versions::Versions): If there is an soname, use it as
11374 the base version name.
11375
5778530e
ILT
11376 * stringpool.cc (Stringpool_template::add_with_length): Set key to
11377 array size plus one.
11378 (Stringpool_template::set_string_offsets): Subtract one from key
11379 before using it as an array index.
11380 (Stringpool_template::get_offset_with_length): Likewise.
11381 (Stringpool_template::write_to_buffer): Likewise.
11382 * stringpool.h (Stringpool_template::get_offset_from_key):
11383 Likewise.
11384
057ead22
ILT
113852008-07-23 Ian Lance Taylor <iant@google.com>
11386
7f649c59
ILT
11387 PR 6658
11388 * object.h (Merged_symbol_value::value): Do our best to handle a
11389 negative addend.
11390
057ead22
ILT
11391 PR 6647
11392 * script.cc (Version_script_info::get_versions): Don't add empty
11393 version tag to return value.
11394 (Version_script_info::get_symbol_version_helper): Change return
11395 type to bool. Add pversion parameter. Change all callers.
11396 (script_register_vers_node): Don't require a non-NULL tag.
11397 * script.h (class Version_script_info): Update declarations.
11398 (Version_script_info::get_symbol_version): Change return type to
11399 bool. Add version parameter. Change all callers.
11400 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
11401 handling. Handle an empty version from a version script.
11402 (Symbol_table::define_special_symbol): Likewise.
11403 * testsuite/ver_test_10.script: New file.
11404 * testsuite/ver_test_10.sh: New file.
11405 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
11406 (check_DATA): Add ver_test_10.syms.
11407 (ver_test_10.syms, ver_test_10.so): New target.
11408 * testsuite/Makefile.in: Rebuild.
11409
58e54ac2
CD
114102008-07-23 Simon Baldwin <simonb@google.com>
11411
11412 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
11413 to zero for undefined symbols from dynamic libraries.
11414
95d14cd3
ILT
114152008-07-23 Ian Lance Taylor <iant@google.com>
11416
11417 * symtab.cc (Symbol_table::resolve): Remove version parameter.
11418 Change all callers.
11419 * symtab.h (class Symbol_table): Update declaration.
11420 * testsuite/ver_test_9.cc: New file.
11421 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
11422 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
11423 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
11424 (ver_test_9.so, ver_test_9.o): New targets.
11425 * testsuite/Makefile.in: Rebuild.
11426
92de84a6
ILT
114272008-07-22 Ian Lance Taylor <iant@google.com>
11428
34810851
ILT
11429 * options.h (class General_options): Define --check-sections.
11430 * layout.cc (Layout::set_segment_offsets): Handle
11431 --check-sections.
11432
af6156ef
ILT
11433 * options.h (class General_options): Define -n/--nmagic and
11434 -N/--omagic.
11435 * options.cc (General_options::finalize): For -n/--nmagic or
11436 -N/--omagic, set -static.
11437 * layout.cc (Layout::attach_allocated_section_to_segment): If
11438 -N/--omagic, don't put read-only and read-write sections in
11439 different segments.
11440 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
11441 finding a read-only segment.
11442 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
11443 don't set the minimum segment alignment to the common page size,
11444 and don't set the file offset to the address modulo the page size.
11445 * script-sections.cc (Script_sections::create_segments): If
11446 -n/--omagic, don't put read-only and read-write sections in
11447 different segments.
11448
92de84a6
ILT
11449 * cref.cc: New file.
11450 * cref.h: New file.
11451 * options.h (class General_options): Add --print-symbol-counts.
11452 * main.cc (main): Issue defined symbol report if requested.
11453 * archive.cc (Archive::interpret_header): Make into a const member
11454 function.
11455 (Archive::add_symbols): Call Input_objects::archive_start and
11456 archive_stop.
11457 (Archive::const_iterator): Define new class.
11458 (Archive::begin, Archive::end): New functions.
11459 (Archive::include_all_members): Rewrite to use iterator.
11460 (Archive::count_members): New function.
11461 * archive.h (class Archive): Update declarations.
11462 (Archive::filename): New function.
11463 * object.cc: Include "cref.h".
11464 (Sized_relobj::Sized_relobj): Initialize defined_count_.
11465 (Sized_relobj::do_get_global_symbol_counts): New function.
11466 (Input_objects::add_object): Add object to cross-referencer.
11467 (Input_objects::archive_start): New function.
11468 (Input_objects::archive_stop): New function.
11469 (Input_objects::print_symbol_counts): New function.
11470 * object.h: Declare Cref and Archive.
11471 (Object::get_global_symbol_counts): New function.
11472 (Object::do_get_global_symbol_counts): New pure virtual function.
11473 (class Sized_relobj): Add defined_count_ field. Update
11474 declarations.
11475 (class Input_objects): Add cref_ field. Update constructor.
11476 Update declarations.
11477 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
11478 defined_count_.
11479 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
11480 symbol counts.
11481 (Sized_dynobj::do_get_global_symbol_counts): New function.
11482 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
11483 defined_count_. Update declarations. Define Symbols typedef.
11484 * symtab.cc (Symbol_table::add_from_relobj): Add defined
11485 parameter. Change all callers.
11486 (Symbol_table::add_from_dynobj): Add sympointers and defined
11487 parameters. Change all callers.
11488 * symtab.h (class Symbol_table): Update declarations.
11489 * Makefile.am (CCFILES): Add cref.cc.
11490 (HFILES): Add cref.h.
11491 * Makefile.in: Rebuild.
11492
3f7c5e1d
CD
114932008-07-22 Simon Baldwin <simonb@google.com>
11494
11495 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
11496 to zero when writing undefined symbols.
11497
e0b64032
ILT
114982008-07-22 Ian Lance Taylor <iant@google.com>
11499
11500 * output.cc (Output_section::add_input_section): Don't try to
11501 merge empty merge sections.
11502
096b02cf
CS
115032008-07-21 Craig Silverstein <csilvers@google.com>
11504
11505 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
11506 Include symbol version in error message.
cd536b21 11507
1d1f116d
CD
115082008-07-20 Chris Demetriou <cgd@google.com>
11509
cd536b21 11510 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
11511 (RANDOM_SEED_CFLAGS): New substituted variable.
11512 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
11513 * configure: Rebuild.
11514 * Makefile.in: Likewise.
11515 * testsuite/Makefile.in: Likewise.
11516
a18f591e
ILT
115172008-07-18 Ian Lance Taylor <iant@google.com>
11518
11519 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
11520 where we see NAME/NULL and NAME/VERSION as separate symbols.
11521 * testsuite/ver_test_main.cc (main): Call t4.
11522 (t4, t4_2a): Define.
11523 * testsuite/ver_test_2.cc (t4_2): Define.
11524 * testsuite/ver_test_2.script: Put t4_2a in VER2.
11525 * testsuite/ver_test_4.cc (t4_2a): Define.
11526 * testsuite/ver_test_4.script: Put t4_2a in VER2.
11527 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
11528
c6e3f6ed
ILT
115292008-07-17 Ian Lance Taylor <iant@google.com>
11530
11531 * dynobj.cc (Versions::add_def): If we give an error about a
11532 missing version, go ahead and create the version anyhow.
11533
ef9beddf
ILT
115342008-07-10 Ian Lance Taylor <iant@google.com>
11535
11536 Handle output sections with more than 0x7fffffff bytes.
11537 * object.h (class Relobj): Change map_to_output_ to
11538 output_sections_, and just keep a section pointer. Change all
11539 uses. Move comdat group support to Sized_relobj.
11540 (Relobj::is_section_specially_mapped): Remove.
11541 (Relobj::output_section): Remove poff parameter. Change all
11542 callers.
11543 (Relobj::output_section_offset): New function.
11544 (Relobj::set_section_offset): Rewrite.
11545 (Relobj::map_to_output): Remove.
11546 (Relobj::output_sections): New function.
11547 (Relobj::do_output_section_offset): New pure virtual function.
11548 (Relobj::do_set_section_offset): Likewise.
11549 (class Sized_relobj): Add section_offsets_ field. Add comdat
11550 group support from Relobj. Update declarations.
11551 (Sized_relobj::get_output_section_offset): New function.
11552 (Sized_relobj::do_output_section_offset): New function.
11553 (Sized_relobj::do_set_section_offset): New function.
11554 * object.cc (Relobj::output_section_address): Remove.
11555 (Sized_relobj::Sized_relobj): Initialize new fields.
11556 (Sized_relobj::include_section_group): Cast find_kept_object to
11557 Sized_relobj.
11558 (Sized_relobj::include_linkonce_section): Likewise.
11559 (Sized_relobj::do_layout): Use separate arrays for output section
11560 and output offset.
11561 (Sized_relobj::do_count_local_symbols): Change map_to_output to
11562 output_sections.
11563 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
11564 output_sections and section_offsets.
11565 (Sized_relobj::write_local_symbols): Likewise.
11566 (map_to_kept_section): Compute output address directly.
11567 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
11568 output_sections and section_offsets.
11569 (Sized_relobj::write_sections): Likewise.
11570 (Sized_relobj::relocate_sections): Likewise.
11571 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
11572 * output.h (class Output_reloc): Update declarations. Change
11573 u2_.relobj to Sized_relobj*.
11574 (class Output_data_reloc): Change add functions to use
11575 Sized_relobj*.
11576 * output.cc (Output_reloc::Output_reloc): Change relobj to
11577 Sized_relobj*.
11578 (Output_reloc::local_section_offset): Change return type to
11579 Elf_Addr. Use get_output_section_offset.
11580 (Output_reloc::get_address): Likewise.
11581 (Output_section::is_input_address_mapped): Don't call
11582 is_section_specially_mapped.
11583 (Output_section::output_offset): Likewise.
11584 (Output_section::output_address): Likewise.
11585 (Output_section::starting_output_address): Likewise.
11586 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
11587 parameter to Sized_relobj*.
11588 (Copy_relocs::need_copy_reloc): Likewise.
11589 (Copy_relocs::save): Likewise.
11590 * copy-relocs.h (class Copy_relocs): Update declarations.
11591 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
11592 Sized_relobj*. Change relobj_ field to Sized_relobj*.
11593 * target-reloc.h (relocate_for_relocatable): Change
11594 offset_in_output_section type to Elf_Addr. Change code that uses
11595 it as well.
11596 * layout.cc (Layout::layout): Always set *off.
11597 * mapfile.cc (Mapfile::print_input_section): Use
11598 output_section_offset.
11599 * i386.cc (Target_i386::copy_reloc): Change object parameter to
11600 Sized_relobj*.
11601 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
11602 * sparc.cc (Target_sparc::copy_reloc): Likewise.
11603 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
11604
5cb66f97
ILT
116052008-07-03 Ian Lance Taylor <iant@google.com>
11606
11607 * layout.cc (Layout::include_section): Do not discard unrecognized
11608 SHT_STRTAB sections.
11609
afe47622
CS
116102008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
11611
11612 * script.cc (Lex::can_continue_name): Make '?' allowable in
11613 version-script names.
11614 * testsuite/version_script.map: Change glob pattern to use '?'
11615
5adf9721
ILT
116162008-06-30 Manish Singh <yosh@gimp.org>
11617
11618 PR 6585
11619 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
11620 Correct typo.
11621
e6fde208
ILT
116222008-06-30 Ian Lance Taylor <iant@google.com>
11623
11624 PR 6660
11625 PR 6682
11626 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
11627 versions]: Don't try to read the value in the contents, since we
11628 don't use it. Use the template endianness when writing.
11629
3f2e6a2d
CC
116302008-06-25 Cary Coutant <ccoutant@google.com>
11631
11632 * fileread.cc (File_read::make_view): Assert on zero-length view.
11633 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
11634 symbol table when there are no symbols to read.
11635
c43d3a48
CS
116362008-06-23 Craig Silverstein <csilvers@google.com>
11637
11638 * version.cc (version_string): Bump to 1.7
11639
5f494ea0
CS
116402008-06-18 Craig Silverstein <csilvers@google.com>
11641
11642 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
11643 constant 0xFFFF to type Valtype.
11644 (Powerpc_relocate_functions::rel16_ha): Likewise.
11645
c42e122e
ILT
116462008-06-17 Ian Lance Taylor <iant@google.com>
11647
f34787f8
ILT
11648 * output.h (Output_section::Input_section): Initialize p2align_ to
11649 zero for Output_section_data constructors.
11650 (Output_section::Input_section::addralign): If not an input
11651 section, return the alignment of the Output_section_data.
11652 * testsuite/copy_test.cc: New file.
11653 * testsuite/copy_test_1.cc: New file.
11654 * testsuite/copy_test_2.cc: New file.
11655 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
11656 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
11657 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
11658 (copy_test_1_pic.o, copy_test_1.so): New targets.
11659 (copy_test_2_pic.o, copy_test_2.so): New targets.
11660 * testsuite/Makefile.in: Rebuild.
11661
c42e122e
ILT
11662 * script-sections.cc (Script_sections::place_orphan): Initialize
11663 local variable exact.
11664
ce3ac18a
DE
116652008-06-13 David Edelsohn <edelsohn@gnu.org>
11666
11667 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
11668
42cacb20
DE
116692008-06-12 David Edelsohn <edelsohn@gnu.org>
11670 David S. Miller <davem@davemloft.net>
11671
11672 * powerpc.cc: New file.
11673 * Makefile.am (TARGETSOURCES): Add powerpc.cc
11674 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
11675 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
11676 * Makefile.in: Rebuild.
11677
7b308235
ILT
116782008-06-09 Ian Lance Taylor <iant@google.com>
11679
11680 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
11681 <exception>.
11682 (throwing, orig_terminate): New static variables.
11683 (terminate_handler): New static function.
11684 (t2): Set terminate handler.
11685
f0b886e3
ILT
116862008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
11687
11688 PR 6584
cd536b21 11689 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
11690 alignment.
11691
3e90f135
CC
116922008-05-30 Cary Coutant <ccoutant@google.com>
11693
11694 * archive.cc (Archive::include_all_members) Correct to step
11695 over symbol table and extended name table in thin archives.
11696
e09ad04a
ILT
116972008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
11698
11699 PR 6407
11700 * target-reloc.h (relocate_for_relocatable): Fix new_offset
11701 calculation.
11702
62b01cb5
ILT
117032008-05-28 Caleb Howe <cshowe@google.com>
11704
11705 * reduced_debug_output.cc: New file.
11706 * reduced_debug_output.h: New file.
92de84a6 11707 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
11708 * options.cc (General_options::finalize): Add strip_debug_non_line
11709 to the strip heirarchy.
11710 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
11711 fields.
11712 * layout.cc: Include "reduced_debug_output.h".
11713 (Layout::Layout): Initialize new fields.
11714 (line_only_debug_sections): New static array.
11715 (is_lines_only_debug_sections): New static inline function.
11716 (Layout::include_section): Handle --strip-debug-non-line.
11717 (Layout::make_output_section): If --strip-debug-non-line, build
11718 new output sections for .debug_abbrev and .debug_info.
11719 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
11720 gold. Warn about possible overflow.
11721 (read_signed_LEB_128): Likewise.
11722 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
11723 (read_signed_LEB_128): Declare.
11724 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
11725 (HFILES): Add reduced_debug_output.h.
11726 * Makefile.in: Rebuild.
11727
7d9e3d98
ILT
117282008-05-21 Ian Lance Taylor <iant@google.com>
11729
11730 * mapfile.cc: New file.
11731 * mapfile.h: New file.
11732 * options.h (class General_options): Add -M/--print-map and -Map.
11733 * options.cc (General_options::finalize): Make -M equivalent to
11734 -Map -.
11735 * main.cc: Include <cstdio> and "mapfile.h".
11736 (main): Open mapfile if requested.
11737 * gold.cc (class Middle_runner): Add mapfile_ field. Update
11738 constructor. Change caller.
11739 (queue_initial_tasks): Add mapfile parameter. Change caller.
11740 (queue_middle_tasks): Likewise.
11741 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
11742 declarations.
11743 * archive.cc: Include "mapfile.h".
11744 (Archive::add_symbols): Add mapfile parameter. Change all
11745 callers. Pass mapfile, symbol, and reason to include_member.
11746 (Archive::include_all_members): Add mapfile parameter. Change all
11747 callers.
11748 (Archive::include_member): Add mapfile, sym, and why parameters.
11749 Change all callers. Report inclusion to map file.
11750 * archive.h: Include "fileread.h".
11751 (class Archive): Update declarations.
11752 (Archive::file): New const method.
11753 (class Add_archive_symbols): Add mapfile_ field. Update
11754 constructor. Change all callers.
11755 * readsyms.h (class Read_symbols): Likewise.
11756 (class Finish_group): Likewise.
11757 (class Read_script): Likewise.
11758 * common.cc: Include "mapfile.h".
11759 (Symbol_table::allocate_commons): Add mapfile parameter. Change
11760 all callers.
11761 (Symbol_table::do_allocate_commons): Likewise.
11762 (Symbol_table::do_allocate_commons_list): Likewise. Report common
11763 symbol allocation to mapfile.
11764 * common.h (class Allocate_commons_task): Add mapfile_ field.
11765 Update constructor. Change all callers.
11766 * symtab.h (class Symbol_table): Update declarations.
11767 * layout.cc: Include "mapfile.h".
11768 (Layout_task_runner::run): Print information to mapfile.
11769 (Layout::create_gold_note): Change Output_data_fixed_space to
11770 Output_data_zero_fill.
11771 (Layout::create_build_id): Likewise.
11772 (Layout::print_to_mapfile): New function.
11773 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
11774 constructor. Change caller.
11775 (class Layout): Declare print_to_mapfile.
11776 * output.cc (Output_section::Input_section::print_to_mapfile): New
11777 function.
11778 (Output_section::add_input_section): If producing a map, always
11779 add to input_sections_ list.
11780 (Output_section::do_print_to_mapfile): New function.
11781 (Output_segment::print_sections_to_mapfile): New function.
11782 (Output_segment::print_section_list_to_mapfile): New function.
11783 * output.h: Include "mapfile.h".
11784 (Output_data::print_to_mapfile): New function.
11785 (Output_data::do_print_to_mapfile): New virtual function.
11786 (Output_segment_headers::do_print_to_mapfile): New function.
11787 (Output_file_header::do_print_to_mapfile): New function.
11788 (Output_data_const::do_print_to_mapfile): New function.
11789 (class Output_data_const_buffer): Add map_name_ field. Update
11790 constructor. Change all callers. Add do_print_to_mapfile
11791 function.
11792 (class Output_data_fixed_space): Likewise.
11793 (class Output_data_space): Likewise.
11794 (class Output_data_zero_fill): New class.
11795 (Output_data_strtab::do_print_to_mapfile): New function.
11796 (Output_data_reloc_base::do_print_to_mapfile): New function.
11797 (Output_relocatable_relocs::do_print_to_mapfile): New function.
11798 (Output_data_group::do_print_to_mapfile): New function.
11799 (Output_data_got::do_print_to_mapfile): New function.
11800 (Output_data_dynamic::do_print_to_mapfile): New function.
11801 (Output_symtab_xindex::do_print_to_mapfile): New function.
11802 (class Output_section): Declare do_print_to_mapflie. Declare
11803 print_to_mapfile in Input_section.
11804 (class Output_segment): Declare new functions.
11805 * object.h (Sized_relobj::symbol_count): New function.
11806 * script-sections.cc
11807 (Output_section_element_dot_assignment::set_section_addresses):
11808 Change Output_data_fixed_space to Output_data_zero_fill.
11809 (Output_data_expression::do_print_to_mapfile): New function.
11810 * script.cc (read_input_script): Add mapfile parameter. Change
11811 all callers.
11812 * script.h (read_input_script): Update declaration.
11813 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
11814 (Eh_frame::do_print_to_mapfile): New function.
11815 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
11816 (Output_merge_string::do_print_to_mapfile): New function.
11817 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
11818 function.
11819 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
11820 function.
11821 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
11822 function.
11823 * Makefile.am (CCFILES): Add mapfile.cc.
11824 (HFILES): Add mapfile.h.
11825 * Makefile.in: Rebuild.
11826
9f1d377b
ILT
118272008-05-19 Ian Lance Taylor <iant@google.com>
11828
11829 * options.h (class General_options): Add -z relro.
11830 * layout.cc (Layout::Layout): Initialize relro_segment_.
11831 (Layout::add_output_section_data): Return the output section.
11832 (Layout::make_output_section): Rcognize relro sections and mark
11833 them appropriately.
11834 (Layout::attach_allocated_section_to_segment): Put relro sections
11835 in a PT_GNU_RELRO segment.
11836 (Layout::create_initial_dynamic_sections): Mark the .dynamic
11837 section as relro.
11838 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
11839 PT_TLS segments.
11840 (Layout::linkonce_mapping): Map d.rel.ro.local to
11841 .data.rel.ro.local.
11842 (Layout::output_section_name): Us .data.rel.ro.local for any
11843 section which begins with that.
11844 * layout.h (class Layout): Update add_output_section_data
11845 declaration. Add relro_segment_ field.
11846 * output.cc (Output_section::Output_section): Initialize is_relro_
11847 and is_relro_local_ fields.
11848 (Output_segment::add_output_section): Group relro sections.
11849 (Output_segment::is_first_section_relro): New function.
11850 (Output_segment::maximum_alignment): If there is a relro section,
11851 align the segment to the common page size.
11852 (Output_segment::set_section_addresses): Track whether we are
11853 looking at relro sections. If the last section is a relro
11854 section, align to the common page size.
11855 (Output_segment::set_section_list_addresses): Add in_relro
11856 parameter. Change all callers. Align to the page size when
11857 moving from relro to non-relro section.
11858 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
11859 segment.
11860 * output.h (class Output_section): Add is_relro_ and
11861 is_relro_local_ fields.
11862 (Output_section::is_relro): New function.
11863 (Output_section::set_is_relro): New function.
11864 (Output_section::is_relro_local): New function.
11865 (Output_section::set_is_relro_local): New function.
11866 (class Output_segment): Update declarations.
11867 * i386.cc (Target_i386::got_section): Mark .got section as relro.
11868 * sparc.cc (Target_sparc::got_section): Likewise.
11869 * x86_64.cc (Target_x86_64::got_section): Likewise.
11870 * testsuite/relro_test_main.cc: New file.
11871 * testsuite/relro_test.cc: New file.
11872 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
11873 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
11874 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
11875 (relro_test.so, relro_test_pic.o): New targets.
11876 * testsuite/Makefile.in: Rebuild.
11877
a984ee1d
ILT
118782008-05-16 Ian Lance Taylor <iant@google.com>
11879
01676dcd
ILT
11880 * output.cc (Output_segment::add_output_section): Remove front
11881 parameter.
11882 * output.h (class Output_segment): Remove
11883 add_initial_output_section and overloaded add_output_section.
11884 Update declaration of remaining add_output_section.
11885 * layout.cc (Layout::create_interp): Call add_output_section
11886 rather than add_initial_output_section.
11887 (Layout::finish_dynamic_section): Likewise.
11888
497897f9
ILT
11889 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
11890 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
11891 know the dynamic type.
11892 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
11893 field. Initialize it in constructor.
11894 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
11895 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
11896 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
11897 reloc.
11898
a984ee1d
ILT
11899 * output.cc (Output_reloc::get_address): Change return type to
11900 Elf_Addr.
11901 * output.h (class Output_reloc): Update get_address declaration.
11902 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
11903 for section addresses.
11904
55ba0940
ILT
119052008-05-09 Ian Lance Taylor <iant@google.com>
11906
11907 PR 6493
11908 * gold.cc (gold_nomem): Use return value of write.
11909
75517b77
ILT
119102008-05-08 Ian Lance Taylor <iant@google.com>
11911
11912 * symtab.c (Symbol::init_base_output_data): Add version
11913 parameter. Change all callers.
11914 (Symbol::init_base_output_segment): Likewise.
11915 (Symbol::init_base_constant): Likewise.
11916 (Symbol::init_base_undefined): Likewise.
11917 (Sized_symbol::init_output_data): Likewise.
11918 (Sized_symbol::init_output_segment): Likewise.
11919 (Sized_symbol::init_constant): Likewise.
11920 (Sized_symbol::init_undefined): Likewise.
11921 (Symbol_table::do_define_in_output_data): If the new symbol has a
11922 version, mark it as the default.
11923 (Symbol_table::do_define_in_output_segment): Likewise.
11924 (Symbol_table::do_define_as_constant): Likewise.
11925 * symtab.h (class Symbol): Update declarations.
11926 (class Sized_symbol): Likewise.
11927 * resolve.cc (Symbol::override_version): New function.
c42e122e 11928 (Symbol::override_base): Call override_version.
75517b77
ILT
11929 (Symbol::override_base_with_special): Likewise.
11930 * testsuite/ver_script_8.script: New file.
11931 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
11932 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
11933 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
11934 (ver_test_8_1.so, ver_test_8_2.so): New targets.
11935
f1f70eae
ILT
119362008-05-06 Ian Lance Taylor <iant@google.com>
11937
f3e9c5c5
ILT
11938 PR 6049
11939 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
11940 functions.
11941 (class General_options): Remove existing --undefined, and add
11942 --no-undefined instead. Add new --undefined as synonym for -u.
11943 * archive.cc (Archive::add_symbols): Check whether symbol was
11944 named with -u.
11945 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
11946 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
11947 all uses. Add IS_UNDEFINED. Update declarations to split
11948 different versions of init_base. Declare init_base_undefined.
11949 (Symbol::is_defined): Handle IS_UNDEFINED.
11950 (Symbol::is_undefined): Likewise.
11951 (Symbol::is_weak_undefined): Call is_undefined.
11952 (Symbol::is_absolute): Handle IS_CONSTANT.
11953 (class Sized_symbol): Update declarations to split different
11954 versions of init. Declare init_undefined.
11955 (class Symbol_table): Declare new functions.
11956 * symtab.cc (Symbol::init_base_object): Rename from init_base.
11957 Change all callers.
11958 (Symbol::init_base_output_data): Likewise.
11959 (Symbol::init_base_output_segment): Likewise.
11960 (Symbol::init_base_constant): Likewise.
11961 (Symbol::init_base_undefined): New function.
11962 (Sized_symbol::init_object): Rename from init. Change all
11963 callers.
11964 (Sized_symbol::init_output_data): Likewise.
11965 (Sized_symbol::init_output_segment): Likewise.
11966 (Sized_symbol::init_constant): Likewise.
11967 (Sized_symbol::init_undefined): New function.
11968 (Symbol_table::add_undefined_symbols_from_command_line): New
11969 function.
11970 (Symbol_table::do_add_undefined_symbols_from_command_line): New
11971 function.
11972 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
11973 (Symbol::output_section): Likewise.
11974 (Symbol::set_output_section): Likewise.
11975 (Symbol_table::sized_finalize_symbol): Likewise.
11976 (Symbol_table::sized_write_globals): Likewise.
11977 * resolve.cc (Symbol_table::should_override): Likewise.
11978 (Symbol::override_base_with_special): Likewise.
11979
8bdcdf2c
ILT
11980 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
11981 symbol, change it to have default visibility.
11982 * testsuite/protected_1.cc: New file.
11983 * testsuite/protected_2.cc: New file.
11984 * testsuite/protected_3.cc: New file.
11985 * testsuite/protected_main_1.cc: New file.
11986 * testsuite/protected_main_2.cc: New file.
11987 * testsuite/protected_main_3.cc: New file.
11988 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
11989 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
11990 (protected_1_LDFLAGS, protected_1_LDADD): Define.
11991 (protected_1.so): New target.
11992 (protected_1_pic.o, protected_2_pic.o): New targets.
11993 (protected_3_pic.o): New target.
11994 (check_PROGRAMS): Add protected_2.
11995 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
11996 (protected_2_LDFLAGS, protected_2_LDADD): Define.
11997 * testsuite/Makefile.in: Rebuild.
11998
2b706932
ILT
11999 * options.h (DEFINE_var): Add set_user_set_##varname__.
12000 (DEFINE_bool_alias): New macro.
12001 (class General_options): Define -Bstatic using DEFINE_bool_alias
12002 rather than DEFINE_special. Add --undefined as an alias for -z
12003 defs.
12004 * options.cc (General_options::parse_Bstatic): Remove.
12005
d82a5bcc
ILT
12006 * options.h (class General_options): Add --fatal-warnings.
12007 * main.cc (main): Implement --fatal-warnings.
12008 * errors.h (Errors::warning_count): New function.
12009
f1f70eae
ILT
12010 * options.h (class General_options): Add -Bsymbolic-functions.
12011 * symtab.h (Symbol::is_preemptible): Check for
12012 -Bsymbolic-functions.
12013
8825ac63
ILT
120142008-05-05 Ian Lance Taylor <iant@google.com>
12015
d98bc257
ILT
12016 * options.h (DEFINE_bool): For DASH_Z, create the negative option
12017 as noVARNAME rather than no-VARNAME.
12018 (class General_options): Add option -z combreloc.
12019 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
12020 get_address.
12021 (Output_reloc::sort_before) [SHT_REL]: New function.
12022 (Output_reloc::sort_before) [SHT_RELA]: New function.
12023 (class Output_data_reloc_base): Add sort_relocs_ field. Define
12024 Sort_relocs_comparison.
12025 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
12026 parameter. Change all callers.
12027 (Output_data_reloc::Output_data_reloc) [both versions]: Add
12028 sort_relocs parameter. Change all callers.
12029 * output.cc (Output_reloc::get_address): New function, broken out
12030 of write_rel.
12031 (Output_reloc::write_rel): Call it.
12032 (Output_reloc::compare): New function.
12033 (Output_data_reloc_base::do_write): Optionally sort relocs.
12034
60b2b4e7
ILT
12035 * configure.ac: If targ_extra_obj is set, link it in.
12036 * configure.tgt: Initialize all variables.
12037 (x86_64*): Set targ_extra_obj and targ_extra_size.
12038 * configure: Rebuild.
12039
8825ac63
ILT
12040 * object.cc (Sized_relobj::include_section_group): Adjust section
12041 indexes read from group data. Build vector to pass to
12042 layout_group.
12043 * layout.cc (Layout::layout_group): Add flags and shndxes
12044 parameters. Remove contents parameter. Change caller. Update
12045 explicit instantiations.
12046 * layout.h (class Layout): Update layout_group declaration.
12047 * output.cc (Output_data_group::Output_data_group): Add flags and
12048 input_shndxes parameters. Remove contents parameter. Change
12049 caller.
12050 (Output_data_group::do_write): Change input_sections_ to
12051 input_shndxes_.
12052 * output.h (class Output_data_group): Update constructor
12053 declaration. Rename input_sections_ to input_shndxes_.
12054 * testsuite/many_sections_test.cc: Add template.
12055
e94cf127
CC
120562008-04-30 Cary Coutant <ccoutant@google.com>
12057
4418b2d5
CC
12058 * target-reloc.h (relocate_section): Fix dead-pointer bug.
12059
e94cf127
CC
12060 * layout.cc (Layout::include_section): Refactored check for debug
12061 info section.
12062 (Layout::add_comdat): Add new parameters. Change type
12063 of signature parameter. Add object and shndx to signatures table.
12064 (Layout::find_kept_object): New function.
12065 * layout.h: Include <cstring>.
12066 (Layout::is_debug_info_section): New function.
12067 (Layout::add_comdat): Add new parameters.
12068 (Layout::find_kept_object): New function.
12069 (Layout::Kept_section): New struct.
12070 (Layout::Signatures): Change type of map range.
12071 * object.cc (Relobj::output_section_address): New function.
12072 (Sized_relobj::include_section_group): Add new parameters. Change
12073 calls to Layout::add_comdat. Change to build table of kept comdat
12074 groups and table mapping discarded sections to kept sections.
12075 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
12076 (Sized_relobj::do_layout): Change calls to include_section_group and
12077 include_linkonce_section.
12078 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
12079 value to zero when section is discarded.
12080 (Sized_relobj::map_to_kept_section): New function.
12081 * object.h (Relobj::output_section_address): New function.
12082 (Relobj::Comdat_group): New type.
12083 (Relobj::find_comdat_group): New function.
12084 (Relobj::Comdat_group_table): New type.
12085 (Relobj::Kept_comdat_section): New type.
12086 (Relobj::Kept_comdat_section_table): New type.
12087 (Relobj::add_comdat_group): New function.
12088 (Relobj::set_kept_comdat_section): New function.
12089 (Relobj::get_kept_comdat_section): New function.
12090 (Relobj::comdat_groups_): New field.
12091 (Relobj::kept_comdat_sections_): New field.
12092 (Symbol_value::input_value): Update comment.
12093 (Sized_relobj::map_to_kept_section) New function.
12094 (Sized_relobj::include_linkonce_section): Add new parameter.
12095 * target-reloc.h (Comdat_behavior): New type.
12096 (get_comdat_behavior): New function.
12097 (relocate_section): Add code to map a discarded section to the
12098 corresponding kept section when applying a relocation.
12099
e4e5049b
CS
121002008-04-30 Craig Silverstein <csilvers@google.com>
12101
12102 * dwarf_reader.cc (next_generation_count): New static var.
12103 (Addr2line_cache_entry): New struct.
12104 (addr2line_cache): New static var.
12105 (Dwarf_line_info::one_addr2line): Added caching.
12106 (Dwarf_line_info::clear_addr2line_cache): New function.
12107 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
12108 cache-size parameter.
12109 (Dwarf_line_info::one_addr2line_cache): New function.
12110 * symtab.cc (Symbol_table::detect_odr_violations): Pass
12111 new cache-size argument to one_addr2line(), and clear cache.
12112
d09e9154
CC
121132008-04-28 Cary Coutant <ccoutant@google.com>
12114
12115 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
12116 R_386_PC8 relocations.
12117
7ef73768
ILT
121182008-04-23 Ian Lance Taylor <iant@google.com>
12119
55438702
ILT
12120 * object.cc (Sized_relobj::include_section_group): Check for
12121 invalid section group.
12122
c165fb93
ILT
12123 * object.cc (make_elf_object): Correct test for 64-bit ELF file
12124 header size.
12125
7ef73768
ILT
12126 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
12127 than read for file header.
12128 * archive.cc (Archive::include_member): Likewise.
12129
6194aaab
L
121302008-04-23 Paolo Bonzini <bonzini@gnu.org>
12131
12132 * aclocal.m4: Regenerate.
12133 * configure: Regenerate.
12134
d491d34e
ILT
121352008-04-19 Ian Lance Taylor <iant@google.com>
12136
5ea2bac6
ILT
12137 * version.cc (version_string): Bump to 1.6.
12138
7bc3e21a
ILT
12139 * testsuite/Makefile.am (many_sections_r_test): New target.
12140 (many_sections_r_test_SOURCES): Remove.
12141 (many_sections_r_test_DEPENDENCIES): Remove.
12142 (many_sections_r_test_LDFLAGS): Remove.
12143 (many_sections_r_test_LDADD): Remove.
12144
7fcd3aa9
ILT
12145 * object.cc (Sized_relobj::do_add_symbols): Always pass
12146 local_symbol_count_ to add_from_relobj.
12147
4c94d6ae
ILT
12148 * testsuite/Makefile.am (many_sections_check.h): Only check one in
12149 every thousand variables.
12150 * testsuite/Makefile.in: Rebuild.
12151
d491d34e
ILT
12152 * object.cc (Xindex::initialize_symtab_xindex): New function.
12153 (Xindex::read_symtab_xindex): New function.
12154 (Xindex::sym_xindex_to_shndx): New function.
12155 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
12156 available.
12157 (Sized_relobj::do_initialize_xindex): New function.
12158 (Sized_relobj::do_read_symbols): Adjust section links.
12159 (Sized_relobj::symbol_section_and_value): Add is_ordinary
12160 parameter. Change all callers.
12161 (Sized_relobj::include_section_group): Adjust section links and
12162 symbol section indexes.
12163 (Sized_relobj::do_layout): Adjust section links.
12164 (Sized_relobj::do_count_local_symbols): Adjust section links and
12165 symbol section indexes.
12166 (Sized_relobj::do_finalize_local_symbols): Distinguish between
12167 ordinary and special symbols.
12168 (Sized_relobj::write_local_symbols): Add symtab_xindex and
12169 dynsym_xindex parameters. Change all callers. Adjust section
12170 links. Use SHN_XINDEX when needed.
12171 (Sized_relobj::get_symbol_location_info): Adjust section links.
12172 Don't get fooled by special symbols.
12173 * object.h (class Xindex): Define.
12174 (class Object): Add xindex_ parameter. Declare virtual functoin
12175 do_initialize_xindex.
12176 (Object::adjust_sym_shndx): New function.
12177 (Object::set_xindex): New protected function.
12178 (class Symbol_value): Add is_ordinary_shndx_ field.
12179 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
12180 (Symbol_value::value): Assert ordinary section.
12181 (Symbol_value::initialize_input_to_output_map): Likewise.
12182 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
12183 Change all callers.
12184 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
12185 all callers.
12186 (class Sized_relobj): Update declarations.
12187 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
12188 parameter. Change all callers.
12189 (Sized_relobj::adjust_shndx): New function.
12190 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
12191 field.
12192 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
12193 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
12194 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
12195 (Sized_dynobj::read_dynsym_section): Adjust section links.
12196 (Sized_dynobj::read_dynamic): Likewise.
12197 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
12198 section links.
12199 (Sized_dynobj::do_initialize_xindex): New function.
12200 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
12201 do_initialize_xindex.
12202 (Sized_dynobj::adjust_shndx): New function.
12203 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
12204 dynsym_xindex_ fields.
12205 (Layout::finalize): Add a call to set_section_indexes before
12206 creating the symtab sections.
12207 (Layout::set_section_indexes): Don't do anything if the section
12208 already has a section index.
12209 (Layout::create_symtab_sections): Add shnum parameter. Change
12210 caller. Create .symtab_shndx section if needed.
12211 (Layout::create_shdrs): Add shstrtab_section parameter. Change
12212 caller.
12213 (Layout::allocated_output_section_count): New function.
12214 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
12215 needed.
12216 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
12217 fields. Update declarations.
12218 (Layout::symtab_xindex): New function.
12219 (Layout::dynsym_xindex): New function.
12220 (class Write_symbols_task): Add layout_ field.
12221 (Write_symbols_task::Write_symbols_task): Add layout parameter.
12222 Change caller.
12223 * output.cc (Output_section_headers::Output_section_headers): Add
12224 shstrtab_section parameter. Change all callers.
12225 (Output_section_headers::do_sized_write): Store overflow values
12226 for section count and section string table section index in
12227 section header zero.
12228 (Output_file_header::do_sized_write): Check for overflow of
12229 section count and section string table section index.
12230 (Output_symtab_xindex::do_write): New function.
12231 (Output_symtab_xindex::endian_do_write): New function.
12232 * output.h (class Output_section_headers): Add shstrtab_section_.
12233 Update declarations.
12234 (class Output_symtab_xindex): Define.
12235 (Output_section::has_out_shndx): New function.
12236 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
12237 field.
12238 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
12239 Change all callers.
12240 (Sized_symbol::init): Likewise.
12241 (Symbol::output_section): Check for ordinary symbol.
12242 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
12243 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
12244 callers.
12245 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
12246 Change all callers. Simplify handling of symbols from sections
12247 not included in the link.
12248 (Symbol_table::add_from_dynobj): Handle ordinary symbol
12249 distinction.
12250 (Weak_alias_sorter::operator()): Assert that symbols are
12251 ordinary.
12252 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
12253 distinction.
12254 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
12255 parameters. Change all callers.
12256 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
12257 symbol distinction. Use SHN_XINDEX when needed.
12258 (Symbol_table::write_section_symbol): Add symtab_xindex
12259 parameter. Change all callers.
12260 (Symbol_table::sized_write_section_symbol): Likewise. Use
12261 SHN_XINDEX when needed.
12262 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
12263 declarations.
12264 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
12265 (Symbol::is_defined): Check is_ordinary.
12266 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
12267 (Symbol::is_absolute, Symbol::is_common): Likewise.
12268 (class Sized_symbol): Update declarations.
12269 (class Symbol_table): Update declarations.
12270 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
12271 parameters. Change all callers.
12272 (Sized_symbol::override): Likewise.
12273 (Symbol_table::override): Likewise.
12274 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
12275 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
12276 is_ordinary, and orig_st_shndx parameters. Change all callers.
12277 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
12278 to be in an ordinary section.
12279 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
12280 object and is_ordinary parameters. Change all callers.
12281 (Sized_dwarf_line_info::read_relocs): Add object parameter.
12282 Change all callers. Don't add undefined or non-ordinary symbols
12283 to reloc_map_.
12284 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
12285 Change all callers.
12286 * dwarf_reader.h (class Sized_dwarf_line_info): Update
12287 declarations.
12288 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
12289 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
12290 (Sized_relobj::relocate_sections): Likewise.
12291 * target-reloc.h (scan_relocs): Adjust section symbol index.
12292 (scan_relocatable_relocs): Likewise.
12293 * i386.cc (Scan::local): Check for ordinary symbols.
12294 * sparc.cc (Scan::local): Likewise.
12295 * x86_64.cc (Scan::local): Likewise.
12296 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
12297 to symbol_section_and_value.
12298 * testsuite/many_sections_test.cc: New file.
12299 * testsuite/Makefile.am (BUILT_SOURCES): Define.
12300 (check_PROGRAMS): Add many_sections_test.
12301 (many_sections_test_SOURCES): Define.
12302 (many_sections_test_DEPENDENCIES): Define.
12303 (many_sections_test_LDFLAGS): Define.
12304 (BUILT_SOURCES): Add many_sections_define.h.
12305 (many_sections_define.h): New target.
12306 (BUILT_SOURCES): Add many_sections_check.h.
12307 (many_sections_check.h): New target.
12308 (check_PROGRAMS): Add many_sections_r_test.
12309 (many_sections_r_test_SOURCES): Define.
12310 (many_sections_r_test_DEPENDENCIES): Define.
12311 (many_sections_r_test_LDFLAGS): Define.
12312 (many_sections_r_test_LDADD): Define.
12313 (many_sections_r_test.o): New target.
12314 * testsuite/Makefile.in: Rebuild.
12315
c5818ff1
CC
123162008-04-17 Cary Coutant <ccoutant@google.com>
12317
12318 * errors.cc (Errors::info): New function.
12319 (gold_info): New function.
12320 * errors.h (Errors::info): New function.
12321 * gold.h (gold_info): New function.
12322 * object.cc (Input_objects::add_object): Print trace output.
12323 * options.cc (options::parse_set): New function.
12324 (General_options::parse_wrap): Deleted.
12325 (General_options::General_options): Deleted initializer.
12326 * options.h (options::String_set): New typedef.
12327 (options::parse_set): New function.
12328 (DEFINE_set): New macro.
12329 (General_options::wrap): Changed to use DEFINE_set. Changed
12330 callers of any_wrap_symbols and is_wrap_symbol.
12331 (General_options::trace, General_options::trace_symbol):
12332 New options.
12333 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
12334 (General_options::wrap_symbols_): Deleted.
12335 * symtab.cc (Symbol_table::add_from_object): Print trace output.
12336
b5be4a7c
DM
123372008-04-17 David S. Miller <davem@davemloft.net>
12338
12339 * options.cc (General_options::parse_V): New function.
12340 * options.h: Add entries for -V and -Qy.
12341
155a0dd7
ILT
123422008-04-17 Ian Lance Taylor <iant@google.com>
12343
12344 * common.cc (Symbol_table::allocate_commons): Remove options
12345 parameter. Change caller.
12346 (Symbol_table::do_allocate_commons): Remove options parameter.
12347 Change caller. Just call do_allocate_commons_list twice.
12348 (Symbol_table::do_allocate_commons_list): New function, broken out
12349 of do_allocate_commons.
12350 * common.h (class Allocate_commons_task): Remove options_ field.
12351 Update constructor.
12352 * symtab.cc (Symbol_table::Symbol_table): Initialize
12353 tls_commons_.
12354 (Symbol_table::add_from_object): Put TLS common symbols on
12355 tls_commons_ list.
12356 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
12357 which are IN_OUTPUT_DATA.
12358 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
12359 allocate_commons and do_allocate_commons declarations. Declare
12360 do_allocate_commons_list.
12361 * gold.cc (queue_middle_tasks): Update creation of
12362 Allocate_commons_task to not pass options.
12363 * testsuite/Makefile.am (INCLUDES): Add -I.. .
12364 (TLS_TEST_C_FLAGS): New variable.
12365 (tls_test_c_pic.o): New target.
12366 (tls_test_shared.so): Link in tls_test_c_pic.o.
12367 (tls_test_c_pic_ie.o): New target.
12368 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
12369 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
12370 (tls_test_c.o): New target.
12371 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
12372 (tls_pic_test_LDADD): Likewise.
12373 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
12374 (tls_shared_gd_to_ie_test_LDADD): Likewise.
12375 (tls_test_c_gnu2.o): New target.
12376 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
12377 tls_test_c_gnu2.o.
12378 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
12379 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
12380 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
12381 * testsuite/tls_test.cc: Include "config.h".
12382 (t_last): Call t11_last.
12383 * testsuite/tls_test.h (t11, t11_last): Declare.
12384 * testsuite/tls_test_c.c: New file.
12385 * testsuite/tls_test_main.cc (thread_routine): Call t11.
12386 * configure.ac: Check for OpenMP support.
12387 * configure, config.in, Makefile.in: Rebuild.
12388 * testsuite/Makefile.in: Rebuild.
12389
edfbb029
CC
123902008-04-16 Cary Coutant <ccoutant@google.com>
12391
12392 * i386.cc (Target_i386::define_tls_base_symbol): New function.
12393 (Target_i386::tls_base_symbol_defined_): New field.
12394 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12395 (Target_i386::Scan::global): Likewise.
12396 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
12397 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
12398 (Target_x86_64::tls_base_symbol_defined_): New field.
12399 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12400 (Target_x86_64::Scan::global): Likewise.
12401
f3c69fca
CC
124022008-04-16 Cary Coutant <ccoutant@google.com>
12403
12404 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
12405 (Symbol::needs_plt_entry): Allow weak undefined symbols.
12406 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
12407 building shared libraries.
12408 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
12409 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
12410 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
12411 * testsuite/Makefile.in: Rebuild.
12412 * testsuite/weak_undef.h: New file.
12413 * testsuite/weak_undef_file1.cc: Add extra test cases.
12414 * testsuite/weak_undef_file2.cc: Likewise.
12415 * testsuite/weak_undef_test.cc: Likewise.
12416
7c414435
DM
124172008-04-16 David S. Miller <davem@davemloft.net>
12418
32b769e1
DM
12419 * sparc.cc (Target_sparc::Scan): Change from struct to class.
12420 Add issued_non_pic_error_ field. Declare check_non_pic.
12421 (Target_sparc::Scan::check_non_pic): New function.
12422 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
12423 (Target_sparc::Scan::global): Likewise.
12424
11936fb1
DM
12425 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
12426 * configure: Rebuild.
12427
7c414435
DM
12428 * options.h (DEFINE_enable): New macro.
12429 (new_dtags): New enable option.
12430 (initfirst, interpose, loadfltr, nodefaultlib,
12431 nodelete, nodlopen, nodump): New -z options.
12432 * layout.cc (Layout:finish_dynamic_section): If new
12433 dtags enabled, emit DT_RUNPATH. Also, emit a
12434 DT_FLAGS_1 containing any specified -z flags.
12435
85c7bf8b
ILT
124362008-04-16 Ian Lance Taylor <iant@google.com>
12437
12c0daef
ILT
12438 * copy-relocs.cc: New file.
12439 * copy-relocs.h: New file.
12440 * reloc.cc: Remove Copy_relocs code.
12441 * reloc.h: Likewise.
12442 * reloc-types.h (struct Reloc_types) [both versions]: Add
12443 get_reloc_addend_noerror.
12444 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
12445 variants of add_global which take an addend which must be zero.
12446 * i386.cc: Include "copy-relocs.h".
12447 (class Target_i386): Change type of copy_relocs_ to variable,
12448 update initializer.
12449 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
12450 Change all callers.
12451 (Target_i386::do_finalize_sections): Change handling of
12452 copy_relocs_.
12453 * sparc.cc: Include "copy-relocs.h".
12454 (class Target_sparc): Change type of copy_relocs_ to variable,
12455 update initializer.
12456 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
12457 Change all callers.
12458 (Target_sparc::do_finalize_sections): Change handling of
12459 copy_relocs_.
12460 * x86_64.cc: Include "copy-relocs.h".
12461 (class Target_x86_64): Change type of copy_relocs_ to variable,
12462 update initializer.
12463 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
12464 class. Change all callers.
12465 (Target_x86_64::do_finalize_sections): Change handling of
12466 copy_relocs_.
12467 * Makefile.am (CCFILES): Add copy-relocs.cc.
12468 (HFILES): Add copy-relocs.h.
12469
4f4995b6
ILT
12470 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
12471
85c7bf8b
ILT
12472 * testsuite/script_test_4.sh: Permit leading zeroes.
12473
4f2a9edd
ILT
124742008-04-15 Ian Lance Taylor <iant@google.com>
12475
e6188289
ILT
12476 * script-sections.cc (Script_sections::create_segments): Use
12477 header_size_adjustment even when there is enough room for the
12478 headers.
12479 * testsuite/script_test_4.sh: New file.
12480 * testsuite/script_test_4.t: New file.
12481 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
12482 (check_DATA): Add script_test_4.stdout.
12483 (MOSTLYCLEANFILES): Likewise.
12484 (script_test_4): New target.
12485 (script_test_4.stdout): New target.
12486 * testsuite/Makefile.in: Rebuild.
12487
4f2a9edd
ILT
12488 * sparc.cc: Add definitions for Output_data_plt_sparc class
12489 constants.
12490
f5314dd5
DM
124912008-04-14 David S. Miller <davem@davemloft.net>
12492
12493 * sparc.cc: New file.
12494 * Makefile.am (TARGETSOURCES): Add sparc.cc
12495 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
12496 * configure.tgt: Document targ_extra_size and
12497 targ_extra_big_endian. Add entries for sparc-* and
12498 sparc64-*.
12499 * configure.ac: Handle targ_extra_size and
12500 targ_extra_big_endian.
12501 * Makefile.in: Rebuild.
12502 * configure: Likewise.
12503 * po/POTFILES.in: Likewise.
12504 * po/gold.pot: Likewise.
12505
154e0e9a
ILT
125062008-04-14 Ian Lance Taylor <iant@google.com>
12507
12508 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
12509 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
12510 in the name/type/flags to section mapping. Don't call
12511 allocate_output_section.
12512 (Layout::choose_output_section): Change parameter from adjust_name
12513 to is_input_section. Don't permit input sections after sections
12514 are attached to segments. Don't call allocate_output_section.
12515 (Layout::layout_eh_frame): Call update_flags_for_input_section,
12516 not write_enable_output_section.
12517 (Layout::make_output_section): Don't push to
12518 unattached_section_list_ nor call attach_to_segment. Call
12519 attach_section_to_segment if sections are attached.
12520 (Layout::attach_sections_to_segments): New function.
12521 (Layout::attach_section_to_segment): New function.
12522 (Layout::attach_allocated_section_to_segment): Rename from
12523 attach_to_segment. Remove flags parameter.
12524 (Layout::allocate_output_section): Remove function.
12525 (Layout::write_enable_output_section): Remove function.
12526 * layout.h (class Layout): Update for above changes. Add new
12527 field sections_are_attached_.
12528 * output.h (Output_section::update_flags_for_input_section): New
12529 function.
12530 * output.cc (Output_section::add_input_section): Call
12531 update_flags_for_input_section.
12532 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
12533
009a67a2
CC
125342008-04-11 Cary Coutant <ccoutant@google.com>
12535
12536 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
12537 thought unnecessary.
12538 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
12539
759b1a24
ILT
125402008-04-11 Ian Lance Taylor <iant@google.com>
12541
12542 * output.h (class Output_section_data): Remove inline definition
12543 of set_addralign.
12544 * output.cc (Output_section_data::set_addralign): New function.
12545
c2b45e22
CC
125462008-04-11 Cary Coutant <ccoutant@google.com>
12547
12548 Add support for TLS descriptors for i386 and x86_64.
12549 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
12550 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
12551 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
12552 GOT_TYPE_TLS_DESC.
12553 (Target_i386::got_mod_index_entry): Remove unnecessary code.
12554 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
12555 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
12556 relocations.
12557 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
12558 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
12559 Fix problem with initial-exec relocations.
12560 (Target_i386::Relocate::relocate_tls): Likewise.
12561 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
12562 relaxation.
12563 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
12564 support for section-plus-offset dynamic table entries.
12565 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
12566 (Output_data_dynamic::Dynamic_entry): Add support for
12567 section-plus-offset dynamic table entries.
12568 (Output_data_dynamic::Classification): Likewise.
12569 (Output_data_dynamic::classification_): Renamed offset_.
12570 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
12571 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
12572 (Target_x86_64::make_plt_section): New function.
12573 (Target_x86_64::reserve_tlsdesc_entries): New function.
12574 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
12575 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
12576 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
12577 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
12578 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
12579 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
12580 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
12581 add extra PLT entry for TLS descriptors.
12582 (Output_data_plt_x86_64::got_): New field.
12583 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
12584 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
12585 fields.
12586 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
12587 descriptors.
12588 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
12589 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
12590 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
12591 R_386_TLS_DESC_CALL relocations.
12592 (Target_x86_64::Scan::global): Likewise.
12593 (Target_x86_64::do_finalize_sections): Add dynamic table entries
12594 for TLS descriptors.
12595 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
12596 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
12597 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
12598 GD-to-IE relaxation.
12599 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
12600 and TLS_DESCRIPTORS.
12601 * Makefile.in: Rebuild.
12602 * configure: Rebuild.
12603 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
12604 (tls_test_shared2.so): New target.
12605 (tls_shared_gd_to_ie_test_SOURCES): New variable.
12606 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
12607 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
12608 (tls_shared_gd_to_ie_test_LDADD): New variable.
12609 (tls_shared_gnu2_gd_to_ie_test): New target.
12610 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
12611 New targets.
12612 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
12613 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
12614 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
12615 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
12616 (tls_shared_gnu2_test): New target.
12617 (tls_test_gnu2_shared.so): New target.
12618 (tls_shared_gnu2_test_SOURCES): New variable.
12619 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
12620 (tls_shared_gnu2_test_LDFLAGS): New variable.
12621 (tls_shared_gnu2_test_LDADD): New variable.
12622 * testsuite/Makefile.in: Rebuild.
12623 * testsuite/Makefile.
12624
83bfb6b7
ILT
126252008-04-11 Ian Lance Taylor <iant@google.com>
12626
12627 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
12628 justsyms.t.
12629 * testsuite/Makefile.in: Rebuild.
12630
12631 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
12632 long.
12633 * testsuite/script_test_2.cc (main): Adjust test.
12634
706e1f5e
ILT
126352008-04-11 David S. Miller <davem@davemloft.net>
12636 Ian Lance Taylor <iant@google.com>
12637
12638 * options.h (General_options): Add entries for '-Y' and
12639 '-relax'.
12640 * options.cc (General_options:finalize): If -Y was used, add those
12641 entries to the library path instead of the default "/lib" and
12642 "/usr/lib".
12643
7c98e6bb
DM
126442008-04-11 David S. Miller <davem@davemloft.net>
12645
12646 * testsuite/justsyms.t: Start at 0x100.
12647 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
12648 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
12649 long.
12650 * testsuite/script_test_2.cc: Adjust string and section length
12651 checks.
7c98e6bb 12652
99a37bfd
ILT
126532008-04-09 Ian Lance Taylor <iant@google.com>
12654
2cefc357
ILT
12655 PR gold/5996
12656 * script-sections.cc (Sections_element::allocate_to_segment): Add
12657 orphan parameter.
12658 (Output_section_definition::allocate_to_segment): Likewise.
12659 (Orphan_output_section::allocate_to_segment): Likewise.
12660 (Script_sections::attach_sections_using_phdrs_clause): Don't
12661 propagate non-PT_LOAD segments to orphan sections.
12662 * testsuite/Makefile.am (script_test_3.stdout): Generate using
12663 readelf rather than objdump.
12664 * testsuite/script_test_3.sh: Adjust accordingly. Test that
12665 .interp section and PT_INTERP segment are the same size.
12666 * testsuite/Makefile.in: Rebuild.
12667
99a37bfd
ILT
12668 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
12669 aliases for symbols defined in the same object.
12670 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
12671 (weak_alias_test_SOURCES): New variable.
12672 (weak_alias_test_DEPENDENCIES): New variable.
12673 (weak_alias_test_LDFLAGS): New variable.
12674 (weak_alias_test_LDADD): New variable.
12675 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
12676 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
12677 (weak_alias_test_3.o): New target.
12678 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
12679 * testsuite/weak_alias_test_main.cc: New file.
12680 * testsuite/weak_alias_test_1.cc: New file.
12681 * testsuite/weak_alias_test_2.cc: New file.
12682 * testsuite/weak_alias_test_3.cc: New file.
12683
780e49c5
ILT
126842008-04-08 Ian Lance Taylor <iant@google.com>
12685
cdb0b8f5
ILT
12686 * options.h (class General_options): Add --noinhibit-exec option.
12687 * main.cc (main): Check --noinhibit-exec.
12688
0864d551
ILT
12689 * options.h (class General_options): Define --wrap as a special
12690 option. Add wrap_symbols_ field.
12691 (General_options::any_wrap_symbols): New function.
12692 (General_options::is_wrap_symbol): New function.
12693 * options.cc (General_options::parse_wrap): New function.
12694 (General_options::General_options): Initialize wrap_symbols_.
12695 * symtab.cc (Symbol_table::wrap_symbol): New function.
12696 (Symbol_table::add_from_object): Handle --wrap.
12697 * symtab.h (class Symbol_table): Declare wrap_symbol.
12698 * target.h (Target::wrap_char): New function.
12699 (Target::Target_info): Add wrap_char field.
12700 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
12701 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12702 * testsuite/testfile.cc (Target_test::test_target_info):
12703 Likewise.
12704
789aa6de
ILT
12705 * errors.cc (Errors::undefined_symbol): Mention symbol version if
12706 there is one.
12707
2c38906f
ILT
12708 * layout.h (class Layout): Add added_eh_frame_data_ field.
12709 * layout.cc (Layout::Layout): Initialize new field.
12710 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
12711 output section until we find a section we merged successfully.
12712 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
12713 that the size be non-zero.
12714
780e49c5
ILT
12715 * merge.cc (Object_merge_map::get_output_offset): Remove inline
12716 qualifier.
12717
7fcd0256
ILT
127182008-04-08 Craig Silverstein <csilvers@google.com>
12719
12720 * configure.ac: Export new conditional variable HAVE_ZLIB.
12721 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
12722 on HAVE_ZLIB.
12723 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
12724 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12725
6835af53
ILT
127262008-04-07 Ian Lance Taylor <iant@google.com>
12727
e24f324c
ILT
12728 * version.cc (version_string): Set to "1.5".
12729
a036edd8
ILT
12730 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
12731 Add issued_non_pic_error_ field. Declare check_non_pic.
12732 (Target_x86_64::Scan::check_non_pic): New function.
12733 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
12734 (Target_x86_64::Scan::global): Likewise.
12735
624f8810
ILT
12736 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
12737 addend parameter. Change caller. Handle merge sections.
12738 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
12739 Address to Addend. Don't add in the result of
12740 local_section_offset, pass down the addend and use the returned
12741 value.
12742 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
12743 Update declarations of local_section_offset and symbol_value.
12744 * testsuite/two_file_test_1.cc (t18): New function.
12745 * testsuite/two_file_test_2.cc (f18): New function.
12746 * testsuite/two_file_test_main.cc (main): Call t18.
12747 * testsuite/two_file_test.h (t18, f18): Declare.
12748
6835af53
ILT
12749 * configure.ac: Don't test for objdump, c++filt, or readelf.
12750 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
12751 conditionals.
12752 (TEST_READELF): New variable.
12753 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
12754 (check_PROGRAMS): Add two_file_strip_test.
12755 (two_file_strip_test): New target.
12756 (check_PROGRAMS): Add two_file_same_shared_strip_test.
12757 (two_file_same_shared_strip_test_SOURCES): New variable.
12758 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
12759 (two_file_same_shared_strip_test_LDFLAGS): New variable.
12760 (two_file_same_shared_strip_test_LDADD): New variable.
12761 (two_file_shared_strip.so): New target.
12762 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
12763 (ver_test_5.syms, ver_test_7.syms): Likewise.
12764 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
12765 (strip_test_3.stdout): Use TEST_OBJDUMP.
12766 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12767
86925eef
CC
127682008-04-04 Cary Coutant <ccoutant@google.com>
12769
12770 * symtab.h (Symbol::is_weak_undefined): New function.
12771 (Symbol::is_strong_undefined): New function.
12772 (Symbol::is_absolute): New function.
12773 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
12774 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
12775 absolute symbols.
12776 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
12777 (weak_undef_test): New target.
12778 * testsuite/Makefile.in: Rebuild.
12779 * testsuite/weak_undef_file1.cc: New file.
12780 * testsuite/weak_undef_file2.cc: New file.
12781 * testsuite/weak_undef_test.cc: New file.
12782
126f3ece
ILT
127832008-04-03 Craig Silverstein <csilvers@google.com>
12784
12785 * compressed_output.h (class Output_compressed_section): Use
12786 unsigned buffer.
12787 * compressed_output.cc (zlib_compress): Use unsigned buffers,
12788 add zlib header.
12789 (zlib_compressed_suffix): Removed.
12790 (Output_compressed_section::set_final_data_size): Use unsigned
12791 buffers.
12792 * testsuite/Makefile.am (flagstest_compress_debug_sections):
12793 Fix linker invocation.
12794 (flagstest_o_specialfile_and_compress_debug_sections):
12795 Likewise.
12796 * testsuite/Makefile.in: Regenerated.
12797
deae2a14
DM
127982008-04-02 David S. Miller <davem@davemloft.net>
12799
12800 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
12801 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
12802
70752818
ILT
128032008-04-02 Craig Silverstein <csilvers@google.com>
12804
12805 * TODO: New file.
12806
39d0cb0e
ILT
128072008-04-02 Ian Lance Taylor <iant@google.com>
12808
12809 * fileread.cc (File_read::find_view): Add byteshift and vshifted
12810 parameters. Update for new key type to views_. Change all
12811 callers.
12812 (File_read::read): Adjust for byteshift in returned view.
12813 (File_read::add_view): New function, broken out of
12814 find_and_make_view.
12815 (File_read::make_view): New function, broken out of
12816 find_and_make_view.
12817 (File_read::find_or_make_view): Add offset and aligned
12818 parameters. Rewrite accordingly. Change all callers.
12819 (File_read::get_view): Add offset and aligned parameters. Adjust
12820 for byteshift in return value.
12821 (File_read::get_lasting_view): Likewise.
12822 * fileread.h (class File_read): Update declarations.
12823 (class File_read::View): Add byteshift_ field. Add byteshift to
12824 constructor. Add byteshift method.
12825 * archive.h (Archive::clear_uncached_views): New function.
12826 (Archive::get_view): Add aligned parameter. Change all callers.
12827 * object.h (Object::get_view): Add aligned parameter. Change all
12828 callers.
12829 (Object::get_lasting_view): Likewise.
12830
12831 * fileread.cc (File_read::release): Don't call clear_views if
12832 there are multiple objects.
12833 * fileread.h (File_read::clear_uncached_views): New function.
12834 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
12835 on the archive.
12836
a1207466
CC
128372008-03-31 Cary Coutant <ccoutant@google.com>
12838
12839 Add thin archive support.
12840 * archive.cc (Archive::armagt): New const.
12841 (Archive::setup): Remove task parameter and calls to unlock.
12842 (Archive::unlock_nested_archives): New function.
12843 (Archive::read_header): Add nested_off parameter. Change
12844 all callers.
12845 (Archive::interpret_header): Likewise.
12846 (Archive::include_all_members): Change to handle thin
12847 archives.
12848 (Archive::include_member): Likewise.
12849 * archive.h (Archive::Archive): Add new parameters and
12850 initializers.
12851 (Archive::armagt): New const.
12852 (Archive::setup): Remove task parameter.
12853 (Archive::unlock_nested_archives): New function.
12854 (Archive::read_header): Add nested_off parameter.
12855 (Archive::interpret_header): Likewise.
12856 (Archive::Nested_archive_table): New typedef.
12857 (Archive::is_thin_archive_): New field.
12858 (Archive::nested_archives_): New field.
12859 (Archive::options_): New field.
12860 (Archive::dirpath_): New field.
12861 (Archive::task_): New field.
12862 * readsyms.cc (Read_symbols::do_read_symbols): Add check
12863 for thin archives. Pass additional parameters to
12864 Archive::Archive. Unlock the archive file after calling
12865 Archive::setup.
cd536b21 12866
479f6503
ILT
128672008-03-29 Ian Lance Taylor <iant@google.com>
12868
686c8caf
ILT
12869 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
12870 version symbol to be local.
12871 * testsuite/ver_test_4.sh: New file.
12872 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
12873 (check_DATA): Add ver_test_4.syms.
12874 (ver_test_4.syms): New target.
12875 * testsuite/Makefile.in: Rebuild.
12876
ab794b6b
ILT
12877 * output.cc
12878 (Output_section::Input_section_sort_entry::has_priority): New
12879 function.
12880 (Output_section::Input_section_sort_entry::match_file_name): New
12881 function.
12882 (Output_section::Input_section_sort_entry::match_section_name):
12883 Remove.
12884 (Output_section::Input_section_sort_entry::match_section_name_prefix):
12885 Remove.
12886 (Output_section::Input_section_sort_entry::match_section_file):
12887 Remove.
12888 (Output_section::Input_section_sort_compare::operator()): Rewrite
12889 using new Input_section_sort_entry functions. Sort crtbegin and
12890 crtend first. Sort sections with no priority before sections with
12891 a priority.
12892 * testsuite/initpri1.c (d3): Check j != 4.
12893 (cd5): New constructor/destructor function.
12894 (main): Check j != 2.
12895
479f6503
ILT
12896 * symtab.cc (Symbol_table::add_from_object): If we don't use the
12897 new symbol when resolving, don't call set_is_default.
12898 * testsuite/ver_test_7.cc: New file.
12899 * testsuite/ver_test_7.sh: New file.
12900 * testsuite/Makefile.am (ver_test_7.so): New target.
12901 (ver_test_7.o): New target.
12902 (check_SCRIPTS): Add ver_test_7.sh.
12903 (check_DATA): Add ver_test_7.syms.
12904 (ver_test_7.syms): New target.
12905
2fd32231
ILT
129062008-03-28 Ian Lance Taylor <iant@google.com>
12907
12908 * layout.cc (Layout::layout): If we see an input section with a
12909 name that needs sorting, set the must_sort flag for the output
12910 section.
12911 (Layout::make_output_section): If the name of the output section
12912 indicates that it might require sorting, set the may_sort flag.
12913 * output.h (Output_section::may_sort_attached_input_sections): New
12914 function.
12915 (Output_section::set_may_sort_attached_input_sections): New
12916 function.
12917 (Output_section::must_sort_attached_input_sections): New
12918 function.
12919 (Output_section::set_must_sort_attached_input_sections): New
12920 function.
12921 (class Output_section): Declare Input_section_sort_entry. Define
12922 Input_section_sort_compare. Declare
12923 sort_attached_input_sections. Add new fields:
12924 may_sort_attached_input_sections_,
12925 must_sort_attached_input_sections_,
12926 attached_input_sections_are_sorted_.
12927 * output.cc (Output_section::Output_section): Initialize new
12928 fields.
12929 (Output_section::add_input_section): Add an entry to
12930 input_sections_ if may_sort or must_sort are true.
12931 (Output_section::set_final_data_size): Call
12932 sort_attached_input_sections if necessary.
12933 (Output_section::Input_section_sort_entry): Define new class.
12934 (Output_section::Input_section_sort_compare::operator()): New
12935 function.
12936 (Output_section::sort_attached_input_sections): New function.
12937 * configure.ac: Check whether the compiler supports constructor
12938 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
12939 * testsuite/initpri1.c: New file.
12940 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
12941 CONSTRUCTOR_PRIORITY.
12942 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
12943 (initpri1_LDFLAGS): New variable.
12944 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12945
18e6b24e
ILT
129462008-03-27 Ian Lance Taylor <iant@google.com>
12947
49bdd526
ILT
12948 * common.cc (Sort_commons::operator): Correct sorting algorithm.
12949 * testsuite/common_test_1.c: New file.
12950 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
12951 (common_test_1_SOURCES): New variable.
12952 (common_test_1_DEPENDENCIES): New variable.
12953 (common_test_1_LDFLAGS): New variable.
12954
18e6b24e
ILT
12955 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
12956 and commons_ correctly when NAME/VERSION does not override
12957 NAME/NULL.
12958 * testsuite/ver_test_6.c: New file.
12959 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
12960 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
12961 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
12962
04bf7072
ILT
129632008-03-26 Ian Lance Taylor <iant@google.com>
12964
5871526f
ILT
12965 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
12966 of an undefined symbol from a version script.
12967 * testsuite/Makefile.am (ver_test_5.so): New target.
12968 (ver_test_5.o): New target.
12969 (check_SCRIPTS): Add ver_test_5.sh.
12970 (check_DATA): Add ver_test_5.syms.
12971 (ver_test_5.syms): New target.
12972 * testsuite/ver_test_5.cc: New file.
12973 * testsuite/ver_test_5.script: New file.
12974 * testsuite/ver_test_5.sh: New file.
12975 * Makefile.in, testsuite/Makefile.in: Rebuild.
12976
04bf7072
ILT
12977 PR gold/5986
12978 Fix problems building gold with gcc 4.3.0.
12979 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
12980 (gold_error_at_location, gold_warning_at_location): Use it.
12981 * configure.ac: Check whether we can compile and use a template
12982 function with a printf attribute.
12983 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
12984 when jumping over bytes.
12985 * object.cc: Instantiate Object::read_section_data.
12986 * debug.h: Include <cstring>
12987 * dwarf_reader.cc: Include <algorithm>
12988 * main.cc: Include <cstring>.
12989 * options.cc: Include <cstring>.
12990 * output.cc: Include <cstring>.
12991 * script.cc: Include <cstring>.
12992 * script.h: Include <string>.
12993 * symtab.cc: Include <cstring> and <algorithm>.
12994 * target-select.cc: Include <cstring>.
12995 * version.cc: Include <string>.
12996 * testsuite/testmain.cc: Include <cstdlib>.
12997 * configure, config.in: Rebuild.
12998
874c5b28
ILT
129992008-03-25 Ian Lance Taylor <iant@google.com>
13000
819d6c3a
ILT
13001 * options.cc: Include "../bfd/bfdver.h".
13002 (options::help): Print bug reporting address.
13003
f4b2c6f5
ILT
13004 * version.cc (print_version): Adjust output for current value of
13005 BFD_VERSION_STRING.
13006
13007 * NEWS: New file.
13008
e96caa79
ILT
13009 * options.cc (options::help): Print list of supported targets.
13010 * target-select.h: Include <vector>.
13011 (class Target_selector): Make machine_, size_, and is_big_endian_
13012 fields const. Add bfd_name_ and instantiated_target_ fields.
13013 (Target_selector::Target_selector): Add bfd_name parameter.
13014 (Target_selector::recognize): Make non-virtual, call
13015 do_recognize.
13016 (Target_selector::recognize_by_name): Make non-virtual, call
13017 do_recognize_by_name.
13018 (Target_selector::supported_names): New function.
13019 (Target_selector::bfd_name): New function.
13020 (Target_selector::do_instantiate_target): New pure virtual
13021 function.
13022 (Target_selector::do_recognize): New virtual function.
13023 (Target_selector::do_recognize_by_name): New virtual function.
13024 (Target_selector::instantiate_target): New private function.
13025 (supported_target_names): Declare.
13026 * target-select.cc (Target_selector::Target_selector): Update for
13027 new parameter and fields.
13028 (select_target_by_name): Check that the name matches before
13029 calling recognize_by_name.
13030 (supported_target_names): New function.
13031 * i386.cc (class Target_selector_i386): Update Target_selector
13032 constructor call. Remove recognize and recognize_by_name. Add
13033 do_instantiate_target.
13034 * x86_64.cc (class Target_selector_x86_64): Likewise.
13035 * testsuite/testfile.cc (class Target_selector_test): Update for
13036 changes to Target_selector.
13037
874c5b28
ILT
13038 * README: Rewrite, with some notes on unsupported features.
13039
0a65a3a7
CC
130402008-03-24 Cary Coutant <ccoutant@google.com>
13041
13042 * i386.cc (Target_i386::Got_type): New enum declaration.
13043 (Target_i386::Scan::local): Updated callers of Output_data_got
13044 member functions.
13045 (Target_i386::Scan::global): Likewise.
13046 (Target_i386::Relocate::relocate): Likewise.
13047 (Target_i386::Relocate::relocate_tls): Likewise.
13048 * object.h (Got_offset_list): New class.
13049 (Sized_relobj::local_has_got_offset): Added got_type parameter.
13050 (Sized_relobj::local_got_offset): Likewise.
13051 (Sized_relobj::set_local_got_offset): Likewise.
13052 (Sized_relobj::local_has_tls_got_offset): Removed.
13053 (Sized_relobj::local_tls_got_offset): Removed.
13054 (Sized_relobj::set_local_tls_got_offset): Removed.
13055 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
13056 * output.cc (Output_data_got::add_global): Added got_type parameter.
13057 (Output_data_got::add_global_with_rel): Likewise.
13058 (Output_data_got::add_global_with_rela): Likewise.
13059 (Output_data_got::add_global_pair_with_rel): New function.
13060 (Output_data_got::add_global_pair_with_rela): New function.
13061 (Output_data_got::add_local): Added got_type parameter.
13062 (Output_data_got::add_local_with_rel): Likewise.
13063 (Output_data_got::add_local_with_rela): Likewise.
13064 (Output_data_got::add_local_pair_with_rel): New function.
13065 (Output_data_got::add_local_pair_with_rela): New function.
13066 (Output_data_got::add_global_tls): Removed.
13067 (Output_data_got::add_global_tls_with_rel): Removed.
13068 (Output_data_got::add_global_tls_with_rela): Removed.
13069 (Output_data_got::add_local_tls): Removed.
13070 (Output_data_got::add_local_tls_with_rel): Removed.
13071 (Output_data_got::add_local_tls_with_rela): Removed.
13072 * output.h (Output_data_got::add_global): Added got_type parameter.
13073 (Output_data_got::add_global_with_rel): Likewise.
13074 (Output_data_got::add_global_with_rela): Likewise.
13075 (Output_data_got::add_global_pair_with_rel): New function.
13076 (Output_data_got::add_global_pair_with_rela): New function.
13077 (Output_data_got::add_local): Added got_type parameter.
13078 (Output_data_got::add_local_with_rel): Likewise.
13079 (Output_data_got::add_local_with_rela): Likewise.
13080 (Output_data_got::add_local_pair_with_rel): New function.
13081 (Output_data_got::add_local_pair_with_rela): New function.
13082 (Output_data_got::add_global_tls): Removed.
13083 (Output_data_got::add_global_tls_with_rel): Removed.
13084 (Output_data_got::add_global_tls_with_rela): Removed.
13085 (Output_data_got::add_local_tls): Removed.
13086 (Output_data_got::add_local_tls_with_rel): Removed.
13087 (Output_data_got::add_local_tls_with_rela): Removed.
13088 * resolve.cc (Symbol::override_base_with_special): Removed
13089 reference to has_got_offset_ field.
13090 * symtab.cc (Symbol::init_fields): Replaced initialization
13091 of got_offset_ with got_offsets_. Removed initialization
13092 of has_got_offset_
53fcba31 13093 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
13094 (Symbol::got_offset): Likewise.
13095 (Symbol::set_got_offset): Likewise.
13096 (Symbol::has_tls_got_offset): Removed.
13097 (Symbol::tls_got_offset): Removed.
13098 (Symbol::set_tls_got_offset): Removed.
13099 (Symbol::got_offset_): Removed.
13100 (Symbol::tls_mod_got_offset_): Removed.
13101 (Symbol::tls_pair_got_offset_): Removed.
13102 (Symbol::got_offsets_): New field.
13103 (Symbol::has_got_offset): Removed.
13104 (Symbol::has_tls_mod_got_offset): Removed.
13105 (Symbol::has_tls_pair_got_offset): Removed.
13106 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
13107 (Target_x86_64::Scan::local): Updated callers of Output_data_got
13108 member functions.
13109 (Target_x86_64::Scan::global): Likewise.
13110 (Target_x86_64::Relocate::relocate): Likewise.
13111 (Target_x86_64::Relocate::relocate_tls): Likewise.
13112
bd52eafb
BE
131132008-03-25 Ben Elliston <bje@au.ibm.com>
13114
13115 * yyscript.y: Fix spelling error in comment.
13116
8b105e34
ILT
131172008-03-24 Ian Lance Taylor <iant@google.com>
13118
8ed814a9
ILT
13119 * options.h (class General_options): Define build_id option.
13120 * layout.h (class Layout): Declare write_build_id, create_note,
13121 create_build_id. Add build_id_note_ member.
13122 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
13123 "libiberty.h", "md5.h", "sha1.h".
13124 (Layout::Layout): Initialize eh_frame_data_,
13125 eh_frame_hdr_section_, and build_id_note_.
13126 (Layout::finalize): Call create_build_id.
13127 (Layout::create_note): New function, broken out of
13128 Layout::create_gold_note.
13129 (Layout::create_gold_note): Call create_note.
13130 (Layout::create_build_id): New function.
13131 (Layout::write_build_id): New function.
13132 (Close_task_runner::run): Call write_build_id.
13133
8b105e34
ILT
13134 * x86_64.cc: Correct license to GPLv3.
13135
086a1841
ILT
131362008-03-23 Ian Lance Taylor <iant@google.com>
13137
13138 * options.cc: Include "demangle.h".
13139 (parse_optional_string): New function.
13140 (parse_long_option): Handle takes_optional_argument.
13141 (parse_short_option): Update dash_z initializer. Handle
13142 takes_optional_argument.
13143 (General_options::General_options): Initialize do_demangle_.
13144 (General_options::finalize): Set do_demangle_. Handle demangling
13145 style.
13146 * options.h (parse_optional_string): Declare.
13147 (struct One_option): Add optional_arg field. Update constructor.
13148 Update call constructor calls. Add takes_optional_argument
13149 function.
13150 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
13151 (DEFINE_optional_string): Define.
13152 (General_options::demangle): Change from DEFINE_bool to
13153 DEFINE_optional_string.
13154 (General_options::no_demangle): New function.
13155 (General_options::do_demangle): New function.
13156 (General_options::set_do_demangle): New function.
13157 (General_options::execstack_status_): Move definition to end of
13158 class definition.
13159 (General_options::static_): Likewise.
13160 (General_options::do_demangle_): New field.
13161 * object.cc (big_endian>::get_symbol_location_info): Call
13162 Options::do_demangle, not Options::demangle.
13163 * symtab.cc (demangle): Likewise.
13164
cbb93e63
ILT
131652008-03-22 Ian Lance Taylor <iant@google.com>
13166
13167 * gold.h: Include <cstddef> and <sys/types.h>
13168 * options.h: Include <cstring>.
13169
ec531623
ILT
131702008-03-21 Ian Lance Taylor <iant@google.com>
13171
13172 * Added source code to GNU binutils.
This page took 0.792041 seconds and 4 git commands to generate.