2012-06-04 Pedro Alves <palves@redhat.com>
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
8cc69fb6
ST
12012-05-25 Sriraman Tallam <tmsriram@google.com>
2
3 * symtab.cc (Symbol_table::define_special_symbol):
4 Initialize *poldsym to prevent uninitialized variable errors.
5
1be75daa
CC
62012-05-23 Cary Coutant <ccoutant@google.com>
7
8 * layout.cc (Layout::section_name_mapping): Add rules to handle
9 exact match on .data.rel.ro.local or .data.rel.ro.
10 (Layout::output_section_name): Check for exact matches.
11
9b689de0
CC
122012-05-23 Cary Coutant <ccoutant@google.com>
13
14 * layout.cc (Layout::section_name_mapping): Match .data.rel.ro.*
15 more carefully.
16
b24fdbf5
CC
172012-05-22 Cary Coutant <ccoutant@google.com>
18
19 * symtab.cc (Symbol::should_add_dynsym_entry): Check for relocatable
20 object before exporting symbol.
21
e550e1a2
L
222012-05-21 H.J. Lu <hongjiu.lu@intel.com>
23
24 * testsuite/tls_test.cc: Include "config.h" first.
25 * testsuite/tls_test_c.c: Likewise.
26
df7b86aa
NC
272012-05-17 Daniel Richard G. <skunk@iskunk.org>
28 Nick Clifton <nickc@redhat.com>
29
30 PR 14072
31 * configure.in: Add check that sysdep.h has been included before
32 any system header files.
33 * configure: Regenerate.
34 * config.in: Regenerate.
35
1007b503
CC
362012-05-14 Cary Coutant <ccoutant@google.com>
37
38 * layout.cc (Layout::make_output_section): Mark .tdata section
39 as RELRO.
40 * testsuite/relro_test.cc: Add a TLS variable.
41
fd885f3a
L
422012-05-10 H.J. Lu <hongjiu.lu@intel.com>
43
44 PR gold/14091
45 * x86_64.cc (Target_x86_64::Scan::local): For x32, generate
46 R_X86_64_RELATIVE64 instead of R_X86_64_RELATIVE in case of
47 R_X86_64_64.
48
80f5885c
CC
492012-05-08 Cary Coutant <ccoutant@google.com>
50
51 * layout.cc (gdb_sections): Update GDB version, add .debug_addr.
52 (lines_only_debug_sections): Likewise.
53
2e702c99
RM
542012-05-02 Roland McGrath <mcgrathr@google.com>
55
56 * nacl.cc: New file.
57 * nacl.h: New file.
58 * Makefile.am (CCFILES, HFILES): Add them.
59 * Makefile.in: Regenerate.
60 * i386.cc (Output_data_plt_i386_nacl): New class.
61 (Output_data_plt_i386_nacl_exec): New class.
62 (Output_data_plt_i386_nacl_dyn): New class.
63 (Target_i386_nacl): New class.
64 (Target_selector_i386_nacl): New class.
65 (target_selector_i386): Use it instead of Target_selector_i386.
66 * x86_64.cc (Output_data_plt_x86_64_nacl): New class.
67 (Target_x86_64_nacl): New class.
68 (Target_selector_x86_64_nacl): New class.
69 (target_selector_x86_64, target_selector_x32): Use it instead of
70 Target_selector_x86_64.
71 * arm.cc (Output_data_plt_arm_nacl): New class.
72 (Target_arm_nacl): New class.
73 (Target_selector_arm_nacl): New class.
74 (target_selector_arm, target_selector_armbe): Use it instead of
75 Target_selector_arm.
76
77 * target-select.cc (select_target): Take new Input_file* and off_t
78 arguments, pass them on to recognize method of selector.
79 * object.cc (make_elf_sized_object): Update caller.
80 * parameters.cc (parameters_force_valid_target): Likewise.
81 * incremental.cc (make_sized_incremental_binary): Likewise.
82 * target-select.h: Update decl.
83 (Target_selector::recognize): Take new Input_file* argument,
84 pass it on to do_recognize.
85 (Target_selector::do_recognize): Take new Input_file* argument.
86 * freebsd.h (Target_selector_freebsd::do_recognize): Likewise.
87 * powerpc.cc (Target_selector_powerpc::do_recognize): Likewise.
88 * sparc.cc (Target_selector_sparc::do_recognize): Likewise.
89 * testsuite/testfile.cc (Target_selector::do_recognize): Likewise.
90
91 * target.h (Target::Target_info): New members isolate_execinstr
92 and rosegment_gap.
93 (Target::isolate_execinstr, Target::rosegment_gap): New methods.
94 * arm.cc (Target_arm::arm_info): Update initializer.
95 * i386.cc (Target_i386::i386_info): Likewise.
96 * powerpc.cc (Target_powerpc::powerpc_info): Likewise.
97 * sparc.cc (Target_sparc::sparc_info): Likewise.
98 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
99 * testsuite/testfile.cc (Target_test::test_target_info): Likewise.
100 * layout.cc (Layout::attach_allocated_section_to_segment):
101 Take new const Target* argument. If target->isolate_execinstr(), act
102 like --rosegment.
103 (Layout::find_first_load_seg): Take new const Target* argument;
104 if target->isolate_execinstr(), reject PF_X segments.
105 (Layout::relaxation_loop_body): Update caller.
106 (Layout::set_segment_offsets): If target->isolate_execinstr(),
107 reset file offset to zero when we hit LOAD_SEG, and then do a second
108 loop over the segments before LOAD_SEG to reassign offsets after
109 addresses have been determined. Handle target->rosegment_gap().
110 (Layout::attach_section_to_segment): Take new const Target* argument;
111 pass it to attach_allocated_section_to_segment.
112 (Layout::make_output_section): Update caller.
113 (Layout::attach_sections_to_segments): Take new const Target* argument;
114 pass it to attach_section_to_segment.
115 * gold.cc (queue_middle_tasks): Update caller.
116 * layout.h (Layout): Update method decls with new arguments.
117
118 * arm.cc (Target_arm::Target_arm): Take optional argument for the
119 Target_info pointer to use.
120 (Target_arm::do_make_data_plt): New virtual method.
121 (Target_arm::make_data_plt): New method that calls it.
122 (Target_arm::make_plt_entry): Use it.
123 (Output_data_plt_arm::Output_data_plt_arm): Take additional argument
124 for the section alignment.
125 (Output_data_plt_arm::do_first_plt_entry_offset): New abstract virtual
126 method.
127 (Output_data_plt_arm::first_plt_entry_offset): Call it.
128 (Output_data_plt_arm::do_get_plt_entry_size): New abstract virtual
129 method.
130 (Output_data_plt_arm::get_plt_entry_size): Call it.
131 (Output_data_plt_arm::do_fill_plt_entry): New abstract virtual method.
132 (Output_data_plt_arm::fill_plt_entry): New method that calls it.
133 (Output_data_plt_arm::do_fill_first_plt_entry): New abstract virtual
134 method.
135 (Output_data_plt_arm::fill_first_plt_entry): New method that calls it.
136 (Output_data_plt_arm::set_final_data_size): Use get_plt_entry_size
137 method instead of sizeof(plt_entry).
138 (Output_data_plt_arm::add_entry): Likewise.
139 Use first_plt_entry_offset method instead of sizeof(first_plt_entry).
140 (Target_arm::first_plt_entry_offset): Call method on this->plt_ rather
141 than static method.
142 (Target_arm::plt_entry_size): Likewise.
143 (Output_data_plt_arm::first_plt_entry, Output_data_plt_arm::plt_entry):
144 Move to ...
145 (Output_data_plt_arm_standard): ... here, new class.
146 (Output_data_plt_arm::do_write): Move guts of PLT filling to...
147 (Output_data_plt_arm_standard::do_fill_first_plt_entry): ... here ...
148 (Output_data_plt_arm_standard::do_fill_plt_entry): ... and here.
149
150 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
151 Take additional argument for the PLT entry size.
152 (Output_data_plt_x86_64::get_tlsdesc_plt_offset):
153 Use get_plt_entry_size method rather than plt_entry_size variable.
154 (Output_data_plt_x86_64::reserve_slot): Likewise.
155 (Output_data_plt_x86_64::do_adjust_output_section): Likewise.
156 (Output_data_plt_x86_64::add_entry): Likewise.
157 (Output_data_plt_x86_64::add_local_ifunc_entry): Likewise.
158 (Output_data_plt_x86_64::address_for_global): Likewise.
159 (Output_data_plt_x86_64::address_for_local): Likewise.
160 (Output_data_plt_x86_64::set_final_data_size): Likewise.
161 (Output_data_plt_x86_64::first_plt_entry_offset): Likewise.
162 Make method non-static.
163 (Output_data_plt_x86_64::do_get_plt_entry_size): New abstract virtual
164 method.
165 (Output_data_plt_x86_64::get_plt_entry_size): Just call that.
166 (Output_data_plt_x86_64::do_add_eh_frame): New abstract virtual method.
167 (Output_data_plt_x86_64::add_eh_frame): New method to call it.
168 (Output_data_plt_x86_64::do_fill_first_plt_entry): New abstract
169 virtual method.
170 (Output_data_plt_x86_64::fill_first_plt_entry): New method to call it.
171 (Output_data_plt_x86_64::do_fill_plt_entry): New abstract
172 virtual method.
173 (Output_data_plt_x86_64::fill_plt_entry): New method to call it.
174 (Output_data_plt_x86_64::do_fill_tlsdesc_entry): New abstract
175 virtual method.
176 (Output_data_plt_x86_64::fill_tlsdesc_entry): New method to call it.
177 (Output_data_plt_x86_64::plt_entry_size)
178 (Output_data_plt_x86_64::first_plt_entry)
179 (Output_data_plt_x86_64::plt_entry)
180 (Output_data_plt_x86_64::tlsdesc_plt_entry)
181 (Output_data_plt_x86_64::plt_eh_frame_fde_size)
182 (Output_data_plt_x86_64::plt_eh_frame_fde): Move to ...
183 (Output_data_plt_x86_64_standard): ... here, new class.
184 (Target_x86_64::Target_x86_64): Take optional argument for the
185 Target_info pointer to use.
186 (Target_x86_64::do_make_data_plt): New virtual method.
187 (Target_x86_64::make_data_plt): New method to call it.
188 (Target_x86_64::init_got_plt_for_update): Use that.
189 Call this->plt_->add_eh_frame method here.
190 (Output_data_plt_x86_64::init): Don't do add_eh_frame_for_plt here.
191 (Target_x86_64::first_plt_entry_offset): Call method on this->plt_
192 rather than static method.
193 (Target_x86_64::plt_entry_size): Likewise.
194 (Output_data_plt_x86_64::do_write): Use get_plt_entry_size method
195 rather than plt_entry_size variable. Move guts of PLT filling to...
196 (Output_data_plt_x86_64_standard::do_fill_first_plt_entry): ... here ...
197 (Output_data_plt_x86_64_standard::do_fill_plt_entry): ... and here ...
198 (Output_data_plt_x86_64_standard::do_fill_tlsdesc_entry): ... and here.
199
200 * i386.cc (Output_data_plt_i386::Output_data_plt_i386): Take
201 additional argument for the section alignment.
202 Don't do add_eh_frame_for_plt here.
203 (Output_data_plt_i386::first_plt_entry_offset): Make the method
204 non-static. Use get_plt_entry_size method rather than plt_entry_size
205 variable.
206 (Output_data_plt_i386::do_get_plt_entry_size): New abstract virtual
207 method.
208 (Output_data_plt_i386::get_plt_entry_size): Call it.
209 (Output_data_plt_i386::do_add_eh_frame): New abstract virtual method.
210 (Output_data_plt_i386::add_eh_frame): New method to call it.
211 (Output_data_plt_i386::do_fill_first_plt_entry): New abstract virtual
212 method.
213 (Output_data_plt_i386::fill_first_plt_entry): New method to call it.
214 (Output_data_plt_i386::do_fill_plt_entry): New abstract virtual
215 method.
216 (Output_data_plt_i386::fill_plt_entry): New method to call it.
217 (Output_data_plt_i386::set_final_data_size): Use get_plt_entry_size
218 method instead of plt_entry_size.
219 (Output_data_plt_i386::plt_entry_size)
220 (Output_data_plt_i386::plt_eh_frame_fde_size)
221 (Output_data_plt_i386::plt_eh_frame_fde): Move to ...
222 (Output_data_plt_i386_standard): ... here, new class.
223 (Output_data_plt_i386_exec): New class.
224 (Output_data_plt_i386::exec_first_plt_entry): Move to ...
225 (Output_data_plt_i386_exec::first_plt_entry): ... here.
226 (Output_data_plt_i386::exec_plt_entry): Move to ...
227 (Output_data_plt_i386_exec::plt_entry): ... here.
228 (Output_data_plt_i386_dyn): New class.
229 (Output_data_plt_i386::first_plt_entry): Move to ...
230 (Output_data_plt_i386_dyn::first_plt_entry): ... here.
231 (Output_data_plt_i386::dyn_plt_entry): Move to ...
232 (Output_data_plt_i386_dyn::plt_entry): ... here.
233 (Target_i386::Target_i386): Take optional argument for the Target_info
234 pointer to use.
235 (Target_i386::do_make_data_plt): New virtual method.
236 (Target_i386::make_data_plt): New method to call it.
237 (Target_i386::make_plt_section): Use that.
238 Call this->plt_->add_eh_frame method here.
239 (Output_data_plt_i386::add_entry): Use get_plt_entry_size method
240 rather than plt_entry_size variable.
241 (Output_data_plt_i386::add_local_ifunc_entry): Likewise.
242 (Output_data_plt_i386::address_for_local): Likewise.
243 (Output_data_plt_i386::do_write): Likewise.
244 Move guts of PLT filling to...
245 (Output_data_plt_i386_exec::do_fill_first_plt_entry): ... here ...
246 (Output_data_plt_i386_exec::do_fill_plt_entry): ... and here ...
247 (Output_data_plt_i386_dyn::do_fill_first_plt_entry): ... and here ...
248 (Output_data_plt_i386_dyn::do_fill_plt_entry): ... and here.
249
b9b9f2ee
CC
2502012-05-01 Cary Coutant <ccoutant@google.com>
251
252 * dwarf_reader.cc (Dwarf_die::read_attributes)
253 (Dwarf_die::skip_attributes, Dwarf_die::int_attribute)
254 (Dwarf_die::uint_attribute): Remove DW_FORM_null.
255 * reduced_debug_output.cc
256 (Output_reduced_debug_info_section::get_die_end): Remove
257 DW_FORM_GNU_ref_index. Add default case.
258
57923f48
MW
2592012-04-26 Mark Wielaard <mjw@redhat.com>
260
261 * dwarf_reader.cc (Dwarf_die::address_attribute): New function.
262 * dwarf_reader.h (Dwarf_die::address_attribute): Likewise.
263 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Handle
264 DW_AT_high_pc as offset from DW_AT_low_pc.
265
266 * testsuite/Makefile.am (gdb_index_test_3.sh): New test case.
267 * testsuite/Makefile.in: Regenerate.
268 * testsuite/gdb_index_test_3.c: New test source file.
269 * testsuite/gdb_index_test_3.sh: New test source file.
270
2c54b4f4
ILT
2712012-04-25 Ian Lance Taylor <iant@google.com>
272
273 * arm.cc (Target_arm::do_is_defined_by_abi): Make sym a const
274 pointer.
275 (Stub_addend_reader::operator()): Declare Arm_relocate_functions
276 as a class, not a struct.
277 (Target_arm::scan_span_for_cortex_a8_erratum): Likewise.
278 (Target_arm::apply_cortex_a8_workaround): Likewise.
279 * gc.h: Declare Reloc_types as a struct, not a class.
280 * object.h: Declare Symbols_data as a struct.
281 * reloc.h: Declare Read_relocs_data as a struct.
282 * target.h: Declare Relocate_info as a struct.
283
a5a5f7a3
DM
2842012-04-24 David S. Miller <davem@davemloft.net>
285
286 * sparc.cc (Target_sparc::Relocate::relax_call): New function.
287 (Target_sparc::Relocate::relocate): Call it for R_SPARC_WDISP30
288 and R_SPARC_WPLT30.
289
f038d496
CC
2902012-04-24 Cary Coutant <ccoutant@google.com>
291
292 * incremental-dump.cc (find_input_containing_global): Replace
293 magic number with symbolic constant.
294 (dump_incremental_inputs): Update version number.
295 * incremental.cc (Output_section_incremental_inputs): Update version
296 number; import symbolic constants from Incremental_inputs_reader.
297 (Incremental_inputs::create_data_sections): Align relocations
298 section correctly for 64-bit targets.
299 (Output_section_incremental_inputs::set_final_data_size): Use symbolic
300 constants; add padding.
301 (Output_section_incremental_inputs::write_header): Add assert for
302 header_size.
303 (Output_section_incremental_inputs::write_input_files): Add assert
304 for input_entry_size.
305 (Output_section_incremental_inputs::write_info_blocks): Add padding;
306 add assert for object_info_size, input_section_entry_size,
307 global_sym_entry_size.
308 * incremental.h (Incremental_inputs_reader): Add symbolic constants
309 for data structure sizes; use them.
310 (Incremental_input_entry_reader): Import symbolic constants from
311 Incremental_inputs_reader; use them.
312
a4d85145
DM
3132012-04-23 David S. Miller <davem@davemloft.net>
314
315 * sparc.cc (class Target_sparc): Add elf_machine_, elf_flags_,
316 and elf_flags_set_.
317 (Target_sparc::Target_sparc): Initialize new fields.
318 (Target_sparc::do_make_elf_object): New function.
319 (Target_sparc::do_adjust_elf_header): New function.
320
1d509098
CC
3212012-04-23 Cary Coutant <ccoutant@google.com>
322
323 * gdb-index.cc (Gdb_index::do_write): Use Swap_aligned32 for writing
324 CU range table of gdb index.
325
7ebeff7f
DM
3262012-04-20 David S. Miller <davem@davemloft.net>
327
328 * target.cc (Sized_target::do_adjust_elf_header): Use big_endian
329 instead of false.
330
13cf9988
DM
3312012-04-16 David S. Miller <davem@davemloft.net>
332
2a1079e8
DM
333 * sparc.cc (Target_sparc::got_address): New function.
334 (Sparc_relocate_functions::gdop_hix22): New function.
335 (Sparc_relocate_functions::gdop_lox10): New function.
336 (Target_sparc::Scan::local): Do not emit a GOT entry for GOTDATA
337 relocs.
338 (Target_sparc::Scan::local): Likewise if the global symbol is not
339 preemptible and is not IFUNC.
340 (Target_sparc::Relocate::relocate): Perform GOTDATA code
341 transformations for local and non-preemptible non-IFUNC global
342 symbols.
343
0bc964fc
DM
344 * gdb-index.cc (Gdb_index::do_write): Use Swap_unaligned when
345 writing out 64-bit part of ranges.
346
661d7a80
DM
347 * Makefile.am: Build IFUNC tests with -fPIC and -fPIE instead of
348 -fpic and -fpie respectively.
349 * Makefile.in: Regenerate.
350
8c2bf391
DM
351 * sparc.cc (class Target_sparc): Add rela_ifunc_.
352 (Target_sparc::Target_sparc): Initialize new field.
353 (Target_sparc::do_plt_section_for_global): New function.
354 (Target_sparc::do_plt_section_for_local): New function.
355 (Target_sparc::reloc_needs_plt_for_ifunc): New function.
356 (Target_sparc::make_plt_section): New function, broken out of
357 make_plt_entry. Use ORDER_NON_RELRO_FIRST for ".plt".
358 (Target_sparc::make_plt_entry): Call make_plt_section.
359 (Target_sparc::make_local_ifunc_plt_entry): New function.
360 (Target_sparc::rela_ifunc_section): New function.
361 (Target_sparc::plt_section): Remove const.
362 (Output_data_plt_sparc): Update declarations. Define Global_ifunc
363 and Local_ifunc types. Add global_ifuncs_, local_ifuncs_, ifunc_rel_,
364 and ifunc_count_ fields.
365 (Output_data_plt_sparc::Output_data_plt_sparc): Initialize new fields.
366 (Output_data_plt_sparc::add_entry): Handle IFUNC symbols.
367 (Output_data_plt_sparc::add_local_ifunc_entry): New function.
368 (Output_data_plt_sparc::rela_ifunc): New function.
369 (Output_data_plt_sparc::emit_pending_ifunc_relocs): New function.
370 (Output_data_plt_sparc::has_ifunc_section): New function.
371 (Output_data_plt_sparc::entry_count): Include ifunc_count_.
372 (Output_data_plt_sparc::address_for_global): New function.
373 (Output_data_plt_sparc::address_for_local): New function.
374 (Output_data_plt_sparc::plt_index_to_offset): New function.
375 (Output_data_plt_sparc::set_final_data_size): Use plt_index_to_offset
376 and entry_count.
377 (Output_data_plt_sparc::do_write): Use first_plt_entry_offset and
378 entry_count.
379 (Target_sparc::Scan::get_reference_flags): Add R_SPARC_IRELATIVE and
380 R_SPARC_JMP_IREL to switch.
381 (Target_sparc::Scan::check_non_pic): Likewise.
382 (Target_sparc::Scan::local): Handle IFUNC symbols.
383 (Target_sparc::Scan::local): Likewise.
384 (Target_sparc::Relocate::relocate): Likewise, use plt_address_for_global
385 and plt_address_for_local.
386 (Target_sparc::do_finalize_sections): Call emit_pending_ifunc_relocs.
387 Define __rel_iplt_start and __rel_iplt_end if doing a static link.
388
13cf9988
DM
389 * output.h (Output_reloc): Allow use_plt_offset for global relocs too.
390 (class Output_data_reloc): Adjust calls to Output_reloc_type.
391 (Output_data_reloc::add_global_relative): (RELA only) Add use_plt_offset.
392 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag for
393 global relocs too.
394 (Output_reloc::symbol_value): Respect use_plt_offset_ for global symbols.
395 * powerpc.cc (Target_powerpc::Scan::global): Adjust add_global_relative
396 calls.
397 * sparc.cc (Target_sparc::Scan::global): Likewise.
398 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
399
31821be0
CC
4002012-04-16 Cary Coutant <ccoutant@google.com>
401
402 * archive.cc (Library_base::should_include_member): Check for
403 --export-dynamic-symbol.
404 * options.h (class General_options): Add --export-dynamic-symbol.
405 * symtab.cc (Symbol::should_add_dynsym_entry): Check for
406 --export-dynamic-symbol.
407 (Symbol_table::gc_mark_undef_symbols): Likewise.
408 (Symbol_table::do_add_undefined_symbols_from_command_line): Likewise.
409
2615994e
DM
4102012-04-12 David S. Miller <davem@davemloft.net>
411
412 * sparc.cc (Reloc::wdisp10): New relocation method.
413 (Reloc::h34): Likewise.
414 (Target_sparc::Scan::check_non_pic): Handle R_SPARC_H34.
415 (Target_sparc::Scan::get_reference_flags): Handle R_SPARC_H34 and
416 R_SPARC_WDISP10.
417 (Target_sparc::Scan::local): Likewise.
418 (Target_sparc::Scan::global): Likewise.
419 (Target_sparc::Relocate::relocate): Likewise.
420
6782735d
CC
4212012-04-09 Cary Coutant <ccoutant@google.com>
422
423 * gdb-index.cc (Gdb_index_info_reader::record_cu_ranges): Allow
424 low_pc == 0.
425
8c7a0b00
ILT
4262012-04-06 Ian Lance Taylor <iant@google.com>
427
428 * timer.cc: #include <unistd.h>.
429
58797674
RM
4302012-04-06 Roland McGrath <mcgrathr@google.com>
431
432 * configure.in (AC_CHECK_HEADERS): Add locale.h.
433 * config.in: Regenerate.
434 * configure: Regenerate.
435
44350750
NC
4362012-04-05 Nick Clifton <nickc@redhat.com>
437
438 * configure.ac (AC_CHECK_FUNCS): Add setlocale.
439 (AM_LC_MESSAGES): Add.
440 * aclocal.m4: Regenerate.
441 * config.in: Regenerate.
442 * configure: Regenerate.
443
c1027032
CC
4442012-03-21 Cary Coutant <ccoutant@google.com>
445
446 * Makefile.am: Add gdb-index.cc, gdb-index.h.
447 * Makefile.in: Regenerate.
448 * dwarf_reader.cc (Sized_elf_reloc_mapper::do_initialize): New function.
449 (Sized_elf_reloc_mapper::symbol_section): New function.
450 (Sized_elf_reloc_mapper::do_get_reloc_target): New function.
451 (make_elf_reloc_mapper): New function.
452 (Dwarf_abbrev_table::clear_abbrev_codes): New function.
453 (Dwarf_abbrev_table::do_read_abbrevs): New function.
454 (Dwarf_abbrev_table::do_get_abbrev): New function.
455 (Dwarf_ranges_table::read_ranges_table): New function.
456 (Dwarf_ranges_table::read_range_list): New function.
457 (Dwarf_pubnames_table::read_section): New function.
458 (Dwarf_pubnames_table::read_header): New function.
459 (Dwarf_pubnames_table::next_name): New function.
460 (Dwarf_die::Dwarf_die): New function.
461 (Dwarf_die::read_attributes): New function.
462 (Dwarf_die::skip_attributes): New function.
463 (Dwarf_die::set_name): New function.
464 (Dwarf_die::set_linkage_name): New function.
465 (Dwarf_die::attribute): New function.
466 (Dwarf_die::string_attribute): New function.
467 (Dwarf_die::int_attribute): New function.
468 (Dwarf_die::uint_attribute): New function.
469 (Dwarf_die::ref_attribute): New function.
470 (Dwarf_die::child_offset): New function.
471 (Dwarf_die::sibling_offset): New function.
472 (Dwarf_info_reader::check_buffer): New function.
473 (Dwarf_info_reader::parse): New function.
474 (Dwarf_info_reader::do_parse): New function.
475 (Dwarf_info_reader::do_read_string_table): New function.
476 (Dwarf_info_reader::lookup_reloc): New function.
477 (Dwarf_info_reader::get_string): New function.
478 (Dwarf_info_reader::visit_compilation_unit): New function.
479 (Dwarf_info_reader::visit_type_unit): New function.
480 (Sized_dwarf_line_info::Sized_dwarf_line_info): Use
481 Sized_elf_reloc_mapper.
482 (Sized_dwarf_line_info::symbol_section): Remove function.
483 (Sized_dwarf_line_info::read_relocs): Use Sized_elf_reloc_mapper.
484 (Sized_dwarf_line_info::read_line_mappings): Remove object
485 parameter, adjust callers.
486 (Sized_dwarf_line_info::format_file_lineno): Fix type of cast.
487 * dwarf_reader.h: Include <sys/types.h>.
488 (class Track_relocs): Remove forward declaration.
489 (class Elf_reloc_mapper): New class.
490 (class Sized_elf_reloc_mapper): New class.
491 (class Dwarf_abbrev_table): New class.
492 (class Dwarf_range_list): New class.
493 (class Dwarf_ranges_table): New class.
494 (class Dwarf_pubnames_table): New class.
495 (class Dwarf_die): New class.
496 (class Dwarf_info_reader): New class.
497 (Sized_dwarf_line_info::read_line_mappings): Remove object parameter.
498 (Sized_dwarf_line_info::symbol_section): Remove member function.
499 * dynobj.h (Sized_dynobj::do_section_contents): Refactor code from
500 base class.
501 * gdb-index.cc: New source file.
502 * gdb-index.h: New source file.
503 * incremental.cc (Sized_relobj_incr::do_layout): Track .debug_info
504 and .debug_types sections, call Layout::add_to_gdb_index.
505 (Sized_relobj_incr::do_section_name): Implement.
506 (Sized_relobj_incr::do_section_contents): Adjust parameter list and
507 return type; Implement.
508 (Sized_incr_dynobj::do_section_contents): Adjust parameter list and
509 return type.
510 * incremental.h (Sized_relobj_incr::do_section_contents): Adjust
511 parameter list and return type.
512 (Sized_incr_dynobj::do_section_contents): Likewise.
513 * layout.cc: Include gdb-index.h.
514 (Layout::Layout): Initialize gdb_index_data_.
515 (Layout::init_fixed_output_section): Check for .gdb_index section.
516 (Layout::add_to_gdb_index): New function. Instantiate.
517 * layout.h: Add forward declaration for class Gdb_index.
518 (Layout::add_to_gdb_index): New member function.
519 (Layout::gdb_index_data_): New data member.
520 * main.cc: Include gdb-index.h.
521 (main): Print statistics for gdb index.
522 * object.cc (Object::section_contents): Move code into
523 do_section_contents.
524 (need_decompressed_section): Check for sections needed when building
525 gdb index.
526 (build_compressed_section_map): Likewise.
527 (Sized_relobj_file::do_read_symbols): Need local symbols when building
528 gdb index.
529 (Sized_relobj_file::do_layout): Track .debug_info and .debug_types
530 sections; call Layout::add_to_gdb_index.
531 (Sized_relobj_file::do_decompressed_section_contents): Call
532 do_section_contents directly.
533 * object.h (Object::do_section_contents): Adjust parameter list and
534 return type.
535 (Object::do_decompressed_section_contents): Call do_section_contents
536 directly.
537 (Sized_relobj_file::do_section_contents): Adjust parameter list and
538 return type.
539 * options.h (class General_options): Add --gdb-index option.
540 * plugin.cc (Sized_pluginobj::do_section_contents): Adjust parameter
541 list and return type.
542 * plugin.h (Sized_pluginobj::do_section_contents): Likewise.
543 * reloc.h (Track_relocs::checkpoint): New function.
544 (Track_relocs::reset): New function.
545
546 * testsuite/Makefile.am (gdb_index_test_1.sh, gdb_index_test_2.sh):
547 New test cases.
548 * testsuite/Makefile.in: Regenerate.
549 * testsuite/gdb_index_test.cc: New test source file.
550 * testsuite/gdb_index_test_1.sh: New test source file.
551 * testsuite/gdb_index_test_2.sh: New test source file.
552
647f1574
DK
5532012-03-19 Doug Kwan <dougkwan@google.com>
554
555 * arm.cc (Target_arm::do_define_standard_symbols): New method.
2e702c99 556 (Target_arm::do_finalize_sections): Remove code which defines
647f1574
DK
557 __exidx_start and __exidx_end. Make symbol table parameter
558 anonymous as it is not used.
559 * gold.cc (queue_middle_tasks): Call target hook to define any
560 target-specific symbols.
561 * target.h (Target::define_standard_symbols): New method.
562 (Target::do_define_standard_symbols): Same.
563 * testsuite/Makefile.am (arm_exidx_test): Dump relocations also.
564 * testsuite/Makefile.in: Regenerate.
565 * testsuite/arm_exidx.s: Generate data relocations for __exidx_start
566 and __exidx_end.
567 * testsuite/arm_exidx_test.sh: Check that no unused dynamic
568 relocations are generated for __exidx_start and __exidx_end.
569
7c6109da
DK
5702012-03-16 Doug Kwan <dougkwan@google.com>
571
572 * testsuite/Makefile.am: Disable test initpri3b.
573 * testsuite/Makefile.in: Regenerate.
574
7b8957f8
DK
5752012-03-15 Doug Kwan <dougkwan@google.com>
576
577 * arm.cc (Target_arm::got_section): Make .got section read-only
578 if -z now is given.
579
14dc9ef7
ILT
5802012-03-15 Ian Lance Taylor <iant@google.com>
581
582 PR gold/13850
583 * layout.cc (Layout::make_output_section): Correctly mark
584 SHT_INIT_ARRAY, et. al., as relro.
585
fa40b62a
DK
5862012-03-14 Doug Kwan <dougkwan@google.com>
587
588 * gold/arm.cc (Target_arm::Scan::global): Generate R_ARM_GLOB_DAT
589 dynamic relocations for protected symbols in shared objects.
590
fd325007
ILT
5912012-03-13 Ian Lance Taylor <iant@google.com>
592
593 * resolve.cc (Symbol_table::resolve): When merging common symbols,
594 keep the larger alignment.
595
e8dd54e1
CC
5962012-03-12 Cary Coutant <ccoutant@google.com>
597
598 * dwarf_reader.cc (Sized_dwarf_line_info::process_one_opcode): Fix
599 handling of DW_LNE_define_file.
600
feb5f3b0
CC
6012012-03-12 Cary Coutant <ccoutant@google.com>
602
603 * reduced_debug_output.cc
604 (Output_reduced_debug_info_section::get_die_end): Add new FORM
605 codes to switch.
606
a1fb4256
CC
6072012-02-29 Cary Coutant <ccoutant@google.com>
608
609 * object.cc (need_decompressed_section): Add #ifdef ENABLE_THREADS.
610
5dd8762a
CC
6112012-02-29 Cary Coutant <ccoutant@google.com>
612
613 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
614 Call Object::decompressed_section_contents.
615 * dwarf_reader.h (Sized_dwarf_line_info::~Sized_dwarf_line_info):
616 New dtor.
617 (Sized_dwarf_line_info::buffer_start_): New data member.
618 * merge.cc (Output_merge_data::do_add_input_section): Call
619 Object::decompressed_section_contents.
620 (Output_merge_string::do_add_input_section): Likewise.
621 * object.cc (need_decompressed_section): New function.
622 (build_compressed_section_map): Decompress sections needed later.
623 (Sized_relobj_file::do_decompressed_section_contents): New function.
624 (Sized_relobj_file::do_discard_decompressed_sections): New function.
625 * object.h (Object::decompressed_section_contents): New function.
626 (Object::discard_decompressed_sections): New function.
627 (Object::do_decompressed_section_contents): New function.
628 (Object::do_discard_decompressed_sections): New function.
629 (Compressed_section_info): New type.
630 (Compressed_section_map): Include decompressed section contents.
631 (Sized_relobj_file::do_decompressed_section_contents): New function.
632 (Sized_relobj_file::do_discard_decompressed_sections): New function.
633
7b5de7ee
CC
6342012-02-16 Cary Coutant <ccoutant@google.com>
635
636 * testsuite/Makefile.am (initpri2): Add --ctors-in-init-array option.
637 * testsuite/Makefile.in: Regenerate.
638
f9fa4a63
CC
6392012-02-14 Cary Coutant <ccoutant@google.com>
640
641 * options.cc (General_options::finalize): Disallow -pie and -static.
642
2c175ebc
DK
6432012-02-03 Doug Kwan <dougkwan@google.com>
644
645 * arm.cc (Arm_relocate_functions::abs8,
646 Arm_relocate_functions::abs16): Use
647 Bits::has_signed_unsigned_overflow32.
648 (Arm_relocate_functions::thm_abs8): Correct range of
649 overflow check.
650 * reloc.h (Bits class): Change minimum number of bits from 0 to 1
651 in assertions.
652
90cff06f
DK
6532012-02-02 Doug Kwan <dougkwan@google.com>
654
655 * arm.cc (Reloc_stub::stub_type_for_reloc): Use PIC stubs in all
656 position independent outputs, not just shared objects.
657
63887f3d
L
6582012-01-30 H.J. Lu <hongjiu.lu@intel.com>
659
660 * configure.ac: Check if -fpic -mtls-dialect=gnu2 works.
661 * configure: Regenerated.
662
bef2b434
ILT
6632012-01-27 Ian Lance Taylor <iant@google.com>
664
665 * reloc.h (Bits): New class with static functions, copied from
666 namespace utils in arm.cc.
667 * arm.cc (namespace utils): Remove. Rewrite all uses to use Bits
668 instead.
669
c335b55d
L
6702012-01-27 H.J. Lu <hongjiu.lu@intel.com>
671
672 * incremental.cc (write_info_blocks): Correct relocation offset.
673
41194d9f
L
6742012-01-27 H.J. Lu <hongjiu.lu@intel.com>
675
676 * x86_64.cc (Relocate::tls_gd_to_ie): Support x32.
677 (Relocate::tls_gd_to_le): Likewise.
678
1bae613c
L
6792012-01-27 H.J. Lu <hongjiu.lu@intel.com>
680
681 * x86_64.cc (Scan::global): Support x32 IFUNC function pointer.
682
24482ca0
L
6832012-01-27 H.J. Lu <hongjiu.lu@intel.com>
684
685 * configure.ac: Check if -mcmodel=medium works.
686 * configure: Regenerated.
687
c2c7840a
CC
6882012-01-24 Cary Coutant <ccoutant@google.com>
689
690 * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline
691 definition and ...
692 (read_unsigned_LEB_128_x): ... this new function.
693 (read_signed_LEB_128): Replaced with inline definition and ...
694 (read_signed_LEB_128_x): ... this new function.
695 * int_encoding.h (read_unsigned_LEB_128_x): New function.
696 (read_unsigned_LEB_128): Add inline definition.
697 (read_signed_LEB_128_x): New function.
698 (read_signed_LEB_128): Add inline definition.
699 * testsuite/Makefile.am (leb128_unittest): New unit test.
700 * testsuite/Makefile.in: Regenerate.
701 * testsuite/leb128_unittest.cc: New unit test.
702
833de760 7032012-01-23 Ian Lance Taylor <iant@google.com>
9dee3b3c
ILT
704
705 PR gold/13617
706 * i386.cc (Target_i386::do_code_fill): When using a jmp
707 instruction, pad with nop instructions.
708 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
709
618d6666
L
7102012-01-22 H.J. Lu <hongjiu.lu@intel.com>
711
712 * x86_64.cc (gc_process_relocs): Add typename on types used in
713 template.
714 (scan_relocs): Likewise.
715 (relocate_section): Likewise.
716 (apply_relocation): Likewise.
717
3660ff06
L
7182012-01-10 H.J. Lu <hongjiu.lu@intel.com>
719
720 * x86_64.cc (Scan::check_non_pic): Allow R_X86_64_32 for x32.
721 (Scan::local): Use R_X86_64_RELATIVE relocation for R_X86_64_32
722 under x32.
723
fc51264f
L
7242012-01-09 H.J. Lu <hongjiu.lu@intel.com>
725
726 * x86_64.cc: Initial support for x32.
727
dd74ae06
CC
7282012-01-03 Cary Coutant <ccoutant@google.com>
729
730 * gold/incremental.cc (Sized_incremental_binary::do_process_got_plt):
731 Use abstract base class for GOT.
732 * gold/output.h (class Output_data_got_base): New abstract base class.
733 (class Output_data_got): Derive from new base class, adjust ctors.
734 (Output_data_got::reserve_slot): Make virtual; rename to
735 do_reserve_slot; Adjust callers.
736 * gold/target.h (Sized_target::init_got_plt_for_update): Return
737 pointer to abstract base class.
738 * gold/x86_64.cc (Target_x86_64::init_got_plt_for_update): Likewise.
739
83896202
ILT
7402011-12-18 Ian Lance Taylor <iant@google.com>
741
742 * object.h (Relobj::local_symbol_value): New function.
743 (Relobj::local_plt_offset): New function.
744 (Relobj::local_has_got_offset): New function.
745 (Relobj::local_got_offset): New function.
746 (Relobj::set_local_got_offset): New function.
747 (Relobj::do_local_symbol_value): New pure virtual function.
748 (Relobj::do_local_plt_offset): Likewise.
749 (Relobj::do_local_has_got_offset): Likewise.
750 (Relobj::do_local_got_offset): Likewise.
751 (Relobj::do_set_local_got_offset): Likewise.
752 (Sized_relobj::do_local_has_got_offset): Rename from
753 local_has_got_offset.
754 (Sized_relobj::do_local_got_offset): Rename from local_got_offset.
755 (Sized_relobj::do_set_local_got_offset): Rename from
756 set_local_got_offset.
757 (Sized_relobj_file::do_local_plt_offset): Rename from
758 local_plt_offset.
759 (Sized_relobj_file::do_local_symbol_value): New function.
760 * object.cc (Sized_relobj_file::do_local_plt_offset): Rename from
761 local_plt_offset.
762 * output.cc (Output_data_got::Got_entry::write): Change object to
763 Relobj. Use local_symbol_value.
764 (Output_data_got::add_global_with_rel): Change rel_dyn to
765 Output_data_reloc_generic*. Use add_global_generic.
766 (Output_data_got::add_global_with_rela): Remove. Change all
767 callers to use add_global_with_rel.
768 (Output_data_got::add_global_pair_with_rel): Change rel_dyn to
769 Output_data_reloc_generic*. Use add_global_generic.
770 (Output_data_got::add_global_pair_with_rela): Remove. Change all
771 callers to use add_global_pair_with_rel.
772 (Output_data_got::add_local): Change object to Relobj*.
773 (Output_data_got::add_local_plt): Likewise.
774 (Output_data_got::add_local_with_rel): Change object to Relobj*,
775 change rel_dyn to Output_data_reloc_generic*. Use
776 add_local_generic.
777 (Output_data_got::add_local_with_rela): Remove. Change all
778 callers to use all_local_with_rel.
779 (Output_data_got::add_local_pair_with_rel): Change object to
780 Relobj*, change rel_dyn to Output_data_reloc_generic*. Use
781 add_output_section_generic.
782 (Output_data_got::add_local_pair_with_rela): Remove. Change all
783 callers to use add_local_pair_with_rel.
784 (Output_data_got::reserve_local): Change object to Relobj*.
785 * output.h: (class Output_data_reloc_generic): Add pure virtual
786 declarations for add_global_generic, add_local_generic,
787 add_output_section_generic.
788 (class Output_data_reloc) [SHT_REL, SHT_RELA]: Implement new
789 functions for Output_data_reloc_generic. Update declarations for
790 changes listed in output.cc.
791 (class Output_data_got): Change template parameter to got_size.
792 Don't define Rel_dyn or Rela_dyn. Update declarations per above.
793 * incremental.h (Sized_relobj_incr::do_local_symbol_value): New
794 function.
795 (Sized_relobj_incr::do_local_plt_offset): New function.
796 * copy-relocs.cc (Copy_relocs::Copy_reloc_entry::emit): Call
797 add_global_generic.
798
76677ad0
CC
7992011-12-17 Cary Coutant <ccoutant@google.com>
800
801 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Add casts.
802 * resolve.cc (Symbol_table::resolve): Likewise.
803 * i386.cc (Target_i386::do_code_fill): Use char constants for nop
804 arrays.
805 * x86_64.cc (Target_x86_64::do_code_fill): Likewise.
806
8b8dd8d5
ILT
8072011-12-16 Ian Lance Taylor <iant@google.com>
808
809 * output.h (Output_data_reloc_generic::add): Only call
810 add_dynamic_reloc if this is a dynamic reloc section.
811
d55525b9
L
8122011-12-15 H.J. Lu <hongjiu.lu@intel.com>
813
814 PR gold/13505
815 * target-reloc.h (apply_relocation): Replace <64, false> with
816 <size, big_endian>.
817
ff81c7c1
NC
8182011-11-25 Nick Clifton <nickc@redhat.com>
819
820 * po/it.po: New Italian translation.
821
628f39be
SA
8222011-11-17 Sterling Augustine <saugustine@google.com>
823
824 * script.cc (script_include_directive): Implement.
825 (read_script_file): New local variables name and search_path. Update
826 comment. Call IS_ABSOLUTE_PATH and Dirsearch::find_file_in_dir_list.
827 * dirsearch.h (Dirsearch::find_file_in_dir_list): Declare new method.
828 * dirsearch.cc (Dirsearch::find_file_in_dir_list): Implement it.
829
98ef3ea4
SA
8302011-11-11 Sterling Augustine <saugustine@google.com>
831
832 * yyscript.y (section_cmd): Add support for INCLUDE directive.
833 (file_or_sections_cmd): Likewise.
834
f4a8b6d7
DK
8352011-11-11 Doug Kwan <dougkwan@google.com>
836
837 * arm.cc (Target_arm::do_make_elf_object): Allow executable also
838 if --just-symbols is given.
839
29ab395d
DK
8402011-11-10 Doug Kwan <dougkwan@google.com>
841
842 PR gold/13362
843 * arm.cc (Target_arm::Relocate::relocate_tls): Do unaligned accesses
844 when processing data relocs.
845 * reloc.h (Relocate_functions::rel_unaligned): New method.
846 (Relocate_functions::pcrel_unaligned): Ditto.
847 (Relocate_functions::rel32_unaligned): Ditto.
848 (Relocate_functions::pcrel32_unaligned): Ditto.
849
2c339f71
DK
8502011-11-09 Doug Kwan <dougkwan@google.com>
851
852 PR gold/13362
853 * arm.cc (Arm_scan_relocatable_relocs::Default_scan_relocatable_relocs):
854 Use unaligned 4-byte relocs for static 32-bit data as required by EABI.
855 * reloc.h (Relocatable_relocs::Reloc_strategy): New enum
856 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
857 (Relocate_functions::rel_unaligned): New.
858 (Relocate_functions::rel32_unaligned): New.
859 * target-reloc.h (relocate_for_relocatable): Add code to handle
860 RELOC_ADJUST_FOR_SECTION_4_UNALIGNED.
861 * testsuite/Makefile.am (arm_unaligned_reloc_r.stdout,
862 arm_unaligned_reloc_r): New targets.
863 * testsuite/Makefile.in: Regenerate.
864 * arm_unaligned_reloc.sh: Check unaligned relocs in relocatable
865 linking.
866
3f3cddf1
ILT
8672011-11-02 Ian Lance Taylor <iant@google.com>
868
869 * configure.ac: Add --with-lib-path option. Define LIB_PATH and
870 NATIVE_LINKER.
871 * Makefile.am (AM_CPPFLAGS): Define TOOLLIBDIR.
872 * options.cc (General_options::finalize): Use library search path
873 from configure script if specified. If not native and no sysroot,
874 only search TOOLLIBDIR.
875 * options.h (Search_directory::Search_directory): Change name to
876 const std::string&.
877 (General_options::add_to_library_path_with_sysroot): Change arg to
878 const std::string&.
879 * configure, Makefile.in, config.in: Rebuild.
880
a8e2273b
ILT
8812011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
882
883 * arm.cc (Target_arm::may_use_v5t_interworking): Check whether
884 we are working around the ARM1176 Erratum.
885 * options.h (General_options::fix_arm1176): Add option.
886 * testsuite/Makefile.am: Add testcases, and keep current ones
887 working.
888 * testsuite/Makefile.in: Regenerate.
889 * testsuite/arm_fix_1176.s: New file.
890 * testsuite/arm_fix_1176.sh: Likewise.
891
cd6eab1c
ILT
8922011-11-02 Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
893
894 * arm.cc (Target_arm::Target_arm): Remove initialisation of
895 may_use_blx_.
896 (Target_arm::may_use_blx): Remove method.
897 (Target_arm::set_may_use_blx): Likewise.
898 (Target_arm::may_use_v4t_interworking): New method.
899 (Target_arm::may_use_v5t_interworking): Likewise.
900 (Target_arm::may_use_blx_): Remove member variable.
901 (Arm_relocate_functions::arm_branch_common): Check for v5T
902 interworking.
903 (Arm_relocate_functions::thumb_branch_common): Likewise.
904 (Reloc_stub::stub_type_for_reloc): Likewise.
905 (Target_arm::do_finalize_sections): Correct interworking checks.
906 * testsuite/Makefile.am: Add new tests.
907 * testsuite/Makefile.in: Regenerate.
908 * testsuite/arm_farcall_arm_arm.s: New test.
909 * testsuite/arm_farcall_arm_arm.sh: Likewise.
910 * testsuite/arm_farcall_arm_thumb.s: Likewise.
911 * testsuite/arm_farcall_arm_thumb.sh: Likewise.
912 * testsuite/arm_farcall_thumb_arm.s: Likewise.
913 * testsuite/arm_farcall_thumb_arm.sh: Likewise.
914 * testsuite/arm_farcall_thumb_thumb.s: Likewise.
915 * testsuite/arm_farcall_thumb_thumb.sh: Likewise.
916
286adcf4
CC
9172011-10-31 Cary Coutant <ccoutant@google.com>
918
919 PR gold/13023
920 * expression.cc (Expression::eval_with_dot): Add
921 is_section_dot_assignment parameter.
922 (Expression::eval_maybe_dot): Likewise. Adjust value when rhs is
923 absolute and assigning to dot within a section.
924 * script-sections.cc
925 (Output_section_element_assignment::set_section_addresses): Pass
926 dot_section to set_if_absolute.
927 (Output_section_element_dot_assignment::finalize_symbols): Pass TRUE
928 as is_section_dot_assignment flag to eval_with_dot.
929 (Output_section_element_dot_assignment::set_section_addresses):
930 Likewise.
931 * script.cc (Symbol_assignment::set_if_absolute): Add dot_section
932 parameter. Also set value if relative to dot_section; set the
933 symbol's output_section.
934 * script.h (Expression::eval_with_dot): Add is_section_dot_assignment
935 parameter. Adjust all callers.
936 (Expression::eval_maybe_dot): Likewise.
937 (Symbol_assignment::set_if_absolute): Add dot_section parameter.
938 Adjust all callers.
939 * testsuite/script_test_2.t: Test assignment of an absolute value
940 to dot within an output section element.
941
9634ed06
CC
9422011-10-31 Cary Coutant <ccoutant@google.com>
943
944 * options.h (class General_options): Add --[no-]gnu-unique options.
945 * symtab.cc (Symbol_table::sized_write_globals): Convert
946 STB_GNU_UNIQUE to STB_GLOBAL if --no-gnu-unique.
947
de4101c7
CC
9482011-10-31 Cary Coutant <ccoutant@google.com>
949
950 PR gold/13359
951 * i386.cc (Target_i386::Relocate::relocate_tls): Remove
952 unnecessary assertion.
953 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Likewise.
954
7257cc92
ST
9552011-10-31 Sriraman Tallam <tmsriram@google.com>
956
957 * symtab.h (Symbol_table::gc_mark_symbol_for_shlib): Rename to
958 gc_mark_symbol.
959 * symtab.cc (Symbol_table::gc_mark_symbol_for_shlib): Rename to
960 gc_mark_symbol.
961 Change to just keep the section associated with symbol.
962 (Symbol_table::add_from_relobj): Mark symbols as not garbage when
963 they are externally visible and --export-dynamic is turned on.
964 (Symbol_table::gc_mark_dyn_syms): Call gc_mark_symbol.
965
bfc34b3f
ILT
9662011-10-19 Ian Lance Taylor <iant@google.com>
967
968 PR gold/13163
969 * script-sections.cc
970 (Output_section_element_dot_assignment::needs_output_section): New
971 function.
972
ea0d8c47
ILT
9732011-10-19 Ian Lance Taylor <iant@google.com>
974
975 PR gold/13204
976 * layout.cc (Layout::segment_precedes): Don't assert failure if a
977 --section-start option was seen.
978 * options.h (General_options::any_section_start): New function.
979
abd242a9
DM
9802011-10-18 David S. Miller <davem@davemloft.net>
981
982 PR binutils/13301
983 * sparc.cc (Target_sparc::Relocate::reloc_adjust_addr_): New
984 member to track relocation locations that have moved during TLS
985 reloc optimizations.
986 (Target_sparc::Relocate::Relocate): Initialize to NULL.
987 (Target_sparc::Relocate::relocate): Adjust view down by 4
988 bytes if it matches reloc_adjust_addr_.
989 (Target_sparc::Relocate::relocate_tls): Always move the
990 __tls_get_addr call delay slot instruction forward 4 bytes when
991 performing relaxation.
992
bab9090f
CC
9932011-10-18 Cary Coutant <ccoutant@google.com>
994
995 * output.cc (posix_fallocate): Return 0 on success, errno on failure.
996 (Output_file::map_no_anonymous): Check for non-zero
997 return code from posix_fallocate.
998
f7c5b166
CC
9992011-10-17 Cary Coutant <ccoutant@google.com>
1000
1001 PR gold/13245
1002 * plugin.cc (is_visible_from_outside): Check for symbols
1003 referenced from dynamic objects.
1004 * resolve.cc (Symbol_table::resolve): Don't count references
1005 from dynamic objects as references from real ELF files.
1006 * testsuite/plugin_test_2.sh: Adjust expected result.
1007
b490c0bb
CC
10082011-10-17 Cary Coutant <ccoutant@google.com>
1009
1010 * gold.cc: Include timer.h.
1011 (queue_middle_tasks): Stamp time.
1012 (queue_final_tasks): Likewise.
1013 * main.cc (main): Store timer in parameters. Print timers
1014 for each pass.
1015 * parameters.cc (Parameters::Parameters): Initialize timer_.
1016 (Parameters::set_timer): New function.
1017 (set_parameters_timer): New function.
1018 * parameters.h (Parameters::set_timer): New function.
1019 (Parameters::timer): New function.
1020 (Parameters::timer_): New data member.
1021 (set_parameters_timer): New function.
1022 * timer.cc (Timer::stamp): New function.
1023 (Timer::get_pass_time): New function.
1024 * timer.h (Timer::stamp): New function.
1025 (Timer::get_pass_time): New function.
1026 (Timer::pass_times_): New data member.
1027
f475cf7b
CC
10282011-10-17 Cary Coutant <ccoutant@google.com>
1029
1030 * readsyms.cc (Read_symbols::run): Don't queue an unblocker
1031 task for members of lib groups.
1032
cdd7e244
CC
10332011-10-17 Cary Coutant <ccoutant@google.com>
1034
1035 PR gold/13288
4f95c8b4 1036 * fileread.cc (File_read::find_view): Add assert.
cdd7e244
CC
1037 (File_read::make_view): Move bounds check (replace with assert)...
1038 (File_read::find_or_make_view): ... to here.
1039
dfb45471
CC
10402011-10-12 Cary Coutant <ccoutant@google.com>
1041
4f95c8b4 1042 * output.cc (Output_file::open_base_file): Handle case where
dfb45471
CC
1043 ::read returns less than requested size.
1044
53bbcc1b
CC
10452011-10-10 Cary Coutant <ccoutant@google.com>
1046
4f95c8b4 1047 * incremental.cc (Sized_relobj_incr::Sized_relobj_incr):
53bbcc1b
CC
1048 Initialize defined_count_.
1049 (Sized_relobj_incr::do_add_symbols): Count defined symbols.
1050 (Sized_relobj_incr::do_get_global_symbol_counts): Rewrite.
1051 (Sized_incr_dynobj::Sized_incr_dynobj): Initialize defined_count_.
1052 (Sized_incr_dynobj::do_add_symbols): Count defined symbols.
1053 (Sized_incr_dynobj::do_get_global_symbol_counts): Rewrite.
4f95c8b4 1054 * incremental.h (Sized_relobj_incr::defined_count_): New data
53bbcc1b
CC
1055 member.
1056 (Sized_incr_dynobj::defined_count_): New data member.
4f95c8b4 1057 * plugin.cc (Sized_pluginobj::do_get_global_symbol_counts):
53bbcc1b
CC
1058 Return zeroes instead of internal error.
1059
397b129b
CC
10602011-10-10 Cary Coutant <ccoutant@google.com>
1061
1062 PR gold/13249
4f95c8b4 1063 * output.cc (Output_reloc::Output_reloc): Add use_plt_offset flag.
397b129b 1064 (Output_reloc::symbol_value): Return PLT offset if flag is set.
4f95c8b4 1065 * output.h (class Output_reloc): Add use_plt_offset flag.
397b129b
CC
1066 (Output_reloc::type_): Adjust size of bit field.
1067 (Output_reloc::use_plt_offset_): New bit field.
1068 (class Output_data_reloc): Adjust all calls to Output_reloc_type.
1069 (Output_data_reloc::add_local_relative): (RELA only) Add use_plt_offset
1070 flag. Adjust all callers.
4f95c8b4 1071 * x86_64.cc (Target_x86_64::Scan::local): Check for IFUNC when
397b129b
CC
1072 creating RELATIVE relocations.
1073
d5698657
NC
10742011-10-10 Nick Clifton <nickc@redhat.com>
1075
1076 * po/es.po: Updated Spanish translation.
1077 * po/fi.po: Updated Finnish translation.
1078
6a59a5c2
DN
10792011-10-03 Diego Novillo <dnovillo@google.com>
1080
1081 * options.cc (parse_uint): Fix dereference of RETVAL.
1082
f0558624
ST
10832011-09-29 Sriraman Tallam <tmsriram@google.com>
1084
1085 * layout.h (section_order_map_): New member.
1086 (get_section_order_map): New member function.
1087 * output.cc (Output_section::add_input_section): Check for patterns
1088 only when --section-ordering-file is specified.
1089 * gold.cc (queue_middle_tasks): Delay updating order of sections till
1090 output_sections have been formed.
1091 * layout.cc (Layout_Layout): Initialize section_order_map_.
1092 * plugin.cc (update_section_order): Store order in order_map. Do not
1093 update the order.
1094 * testsuite/Makefile.am: Add test case for plugin_final_layout.
1095 * testsuite/Makefile.in: Regenerate.
1096 * testsuite/plugin_section_order.c: New file.
1097 * testsuite/plugin_final_layout.cc: New file.
1098 * testsuite/plugin_final_layout.sh: New file.
1099
a7dac153
CC
11002011-09-29 Cary Coutant <ccoutant@google.com>
1101
4f95c8b4 1102 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
a7dac153 1103 Check for NULL.
4f95c8b4 1104 * symtab.cc (Symbol_table::add_from_relobj): Ignore version
a7dac153
CC
1105 symbols during incremental update.
1106 (Symbol_table::add_from_dynobj): Likewise.
1107
eebd87a5
ILT
11082011-09-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1109 Ian Lance Taylor <iant@google.com>
1110
1111 * symtab.cc (Symbol_table::define_special_symbol): Always
1112 canonicalize version string.
1113
403a3331
CC
11142011-09-26 Cary Coutant <ccoutant@google.com>
1115
4f95c8b4
CC
1116 * gold.cc (queue_initial_tasks): Move option checks ...
1117 * options.cc (General_options::finalize): ... to here. Disable
403a3331
CC
1118 some options; make others fatal.
1119
235061c2
CC
11202011-09-26 Cary Coutant <ccoutant@google.com>
1121
1122 gcc PR lto/47247
1123 * plugin.cc (get_symbols_v2): New function.
1124 (Plugin::load): Add LDPT_GET_SYMBOLS_V2.
1125 (is_referenced_from_outside): New function.
1126 (Pluginobj::get_symbol_resolution_info): Add version parameter, return
1127 LDPR_PREVAILING_DEF_IRONLY_EXP when using new version.
1128 (get_symbols): Pass version parameter.
1129 (get_symbols_v2): New function.
1130 * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
1131 parameter.
1132 * testsuite/plugin_test.c (get_symbols_v2): New static variable.
1133 (onload): Add LDPT_GET_SYMBOLS_V2.
1134 (all_symbols_read_hook): Use get_symbols_v2; check for
1135 LDPR_PREVAILING_DEF_IRONLY_EXP.
1136 * testsuite/plugin_test_3.sh: Update expected results.
1137
dc87f620
ILT
11382011-09-23 Simon Baldwin <simonb@google.com>
1139
1140 * configure.ac: Add new --with-gold-ldadd and --with-gold-ldflags
1141 configuration options.
1142 * configure: Regenerate.
1143 * Makefile.am: Handle GOLD_LDADD and GOLD_LDFLAGS.
1144 * Makefile.in: Regenerate.
1145 * testsuite/Makefile.in: Regenerate.
1146
a8279f82
ST
11472011-09-19 Sriraman Tallam <tmsriram@google.com>
1148
1149 * plugin.h (should_defer_layout): Modify to check for any_claimed_.
1150
0c9350c8
CC
11512011-09-19 Cary Coutant <ccoutant@google.com>
1152
1153 * incremental.cc (can_incremental_update): Fix typo in comment.
1154 * incremental.h (can_incremental_update): Likewise.
1155
aa06ae28
CC
11562011-09-18 Cary Coutant <ccoutant@google.com>
1157
1158 * incremental.cc (can_incremental_update): New function.
1159 * incremental.h (can_incremental_update): New function.
1160 * layout.cc (Layout::init_fixed_output_section): Call it.
1161 (Layout::make_output_section): Don't allow patch space in .eh_frame.
1162 * object.cc (Sized_relobj_file::do_layout): Call
1163 can_incremental_update.
1164
ebb300b2
CC
11652011-09-13 Cary Coutant <ccoutant@google.com>
1166
1167 * configure.ac: Check for glibc support for gnu_indirect_function
1168 support with static linking, setting automake conditional
1169 IFUNC_STATIC.
1170 * Makefile.in: Regenerate.
1171 * configure: Regenerate.
1172
1173 * testsuite/Makefile.am (ifuncmain1static, ifuncmain2static)
1174 (ifuncmain4static, ifuncmain5static, ifuncmain7static): Add check
1175 for IFUNC_STATIC.
1176 * testsuite/Makefile.in: Regenerate.
1177
1206d0d5
CC
11782011-09-13 Cary Coutant <ccoutant@google.com>
1179
1180 * incremental.cc (Sized_relobj_incr::do_layout): Call
1181 report_comdat_group for kept comdat sections.
1182 * testsuite/Makefile.am (incremental_comdat_test_1): New test.
1183 * testsuite/Makefile.in: Regenerate.
1184 * testsuite/incr_comdat_test_1.cc: New source file.
1185 * testsuite/incr_comdat_test_2_v1.cc: New source file.
1186 * testsuite/incr_comdat_test_2_v2.cc: New source file.
1187 * testsuite/incr_comdat_test_2_v3.cc: New source file.
1188
40b29874
ILT
11892011-09-13 Ian Lance Taylor <iant@google.com>
1190
1191 * object.cc (Sized_relobj_file::do_layout): Remove unused local
1192 variable external_symbols_offset.
1193
1b045aac
ILT
11942011-09-12 Ian Lance Taylor <iant@google.com>
1195
1196 * object.cc (Sized_relobj_file::do_layout): Remove assertion which
1197 triggered if object has no symbols.
1198
24c6c55a
DM
11992011-09-09 David S. Miller <davem@davemloft.net>
1200
1201 * output.cc (Output_fill_debug_info::do_write): Use Swap_unaligned.
1202 (Output_fill_debug_line::do_write): Likewise.
1203
66570254
CC
12042011-08-29 Cary Coutant <ccoutant@google.com>
1205
1206 * output.cc: (Output_fill_debug_info::do_minimum_hole_size): Add
1207 casts to match formatting specs.
1208 (Output_fill_debug_line::do_minimum_hole_size): Likewise.
1209
8ea8cd50
CC
12102011-08-26 Cary Coutant <ccoutant@google.com>
1211
1212 * layout.cc (Free_list::allocate): Provide guarantee of minimum
1213 remaining hole size when allocating.
1214 (Layout::make_output_section): Set fill methods for debug sections.
1215 * layout.h (Free_list::Free_list_node): Move from private to
1216 public.
1217 (Free_list::set_min_hole_size): New function.
1218 (Free_list::begin, Free_list::end): New functions.
1219 (Free_list::min_hole_): New data member.
1220 * output.cc: Include dwarf.h.
1221 (Output_fill_debug_info::do_minimum_hole_size): New function.
1222 (Output_fill_debug_info::do_write): New function.
1223 (Output_fill_debug_line::do_minimum_hole_size): New function.
1224 (Output_fill_debug_line::do_write): New function.
1225 (Output_section::Output_section): Initialize new data member.
1226 (Output_section::set_final_data_size): Ensure patch space is larger
1227 than minimum hole size.
1228 (Output_section::do_write): Fill holes in debug sections.
1229 * output.h (Output_fill): New class.
1230 (Output_fill_debug_info): New class.
1231 (Output_fill_debug_line): New class.
1232 (Output_section::set_free_space_fill): New function.
1233 (Output_section::free_space_fill_): New data member.
1234 * testsuite/Makefile.am (incremental_test_3): Add
1235 --incremental-patch option.
1236 (incremental_test_4): Likewise.
1237 (incremental_test_5): Likewise.
1238 (incremental_test_6): Likewise.
1239 (incremental_copy_test): Likewise.
1240 (incremental_common_test_1): Likewise.
1241 * testsuite/Makefile.in: Regenerate.
1242
7cf80422
NC
12432011-08-26 Nick Clifton <nickc@redhat.com>
1244
1245 * po/es.po: Updated Spanish translation.
1246
c3f7b0e5
CC
12472011-08-01 Cary Coutant <ccoutant@google.com>
1248
1249 * gold/testsuite/Makefile.am (justsyms_exec): New testcase.
1250 * gold/testsuite/Makefile.in: Regenerate.
1251 * gold/testsuite/justsyms_exec.c: New source file.
1252 * gold/testsuite/justsyms_lib.c: New source file.
1253
9590bf25
CC
12542011-08-01 Cary Coutant <ccoutant@google.com>
1255
1256 * layout.cc (Layout::set_segment_offsets): Don't realign text
1257 segment if -Ttext was specified.
1258 * object.cc (Sized_relobj_file::Sized_relobj_file): Store the ELF
1259 file type.
1260 * object.h (Sized_relobj_file::e_type): New function.
1261 (Sized_relobj_file::e_type_): New data member.
1262 * symtab.cc (Symbol_table::add_from_relobj): Don't add section
1263 base address for ET_EXEC files.
1264 * target.cc (Target::do_make_elf_object_implementation): Allow
1265 ET_EXEC files with --just-symbols option.
1266
dcd8d12e
CC
12672011-07-28 Cary Coutant <ccoutant@google.com>
1268
1269 * workqueue-internal.h (Workqueue_threader::should_cancel_thread):
1270 Add thread_number parameter.
1271 (Workqueue_threader_threadpool::should_cancel_thread): Likewise.
1272 * workqueue-threads.cc
1273 (Workqueue_threader_threadpool::should_cancel_thread): Cancel
1274 current thread if its thread number is greater than desired thread
1275 count.
1276 * workqueue.cc (Workqueue_threader_single::should_cancel_thread):
1277 Add thread_number parameter.
1278 (Workqueue::should_cancel_thread): Likewise.
1279 (Workqueue::find_runnable_or_wait): Pass thread_number to
1280 should_cancel_thread.
1281 * workqueue.h (Workqueue::should_cancel_thread): Add thread_number
1282 parameter.
1283
804eb480
ST
12842011-07-22 Sriraman Tallam <tmsriram@google.com>
1285
1286 * symtab.cc (Symbol_table::add_from_relobj): Mark symbol as referenced
1287 only after checking if it cannot be forced local.
1288 * symtab.h (is_externally_visible): Check if the symbol is not forced
1289 local.
1290
f1ddb600
ILT
12912011-07-15 Ian Lance Taylor <iant@google.com>
1292
1293 * options.h (class General_options): Add --print-output-format.
1294 Move -EL next to -EB, for better --help output.
1295 * target-select.cc: Include <cstdio>, "options.h", and
1296 "parameters.h".
1297 (Target_selector::do_target_bfd_name): New function.
1298 (print_output_format): New function.
1299 * target-select.h (class Target_selector): Update declarations.
1300 (Target_selector::target_bfd_name): New function.
1301 (print_output_format): Declare.
1302 * main.cc: Include "target-select.h".
1303 (main): Handle --print-output-format.
1304 * gold.cc: Include "target-select.h".
1305 (queue_initial_tasks): Handle --print-output-format when there are
1306 no input files.
1307 * parameters.cc (parameters_force_valid_target): Give a better
1308 error message if -EB/-EL does not match target.
1309 * freebsd.h (Target_selector_freebsd::do_target_bfd_name): New
1310 function.
1311
7d172687
ILT
13122011-07-15 Ian Lance Taylor <iant@google.com>
1313
1314 * i386.cc (class Output_data_plt_i386): Add layout_ field.
1315 (Output_data_plt_i386::Output_data_plt_i386): Initialize layout_.
1316 (Output_data_plt_i386::do_write): Write address of .dynamic
1317 section to first entry in .got.plt section.
1318 * x86_64.cc (class Output_data_plt_x86_64): Add layout_ field.
1319 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1320 Initialize layout_.
1321 (Output_data_plt_x86_64::do_write): Write address of .dynamic
1322 section to first entry in .got.plt section.
1323 * layout.h (Layout::dynamic_section): New function.
1324
e9552f7e
ST
13252011-07-13 Sriraman Tallam <tmsriram@google.com>
1326
1327 * archive.cc (Archive::get_elf_object_for_member): Add extra parameter
1328 to claim_file call.
1329 * layout.cc (Layout::Layout): Initialize section_ordering_specified_,
1330 input_section_position_, and input_section_glob_.
1331 (read_layout_from_file): Call function section_ordering_specified.
1332 * layout.h (is_section_ordering_specified): New function.
1333 (section_ordering_specified): New function.
1334 (section_ordering_specified_): New boolean member.
1335 * main.cc(main): Call load_plugins after layout object is defined.
1336 * output.cc (Output_section::add_input_section): Use
1337 function section_ordering_specified to check if section ordering is
1338 needed.
1339 * output.cc (Output_section::add_relaxed_input_section): Use
1340 function section_ordering_specified to check if section ordering is
1341 needed.
1342 (Output_section::update_section_layout): New function.
1343 (Output_section::sort_attached_input_sections): Check if input section
1344 must be reordered.
1345 * output.h (Output_section::update_section_layout): New function.
1346 * plugin.cc (get_section_count): New function.
1347 (get_section_type): New function.
1348 (get_section_name): New function.
1349 (get_section_contents): New function.
1350 (update_section_order): New function.
58797674 1351 (allow_section_ordering): New function.
e9552f7e
ST
1352 (Plugin::load): Add the new interfaces to the transfer vector.
1353 (Plugin_manager::load_plugins): New parameter.
1354 (Plugin_manager::all_symbols_read): New parameter.
1355 (Plugin_manager::claim_file): New parameter. Save the elf object for
1356 unclaimed objects.
1357 (Plugin_manager::get_elf_object): New function.
1358 (Plugin_manager::get_view): Change to directly use the bool to check
1359 if get_view is called from claim_file_hook.
1360 * plugin.h (input_objects): New function
1361 (Plugin__manager::load_plugins): New parameter.
1362 (Plugin_manager::claim_file): New parameter.
1363 (Plugin_manager::get_elf_object): New function.
1364 (Plugin_manager::in_claim_file_handler): New function.
1365 (Plugin_manager::in_claim_file_handler_): New member.
1366 (layout): New function.
1367 * readsyms.cc (Read_symbols::do_read_symbols): Call the claim_file
1368 handler with an extra parameter. Make the elf object before calling
1369 claim_file handler.
1370 * testsuite/plugin_test.c (get_section_count): New function pointer.
1371 (get_section_type): New function pointer.
1372 (get_section_name): New function pointer.
1373 (get_section_contents): New function pointer.
1374 (update_section_order): New function pointer.
1375 (allow_section_ordering): New function pointer.
1376 (onload): Check if the new interfaces exist.
1377
9446efde
ILT
13782011-07-13 Ian Lance Taylor <iant@google.com>
1379
1380 * i386.cc (Target_i386::got_section): If -z now, make .got.plt a
1381 relro section.
1382 * x86_64.cc (Target_x86_64::got_section): Likewise.
1383 * testsuite/Makefile.am (check_PROGRAMS): Add relro_now_test.
1384 (relro_now_test_SOURCES): New variable.
1385 (relro_now_test_DEPENDENCIES): New variable.
1386 (relro_now_test_LDFLAGS): New variable.
1387 (relro_now_test_LDADD): New variable.
1388 (relro_now_test.so): New target.
1389 * testsuite/Makefile.in: Rebuild.
1390
07aa62f2
ILT
13912011-07-12 Ian Lance Taylor <iant@google.com>
1392
1393 PR gold/12980
1394 * i386.cc (Target_i386::Scan::global): For a GOT reloc, use a
1395 GLOB_DAT relocation rather than a RELATIVE relocation for a
1396 protected symbol when creating a shared library.
1397 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
1398 * testsuite/protected_1.cc (f2, get_f2_addr): New functions.
1399 * testsuite/protected_main_1.cc (main): Test that protected
1400 function has same address.
1401
e2153196
ILT
14022011-07-11 Ian Lance Taylor <iant@google.com>
1403
1404 PR gold/12979
1405 * options.h (class General_options): Add -Bgroup.
1406 * options.cc (General_options::finalize): If -Bgroup is set,
1407 default to --unresolved-symbols=report-all.
1408 * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
1409 * target-reloc.h (issue_undefined_symbol_error): Handle
1410 --unresolved-symbols=report-all.
1411
6daf5215
ILT
14122011-07-08 Ian Lance Taylor <iant@google.com>
1413
1414 PR gold/11985
1415 * layout.cc (Layout::create_initial_dynamic_sections): Don't crash
1416 if linker script discards key sections.
1417 (Layout::create_dynamic_symtab): Likewise.
1418 (Layout::assign_local_dynsym_offsets): Likewise.
1419 (Layout::sized_create_version_sections): Likewise.
1420 (Layout::create_interp): Likewise.
1421 (Layout::finish_dynamic_section): Likewise.
1422 (Layout::set_dynamic_symbol_size): Likewise.
1423
beabb2c6
ILT
14242011-07-08 Ian Lance Taylor <iant@google.com>
1425
1426 PR gold/12386
1427 * options.h (class General_options): Add --unresolved-symbols.
1428 * target-reloc.h (issue_undefined_symbol_error): Check
1429 --unresolved-symbols. Add comments.
1430
9c16daf1
ILT
14312011-07-08 Ian Lance Taylor <iant@google.com>
1432
1433 * testsuite/odr_violation2.cc (Ordering::operator()): Make
1434 expression more complex.
1435
191f1a2d
ILT
14362011-07-08 Ian Lance Taylor <iant@google.com>
1437
1438 PR gold/11317
1439 * target-reloc.h (issue_undefined_symbol_error): New inline
1440 function, broken out of relocate_section.
1441 (relocate_section): Call issue_undefined_symbol_error.
1442 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1443 there is no TLS segment if we are about to issue an undefined
1444 symbol error.
1445 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1446
62855347
ILT
14472011-07-08 Ian Lance Taylor <iant@google.com>
1448
1449 PR gold/12279
1450 * resolve.cc (Symbol_table::should_override): Add fromtype
1451 parameter. Change all callers. Give error when linking together
1452 TLS and non-TLS symbol.
1453 (Symbol_table::should_override_with_special): Add fromtype
1454 parameter. Change all callers.
1455 * i386.cc (Target_i386::Relocate::relocate_tls): Don't crash if
1456 there is no TLS segment if we have reported some errors.
1457 * x86_64.cc (Target_x86_64::relocate_tls): Likewise.
1458
67181c72
ILT
14592011-07-08 Ian Lance Taylor <iant@google.com>
1460
1461 PR gold/12372
1462 * target.h (Target::plt_address_for_global): New function.
1463 (Target::plt_address_for_local): New function.
1464 (Target::plt_section_for_global): Remove.
1465 (Target::plt_section_for_local): Remove.
1466 (Target::do_plt_address_for_global): New virtual function.
1467 (Target::do_plt_address_for_local): New virtual function.
1468 (Target::do_plt_section_for_global): Remove.
1469 (Target::do_plt_section_for_local): Remove.
1470 (Target::register_global_plt_entry): Add Symbol_table and Layout
1471 parameters.
1472 * output.cc (Output_data_got::Got_entry::write): Use
1473 plt_address_for_global and plt_address_for_local.
1474 * layout.cc (Layout::add_target_dynamic_tags): Use size and
1475 address of output section.
1476 * i386.cc (class Output_data_plt_i386): Add irelative_rel_,
1477 got_irelative_, and irelative_count_ fields. Update
1478 declarations.
1479 (Output_data_plt_i386::has_irelative_section): New function.
1480 (Output_data_plt_i386::entry_count): Add irelative_count_.
1481 (Output_data_plt_i386::set_final_data_size): Likewise.
1482 (class Target_i386): Add got_irelative_ and rel_irelative_
1483 fields. Update declarations.
1484 (Target_i386::Target_i386): Initialize new fields.
1485 (Target_i386::do_plt_address_for_global): New function replacing
1486 do_plt_section_for_global.
1487 (Target_i386::do_plt_address_for_local): New function replacing
1488 do_plt_section_for_local.
1489 (Target_i386::got_section): Create got_irelative_.
1490 (Target_i386::rel_irelative_section): New function.
1491 (Output_data_plt_i386::Output_data_plt_i386): Initialize new
1492 fields. Don't define __rel_iplt_{start,end}.
1493 (Output_data_plt_i386::add_entry): Add symtab and layout
1494 parameters. Change all callers. Use different PLT and GOT for
1495 IFUNC symbols.
1496 (Output_data_plt_i386::add_local_ifunc_entry): Add symtab and
1497 layout parameters. Change all callers. Use different PLT and
1498 GOT.
1499 (Output_data_plt_i386::rel_tls_desc): Fix formatting.
1500 (Output_data_plt_i386::rel_irelative): New function.
1501 (Output_data_plt_i386::address_for_global): New function.
1502 (Output_data_plt_i386::address_for_local): New function.
1503 (Output_data_plt_i386::do_write): Write out IRELATIVE area. Use
1504 IRELATIVE GOT when changing IFUNC GOT entries.
1505 (Target_i386::Scan::global): Use IRELATIVE GOT for IRELATIVE
1506 reloc.
1507 (Target_i386::do_finalize_sections): Create the __rel_iplt symbols
1508 if we didn't create an IRELATIVE GOT.
1509 (Target_i386::Relocate::relocate): Use plt_address_for_global and
1510 plt_address_for_local.
1511 (Target_i386::do_dynsym_value): Use plt_address_for_global.
1512 * x86_64.cc (class Output_data_plt_x86_64): Add irelative_rel_,
1513 got_irelative_, and irelative_count_ fields. Update
1514 declarations.
1515 (Output_data_plt_x86_64::Output_data_plt_x86_64) [both versions]:
1516 Initialize new fields. Remove symtab parameter. Change all
1517 callers.
1518 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): Add
1519 irelative_count_.
1520 (Output_data_plt_x86_64::has_irelative_section): New function.
1521 (Output_data_plt_x86_64::entry_count): Add irelative_count_.
1522 (class Target_x86_64): Add got_irelative_ and rel_irelative_
1523 fields. Update declarations.
1524 (Target_x86_64::Target_x86_64): Initialize new fields.
1525 (Target_x86_64::do_plt_address_for_global): New function replacing
1526 do_plt_section_for_global.
1527 (Target_x86_64::do_plt_address_for_local): New function replacing
1528 do_plt_section_for_local.
1529 (Target_x86_64::got_section): Create got_irelative_.
1530 (Target_x86_64::rela_irelative_section): New function.
1531 (Output_data_plt_x86_64::init): Remove symtab parameter. Change
1532 all callers. Don't create __rel_iplt_{start,end}.
1533 (Output_data_plt_x86_64::add_entry): Add symtab and layout
1534 parameters. Change all callers. Use different PLT and GOT for
1535 IFUNC symbols.
1536 (Output_data_plt_x86_64::add_local_ifunc_entry): Add symtab and
1537 layout parameters. Change all callers. Use different PLT and
1538 GOT.
1539 (Output_data_plt_x86_64::add_relocation): Add symtab and layout
1540 parameters. Change all callers. Use different PLT and GOT for
1541 IFUNC symbols.
1542 (Output_data_plt_x86_64::rela_tlsdesc): Fix formatting.
1543 (Output_data_plt_x86_64::rela_irelative): New function.
1544 (Output_data_plt_x86_64::address_for_global): New function.
1545 (Output_data_plt_x86_64::address_for_local): New function.
1546 (Output_data_plt_x86_64::set_final_data_size): Likewise.
1547 (Output_data_plt_x86_64::do_write): Write out IRELATIVE area.
1548 (Target_x86_64::init_got_plt_for_update): Create got_irelative_.
1549 (Target_x86_64::register_global_plt_entry): Add symtab and layout
1550 parameters.
1551 (Target_x86_64::Scan::global): Use IRELATIVE GOT for IRELATIVE
1552 reloc.
1553 (Target_x86_64::do_finalize_sections): Create the __rela_iplt
1554 symbols if we didn't create an IRELATIVE GOT.
1555 (Target_x86_64::Relocate::relocate): Use plt_address_for_global and
1556 plt_address_for_local.
1557 (Target_x86_64::do_dynsym_value): Use plt_address_for_global.
1558 * testsuite/ifuncvar1.c: New test file.
1559 * testsuite/ifuncvar2.c: New test file.
1560 * testsuite/ifuncvar3.c: New test file.
1561 * testsuite/Makefile.am (check_PROGRAMS): Add ifuncvar.
1562 (ifuncvar1_pic.o, ifuncvar2_pic.o, ifuncvar.so): New targets.
1563 (ifuncvar_SOURCES, ifuncvar_DEPENDENCIES): New variables.
1564 (ifuncvar_LDFLAGS, ifuncvar_LDADD): New variables.
1565 * testsuite/Makefile.in: Rebuild.
1566
33c15b45
CC
15672011-07-07 Cary Coutant <ccoutant@google.com>
1568
1569 * testsuite/Makefile.am (two_file_test_1_v1_ndebug.o): New target.
1570 (two_file_test_1_ndebug.o): Likewise.
1571 (two_file_test_1b_ndebug.o): Likewise.
1572 (two_file_test_2_ndebug.o): Likewise.
1573 (two_file_test_main_ndebug.o): Likewise.
1574 (incremental_test_2): Link with no-debug versions.
1575
f48b5fb7
CC
15762011-07-06 Cary Coutant <ccoutant@google.com>
1577
1578 * gold/incremental.cc
1579 (Output_section_incremental_inputs::write_info_blocks): Check for
1580 hidden and internal symbols.
1581
221597a5
CC
15822011-07-06 Cary Coutant <ccoutant@google.com>
1583
1584 * incremental.cc (Sized_incremental_binary::do_file_has_changed):
1585 Check disposition for startup file.
1586 (Incremental_inputs::report_command_line): Ignore
1587 --incremental-startup-unchanged option.
1588 * options.cc (General_options::parse_incremental_startup_unchanged):
1589 New function.
1590 (General_options::General_options): Initialize new data member.
1591 * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
1592 (General_options): Add --incremental-startup-unchanged option.
1593 (General_options::incremental_startup_disposition): New function.
1594 (General_options::incremental_startup_disposition_): New data member.
1595
e24719f6
CC
15962011-07-06 Cary Coutant <ccoutant@google.com>
1597
1598 * incremental.cc (Sized_incremental_binary::setup_readers): Pass
1599 input file index to Script_info ctor.
1600 (Sized_incremental_binary::do_file_has_changed): Find the
1601 command-line argument for files named in scripts.
1602 * incremental.h (Script_info::Script_info): New ctor
1603 with input file index.
1604 (Script_info::input_file_index): New function.
1605 (Script_info::input_file_index_): New data member.
1606 (Incremental_binary::get_library): Add const.
1607 (Incremental_binary::get_script_info): Add const.
1608 * readsyms.cc (Read_member::is_runnable): Check for this_blocker_.
1609 * testsuite/Makefile.am (incremental_test_5): New test case.
1610 (incremental_test_6): New test case.
1611 * testsuite/Makefile.in: Regenerate.
1612
8f7c81e8
CC
16132011-07-06 Cary Coutant <ccoutant@google.com>
1614
1615 * incremental.cc (Sized_incremental_binary::do_check_inputs): Add
1616 debug output when command lines differ.
1617
9fbd3822
CC
16182011-07-06 Cary Coutant <ccoutant@google.com>
1619
1620 * incremental.cc (Incremental_inputs::report_command_line): Ignore
1621 --incremental-patch option.
1622 * layout.cc (Free_list::allocate): Extend allocation beyond original
1623 end if enabled.
1624 (Layout::make_output_section): Mark sections that should get
1625 patch space.
1626 * options.cc (parse_percent): New function.
1627 * options.h (parse_percent): New function.
1628 (DEFINE_percent): New macro.
1629 (General_options): Add --incremental-patch option.
1630 * output.cc (Output_section::Output_section): Initialize new data
1631 members.
1632 (Output_section::add_input_section): Print section name when out
1633 of patch space.
1634 (Output_section::add_output_section_data): Likewise.
1635 (Output_section::set_final_data_size): Add patch space when
1636 doing --incremental-full.
1637 (Output_section::do_reset_address_and_file_offset): Remove patch
1638 space.
1639 (Output_segment::set_section_list_addresses): Print debug output
1640 only if --incremental-update.
1641 * output.h (Output_section::set_is_patch_space_allowed): New function.
1642 (Output_section::is_patch_space_allowed_): New data member.
1643 (Output_section::patch_space_): New data member.
1644 * parameters.cc (Parameters::incremental_full): New function.
1645 * parameters.h (Parameters::incremental_full): New function
1646 * testsuite/Makefile.am (incremental_test_2): Add test for
1647 --incremental-patch option.
1648 * testsuite/Makefile.in: Regenerate.
1649 * testsuite/two_file_test_1_v1.cc (t1, t2, t3): Add comments.
1650 (t18): Remove function body.
1651
f6cccc2c
DK
16522011-07-05 Doug Kwan <dougkwan@google.com>
1653
1654 PR gold/12771
1655 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and
1656 Arm_Address type for relocation result.
1657 (Arm_relocate_functions::abs16): Use unaligned access. Also fix
1658 overflow check.
1659 (Arm_relocate_functions::abs32): Use unaligned access.
1660 (Arm_relocate_functions::rel32): Ditto.
1661 (Arm_relocate_functions::prel31): Ditto.
1662 (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto.
1663 * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned
1664 static data relocations.
1665 * testsuite/Makefile.in: Regnerate.
1666 * testsuite/arm_unaligned_reloc.{s,sh}: New files.
1667
28a13fec
ILT
16682011-07-05 Ian Lance Taylor <iant@google.com>
1669
1670 PR gold/12392
1671 * i386.cc (Target_i386::do_finalize_sections): Define __rel_iplt
1672 symbols if necessary.
1673 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
1674
24d47b34
ILT
16752011-07-05 Ian Lance Taylor <iant@google.com>
1676
1677 PR gold/12952
1678 * resolve.cc (Symbol::override_base_with_special): Simply override
1679 version with special symbol version, ignoring previous version.
1680
41f9cbbe
ILT
16812011-07-05 Ian Lance Taylor <iant@google.com>
1682
1683 * object.cc (Sized_relobj_file::include_section_group): Add
1684 information to comment about signature location.
1685
886288f1
ILT
16862011-07-02 Ian Lance Taylor <iant@google.com>
1687
1688 PR gold/12957
1689 * options.h (class General_options): Add -f and -F.
1690 * options.cc (General_options::finalize): Fatal error if -f/-F
1691 are used without -shared.
1692 * layout.cc (Layout::finish_dynamic_section): Implement -f/-F.
1693
ae3a6d4f
ILT
16942011-07-02 Ian Lance Taylor <iant@google.com>
1695
1696 * dirsearch.cc (Dir_cache::read_files): Ignore ENOTDIR errors.
1697
21131061
ILT
16982011-07-01 Ian Lance Taylor <iant@google.com>
1699
1700 PR gold/12525
1701 PR gold/12952
1702 * resolve.cc (Symbol::override_base_with_special): Don't override
1703 the version if the overriding symbol has a different name.
1704 * dynobj.cc (Versions::add_def): Add dynpool parameter. Change
1705 all callers. If we give an error about an undefined version,
1706 define the base version if necessary.
1707 * dynobj.h (class Versions): Update declaration.
1708 * testsuite/weak_alias_test_5.cc: New file.
1709 * testsuite/weak_alias_test.script: New file.
1710 * testsuite/weak_alias_test_main.cc: Check that versioned_symbol
1711 and versioned_alias have the right value, and call t2.
1712 * testsuite/Makefile.am (weak_alias_test_DEPENDENCIES): Add
1713 weak_alias_test_5.so.
1714 (weak_alias_test_LDADD): Likewise.
1715 (weak_alias_test_5_pic.o, weak_alias_test_5.so): New targets.
1716 * testsuite/Makefile.in: Rebuild.
1717
611062c0
ILT
17182011-07-01 Ian Lance Taylor <iant@google.com>
1719
1720 PR gold/12525
1721 * options.h (class General_options): Support -z notext.
1722 * testsuite/Makefile.am (two_file_shared_1_nonpic.so): Use
1723 -Wl,-z,notext.
1724 (two_file_shared_nonpic.so): Likewise.
1725 (two_file_shared_mixed.so): Likewise.
1726 (two_file_shared_mixed_1.so): Likewise.
1727 (weak_undef_lib_nonpic.so): Likewise.
1728 (alt/weak_undef_lib_nonpic.so): Likewise.
1729 (tls_test_shared_nonpic.so): Likewise.
1730 * testsuite/Makefile.in: Rebuild.
1731
328c7c2f
ILT
17322011-07-01 Ian Lance Taylor <iant@google.com>
1733
1734 PR gold/12525
1735 * configure.ac: Test whether static linking works, setting
1736 the automake conditional HAVE_STATIC.
1737 * testsuite/Makefile.am: Disable tests using -static if
1738 HAVE_STATIC is not true.
1739 * configure, testsuite/Makefile.in: Rebuild.
1740
02d7cd44
ILT
17412011-07-01 Ian Lance Taylor <iant@google.com>
1742
1743 PR gold/12525
1744 * ehframe.cc (Eh_frame_hdr::get_fde_pc): Handle DW_EH_PE_datarel.
1745 Assert if we see DW_EH_PE_indirect.
1746 * target.h (Target::ehframe_datarel_base): New function.
1747 (Target::do_ehframe_datarel_base): New target function.
1748 * i386.cc (Target_i386::do_ehframe_datarel_base): New function.
1749 * x86_64.cc (Target_x86_64::do_ehframe_datarel_base): New
1750 function.
1751
07a60597
ILT
17522011-07-01 Ian Lance Taylor <iant@google.com>
1753
1754 PR gold/12571
1755 * options.h (class General_options): Add
1756 --ld-generated-unwind-info.
1757 * ehframe.cc (Fde::write): Add address parameter. Change all
1758 callers. If associated with PLT, fill in address and size.
1759 (Cie::set_output_offset): Only add merge mapping if there is an
1760 object.
1761 (Cie::write): Add address parameter. Change all callers.
1762 (Eh_frame::add_ehframe_for_plt): New function.
1763 * ehframe.h (class Fde): Update declarations. Move shndx_ and
1764 input_offset_ fields into union u_, with new plt field.
1765 (Fde::Fde): Adjust for new union field.
1766 (Fde::Fde) [Output_data version]: New constructor.
1767 (Fde::add_mapping): Only add merge mapping if there is an object.
1768 (class Cie): Update declarations.
1769 (class Eh_frame): Declare add_ehframe_for_plt.
1770 * layout.cc (Layout::layout_eh_frame): Break out code into
1771 make_eh_frame_section, and call it.
1772 (Layout::make_eh_frame_section): New function.
1773 (Layout::add_eh_frame_for_plt): New function.
1774 * layout.h (class Layout): Update declarations.
1775 * merge.cc (Merge_map::add_mapping): Add assertion.
1776 * i386.cc: Include "dwarf.h".
1777 (class Output_data_plt_i386): Make first_plt_entry,
1778 dyn_first_plt_entry, exec_plt_entry, and dyn_plt_entry const. Add
1779 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1780 and plt_eh_frame_fde.
1781 (Output_data_plt_i386::Output_data_plt_i386): Align to 16-byte
1782 boundary. Call add_eh_frame_for_plt if appropriate.
1783 * x86_64.cc: Include "dwarf.h".
1784 (class Output_data_plt_x86_64): Align to 16-byte boundary. Make
1785 first_plt_entry, plt_entry and tlsdesc_plt_entry const. Add
1786 plt_eh_frame_cie_size, plt_eh_frame_fde_size, plt_eh_frame_cie,
1787 and plt_eh_frame_fde.
1788 (Output_data_plt_x86_64::init): Call add_eh_frame_for_plt if
1789 appropriate.
1790
14788a3f
ILT
17912011-06-29 Ian Lance Taylor <iant@google.com>
1792
1793 PR gold/12629
1794 * object.cc (Sized_relobj_file::layout_section): Change shdr
1795 parameter to be const.
1796 (Sized_relobj_file::layout_eh_frame_section): New function, broken
1797 out of do_layout.
1798 (Sized_relobj_file::do_layout): Defer .eh_frame sections if
1799 appropriate. Call layout_eh_frame_section.
1800 (Sized_relobj_file::do_layout_deferred_sections): Handle .eh_frame
1801 sections.
1802 * object.h (class Sized_relobj_file): Update declarations.
1803
6c21fce1
ILT
18042011-06-29 Ian Lance Taylor <iant@google.com>
1805
37e41b03 1806 PR gold/12652
6c21fce1
ILT
1807 * script.cc (Token::integer_value): Accept trailing M/m/K/k
1808 modifier.
1809 (Lex::gather_token): Accept trailing M/m/K/k for integers.
1810
4d5e4e62
ILT
18112011-06-29 Ian Lance Taylor <iant@google.com>
1812
1813 PR gold/12675
1814 * object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
1815 SHT_X86_64_UNWIND.
1816 * layout.cc (Layout::layout_eh_frame): Likewise.
1817
886f533a
ILT
18182011-06-29 Ian Lance Taylor <iant@google.com>
1819
1820 PR gold/12695
1821 * layout.cc (Layout::symtab_section_shndx): New function.
1822 * layout.h (class Layout): Declare symtab_section_shndx.
1823 * output.cc (Output_section::write_header): Call it.
1824
f3ae1b28
ILT
18252011-06-29 Ian Lance Taylor <iant@google.com>
1826
1827 PR gold/12818
1828 * symtab.cc (Symbol::should_add_dynsym_entry): Don't add undefined
1829 symbols which are not used in a relocation.
1830
aecf301f
ILT
18312011-06-28 Ian Lance Taylor <iant@google.com>
1832
1833 PR gold/12898
1834 * layout.cc (Layout::segment_precedes): Don't crash if a linker
1835 script create indistinguishable segments.
1836 (Layout::set_segment_offsets): Use stable_sort when sorting
1837 segments. Pass this to Compare_segments constructor.
1838 * layout.h (class Layout): Make segment_precedes non-static.
1839 (class Compare_segments): Change from struct to class. Add
1840 layout_ field. Add constructor.
1841 * script-sections.cc
1842 (Script_sections::attach_sections_using_phdrs_clause): Rename
1843 local orphan to is_orphan. Don't report failure to put empty
1844 section in segment. On attachment failure, report name of
1845 section, and attach to first PT_LOAD segment.
1846
03ef7571
ILT
18472011-06-28 Ian Lance Taylor <iant@google.com>
1848
1849 PR gold/12934
1850 * target-select.cc (Target_selector::Target_selector): Add
1851 emulation parameter. Change all callers.
1852 (select_target_by_bfd_name): Rename from select_target_by_name.
1853 Change all callers.
1854 (select_target_by_emulation): New function.
1855 (supported_emulation_names): New function.
1856 * target-select.h (class Target_selector): Add emulation_ field.
1857 Update declarations.
1858 (Target_selector::recognize_by_bfd_name): Rename from
1859 recognize_by_name. Change all callers.
1860 (Target_selector::supported_bfd_names): Rename from
1861 supported_names. Change all callers.
1862 (Target_selector::recognize_by_emulation): New function.
1863 (Target_selector::supported_emulations): New function.
1864 (Target_selector::emulation): New function.
1865 (Target_selector::do_recognize_by_bfd_name): Rename from
1866 do_recognize_by_name. Change all callers.
1867 (Target_selector::do_supported_bfd_names): Rename from
1868 do_supported_names. Change all callers.
1869 (Target_selector::do_recognize_by_emulation): New function.
1870 (Target_selector::do_supported_emulations): New function.
1871 (select_target_by_bfd_name): Change name in declaration.
1872 (select_target_by_emulation): Declare.
1873 (supported_emulation_names): Declare.
1874 * parameters.cc (parameters_force_valid_target): Try to find
1875 target based on emulation from -m option.
1876 * options.h (class General_options): Change doc string for -m.
1877 * options.cc (help): Print emulations.
1878 (General_options::parse_V): Likewise.
1879 * freebsd.h (Target_selector_freebsd::Target_selector_freebsd):
1880 Add emulation parameter. Change all callers.
1881
200b2bb9
ILT
18822011-06-28 Ian Lance Taylor <iant@google.com>
1883
1884 * target.h (class Target): Add osabi_ field.
1885 (Target::osabi): New function.
1886 (Target::set_osabi): New function.
1887 (Target::Target): Initialize osabi_.
1888 (Target::do_adjust_elf_header): Make pure virtual.
1889 (Sized_target::do_adjust_elf_header): Declare.
1890 * target.cc (Sized_target::do_adjust_elf_header): New function.
1891 (class Sized_target): Instantiate all versions.
1892 * freebsd.h (class Target_freebsd): Remove.
1893 (Target_selector_freebsd::do_recognize): Call set_osabi on
1894 Target.
1895 (Target_selector_freebsd::do_recognize_by_name): Likewise.
1896 (Target_selector_freebsd::set_osabi): Remove.
1897 * i386.cc (class Target_i386): Inherit from Sized_target rather
1898 than Target_freebsd.
1899 * x86_64.cc (class Target_x86_64): Likewise.
1900
b3ce541e
ILT
19012011-06-28 Ian Lance Taylor <iant@google.com>
1902
1903 * target.h (Target::can_check_for_function_pointers): Rewrite.
1904 Make non-virtual.
1905 (Target::can_icf_inline_merge_sections): Likewise.
1906 (Target::section_may_have_icf_unsafe_poineters): Likewise.
1907 (Target::Target_info): Add can_icf_inline_merge_sections field.
1908 (Target::do_can_check_for_function_pointers): New virtual
1909 function.
1910 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
1911 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
1912 from can_check_for_function_pointers, move in file.
1913 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
1914 section_may_have_icf_unsafe_poineters, move in file.
1915 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
1916 * i386.cc (Target_i386::do_can_check_for_function_pointers):
1917 Rename from can_check_for_function_pointers, move in file.
1918 (Target_i386::can_icf_inline_merge_sections): Remove.
1919 (Target_i386::i386_info): Initialize
1920 can_icf_inline_merge_sections.
1921 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
1922 Initialize can_icf_inline_merge_sections.
1923 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
1924 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
1925 Rename from can_check_for_function_pointers, move in file.
1926 (Target_x86_64::can_icf_inline_merge_sections): Remove.
1927 (Target_x86_64::x86_64_info): Initialize
1928 can_icf_inline_merge_sections.
1929 * testsuite/testfile.cc (Target_test::test_target_info):
1930 Likewise.
1931 * icf.cc (get_section_contents): Correct formatting.
1932
6d1c4efb
ILT
19332011-06-27 Ian Lance Taylor <iant@google.com>
1934
1935 * symtab.cc (Symbol::versioned_name): New function.
1936 (Symbol_table::add_to_final_symtab): Use versioned_name when
1937 appropriate.
1938 (Symbol_table::sized_write_symbol): Likewise.
1939 * symtab.h (class Symbol): Declare versioned_name.
1940 * stringpool.h (class Stringpool_template): Add variant of add
1941 which takes a std::basic_string.
1942 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
1943 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
1944 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
1945 (ver_test_12.o): New target.
1946 * testsuite/Makefile.in: Rebuild.
1947
57eb9b50
DK
19482011-06-27 Doug Kwan <dougkwan@google.com>
1949
1950 * arm.cc (Arm_relocate_functions::thm_jump8,
1951 Arm_relocate_functions::thm_jump11): Use a wider signed
1952 type to compute offset.
1953 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
1954 arm_thm_jump8.
1955 * testsuite/Makefile.in: Regenerate.
1956 * testsuite/arm_branch_in_range.sh: Check test results of
1957 arm_thm_jump11 and arm_thm_jump8.
1958 * testsuite/arm_thm_jump11.s: New test source file.
1959 * testsuite/arm_thm_jump11.t: New linker script.
1960 * testsuite/arm_thm_jump8.s: New test source file.
1961 * testsuite/arm_thm_jump8.t: New linker script.
1962
487b39df
ILT
19632011-06-24 Ian Lance Taylor <iant@google.com>
1964
1965 * layout.cc: Include "object.h".
1966 (ctors_sections_in_init_array): New static variable.
1967 (Layout::is_ctors_in_init_array): New function.
1968 (Layout::layout): Add entry to ctors_sections_in_init_array if
1969 appropriate.
1970 * layout.h (class Layout): Declare is_ctors_in_init_array.
1971 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
1972 is_ctors_reverse_view is set.
1973 (Sized_relobj_file::write_sections): Add layout parameter. Change
1974 all callers. Set is_ctors_reverse_view field of View_size.
1975 (Sized_relobj_file::reverse_words): New function.
1976 * object.h (Sized_relobj_file::View_size): Add
1977 is_ctors_reverse_view field.
1978 (class Sized_relobj_file): Update declarations.
1979 * testsuite/initpri3.c: New test.
1980 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
1981 initpri3b.
1982 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
1983 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
1984 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
1985 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
1986 * testsuite/Makefile.in: Rebuild.
1987
472076e4
CC
19882011-06-24 Cary Coutant <ccoutant@google.com>
1989
1990 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
1991 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
1992 (debug_msg_cdebug.err): New targets.
1993 * testsuite/Makefile.in: Regenerate.
1994 * testsuite/debug_msg.sh: Check output of link with compressed debug.
1995 Fix checks for link with shared library.
1996
a60af0db
DK
19972011-06-24 Doug Kwan <dougkwan@google.com>
1998
1999 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
2000 skip empty text sections.
2001 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
2002
5393d741
ILT
20032011-06-22 Ian Lance Taylor <iant@google.com>
2004
2005 PR gold/12910
2006 * options.h (class General_options): Add --ctors-in-init-array.
2007 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
2008 friends as SHT_PROGBITS for merging sections.
2009 (Layout::layout): Remove special handling of .init_array and
2010 friends. Don't sort if doing relocatable link. Sort for .ctors
2011 and .dtors if ctors_in_init_array.
2012 (Layout::make_output_section): Force correct section types for
2013 .init_array and friends. Don't sort if doing relocatable link,
2014 Don't sort .ctors and .dtors if ctors_in_init_array.
2015 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
2016 (Layout::output_section_name): Add relobj parameter. Change all
2017 callers. Handle .ctors. and .dtors. in code rather than table.
2018 Handle .ctors and .dtors if ctors_in_init_array.
2019 (Layout::match_file_name): New function, moved from output.cc.
2020 * layout.h (class Layout): Update declarations.
2021 * output.cc: Include "layout.h".
2022 (Input_section_sort_entry::get_priority): New function.
2023 (Input_section_sort_entry::match_file_name): Just call
2024 Layout::match_file_name.
2025 (Output_section::Input_section_sort_init_fini_compare::operator()):
2026 Handle .ctors and .dtors. Sort by explicit priority rather than
2027 by name.
2028 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
2029 * testsuite/initpri2.c: New test.
2030 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
2031 (check_PROGRAMS): Add initpri2.
2032 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
2033 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
2034 * configure, testsuite/Makefile.in: Rebuild.
2035
e1f74f98
ILT
20362011-06-19 Ian Lance Taylor <iant@google.com>
2037
2038 PR gold/12880
2039 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
2040 .interp section to a PT_INTERP segment even if we have seen a
2041 --dynamic-linker option. Don't do it if we have seen a PHDRS
2042 clause in a linker script.
2043 (Layout::finalize): Don't create a .interp section if we've
2044 already create a PT_INTERP segment.
2045 (Layout::create_interp): Always call choose_output_section (revert
2046 patch of 2011-06-17). Don't create PT_INTERP segment.
2047 * script-sections.cc
2048 (Script_sections::create_note_and_tls_segments): Add a .interp
2049 section to a PT_INTERP segment even if we have seen a
2050 --dynamic-linker option.
2051
766f91bb
ILT
20522011-06-18 Ian Lance Taylor <iant@google.com>
2053
2054 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
2055 merely because a non-PT_LOAD segment has a dynamic reloc.
2056
0d212c3a
ILT
20572011-06-18 Ian Lance Taylor <iant@google.com>
2058
2059 * layout.cc (Layout::finish_dynamic_section): Don't create
2060 DT_FLAGS entry if not needed.
2061
911a5072
ILT
20622011-06-18 Ian Lance Taylor <iant@google.com>
2063
2064 PR gold/12745
2065 * layout.cc (Layout::layout_eh_frame): Correct handling of
2066 writable .eh_frame section.
2067
534b4e5f
ILT
20682011-06-17 Ian Lance Taylor <iant@google.com>
2069
2070 PR gold/12893
2071 * resolve.cc (Symbol_table::resolve): Don't give an error if a
2072 symbol is redefined with the exact same object and value.
2073
10b4f102
ILT
20742011-06-17 Ian Lance Taylor <iant@google.com>
2075
2076 PR gold/12880
2077 * layout.h (class Layout): Add interp_segment_ field.
2078 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
2079 (Layout::attach_allocated_section_to_segment): If making shared
2080 library, put .interp section in PT_INTERP segment.
2081 (Layout::finalize): Also call create_interp if -dynamic-linker
2082 option was used.
2083 (Layout::create_interp): Assert that there is no PT_INTERP
2084 segment. If not using a SECTIONS clause, use make_output_section.
2085 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
2086 * script-sections.cc
2087 (Script_sections::create_note_and_tls_segments): If making shared
2088 library, put .interp section in PT_INTERP segment.
2089
a29b0dad
ILT
20902011-06-17 Ian Lance Taylor <iant@google.com>
2091
e588ea8d
ILT
2092 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
2093 when making a shared library.
2094
20952011-06-17 Ian Lance Taylor <iant@google.com>
2096
2097 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
2098 parameter. Change all callers. Don't issue warning about PC32
2099 against locally defined symbol.
a29b0dad 2100
9d3b0698
ILT
21012011-06-16 Ian Lance Taylor <iant@google.com>
2102
2103 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
2104 occurs in same object.
2105
85b0f90c
AM
21062011-06-14 Alan Modra <amodra@gmail.com>
2107
2108 * po/POTFILES.in: Regenerate.
2109
a94907d9
ILT
21102011-06-09 Ian Lance Taylor <iant@google.com>
2111
2112 * script-sections.cc
2113 (Orphan_output_section::set_section_addresses): For a relocatable
2114 link set address to 0.
2115
4fb3a1c3
CC
21162011-06-09 Cary Coutant <ccoutant@google.com>
2117
2118 PR gold/12804
2119 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
2120 used with --compress-debug-sections.
2121 * gold/object.cc (Sized_relobj_file::do_layout): Report
2122 uncompressed size of compressed input sections.
2123
61220854
CC
21242011-06-08 Cary Coutant <ccoutant@google.com>
2125
2126 PR gold/12804
2127 * testsuite/two_file_test_2_v1.cc: Change initialization of
2128 v2 to keep it in .data.
2129
e6455dfb
CC
21302011-06-07 Cary Coutant <ccoutant@google.com>
2131
2132 * common.cc (Symbol_table::do_allocate_commons_list): Call
2133 gold_fallback.
2134 * errors.cc (Errors::fatal): Adjust call to gold_exit.
2135 (Errors::fallback): New function.
2136 (gold_fallback): New function.
2137 * errors.h (Errors::fallback): New function.
2138 * gold.cc (gold_exit): Change status parameter to enum; adjust
2139 all callers.
2140 (queue_initial_tasks): Call gold_fallback.
2141 * gold.h: Include cstdlib.
2142 (Exit_status): New enum type.
2143 (gold_exit): Change status parameter to enum.
2144 (gold_fallback): New function.
2145 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
2146 (Layout::create_symtab_sections): Likewise.
2147 (Layout::create_shdrs): Likewise.
2148 * main.cc (main): Adjust call to gold_exit.
2149 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
2150 (Output_data_got::add_got_entry_pair): Likewise.
2151 (Output_section::add_input_section): Likewise.
2152 (Output_section::add_output_section_data): Likewise.
2153 (Output_segment::set_section_list_addresses): Likewise.
2154 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
2155
fb0e076f
CC
21562011-06-07 Cary Coutant <ccoutant@google.com>
2157
2158 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
2159 for incremental links.
2160 * output.cc (Output_segment::set_section_list_addresses): Remove
2161 FIXME and test for TLS or BSS.
2162
a5ee4d5d
CC
21632011-06-07 Cary Coutant <ccoutant@google.com>
2164
2165 * testsuite/Makefile.am: Add incremental_copy_test,
2166 incremental_common_test_1.
2167 * testsuite/Makefile.in: Regenerate.
2168 * testsuite/common_test_1_v1.c: New source file.
2169 * testsuite/common_test_1_v2.c: New source file.
2170 * testsuite/copy_test_v1.cc: New source file.
2171
5146f448
CC
21722011-06-07 Cary Coutant <ccoutant@google.com>
2173
2174 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
2175 update, allocate common from bss section's free list.
2176 * incremental-dump.cc (dump_incremental_inputs): Print flag for
2177 linker-defined symbols.
2178 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
2179 Skip GOT and PLT entries that are no longer referenced.
2180 (Output_section_incremental_inputs::write_info_blocks): Mark
2181 linker-defined symbols.
2182 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
2183 * output.cc (Output_section::allocate): New function.
2184 * output.h (Output_section::allocate): New function.
2185 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
2186 linker-defined symbols.
2187 (Symbol::override_base_with_special): Copy is_predefined_ flag.
2188 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
2189 (Symbol::init_base_output_data): Likewise.
2190 (Symbol::init_base_output_segment): Likewise.
2191 (Symbol::init_base_constant): Likewise.
2192 (Sized_symbol::init_output_data): Likewise.
2193 (Sized_symbol::init_output_segment): Likewise.
2194 (Sized_symbol::init_constant): Likewise.
2195 (Symbol_table::do_define_in_output_data): Likewise.
2196 (Symbol_table::do_define_in_output_segment): Likewise.
2197 (Symbol_table::do_define_as_constant): Likewise.
2198 * symtab.h (Symbol::is_predefined): New function.
2199 (Symbol::init_base_output_data): Add is_predefined parameter.
2200 (Symbol::init_base_output_segment): Likewise.
2201 (Symbol::init_base_constant): Likewise.
2202 (Symbol::is_predefined_): New data member.
2203 (Sized_symbol::init_output_data): Add is_predefined parameter.
2204 (Sized_symbol::init_output_segment): Likewise.
2205 (Sized_symbol::init_constant): Likewise.
2206 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
2207
26d3c67d
CC
22082011-06-07 Cary Coutant <ccoutant@google.com>
2209
2210 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
2211 instead of emit_copy_reloc.
2212 (Copy_relocs::emit_copy_reloc): Refactor.
2213 (Copy_relocs::make_copy_reloc): New function.
2214 (Copy_relocs::add_copy_reloc): Remove.
2215 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
2216 section.
2217 (Copy_relocs::make_copy_reloc): New function.
2218 (Copy_relocs::add_copy_reloc): Remove.
2219 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
2220 unchanged input files.
2221 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
2222 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
2223 Reserve BSS space for COPY relocations.
2224 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2225 (Output_section_incremental_inputs::write_info_blocks): Record
2226 whether a symbol is copied from a shared object.
2227 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
2228 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
2229 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
2230 (Incremental_input_entry_reader::get_output_symbol_index): Add
2231 is_copy parameter.
2232 (Incremental_binary::emit_copy_relocs): New function.
2233 (Incremental_binary::do_emit_copy_relocs): New function.
2234 (Sized_incremental_binary::Sized_incremental_binary): Initialize
2235 new data member.
2236 (Sized_incremental_binary::add_copy_reloc): New function.
2237 (Sized_incremental_binary::do_emit_copy_relocs): New function.
2238 (Sized_incremental_binary::Copy_reloc): New struct.
2239 (Sized_incremental_binary::Copy_relocs): New typedef.
2240 (Sized_incremental_binary::copy_relocs_): New data member.
2241 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
2242 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
2243 * target.h (Sized_target::emit_copy_reloc): New function.
2244 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
2245
7cdb37d9
CC
22462011-06-02 Cary Coutant <ccoutant@google.com>
2247
2248 PR gold/12163
2249 * gold/archive.cc (Archive::Archive): Initialize new data member.
2250 (Archive::include_all_members): Return if archive has already been
2251 included.
2252 * gold/archive.h (Archive::include_all_members_): New data member.
2253
cc643b88
NC
22542011-06-02 Nick Clifton <nickc@redhat.com>
2255
2256 * dynobj.h: Fix spelling mistake in comment.
2257 * output.cc: Likewise.
2258
f62a3ca7 22592011-05-31 Doug Kwan <dougkwan@google.com>
2e702c99 2260 Asier Llano
f62a3ca7
DK
2261
2262 PR gold/12826
cc643b88 2263 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
2264 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
2265 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
2266 redundant arm_exidx_test.so.
2267 * testsuite/Makefile.in: Regenerate.
2268 (check_SCRIPTS): Add pr12826.sh
2269 (check_DATA): Add pr12826.stdout
2270 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
2271 * testsuite/pr12826.sh: New file.
2272 * testsuite/pr12826_1.s: Ditto.
2273 * testsuite/pr12826_1.s: Ditto.
2274
8dbe1edc
ILT
22752011-05-30 Ian Lance Taylor <iant@google.com>
2276
2277 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
2278 sections.
2279
c49875be
ILT
22802011-05-29 Ian Lance Taylor <iant@google.com>
2281
2282 PR gold/12804
2283 * testsuite/Makefile.am: Use different file name for two_file_test
2284 temporary file for each incremental test.
2285 * testsuite/Makefile.in: Rebuild.
2286
69d53f7a
ILT
22872011-05-29 Ian Lance Taylor <iant@google.com>
2288
2289 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
2290 binary input file is empty.
2291
41d0ab5f
ILT
22922011-05-27 Ian Lance Taylor <iant@google.com>
2293
2294 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
2295 (ver_test_9.so): Likewise.
2296 * testsuite/Makefile.in: Rebuild.
2297
89d8a36b
CC
22982011-05-26 Cary Coutant <ccoutant@google.com>
2299
2300 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
2301 * incremental.cc (Incremental_inputs::report_input_section): Fix
2302 comment, indentation.
2303 (Incremental_inputs::report_comdat_group): New function.
2304 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2305 of data for incremental input file entry.
2306 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
2307 group count, COMDAT group signatures.
2308 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
2309 an unchanged input file.
2310 * incremental.h (Incremental_object_entry::Incremental_object_entry):
2311 Initialize new data member.
2312 (Incremental_object_entry::add_comdat_group): New function.
2313 (Incremental_object_entry::get_comdat_group_count): New function.
2314 (Incremental_object_entry::get_comdat_signature_key): New function.
2315 (Incremental_object_entry::groups_): New data member.
2316 (Incremental_inputs::report_comdat_group): New function.
2317 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
2318 data for incremental input file entry.
2319 (Incremental_input_entry_reader::get_comdat_group_count): New function.
2320 (Incremental_input_entry_reader::get_input_section): Adjust size of
2321 data for incremental input file entry.
2322 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
2323 (Incremental_input_entry_reader::get_comdat_group_signature): New
2324 function.
2325 * object.cc (Sized_relobj::include_section_group): Report kept
2326 COMDAT groups for incremental links.
2327
1706a06f
ILT
23282011-05-24 David Meyer <pdox@google.com>
2329
2330 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
2331 with name parameter. Add found_name parameter.
2332 * fileread.cc (Input_file::find_file): Adjust code accordingly.
2333 * dirsearch.h (class Dirsearch): Update declaration.
2334
a10ae760
ILT
23352011-05-24 Ian Lance Taylor <iant@google.com>
2336
2337 * archive.cc (Library_base::should_include_member): Pull in object
2338 from archive if it defines the entry symbol.
2339 * parameters.cc (Parameters::entry): New function.
2340 * parameters.h (class Parameters): Declare entry.
2341 * output.h (class Output_file_header): Remove entry_ field.
2342 * output.cc (Output_file_header::Output_file_header): Remove entry
2343 parameter. Change all callers.
2344 (Output_file_header::entry): Use parameters->entry.
2345 * gold.cc (queue_middle_tasks): Likewise.
2346 * plugin.cc (Plugin_hook::run): Likewise.
2347
aa92d6ed
CC
23482011-05-24 Cary Coutant <ccoutant@google.com>
2349
2350 * gold.cc (queue_initial_tasks): Pass incremental base filename
2351 to Output_file::open_base_file; don't print error message.
2352 * incremental-dump.cc (main): Adjust call to
2353 Output_file::open_for_modification.
2354 * incremental-dump.cc (main): Likewise.
2355 * incremental.cc (Incremental_inputs::report_command_line):
2356 Ignore --incremental-base option when comparing command lines.
2357 Ignore parameter when given as separate argument.
2358 * options.h (class General_options): Add --incremental-base.
2359 * output.cc (Output_file::Output_file):
2360 (Output_file::open_base_file): Add base_name and writable parameters;
2361 read base file into new file; print error message here.
2362 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2363 callers.
2364 * output.h (Output_file::open_for_modification): Rename to...
2365 (Output_file::open_base_file): ...this; add base_name and
2366 writable parameters; adjust all callers.
2367 (Output_file::map_no_anonymous): Add writable parameter; adjust all
2368 callers.
2369 * testsuite/Makefile.am (incremental_test_4): Test
2370 --incremental-base.
2371 * testsuite/Makefile.in: Regenerate.
2372
2eedd706
CC
23732011-05-24 Cary Coutant <ccoutant@google.com>
2374
2375 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
2376 incremental_test_4.
2377 * testsuite/Makefile.in: Regenerate.
2378 * testsuite/two_file_test_1_v1.cc: New test source file.
2379 * testsuite/two_file_test_1b_v1.cc: New test source file.
2380 * testsuite/two_file_test_2_v1.cc: New test source file.
2381
0f1c85a6
CC
23822011-05-24 Cary Coutant <ccoutant@google.com>
2383
2384 * dynobj.h (Dynobj::do_dynobj): New function.
2385 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
2386 flag and soname for shared objects.
2387 * incremental.cc (Incremental_inputs::report_object): Make
2388 either Incremental_object_entry or Incremental_dynobj_entry; add
2389 soname to string table.
2390 (Incremental_inputs::report_input_section): Add assertion.
2391 (Output_section_incremental_inputs::set_final_data_size): Adjust
2392 type of input file entry for shared libraries; adjust size of
2393 shared library info entry.
2394 (Output_section_incremental_inputs::write_input_files): Write
2395 as_needed flag for shared libraries.
2396 (Output_section_incremental_inputs::write_info_blocks): Adjust type
2397 of input file entry for shared libraries; write soname.
2398 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
2399 soname from incremental info.
2400 * incremental.h (enum Incremental_input_flags): Add
2401 INCREMENTAL_INPUT_AS_NEEDED.
2402 (Incremental_input_entry::Incremental_input_entry): Initialize new
2403 data member.
2404 (Incremental_input_entry::set_as_needed): New function.
2405 (Incremental_input_entry::as_needed): New function.
2406 (Incremental_input_entry::do_dynobj_entry): New function.
2407 (Incremental_input_entry::as_needed_): New data member.
2408 (Incremental_object_entry::Incremental_object_entry): Don't check
2409 for shared library.
2410 (Incremental_object_entry::do_type): Likewise.
2411 (class Incremental_dynobj_entry): New class.
2412 (Incremental_input_entry_reader::as_needed): New function.
2413 (Incremental_input_entry_reader::get_soname): New function.
2414 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
2415 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
2416 size of shared library info entry.
58797674 2417 * layout.cc (Layout::finish_dynamic_section): Don't test for
0f1c85a6
CC
2418 incremental link when adding DT_NEEDED entries.
2419 * object.h (Object::Object): Initialize new data member.
2420 (Object::dynobj): New function.
2421 (Object::set_as_needed): New function.
2422 (Object::as_needed): New function.
2423 (Object::do_dynobj): New function.
2424 (Object::as_needed_): New data member.
2425
6fa2a40b
CC
24262011-05-24 Cary Coutant <ccoutant@google.com>
2427
2428 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
2429 info; adjust display of GOT entries.
2430 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2431 vector of input objects; remove file_status_.
2432 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
2433 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
2434 got_plt reader; call target hooks to reserve GOT entries.
2435 (Output_section_incremental_inputs::set_final_data_size): Adjust size
2436 of input file info header and GOT info entry.
2437 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
2438 relocation info.
2439 (Got_plt_view_info::got_descriptor): Remove.
2440 (Got_plt_view_info::sym_index): New data member.
2441 (Got_plt_view_info::input_index): New data member.
2442 (Local_got_offset_visitor::visit): Write input file index.
2443 (Global_got_offset_visitor::visit): Write 0 for input file index.
2444 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
2445 with sym_index and input_index.
2446 (Output_section_incremental_inputs::write_got_plt): Adjust size of
2447 incremental info GOT entry; replace got_descriptor with input_index.
2448 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
2449 map from input file index to object.
2450 (Sized_relobj_incr::do_layout): Replace direct data member reference
2451 with accessor function.
2452 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
2453 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
2454 Adjust size of input file info header.
2455 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
2456 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
2457 (Incremental_input_entry_reader::get_input_section): Adjust size of
2458 input file info header.
2459 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
2460 of incremental info GOT entry.
2461 (Incremental_got_plt_reader::get_got_desc): Remove.
2462 (Incremental_got_plt_reader::get_got_symndx): New function.
2463 (Incremental_got_plt_reader::get_got_input_index): New function.
2464 (Sized_incremental_binary::Sized_incremental_binary): Remove
2465 file_status_; add input_objects_.
2466 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
2467 (Sized_incremental_binary::set_file_is_unchanged): Remove.
2468 (Sized_incremental_binary::file_is_unchanged): Remove.
2469 (Sized_incremental_binary::set_input_object): New function.
2470 (Sized_incremental_binary::input_object): New function.
2471 (Sized_incremental_binary::file_status_): Remove.
2472 (Sized_incremental_binary::input_objects_): New data member.
2473 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
2474 references.
2475 (Sized_relobj_incr::invalid_address): Move to base class.
2476 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
2477 class.
2478 (Sized_relobj_incr::do_output_section_offset): Likewise.
2479 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
2480 (Sized_relobj_incr::section_offsets_): Likewise.
2481 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
2482 function.
2483 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
2484 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
2485 with accessor function.
2486 (Sized_relobj_file::do_layout): Likewise.
2487 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
2488 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
2489 (Sized_relobj_file::compute_final_local_value): Replace refs to
2490 section_offsets_ with accessor function.
2491 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
2492 * object.h (Relobj::Relobj): Initialize new data members.
2493 (Relobj::add_dyn_reloc): New function.
2494 (Relobj::first_dyn_reloc): New function.
2495 (Relobj::dyn_reloc_count): New function.
2496 (Relobj::first_dyn_reloc_): New data member.
2497 (Relobj::dyn_reloc_count_): New data member.
2498 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
2499 references.
2500 (Sized_relobj::Address): New typedef.
2501 (Sized_relobj::invalid_address): Move here from child class.
2502 (Sized_relobj::Sized_relobj): Initialize new data members.
2503 (Sized_relobj::sized_relobj): New function.
2504 (Sized_relobj::is_output_section_offset_invalid): Move here from
2505 child class.
2506 (Sized_relobj::get_output_section_offset): Likewise.
2507 (Sized_relobj::local_has_got_offset): Likewise.
2508 (Sized_relobj::local_got_offset): Likewise.
2509 (Sized_relobj::set_local_got_offset): Likewise.
2510 (Sized_relobj::do_for_all_local_got_entries): Likewise.
2511 (Sized_relobj::clear_got_offsets): New function.
2512 (Sized_relobj::section_offsets): Move here from child class.
2513 (Sized_relobj::do_output_section_offset): Likewise.
2514 (Sized_relobj::do_set_section_offset): Likewise.
2515 (Sized_relobj::Local_got_offsets): Likewise.
2516 (Sized_relobj::local_got_offsets_): Likewise.
2517 (Sized_relobj::section_offsets_): Likewise.
2518 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
2519 references.
2520 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
2521 class.
2522 (Sized_relobj_file::sized_relobj): New function
2523 (Sized_relobj_file::local_has_got_offset): Move to base class.
2524 (Sized_relobj_file::local_got_offset): Likewise.
2525 (Sized_relobj_file::set_local_got_offset): Likewise.
2526 (Sized_relobj_file::get_output_section_offset): Likewise.
2527 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
2528 (Sized_relobj_file::do_output_section_offset): Likewise.
2529 (Sized_relobj_file::do_set_section_offset): Likewise.
2530 (Sized_relobj_file::Local_got_offsets): Likewise.
2531 (Sized_relobj_file::local_got_offsets_): Likewise.
2532 (Sized_relobj_file::section_offsets_): Likewise.
2533 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
2534 (all constructors).
2535 (set_needs_dynsym_index): Convert relobj to derived class pointer.
2536 (Output_reloc::get_symbol_index): Likewise.
2537 (Output_reloc::local_section_offset): Likewise.
2538 (Output_reloc::get_address): Likewise.
2539 (Output_reloc::symbol_value): Likewise.
2540 (Output_data_got::reserve_slot): Move to class definition.
2541 (Output_data_got::reserve_local): New function.
2542 (Output_data_got::reserve_slot_for_global): Remove.
2543 (Output_data_got::reserve_global): New function.
2544 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
2545 (all constructors, two instantiations).
2546 (Output_reloc::get_relobj): New function (two instantiations).
2547 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
2548 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
2549 (Output_data_reloc::add_global): Adjust type of relobj.
2550 (Output_data_reloc::add_global_relative): Likewise.
2551 (Output_data_reloc::add_symbolless_global_addend): Likewise.
2552 (Output_data_reloc::add_local): Likewise.
2553 (Output_data_reloc::add_local_relative): Likewise.
2554 (Output_data_reloc::add_symbolless_local_addend): Likewise.
2555 (Output_data_reloc::add_local_section): Likewise.
2556 (Output_data_reloc::add_output_section): Likewise.
2557 (Output_data_reloc::add_absolute): Likewise.
2558 (Output_data_reloc::add_target_specific): Likewise.
2559 (Output_data_got::reserve_slot): Move definition here.
2560 (Output_data_got::reserve_local): New function.
2561 (Output_data_got::reserve_global): New function.
2562 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
2563 section_offsets_ with accessor function.
2564 (Sized_relobj_file::write_sections): Likewise.
2565 (Sized_relobj_file::do_relocate_sections): Likewise.
2566 * target.h (Sized_target::reserve_local_got_entry): New function.
2567 (Sized_target::reserve_global_got_entry): New function.
2568 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
2569 (Target_x86_64::reserve_global_got_entry): New function.
2570 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
2571
4829d394
CC
25722011-05-23 Cary Coutant <ccoutant@google.com>
2573
2574 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
2575 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
2576 bit when checking got_type.
2577 * incremental.cc (Sized_incremental_binary::setup_readers):
2578 Store symbol table and string table locations; initialize bit vector
2579 of file status flags.
2580 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
2581 unchanged files.
2582 (Sized_incremental_binary::do_process_got_plt): New function.
2583 (Sized_incremental_binary::get_symtab_view): Use stored locations.
2584 (Output_section_incremental_inputs::set_final_data_size): Record
2585 file index for each input file.
2586 (Output_section_incremental_inputs::write_got_plt): Store file index
2587 instead of input entry offset for each GOT entry.
2588 * incremental.h
2589 (Incremental_input_entry::Incremental_input_entry): Initialize new
2590 data member.
2591 (Incremental_input_entry::set_offset): Store file index.
2592 (Incremental_input_entry::get_file_index): New function.
2593 (Incremental_input_entry::file_index_): New data member.
2594 (Incremental_binary::process_got_plt): New function.
2595 (Incremental_binary::do_process_got_plt): New function.
2596 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2597 data members.
2598 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
2599 (Sized_incremental_binary::set_file_is_unchanged): New function.
2600 (Sized_incremental_binary::file_is_unchanged): New function.
2601 (Sized_incremental_binary::do_process_got_plt): New function.
2602 (Sized_incremental_binary::file_status_): New data member.
2603 (Sized_incremental_binary::main_symtab_loc_): New data member.
2604 (Sized_incremental_binary::main_strtab_loc_): New data member.
2605 * output.cc (Output_data_got::Got_entry::write): Add case
2606 RESERVED_CODE.
2607 (Output_data_got::add_global): Call add_got_entry.
2608 (Output_data_got::add_global_plt): Likewise.
2609 (Output_data_got::add_global_with_rel): Likewise.
2610 (Output_data_got::add_global_with_rela): Likewise.
2611 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
2612 (Output_data_got::add_global_pair_with_rela): Likewise.
2613 (Output_data_got::add_local): Call add_got_entry.
2614 (Output_data_got::add_local_plt): Likewise.
2615 (Output_data_got::add_local_with_rel): Likewise.
2616 (Output_data_got::add_local_with_rela): Likewise.
2617 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
2618 (Output_data_got::add_local_pair_with_rela): Likewise.
2619 (Output_data_got::reserve_slot): New function.
2620 (Output_data_got::reserve_slot_for_global): New function.
2621 (Output_data_got::add_got_entry): New function.
2622 (Output_data_got::add_got_entry_pair): New function.
2623 (Output_section::add_output_section_data): Edit FIXME.
2624 * output.h
2625 (Output_section_data_build::Output_section_data_build): New
2626 constructor with size parameter.
2627 (Output_data_space::Output_data_space): Likewise.
2628 (Output_data_got::Output_data_got): Initialize new data member; new
2629 constructor with size parameter.
2630 (Output_data_got::add_constant): Call add_got_entry.
2631 (Output_data_got::reserve_slot): New function.
2632 (Output_data_got::reserve_slot_for_global): New function.
2633 (class Output_data_got::Got_entry): Add RESERVED_CODE.
2634 (Output_data_got::add_got_entry): New function.
2635 (Output_data_got::add_got_entry_pair): New function.
2636 (Output_data_got::free_list_): New data member.
2637 * target.h (Sized_target::init_got_plt_for_update): New function.
2638 (Sized_target::register_global_plt_entry): New function.
2639 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
2640 Initialize new data member; call init; add constructor with PLT count.
2641 (Output_data_plt_x86_64::init): New function.
2642 (Output_data_plt_x86_64::add_relocation): New function.
2643 (Output_data_plt_x86_64::reserve_slot): New function.
2644 (Output_data_plt_x86_64::free_list_): New data member.
2645 (Target_x86_64::init_got_plt_for_update): New function.
2646 (Target_x86_64::register_global_plt_entry): New function.
2647 (Output_data_plt_x86_64::add_entry): Allocate from free list for
2648 incremental updates.
2649 (Output_data_plt_x86_64::add_relocation): New function.
2650 * testsuite/object_unittest.cc (Object_test): Set default options.
2651
ec69d6da
ILT
26522011-05-16 Ian Lance Taylor <iant@google.com>
2653
2654 * options.h (class General_options): Make -i a synonym for -r.
2655
732e31de
ILT
26562011-05-16 Ian Lance Taylor <iant@google.com>
2657
2658 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
2659
403676b5
CC
26602011-05-10 Cary Coutant <ccoutant@google.com>
2661
2662 * object.cc (Sized_relobj::do_count_local_symbols): Check for
2663 strip_all (-s).
2664
5b7b7d6e
ILT
26652011-05-06 Ian Lance Taylor <iant@google.com>
2666
2667 * layout.cc (Layout::layout): If the output section flags change,
2668 update the ordering.
2669
f0f9babf
CC
26702011-04-25 Cary Coutant <ccoutant@google.com>
2671
2672 * incremental-dump.cc (dump_incremental_inputs): Print local
2673 symbol info for each input file.
2674 * incremental.cc
2675 (Output_section_incremental_inputs::set_final_data_size): Add local
2676 symbol info to input file entries in incremental info.
2677 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2678 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
2679 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
2680 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
2681 implementation.
2682 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
2683 (Sized_incr_relobj::do_relocate): Write the local symbols.
2684 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
2685 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
2686 Adjust size of input file header.
2687 (Incremental_inputs_reader::get_local_symbol_offset): New function.
2688 (Incremental_inputs_reader::get_local_symbol_count): New function.
2689 (Incremental_inputs_reader::get_input_section): Adjust size of input
2690 file header.
2691 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
2692 (Sized_incr_relobj::This): New typedef.
2693 (Sized_incr_relobj::sym_size): New const data member.
2694 (Sized_incr_relobj::Local_symbol): New struct.
2695 (Sized_incr_relobj::do_output_local_symbol_count): New function.
2696 (Sized_incr_relobj::do_local_symbol_offset): New function.
2697 (Sized_incr_relobj::local_symbol_count_): New data member.
2698 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
2699 (Sized_incr_relobj::local_symbol_index_): New data member.
2700 (Sized_incr_relobj::local_symbol_offset_): New data member.
2701 (Sized_incr_relobj::local_dynsym_offset_): New data member.
2702 (Sized_incr_relobj::local_symbols_): New data member.
2703 * object.h (Relobj::output_local_symbol_count): New function.
2704 (Relobj::local_symbol_offset): New function.
2705 (Relobj::do_output_local_symbol_count): New function.
2706 (Relobj::do_local_symbol_offset): New function.
2707 (Sized_relobj::do_output_local_symbol_count): New function.
2708 (Sized_relobj::do_local_symbol_offset): New function.
2709
d0a9ace3
ILT
27102011-04-22 Vladimir Simonov <sv@sw.ru>
2711
2712 * descriptors.cc (set_close_on_exec): New function.
2713 (Descriptors::open): Use set_close_on_exec.
2714 * output.cc (S_ISLNK): Define if not defined.
2715
94a3fc8b
CC
27162011-04-22 Cary Coutant <ccoutant@google.com>
2717
2718 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
2719 global symbol map.
2720 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2721 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
2722 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
2723 relocations.
2724 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
2725 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
2726 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
2727 * incremental.h
2728 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
2729 function.
2730 (Incremental_binary::apply_incremental_relocs): New function.
2731 (Incremental_binary::do_apply_incremental_relocs): New function.
2732 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
2733 data member.
2734 (Sized_incremental_binary::add_global_symbol): New function.
2735 (Sized_incremental_binary::global_symbol): New function.
2736 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
2737 (Sized_incremental_binary::symbol_map_): New data member.
2738 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
2739 * target.h (Sized_target::apply_relocation): New function.
2740 * target-reloc.h (apply_relocation): New function.
2741 * x86_64.cc (Target_x86_64::apply_relocation): New function.
2742
c87e4302
DK
27432011-04-22 Doug Kwan <dougkwan@google.com>
2744
2745 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
2746 flag of a SHT_ARM_EXIDX section.
2e702c99 2747 * testsuite/Makefile.am (arm_exidx_test): New test rules.
c87e4302
DK
2748 * testsuite/Makefile.in: Regenerate.
2749 * testsuite/arm_exidx_test.s: New file.
2750 * testsuite/arm_exidx_test.sh: Same.
2751
e7782cf6
CC
27522011-04-20 Cary Coutant <ccoutant@google.com>
2753
2754 PR gold/12689
2755 * archive.h (Incremental_archive_entry::Archive_member):
2756 Initialize arg_serial_ (second constructor).
2757
308ecdc7
ILT
27582011-04-17 Ian Lance Taylor <iant@google.com>
2759
2760 * object.cc (Relocate_info::location): Simplify location string.
2761 * errors.cc (Errors::error_at_location): Don't print program
2762 name.
2763 (Errors::warning_at_location): Likewise.
2764 (Errors::undefined_symbol): Likewise.
2765 * testsuite/debug_msg.sh: Update accordingly.
2766
bec5b579
CC
27672011-04-14 Cary Coutant <ccoutant@google.com>
2768
2769 * gold/layout.cc (Layout::symtab_section_offset): New function.
2770 * gold/layout.h (Layout::symtab_section_offset): New function.
2771 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
2772
88597d34
ILT
27732011-04-12 Ian Lance Taylor <iant@google.com>
2774
2775 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
2776 with MREMAP_MAYMOVE.
2777 * output.h (class Output_file): Add map_is_allocated_ field.
2778 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
2779 not available, provide stubs. If mremap is not available, #define
2780 it to gold_mremap.
2781 (MREMAP_MAYMOVE): Define if not defined.
2782 (Output_file::Output_file): Initialize map_is_allocated_.
2783 (Output_file::resize): Check map_is_allocated_.
2784 (Output_file::map_anonymous): If mmap fails, use malloc.
2785 (Output_file::unmap): Don't do anything for an anonymous map.
2786 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
2787 is not available, provide stubs.
2788 (File_read::View::~View): Use free rather than delete[].
2789 (File_read::make_view): Use malloc rather than new[]. If mmap
2790 fails, use malloc.
2791 (File_read::find_or_make_view): Use malloc rather than new[].
2792 * gold.h: Remove HAVE_REMAP code.
2793 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
2794 exists. Rename mremap to gold_mremap. If mmap is not available
2795 don't do anything.
2796 * configure, config.in: Rebuild.
2797
11e361bc
ILT
27982011-04-11 Ian Lance Taylor <iant@google.com>
2799
2800 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
2801 initialize local variable v.
2802
cdc29364
CC
28032011-04-11 Cary Coutant <ccoutant@google.com>
2804
2805 * archive.cc (Archive::include_member): Adjust call to
2806 report_object.
2807 (Add_archive_symbols::run): Track argument serial numbers.
2808 (Lib_group::include_member): Likewise.
2809 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
2810 * archive.h (Incremental_archive_entry::Archive_member):
2811 Initialize arg_serial_.
2812 (Archive_member::arg_serial_): New data member.
2813 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
2814 (Sized_dynobj::do_add_symbols): Track symbols when doing an
2815 incremental link.
2816 (Sized_dynobj::do_for_all_local_got_entries): New function.
2817 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
2818 function.
2819 * fileread.cc (get_mtime): New function.
2820 * fileread.h (get_mtime): New function.
2821 * gold.cc (queue_initial_tasks): Check for incremental update.
2822 (process_incremental_input): New function.
2823 (queue_middle_tasks): Don't force valid target for incremental
2824 update.
2825 * incremental-dump.cc (find_input_containing_global): Adjust
2826 size of symbol info entry.
2827 (dump_incremental_inputs): Dump argument serial number and
2828 in_system_directory flag; bias shndx by 1; print symbol names
2829 when dumping per-file symbol lists; use new symbol info readers.
2830 * incremental.cc
2831 (Output_section_incremental_inputs:update_data_size): New function.
2832 (Sized_incremental_binary::setup_readers): Setup input readers
2833 for each input file; build maps for files added from libraries
2834 and scripts.
2835 (Sized_incremental_binary::check_input_args): New function.
2836 (Sized_incremental_binary::do_check_inputs): Build map of argument
2837 serial numbers to input arguments.
2838 (Sized_incremental_binary::do_file_has_changed): Rename
2839 do_file_is_unchanged to this; compare file modification times.
2840 (Sized_incremental_binary::do_init_layout): New function.
2841 (Sized_incremental_binary::do_reserve_layout): New function.
2842 (Sized_incremental_binary::do_get_input_reader): Remove.
2843 (Sized_incremental_binary::get_symtab_view): New function.
2844 (Incremental_checker::can_incrementally_link_output_file): Remove.
2845 (Incremental_inputs::report_command_line): Exclude --debug options.
2846 (Incremental_inputs::report_archive_begin): Add parameter; track
2847 argument serial numbers; don't put input file entry for archive
2848 before archive members.
2849 (Incremental_inputs::report_archive_end): Put input file entry
2850 for archive after archive members.
2851 (Incremental_inputs::report_object): Add parameter; track argument
2852 serial numbers and in_system_directory flag.
2853 (Incremental_inputs::report_script): Add parameter; track argument
2854 serial numbers.
2855 (Output_section_incremental_inputs::set_final_data_size): Adjust
2856 size of symbol info entry; check for forwarding symbols.
2857 (Output_section_incremental_inputs::write_input_files): Write
2858 in_system_directory flag and argument serial number.
2859 (Output_section_incremental_inputs::write_info_blocks): Map section
2860 indices between incremental info and original input file; store
2861 input section index for each symbol.
2862 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
2863 change operator() to visit().
2864 (class Global_got_offset_visitor): Likewise.
2865 (class Global_symbol_visitor_got_plt):
2866 (Output_section_incremental_inputs::write_got_plt): Use new visitor
2867 classes.
2868 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
2869 (Sized_incr_relobj::do_read_symbols): New function.
2870 (Sized_incr_relobj::do_layout): New function.
2871 (Sized_incr_relobj::do_layout_deferred_sections): New function.
2872 (Sized_incr_relobj::do_add_symbols): New function.
2873 (Sized_incr_relobj::do_should_include_member): New function.
2874 (Sized_incr_relobj::do_for_all_global_symbols): New function.
2875 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
2876 (Sized_incr_relobj::do_section_size): New function.
2877 (Sized_incr_relobj::do_section_name): New function.
2878 (Sized_incr_relobj::do_section_contents): New function.
2879 (Sized_incr_relobj::do_section_flags): New function.
2880 (Sized_incr_relobj::do_section_entsize): New function.
2881 (Sized_incr_relobj::do_section_address): New function.
2882 (Sized_incr_relobj::do_section_type): New function.
2883 (Sized_incr_relobj::do_section_link): New function.
2884 (Sized_incr_relobj::do_section_info): New function.
2885 (Sized_incr_relobj::do_section_addralign): New function.
2886 (Sized_incr_relobj::do_initialize_xindex): New function.
2887 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
2888 (Sized_incr_relobj::do_read_relocs): New function.
2889 (Sized_incr_relobj::do_gc_process_relocs): New function.
2890 (Sized_incr_relobj::do_scan_relocs): New function.
2891 (Sized_incr_relobj::do_count_local_symbols): New function.
2892 (Sized_incr_relobj::do_finalize_local_symbols): New function.
2893 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
2894 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
2895 (Sized_incr_relobj::do_relocate): New function.
2896 (Sized_incr_relobj::do_set_section_offset): New function.
2897 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
2898 (Sized_incr_dynobj::do_read_symbols): New function.
2899 (Sized_incr_dynobj::do_layout): New function.
2900 (Sized_incr_dynobj::do_add_symbols): New function.
2901 (Sized_incr_dynobj::do_should_include_member): New function.
2902 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
2903 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
2904 (Sized_incr_dynobj::do_section_size): New function.
2905 (Sized_incr_dynobj::do_section_name): New function.
2906 (Sized_incr_dynobj::do_section_contents): New function.
2907 (Sized_incr_dynobj::do_section_flags): New function.
2908 (Sized_incr_dynobj::do_section_entsize): New function.
2909 (Sized_incr_dynobj::do_section_address): New function.
2910 (Sized_incr_dynobj::do_section_type): New function.
2911 (Sized_incr_dynobj::do_section_link): New function.
2912 (Sized_incr_dynobj::do_section_info): New function.
2913 (Sized_incr_dynobj::do_section_addralign): New function.
2914 (Sized_incr_dynobj::do_initialize_xindex): New function.
2915 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
2916 (make_sized_incremental_object): New function.
2917 (Incremental_library::copy_unused_symbols): New function.
2918 (Incremental_library::do_for_all_unused_symbols): New function.
2919 * incremental.h (enum Incremental_input_flags): New type.
2920 (class Incremental_checker): Remove.
2921 (Incremental_input_entry::Incremental_input_entry): Add argument
2922 serial number.
2923 (Incremental_input_entry::arg_serial): New function.
2924 (Incremental_input_entry::set_is_in_system_directory): New function.
2925 (Incremental_input_entry::is_in_system_directory): New function.
2926 (Incremental_input_entry::arg_serial_): New data member.
2927 (Incremental_input_entry::is_in_system_directory_): New data member.
2928 (class Script_info): Move here from script.h.
2929 (Script_info::Script_info): Add filename parameter.
2930 (Script_info::filename): New function.
2931 (Script_info::filename_): New data member.
2932 (Incremental_script_entry::Incremental_script_entry): Add argument
2933 serial number.
2934 (Incremental_object_entry::Incremental_object_entry): Likewise.
2935 (Incremental_object_entry::add_input_section): Build list of input
2936 sections with map to original shndx.
2937 (Incremental_object_entry::get_input_section_index): New function.
2938 (Incremental_object_entry::shndx_): New data member.
2939 (Incremental_object_entry::name_key_): Rename; adjust all refs.
2940 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
2941 (Incremental_archive_entry::Incremental_archive_entry): Add argument
2942 serial number.
2943 (Incremental_inputs::report_archive_begin): Likewise.
2944 (Incremental_inputs::report_object): Likewise.
2945 (Incremental_inputs::report_script): Likewise.
2946 (class Incremental_global_symbol_reader): New class.
2947 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
2948 and store flags and input file type.
2949 (Incremental_input_entry_reader::arg_serial): New function.
2950 (Incremental_input_entry_reader::type): Extract type from flags.
2951 (Incremental_input_entry_reader::is_in_system_directory): New function.
2952 (Incremental_input_entry_reader::get_input_section_count): Call
2953 accessor function for type.
2954 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
2955 function for type; adjust size of global symbol entry.
2956 (Incremental_input_entry_reader::get_global_symbol_count): Call
2957 accessor function for type.
2958 (Incremental_input_entry_reader::get_object_count): Likewise.
2959 (Incremental_input_entry_reader::get_object_offset): Likewise.
2960 (Incremental_input_entry_reader::get_member_count): Likewise.
2961 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
2962 (Incremental_input_entry_reader::get_member_offset): Likewise.
2963 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
2964 (Incremental_input_entry_reader::Global_symbol_info): Remove.
2965 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
2966 (Incremental_input_entry_reader::get_global_symbol_reader): New
2967 function.
2968 (Incremental_input_entry_reader::get_output_symbol_index): New
2969 function.
2970 (Incremental_input_entry_reader::type_): Remove.
2971 (Incremental_input_entry_reader::flags_): New data member.
2972 (Incremental_inputs_reader::input_file_offset): New function.
2973 (Incremental_inputs_reader::input_file_index): New function.
2974 (Incremental_inputs_reader::input_file): Call input_file_offset.
2975 (Incremental_inputs_reader::input_file_at_offset): New function.
2976 (Incremental_relocs_reader::get_r_type): Reformat.
2977 (Incremental_relocs_reader::get_r_shndx): Reformat.
2978 (Incremental_relocs_reader::get_r_offset): Reformat.
2979 (Incremental_relocs_reader::data): New function.
2980 (Incremental_binary::Incremental_binary): Initialize new data members.
2981 (Incremental_binary::check_inputs): Add cmdline parameter.
2982 (Incremental_binary::file_is_unchanged): Remove.
2983 (Input_reader::arg_serial): New function.
2984 (Input_reader::get_unused_symbol_count): New function.
2985 (Input_reader::get_unused_symbol): New function.
2986 (Input_reader::do_arg_serial): New function.
2987 (Input_reader::do_get_unused_symbol_count): New function.
2988 (Input_reader::do_get_unused_symbol): New function.
2989 (Incremental_binary::input_file_count): New function.
2990 (Incremental_binary::get_input_reader): Change signature to use
2991 index instead of filename.
2992 (Incremental_binary::file_has_changed): New function.
2993 (Incremental_binary::get_input_argument): New function.
2994 (Incremental_binary::get_library): New function.
2995 (Incremental_binary::get_script_info): New function.
2996 (Incremental_binary::init_layout): New function.
2997 (Incremental_binary::reserve_layout): New function.
2998 (Incremental_binary::output_file): New function.
2999 (Incremental_binary::do_check_inputs): New function.
3000 (Incremental_binary::do_file_is_unchanged): Remove.
3001 (Incremental_binary::do_file_has_changed): New function.
3002 (Incremental_binary::do_init_layout): New function.
3003 (Incremental_binary::do_reserve_layout): New function.
3004 (Incremental_binary::do_input_file_count): New function.
3005 (Incremental_binary::do_get_input_reader): Change signature.
3006 (Incremental_binary::input_args_map_): New data member.
3007 (Incremental_binary::library_map_): New data member.
3008 (Incremental_binary::script_map_): New data member.
3009 (Sized_incremental_binary::Sized_incremental_binary): Initialize
3010 new data members.
3011 (Sized_incremental_binary::output_section): New function.
3012 (Sized_incremental_binary::inputs_reader): Add const.
3013 (Sized_incremental_binary::symtab_reader): Add const.
3014 (Sized_incremental_binary::relocs_reader): Add const.
3015 (Sized_incremental_binary::got_plt_reader): Add const.
3016 (Sized_incremental_binary::get_symtab_view): New function.
3017 (Sized_incremental_binary::Inputs_reader): New typedef.
3018 (Sized_incremental_binary::Input_entry_reader): New typedef.
3019 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
3020 (Sized_incremental_binary::do_file_is_unchanged): Remove.
3021 (Sized_incremental_binary::do_file_has_changed): New function.
3022 (Sized_incremental_binary::do_init_layout): New function.
3023 (Sized_incremental_binary::do_reserve_layout): New function.
3024 (Sized_input_reader::Inputs_reader): Remove.
3025 (Sized_input_reader::Input_entry_reader): Remove.
3026 (Sized_input_reader::do_arg_serial): New function.
3027 (Sized_input_reader::do_get_unused_symbol_count): New function.
3028 (Sized_input_reader::do_get_unused_symbol): New function.
3029 (Sized_incremental_binary::do_input_file_count): New function.
3030 (Sized_incremental_binary::do_get_input_reader): Change signature;
3031 use index instead of filename.
3032 (Sized_incremental_binary::section_map_): New data member.
3033 (Sized_incremental_binary::input_entry_readers_): New data member.
3034 (class Sized_incr_relobj): New class.
3035 (class Sized_incr_dynobj): New class.
3036 (make_sized_incremental_object): New function.
3037 (class Incremental_library): New class.
3038 * layout.cc (Free_list::num_lists): New static data member.
3039 (Free_list::num_nodes): New static data member.
3040 (Free_list::num_removes): New static data member.
3041 (Free_list::num_remove_visits): New static data member.
3042 (Free_list::num_allocates): New static data member.
3043 (Free_list::num_allocate_visits): New static data member.
3044 (Free_list::init): New function.
3045 (Free_list::remove): New function.
3046 (Free_list::allocate): New function.
3047 (Free_list::dump): New function.
3048 (Free_list::print_stats): New function.
3049 (Layout_task_runner::run): Resize output file for incremental updates.
3050 (Layout::Layout): Initialize new data members.
3051 (Layout::set_incremental_base): New function.
3052 (Layout::init_fixed_output_section): New function.
3053 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
3054 incremental updates.
3055 (Layout::create_gold_note): Do not create gold note section for
3056 incremental updates.
3057 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
3058 for incremental updates.
3059 (Layout::set_section_offsets): For incremental updates, allocate space
3060 from free list.
3061 (Layout::create_symtab_sections): Layout with offsets relative to
3062 start of section; for incremental updates, allocate space from free
3063 list.
3064 (Layout::create_shdrs): For incremental updates, allocate space from
3065 free list.
3066 (Layout::finish_dynamic_section): For incremental updates, do not
3067 check --as-needed (fixed in subsequent patch).
3068 * layout.h (class Free_list): New class.
3069 (Layout::set_incremental_base): New function.
3070 (Layout::incremental_base): New function.
3071 (Layout::init_fixed_output_section): New function.
3072 (Layout::allocate): New function.
3073 (Layout::incremental_base_): New data member.
3074 (Layout::free_list_): New data member.
3075 * main.cc (main): Print Free_list statistics.
3076 * object.cc (Relobj::finalize_incremental_relocs): Add
3077 clear_counts parameter; clear counts only when clear_counts is set.
3078 (Sized_relobj::Sized_relobj): Initialize new base class.
3079 (Sized_relobj::do_layout): Don't report special sections.
3080 (Sized_relobj::do_for_all_local_got_entries): New function.
3081 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
3082 symtab_off to all symbol table offsets.
3083 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
3084 * object.h (class Got_offset_list): Move to top of file.
3085 (Object::Object): Allow case where input_file == NULL.
3086 (Object::~Object): Likewise.
3087 (Object::input_file): Assert that input_file != NULL.
3088 (Object::lock): Allow case where input_file == NULL.
3089 (Object::unlock): Likewise.
3090 (Object::is_locked): Likewise.
3091 (Object::token): Likewise.
3092 (Object::release): Likewise.
3093 (Object::is_incremental): New function.
3094 (Object::get_mtime): New function.
3095 (Object::for_all_local_got_entries): New function.
3096 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
3097 (Object::set_is_in_system_directory): New function.
3098 (Object::is_in_system_directory): New function.
3099 (Object::do_is_incremental): New function.
3100 (Object::do_get_mtime): New function.
3101 (Object::do_for_all_local_got_entries): New function.
3102 (Object::is_in_system_directory_): New data member.
3103 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
3104 (class Sized_relobj_base): New class.
3105 (class Sized_relobj): Derive from Sized_relobj_base.
3106 (class Sized_relobj::Symbols): Redeclare from base class.
3107 (class Sized_relobj::local_got_offset_list): Remove.
3108 (class Sized_relobj::Output_sections): Redeclare from base class.
3109 (class Sized_relobj::do_for_all_local_got_entries): New function.
3110 (class Sized_relobj::write_local_symbols): Add offset parameter.
3111 (class Sized_relobj::local_symbol_offset_): Update comment.
3112 (class Sized_relobj::local_dynsym_offset_): Update comment.
3113 * options.cc (Input_arguments::add_file): Remove const.
3114 * options.h (Input_file_argument::Input_file_argument):
3115 Initialize arg_serial_ (all constructors).
3116 (Input_file_argument::set_arg_serial): New function.
3117 (Input_file_argument::arg_serial): New function.
3118 (Input_file_argument::arg_serial_): New data member.
3119 (Input_arguments::Input_arguments): Initialize file_count_.
3120 (Input_arguments::add_file): Remove const.
3121 (Input_arguments::number_of_input_files): New function.
3122 (Input_arguments::file_count_): New data member.
3123 (Command_line::number_of_input_files): Call
3124 Input_arguments::number_of_input_files.
3125 * output.cc (Output_segment_headers::Output_segment_headers):
3126 Set current size.
3127 (Output_section::Input_section::current_data_size): New function.
3128 (Output_section::Output_section): Initialize new data members.
3129 (Output_section::add_input_section): Don't do merge sections for
3130 an incremental link; allocate space from free list for an
3131 incremental update.
3132 (Output_section::add_output_section_data): Allocate space from
3133 free list for an incremental update.
3134 (Output_section::update_data_size): New function.
3135 (Output_section::set_fixed_layout): New function.
3136 (Output_section::reserve): New function.
3137 (Output_segment::set_section_addresses): Remove const.
3138 (Output_segment::set_section_list_addresses): Remove const; allocate
3139 space from free list for an incremental update.
3140 (Output_segment::set_offset): Adjust size of RELRO segment for an
3141 incremental update.
3142 * output.h (Output_data::current_data_size): Move here from
3143 child classes.
3144 (Output_data::pre_finalize_data_size): New function.
3145 (Output_data::update_data_size): New function.
3146 (Output_section_headers::update_data_size): new function.
3147 (Output_section_data_build::current_data_size): Move to Output_data.
3148 (Output_data_strtab::update_data_size): New function.
3149 (Output_section::current_data_size): Move to Output_data.
3150 (Output_section::set_fixed_layout): New function.
3151 (Output_section::has_fixed_layout): New function.
3152 (Output_section::reserve): New function.
3153 (Output_section::update_data_size): New function.
3154 (Output_section::has_fixed_layout_): New data member.
3155 (Output_section::free_list_): New data member.
3156 (Output_segment::set_section_addresses): Remove const.
3157 (Output_segment::set_section_list_addresses): Remove const.
3158 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
3159 New function.
3160 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
3161 New function.
3162 * readsyms.cc (Read_symbols::do_read_symbols): Add library
3163 parameter when calling Add_symbols constructor; store argument
3164 serial number for members of a lib group.
3165 (Add_symbols::locks): Allow case where token == NULL.
3166 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
3167 (Read_member::~Read_member): New function.
3168 (Read_member::is_runnable): New function.
3169 (Read_member::locks): New function.
3170 (Read_member::run): New function.
3171 (Check_script::~Check_script): New function.
3172 (Check_script::is_runnable): New function.
3173 (Check_script::locks): New function.
3174 (Check_script::run): New function.
3175 (Check_library::~Check_library): New function.
3176 (Check_library::is_runnable): New function.
3177 (Check_library::locks): New function.
3178 (Check_library::run): New function.
3179 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
3180 (Add_symbols::library_): New data member.
3181 (class Read_member): New class.
3182 (class Check_script): New class.
3183 (class Check_library): New class.
3184 * reloc.cc (Read_relocs::is_runnable): Allow case where
3185 token == NULL.
3186 (Read_relocs::locks): Likewise.
3187 (Scan_relocs::locks): Likewise.
3188 (Relocate_task::locks): Likewise.
3189 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
3190 to clear counters.
3191 (Sized_relobj::incremental_relocs_scan): Fix comment.
3192 (Sized_relobj::do_relocate): Pass output file offset to
3193 write_local_symbols.
3194 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
3195 from class declaration.
3196 * script.cc (read_input_script): Allocate Script_info; pass
3197 argument serial number to report_script.
3198 * script.h (class Script_info): Move to incremental.h.
3199 * symtab.cc (Symbol_table::add_from_incrobj): New function.
3200 * symtab.h (Symbol_table::add_from_incrobj): New function.
3201 (Symbol_table::set_file_offset): New function.
3202
b961d0d7
CC
32032011-04-05 Cary Coutant <ccoutant@google.com>
3204
3205 * incremental-dump.cc (dump_incremental_inputs): Change signature
3206 to take a Sized_incremental_binary; change caller. Use readers
3207 in Sized_incremental_binary.
3208 * incremental.cc
3209 (Sized_incremental_binary::find_incremental_inputs_sections):
3210 Rename do_find_incremental_inputs_sections to this.
3211 (Sized_incremental_binary::setup_readers): New function.
3212 (Sized_incremental_binary::do_check_inputs): Check
3213 has_incremental_info_ flag; move setup code to setup_readers;
3214 use input readers.
3215 (Sized_incremental_binary::do_file_is_unchanged): New function.
3216 (Sized_incremental_binary::do_get_input_reader): New function.
3217 * incremental.h (class Incremental_binary): Move to end of file.
3218 (Incremental_binary::file_is_unchanged): New function.
3219 (Incremental_binary::do_file_is_unchanged): New function.
3220 (Incremental_binary::Input_reader): New class.
3221 (Incremental_binary::get_input_reader): New function.
3222 (class Sized_incremental_binary): Move to end of file.
3223 (Sized_incremental_binary::Sized_incremental_binary): Setup the
3224 input section reader classes.
3225 (Sized_incremental_binary::has_incremental_info): New function.
3226 (Sized_incremental_binary::inputs_reader): New function.
3227 (Sized_incremental_binary::symtab_reader): New function.
3228 (Sized_incremental_binary::relocs_reader): New function.
3229 (Sized_incremental_binary::got_plt_reader): New function.
3230 (Sized_incremental_binary::do_file_is_unchanged): New function.
3231 (Sized_incremental_binary::Sized_input_reader): New class.
3232 (Sized_incremental_binary::get_input_reader): New function.
3233 (Sized_incremental_binary::find_incremental_inputs_sections):
3234 Rename do_find_incremental_inputs_sections to this.
3235 (Sized_incremental_binary::setup_readers): New function.
3236 (Sized_incremental_binary::has_incremental_info_): New data member.
3237 (Sized_incremental_binary::inputs_reader_): New data member.
3238 (Sized_incremental_binary::symtab_reader_): New data member.
3239 (Sized_incremental_binary::relocs_reader_): New data member.
3240 (Sized_incremental_binary::got_plt_reader_): New data member.
3241 (Sized_incremental_binary::current_input_file_): New data member.
3242
a869183f
PP
32432011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
3244
3245 PR gold/12640
3246 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
3247 violation.
3248
32492011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
3250
3251 * archive.cc (Archive::include_member): Adjust call to report_object.
3252 (Add_archive_symbols::run): Add script_info to call to
3253 report_archive_begin.
3254 (Lib_group::include_member): Adjust call to report_object.
3255 (Add_lib_group_symbols::run): Adjust call to report_object.
3256 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
3257 blocks. Add object count for script input files.
3258 * incremental.cc (Incremental_inputs::report_archive_begin): Add
3259 script_info parameter; change all callers.
3260 (Incremental_inputs::report_object): Add script_info parameter;
3261 change all callers.
3262 (Incremental_inputs::report_script): Store backpointer to
3263 incremental info entry.
3264 (Output_section_incremental_inputs::set_final_data_size): Record
3265 additional information for scripts.
3266 (Output_section_incremental_inputs::write_info_blocks): Likewise.
3267 * incremental.h (Incremental_script_entry::add_object): New function.
3268 (Incremental_script_entry::get_object_count): New function.
3269 (Incremental_script_entry::get_object): New function.
3270 (Incremental_script_entry::objects_): New data member; adjust
3271 constructor.
3272 (Incremental_inputs::report_archive_begin): Add script_info parameter.
3273 (Incremental_inputs::report_object): Add script_info parameter.
3274 (Incremental_inputs_reader::get_object_count): New function.
3275 (Incremental_inputs_reader::get_object_offset): New function.
3276 * options.cc (Input_arguments::add_file): Return reference to
3277 new input argument.
3278 * options.h (Input_argument::set_script_info): New function.
3279 (Input_argument::script_info): New function.
3280 (Input_argument::script_info_): New data member; adjust all
3281 constructors.
3282 (Input_file_group::add_file): Return reference to new input argument.
3283 (Input_file_lib::add_file): Likewise.
3284 (Input_arguments::add_file): Likewise.
3285 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
3286 * script.cc (Parser_closure::Parser_closure): Add script_info
3287 parameter; adjust all callers.
3288 (Parser_closure::script_info): New function.
3289 (Parser_closure::script_info_): New data member.
3290 (read_input_script): Report scripts earlier to incremental info.
3291 (script_add_file): Set script_info in Input_argument.
3292 (script_add_library): Likewise.
3293 * script.h (Script_options::Script_info): Rewrite class.
3294
a869183f 32952011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
3296
3297 * archive.cc (Library_base::should_include_member): Move
3298 method here from class Archive.
3299 (Archive::Archive): Initialize base class.
3300 (Archive::should_include_member): Move to base class.
3301 (Archive::do_for_all_unused_symbols): New function.
3302 (Add_archive_symbols::run): Remove redundant access to
3303 incremental_inputs.
3304 (Lib_group::Lib_group): Initialize base class.
3305 (Lib_group::do_filename): New function.
3306 (Lib_group::include_member): Pass pointer to Lib_group to
3307 report_object.
3308 (Lib_group::do_for_all_unused_symbols): New function.
3309 (Add_lib_group_symbols::run): Report archive information for
3310 incremental links.
3311 * archive.h (class Library_base): New base class.
3312 (class Archive): Derive from Library_base.
3313 (Archive::filename): Move to base class.
3314 (Archive::set_incremental_info): Likewise.
3315 (Archive::incremental_info): Likewise.
3316 (Archive::Should_include): Likewise.
3317 (Archive::should_include_member): Likewise.
3318 (Archive::Armap_entry): Remove.
3319 (Archive::Unused_symbol_iterator): Remove.
3320 (Archive::unused_symbols_begin): Remove.
3321 (Archive::unused_symbols_end): Remove.
3322 (Archive::do_filename): New function.
3323 (Archive::do_get_mtime): New function.
3324 (Archive::do_for_all_unused_symbols): New function.
3325 (Archive::task_): Move to base class.
3326 (Archive::incremental_info_): Likewise.
3327 (class Lib_group): Derive from Library_base.
3328 (Lib_group::do_filename): New function.
3329 (Lib_group::do_get_mtime): New function.
3330 (Lib_group::do_for_all_unused_symbols): New function.
3331 (Lib_group::task_): Move to base class.
3332 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
3333 function.
3334 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
3335 function.
3336 * incremental.cc (Incremental_inputs::report_archive_begin):
3337 Use Library_base; call library's get_mtime; add incremental inputs
3338 entry before members.
3339 (class Unused_symbol_visitor): New class.
3340 (Incremental_inputs::report_archive_end): Use Library_base; use
3341 visitor class to record unused symbols; don't add incremental inputs
3342 entry after members.
3343 (Incremental_inputs::report_object): Use Library_base.
3344 * incremental.h
3345 (Incremental_archive_entry::Incremental_archive_entry): Remove
3346 unused Archive parameter.
3347 (Incremental_inputs::report_archive_begin): Use Library_base.
3348 (Incremental_inputs::report_archive_end): Likewise.
3349 (Incremental_inputs::report_object): Likewise.
3350 * object.cc (Sized_relobj::do_for_all_global_symbols): New
3351 function.
3352 * object.h (Object::for_all_global_symbols): New function.
3353 (Object::do_for_all_global_symbols): New function.
3354 (Sized_relobj::do_for_all_global_symbols): New function.
3355 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
3356 function.
3357 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
3358 function.
3359
61ab3e40
ILT
33602011-03-27 Ian Lance Taylor <iant@google.com>
3361
3362 * archive.cc (Archive::interpret_header): Return -1 if something
3363 goes wrong. Change callers accordingly.
3364
30e1f9e6
CC
33652011-03-25 Cary Coutant <ccoutant@google.com>
3366
3367 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
3368 * testsuite/Makefile.in: Regenerate.
3369
9370ce59 33702011-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
9c793f14
RÁE
3371
3372 * plugin.cc (get_view): New.
3373 (Plugin::load): Pass get_view to the plugin.
3374 (Plugin_manager::get_view): New.
3375
9312bb0a
ILT
33762011-03-21 Ian Lance Taylor <iant@google.com>
3377
3378 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 3379 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 3380
7e12ba9e
ST
33812011-03-21 Sriraman Tallam <tmsriram@google.com>
3382
3383 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
3384 Change == to -eq.
3385 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
3386 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
3387 Change == to -eq.
3388 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
3389 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
3390
fd7a005d
ILT
33912011-03-14 Ian Lance Taylor <iant@google.com>
3392
3393 * script-sections.cc (Sort_output_sections::script_compare):
3394 Rename from is_before, change return type.
3395 (Sort_output_sections::operator()): Adjust accordingly.
3396
ed16fd1b
ILT
33972011-03-11 Jeffrey Yasskin <jyasskin@google.com>
3398
3399 PR gold/12572
3400 * testsuite/odr_violation2.cc: Add comment to make all error line
3401 numbers double digits.
3402 * testsuite/debug_msg.sh: Adjust expected errors.
3403
71ff8986
ILT
34042011-03-09 Jeffrey Yasskin <jyasskin@google.com>
3405
3406 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
3407 but mark earlier ones as non-canonical
3408 (offset_to_iterator): Update search target and example
3409 (do_addr2line): Return extra lines in a vector*
3410 (format_file_lineno): Extract from do_addr2line
3411 (one_addr2line): Add vector* out-param
3412 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
3413 when a lineno entry appeared last for its instruction
3414 (Dwarf_line_info): Add vector* out-param
3415 * object.cc (Relocate_info): Pass NULL for the vector* out-param
3416 * symtab.cc (Odr_violation_compare): Include the lineno in the
3417 comparison again.
3418 (linenos_from_loc): New. Combine the canonical line for an
3419 address with its other lines.
3420 (True_if_intersect): New. Helper functor to make
3421 std::set_intersection a query.
3422 (detect_odr_violations): Compare sets of lines instead of just
3423 one line for each function. This became less deterministic, but
3424 has fewer false positives.
3425 * symtab.h: Declarations.
3426 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
3427 mix an optimized and non-optimized object in the same binary
3428 (odr_violation2.so): Same.
3429 * testsuite/Makefile.in: Regenerate from Makefile.am.
3430 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
3431 * testsuite/debug_msg.sh: Update line numbers and add
3432 assertions.
3433 * testsuite/odr_violation1.cc: Use OdrDerived, in a
3434 non-optimized context.
3435 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
3436 isn't inlined, and use OdrDerived in an optimized context.
3437 * testsuite/odr_header1.h: Defines OdrDerived, where
3438 optimization will change the
3439 first-instruction-in-the-destructor's file and line number.
3440 * testsuite/odr_header2.h: Defines OdrBase.
3441
a19fefdc
ILT
34422011-03-09 Ian Lance Taylor <iant@google.com>
3443
3444 * fileread.cc (File_read::clear_views): Don't delete the whole
3445 file view.
3446
ecb351e9
ILT
34472011-03-08 Ian Lance Taylor <iant@google.com>
3448
3449 PR gold/12525
3450 * fileread.cc: #include <climits>.
3451 (GOLD_IOV_MAX): Define.
3452 (File_read::read_multiple): Limit number of entries by iov_max.
3453 * fileread.h (class File_read): Always set max_readv_entries to
3454 128.
3455
b821d13c
ILT
34562011-03-07 Ian Lance Taylor <iant@google.com>
3457
3458 PR gold/12525
3459 * options.h (class General_options): Add -dy and -dn.
3460
89243142
CC
34612011-03-02 Cary Coutant <ccoutant@google.com>
3462
3463 * testsuite/script_test_9.t: Add TLS segment.
3464
d0773f31
ILT
34652011-03-02 Simon Baldwin <simonb@google.com>
3466
3467 * configure.ac: Add check for gnu_indirect_function support in
3468 the toolchain building binutils.
3469 * configure: Rebuild.
3470
9370ce59 34712011-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
badc8139
RÁE
3472
3473 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
3474 plugin only symbols.
3475 (Symbol_table::sized_finalize_symbol) Mark symbol only present
3476 in plugin files as not needed in the symbol table.
3477
4cf7a849
ST
34782011-02-11 Sriraman Tallam <tmsriram@google.com>
3479
3480 * output.cc (Output_section::add_input_section): Delay fill
3481 generation for section ordering.
3482
b578bd7d
ILT
34832011-02-09 Ian Lance Taylor <iant@google.com>
3484
3485 PR gold/12316
3486 * object.h (class Sized_relobj): Remove clear_local_symbols.
3487 * reloc.cc (Sized_relobj::do_relocate): Don't call
3488 clear_local_symbols.
3489
9370ce59 34902011-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
84ced98a
RÁE
3491
3492 * plugin.cc (is_visible_from_outside): Return true for symbols
3493 in the -u option.
3494
55382fb7
ILT
34952011-02-04 Jeffrey Yasskin <jyasskin@google.com>
3496
3497 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
3498 filename.
3499
4e271fff
ST
35002011-02-02 Sriraman Tallam <tmsriram@google.com>
3501
3502 * icf.h (is_section_foldable_candidate): Change type of parameter
2e702c99 3503 to std::string.
4e271fff 3504 * icf.cc (Icf::find_identical_sections): Change type of local variable
2e702c99 3505 section_name to be std::string.
4e271fff
ST
3506 (is_function_ctor_or_dtor): Change type of parameter to std::string.
3507
d433c3ac
ILT
35082011-01-25 Ian Lance Taylor <iant@google.com>
3509
3510 * script.cc (script_add_extern): Rewrite to use
3511 add_symbol_reference.
3512
880473a6
DK
35132011-01-25 Doug Kwan <dougkwan@google.com>
3514
d433c3ac 3515 * icf.cc (get_section_contents): Always lock section's object.
880473a6 3516
f30f86fa
ILT
35172011-01-24 Ian Lance Taylor <iant@google.com>
3518
3519 * options.h (class General_options): Accept
3520 --no-detect-odr-violations.
3521
8e51a0b9
ILT
35222011-01-24 Ian Lance Taylor <iant@google.com>
3523
3524 * version.cc (version_string): Bump to 1.11.
3525
0f3b89d8
ILT
35262011-01-24 Ian Lance Taylor <iant@google.com>
3527
3528 * plugin.cc (class Plugin_rescan): Define new class.
3529 (Plugin_manager::claim_file): Set any_claimed_.
3530 (Plugin_manager::save_archive): New function.
3531 (Plugin_manager::save_input_group): New function.
3532 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
3533 necessary.
3534 (Plugin_manager::new_undefined_symbol): New function.
3535 (Plugin_manager::rescan): New function.
3536 (Plugin_manager::rescannable_defines): New function.
3537 (Plugin_manager::add_input_file): Set any_added_.
3538 * plugin.h (class Plugin_manager): define new fields rescannable_,
3539 undefined_symbols_, any_claimed_, and any_added_. Declare
3540 Plugin_rescan as friend. Declare new functions.
3541 (Plugin_manager::Rescannable): Define type.
3542 (Plugin_manager::Rescannable_list): Define type.
3543 (Plugin_manager::Undefined_symbol_list): Define type.
3544 (Plugin_manager::Plugin_manager): Initialize new fields.
3545 * archive.cc (Archive::defines_symbol): New function.
3546 (Add_archive_symbols::run): Pass archive to plugins if any.
3547 * archive.h (class Archive): Declare defines_symbol.
3548 * readsyms.cc (Input_group::~Input_group): New function.
3549 (Finish_group::run): Pass input_group to plugins if any.
3550 * readsyms.h (class Input_group): Declare destructor.
3551 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
3552 any.
3553
3bb951e5
ILT
35542011-01-10 Ian Lance Taylor <iant@google.com>
3555
3556 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
3557 section as relro.
3558 (Layout::set_segment_offsets): Reset increase_relro before calling
3559 set_section_addresses a second time.
3560
0aa45fac
CC
35612011-01-04 Cary Coutant <ccoutant@google.com>
3562
3563 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
3564 sections before NOBITS sections.
3565
0db46eb4
L
35662011-01-01 H.J. Lu <hongjiu.lu@intel.com>
3567
3568 * version.cc (print_version): Update copyright to 2011.
3569
829c9745
CC
35702010-12-23 Cary Coutant <ccoutant@google.com>
3571
3572 * output.h (Output_data_reloc::add_output_section): Pass OD instead
3573 of OS to this->add. Add OD parameter to second form of the function.
3574
7500420b
ILT
35752010-12-20 Ian Lance Taylor <iant@google.com>
3576
3577 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
3578 second of two consecutive entries with same offset.
3579
f8e9a930
RW
35802010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3581
3582 * testsuite/Makefile.am (ifuncmain2static_LDADD)
3583 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
3584 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
3585 to avoid unneeded links against $(LDADD).
3586 * testsuite/Makefile.in: Regenerate.
3587
2fbb4320
ILT
35882010-12-15 Ian Lance Taylor <iant@google.com>
3589
3590 PR gold/12324
3591 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
3592 for R_X86_64_32 and R_X86_64_PC32.
3593 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
3594 ver_matching_def_pic.o.
3595 (ver_matching_def_pic.o): New target.
3596
fedb228d
RW
35972010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3598
3599 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
3600 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
3601 Move definition before File_read::View member definitions.
3602 (File_read::View::~View): Initialize and hold lock before
3603 updating current_mapped_bytes.
3604
9b547ce6
RW
36052010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3606
3607 * dwarf_reader.cc: Remove outdated comment.
3608 * gold-threads.cc: Fix typo in error message.
3609 * archive.cc: Fix typos in comments.
3610 * archive.h: Likewise.
3611 * arm-reloc-property.cc: Likewise.
3612 * arm-reloc-property.h: Likewise.
3613 * arm-reloc.def: Likewise.
3614 * arm.cc: Likewise.
3615 * attributes.h: Likewise.
3616 * cref.cc: Likewise.
3617 * ehframe.cc: Likewise.
3618 * fileread.h: Likewise.
3619 * gold.h: Likewise.
3620 * i386.cc: Likewise.
3621 * icf.cc: Likewise.
3622 * incremental.h: Likewise.
3623 * int_encoding.cc: Likewise.
3624 * layout.h: Likewise.
3625 * main.cc: Likewise.
3626 * merge.h: Likewise.
3627 * object.cc: Likewise.
3628 * object.h: Likewise.
3629 * options.cc: Likewise.
3630 * readsyms.cc: Likewise.
3631 * reduced_debug_output.cc: Likewise.
3632 * reloc.cc: Likewise.
3633 * script-sections.cc: Likewise.
3634 * sparc.cc: Likewise.
3635 * symtab.h: Likewise.
3636 * target-reloc.h: Likewise.
3637 * target.cc: Likewise.
3638 * target.h: Likewise.
3639 * timer.cc: Likewise.
3640 * timer.h: Likewise.
3641 * x86_64.cc: Likewise.
3642
83e17bd5
CC
36432010-12-09 Cary Coutant <ccoutant@google.com>
3644
3645 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
3646 stack.
3647 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
3648 parameter; change all callers.
3649 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
3650 * options.h (warn_execstack): New option.
3651
017257f8
DK
36522010-12-07 Doug Kwan <dougkwan@google.com>
3653
3654 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
3655 like function call relocations.
3656
c20cbc06
ILT
36572010-12-07 Ian Lance Taylor <iant@google.com>
3658
3659 * archive.cc (Archive::get_elf_object_for_member): Permit
3660 punconfigured to be NULL.
3661 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
3662 (Archive::include_member): Pass NULL to get_elf_object_for_member
3663 if we searched for the archive and this is the first included
3664 object.
3665
4dbfafcc
ILT
36662010-12-01 Ian Lance Taylor <iant@google.com>
3667
3668 * dwarf_reader.h (class Sized_dwarf_line_info): Add
3669 track_relocs_type_ field.
3670 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3671 Set track_relocs_type_.
3672 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
3673 contents when using RELA relocs.
3674 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
3675 reloc_map_.
3676 * reloc.cc (Track_relocs::next_addend): New function.
3677 * reloc.h (class Track_relocs): Declare next_addend.
3678
e5e19edd
ILT
36792010-12-01 Ian Lance Taylor <iant@google.com>
3680
3681 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
3682 virtual destructor.
3683
9a5ce24c
ILT
36842010-12-01 Ian Lance Taylor <iant@google.com>
3685
3686 * README: Update compilers known to work and fail.
3687
c7791212
NC
36882010-11-23 Matthias Klose <doko@ubuntu.com>
3689
3690 * configure.in: For --enable-gold, handle value `default' instead of
3691 `both*'. Always install ld as ld.bfd, install as ld if gold is
3692 not the default.
3693 * configure: Regenerate.
3694
0ad220c9
DK
36952010-11-18 Doug Kwan <dougkwan@google.com>
3696
3697 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
3698 and right_alignment to be zero. Store result alignment only if it is
3699 greater than existing alignment.
3700
ab8056e0
CC
37012010-11-16 Cary Coutant <ccoutant@google.com>
3702
3703 PR gold/12220
3704 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
3705 Check for ".zdebug_line".
3706
fd064a5b
CC
37072010-11-16 Doug Kwan <dougkwan@google.com>
3708 Cary Coutant <ccoutant@google.com>
3709
3710 * output.h (Output_segment::set_section_addresses): Pass increase_relro
3711 by reference; adjust all callers.
3712 * output.cc (Output_segment::set_section_addresses): Adjust references
3713 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
3714 list is empty.
3715 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
3716 end at page boundary.
3717
6fc6ea19
CC
37182010-11-16 Cary Coutant <ccoutant@google.com>
3719
3720 PR gold/12220
3721 * layout.cc (Layout::choose_output_section): Transform names of
3722 compressed sections even when using a script with a SECTIONS clause.
3723 (Layout::output_section_name): Remove code to transform
3724 compressed debug section names.
3725 * output.cc (Output_section::add_input_section): Use uncompressed
3726 section size when tracking input sections.
3727
95a2c8d6
RS
37282010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
3729
3730 * symtab.h (Symbol::NON_PIC_REF): Remove.
3731 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
3732 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
3733 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
3734 (Symbol::use_plt_offset): Take a flags argument and pass it
3735 directly to needs_dynamic_reloc. Restrict check for undefined
3736 weak symbols to function calls.
3737 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
3738 (Target_arm::Scan::global): Use it.
3739 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
3740 (Target_arm::Relocate::relocate): Likewise.
3741 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
3742 parameter with an r_type parameter. Use get_reference_flags
3743 to get the flags.
3744 (Target_arm::Relocate::relocate): Update accordingly.
3745 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
3746 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
3747 (Target_i386::Scan::global): Likewise.
3748 (Target_i386::Relocate::relocate): Likewise.
3749 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
3750 parameter with an r_type parameter. Use get_reference_flags
3751 to get the flags.
3752 (Target_i386::Relocate::relocate): Update accordingly.
3753 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
3754 (Target_powerpc::Scan::global): Use it.
3755 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
3756 (Target_powerpc::Relocate::relocate): Likewise.
3757 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
3758 (Target_sparc::Scan::global): Use it.
3759 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
3760 (Target_sparc::Relocate::relocate): Likewise.
3761 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
3762 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
3763 (Target_x86_64::Scan::global): Likewise.
3764 (Target_x86_64::Relocate::relocate): Likewise.
3765
f625ae50
DK
37662010-11-08 Doug Kwan <dougkwan@google.com>
3767 Cary Coutant <ccoutant@google.com>
3768
3769 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
3770 (Arm_exidx_merge_section::section_contents_): New data member.
3771 (Arm_input_section::Arm_input_section): Initialize original_contents_.
3772 (Arm_input_section::~Arm_input_section): De-allocate memory.
58797674 3773 (Arm_input_section::original_contents_): New data member.
f625ae50
DK
3774 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
3775 in parameters instead of calling Object::section_contents without
3776 locking.
3777 (Arm_output_section::group_section): New parameter TASK. Pass it
3778 to callees that need locking objects.
3779 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
3780 to lock EXIDX input sections. Fix a formatting issue. Call
3781 Arm_exidx_merged_section::build_contents to create merged section
3782 contents.
3783 (Arm_output_section::create_stub_group): New parameter TASK. Use it
3784 to lock object of stub table owner.
3785 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
3786 TEXT_SIZE to initialize data member TEXT_SIZE_.
3787 (Arm_exidx_input_section::addralign): Fix typo in comment.
3788 (Arm_exidx_input_section::text_size): New method.
3789 (Target_arm::do_relax): New parameter TASK. Pass it to callees
3790 that require locking objects. Lock objects before scanning for stubs
3791 and updating local symbols.
3792 (Arm_input_section<big_endian>::init): Copy contents of original
3793 input section.
2e702c99 3794 (Arm_input_section<big_endian>::do_write): Use saved contents of
f625ae50
DK
3795 original input section instead of calling Object::section_contents
3796 without locking.
3797 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
3798 size without calling Object::section_size().
3799 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
3800 for size. Allocate a buffer for merged EXIDX entries.
3801 (Arm_exidx_merged_section::build_contents): New method.
2e702c99 3802 (Arm_exidx_merged_section::do_write): Move merge section contents
f625ae50
DK
3803 building code to Arm_exidx_merged_section::build_contetns. Write
3804 out contetns in buffer instead of building it on the fly.
3805 (Arm_relobj::make_exidx_input_section): Also pass text section size
3806 to Arm_exidx_input_section constructor.
3807 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
3808 (Arm_dynobj::do_read_symbols): Fix memory leak.
3809 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
3810 * target.h: (class Task): Add forward declaration.
3811 (Target::relax): Add new parameter TASK and pass it to
3812 Target::do_relax().
3813 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
3814
5f9bcf58
CC
38152010-11-05 Cary Coutant <ccoutant@google.com>
3816
3817 PR gold/10708
3818 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
3819 object when reading from the file.
3820 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
3821 second layout pass.
3822 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
3823 when reading section contents.
3824 (get_section_contents): Likewise.
3825 (icf::find_identical_sections): Likewise.
3826 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
3827 object when reading from the file.
3828 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
3829 the object when doing deferred section layout.
3830
e597fa08
NC
38312010-11-03 Nick Clifton <nickc@redhat.com>
3832
3833 PR gold/12001
3834 * script.h (class Symbol_assignment: name): New member. Returns
3835 the name of the symbol.
3836 * scrfipt.cc (Script_options::is_pending_assignment): New member.
3837 Returns true if the given symbol name is on the list of
3838 assignments wating to be processed.
3839 * archive.cc (should_incldue_member): If the symbol is undefined,
3840 check to see if it is on the list of symbols pending assignment.
3841
3f9a3278
ILT
38422010-11-03 Ryan Mansfield <rmansfield@qnx.com>
3843
3844 * script-sections.cc (Script_sections::find_memory_region): Check
3845 for a NULL output section pointer.
3846
d06fb4d1
DK
38472010-10-29 Doug Kwan <dougkwan@google.com>
3848
3849 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
3850 Output_section::add_relaxed_input_section.
3851 * output.cc (Output_section::add_relaxed_input_section): Add new
3852 arguments LAYOUT and NAME. Set section order index.
3853 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
3854 Copy section order index.
3855 * output.h (Output_section::add_relaxed_input_section): Add new
3856 arguments LAYOUT and NAME.
3857
90e24de5
ILT
38582010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3859
3860 * testsuite/Makefile.am: Move gcctestdir/ld rule to
2e702c99 3861 NATIVE_OR_CROSS_LINKER.
90e24de5
ILT
3862 * testsuite/Makefile.in: Regenerate.
3863
c9484ea5
DK
38642010-10-20 Doug Kwan <dougkwan@google.com>
3865
3866 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
3867 without SHF_LINK_ORDER flags.
3868 * layout.cc (Layout::choose_output_section): Do not filter
3869 SHF_LINK_ORDER flag in a relocatable link.
3870
5bc2f5be
CC
38712010-10-17 Cary Coutant <ccoutant@google.com>
3872
3873 * output.h (Output_segment::set_section_addresses): Change function
3874 signature. Update all callers.
3875 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
3876 sections.
3877 (Output_segment::set_section_addresses): Align after last TLS
3878 section. Add padding before last relro section instead of after.
3879
0c91cf04
DK
38802010-10-17 Doug Kwan <dougkwan@google.com>
3881
3882 * gold/arm.cc (Target_arm::got_section): Use correct order and set
3883 GOT output section to be writable.
3884
8c21d9d3
CC
38852010-10-14 Cary Coutant <ccoutant@google.com>
3886
3887 * debug.h (DEBUG_INCREMENTAL): New flag.
2e702c99
RM
3888 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
3889 * gold.cc (queue_initial_tasks): Check parameters for incremental link
3890 mode.
3891 * incremental.cc (report_command_line): Ignore all forms of
3892 --incremental.
3893 * layout.cc (Layout::Layout): Check parameters for incremental link
3894 mode.
3895 * options.cc (General_options::parse_incremental): New function.
3896 (General_options::parse_no_incremental): New function.
3897 (General_options::parse_incremental_full): New function.
3898 (General_options::parse_incremental_update): New function.
3899 (General_options::incremental_mode_): New data member.
3900 (General_options::finalize): Check incremental_mode_.
3901 * options.h (General_options): Update help text for --incremental.
3902 Add --no-incremental, --incremental-full, --incremental-update.
3903 (General_options::Incremental_mode): New enum type.
3904 (General_options::incremental_mode): New function.
3905 (General_options::incremental_mode_): New data member.
3906 * parameters.cc (Parameters::incremental_mode_): New data member.
3907 (Parameters::set_options): Set incremental_mode_.
3908 (Parameters::set_incremental_full): New function.
3909 (Parameters::incremental): New function.
3910 (Parameters::incremental_update): New function.
3911 (set_parameters_incremental_full): New function.
3912 * parameters.h (Parameters::set_incremental_full): New function.
3913 (Parameters::incremental): New function.
3914 (Parameters::incremental_update): New function.
3915 (Parameters::incremental_mode_): New data member.
3916 (set_parameters_incremental_full): New function.
3917 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
3918 incremental link mode.
3919 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
3920 (Sized_relobj::do_relocate_sections): Likewise.
3921 * testsuite/Makefile.am (incremental_test): Use --incremental-full
3922 option.
3923 * testsuite/Makefile.in: Regenerate.
3924 * testsuite/incremental_test.sh: Filter all forms of --incremental.
8c21d9d3 3925
bb32aa18 39262010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
3927
3928 * script-sections.h (class Script_sections): Make
3929 Sections_elements typedef public.
3930 * script-sections.cc (class Sort_output_sections): Add elements_
3931 field. Add constructor which sets it; change all callers.
3932 (Sort_output_sections::is_before): New function.
3933 (Sort_output_sections::operator()): Call is_before.
3934 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
3935 conditional.
3936 * testsuite/script_test_10.sh: New test. Test script section
3937 order.
3938 * testsuite/script_test_10.t: Likewise.
3939 * testsuite/script_test_10.s: Likewise.
3940 * testsuite/Makefile.am: Wrap the cross linker tests and the
3941 common tests into NATIVE_OR_CROSS_LINKER.
3942 (check_SCRIPTS): Add script_test_10.sh.
3943 (check_DATA): Add script_test_10.stdout.
3944 (script_test_10.o, script_test_10): New targets.
3945 (script_test_10.stdout): New target.
3946 * configure, testsuite/Makefile.in: Regenerate.
3947
3cef7179
ILT
39482010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3949
3950 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
3951 error for the deprecated relocations.
3952 (Target_arm::Scan::global): Likewise.
3953 (Target_arm::Relocate::relocate): Likewise.
3954
7411e9a8
RS
39552010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
3956
3957 * fileread.cc (Input_file::find_file): Initialize *found_name
3958 and *namep when using the fallback search for case 4.
3959
6a9da32a
CC
39602010-10-11 Cary Coutant <ccoutant@google.com>
3961
3962 * options.h (class General_options): Redefine -z lazy as an alias for
3963 the negation of -z now.
3964
ac897c20
ILT
39652010-10-11 Ian Lance Taylor <iant@google.com>
3966
3967 * resolve.cc (symbol_to_bits): Report the value of the unsupported
3968 binding.
3969
ea5cae92
NC
39702010-10-06 Nick Clifton <nickc@redhat.com>
3971
3972 * script-sections.cc(class Memory_region): Remove
3973 current_lma_offset_ field. Rename current_vma_offset_ to
3974 current_offset_. Add last_section_ field.
3975 (Memory_region::get_current_vma_address): Rename to
3976 get_current_address.
3977 (Memory_region::get_current_lma_address): Delete.
3978 (Memory_region::increment_vma_offset): Rename to
3979 increment_offset.
3980 (Memory_region::increment_lma_offset): Delete.
3981 (Memory_region::attributes_compatible): New method. Returns
3982 true if the provided section is compatible with the region.
3983 (Memory_region::get_last_section): New method. Returns the last
3984 section to use the region.
3985 (Memory_region::set_last_section): New method. Stores the last
3986 section to use the region.
3987 (Script_sections::block_in_region): New method. Returns true if
3988 a block of memory is contained within a region.
3989 (Script_sections::find_memory_region): New method. Locates a
3990 memory region to be used to set a VMA or LMA address.
3991 (Output_section_definition::set_section_addresses): Add code to
3992 check for addresses set by memory regions.
3993 (Output_segment::set_section_addresses): Remove memory region
3994 walking code.
3995 (Script_sections::create_segment): Add a warning if a header
3996 segment is created outside of any region.
3997 * script-sections.h (class Script_sections): Add prototypes for
3998 find_memory_region and block_in_region methods.
3999 * testsuite/memory_test.s: Use .long instead of .word.
4000 * testsuite/memory_test.t: Add some more output sections.
4001 * testsuite/memory_test.sh: Update expected output.
4002
a9bfd952
DK
40032010-10-02 Doug Kwan <dougkwan@google.com>
4004
4005 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
4006 defintion to symtab.h
4007 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
4008 declaration to defintion.
4009
bacff3ab
NC
40102010-10-01 Nick Clifton <nickc@redhat.com>
4011
4012 * expression.cc (eval): Replace dummy argument with NULL.
4013 (eval_maybe_dot): Check for a NULL result section pointer.
4014 (Symbol_expression::value): Likewise.
4015 (Dot_expression::value): Likewise.
4016 (BINARY_EXPRESSION): Likewise.
4017 (Max_expression::value): Likewise.
4018 (Min_expression::value): Likewise.
4019 (Absolute_expression::value): Likewise.
4020 (Addr_expression::value_from_output_section): Likewise.
4021 (Loaddddr_expression::value_from_output_section): Likewise.
4022 (Segment_start_expression::value): Likewise.
4023 * script-sections.cc
4024 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
4025 argument with NULL.
4026 (Sections_elememt_dot_assignment::set_section_addresses):
4027 Likewise.
4028 (Output_data_expression::do_write_to_buffer): Likewise.
4029 (Output_section_definition::finalize_symbols): Likewise.
4030 (Output_section_definition::set_section_addresses): Likewise.
4031
f81bc8b5
DK
40322010-09-30 Doug Kwan <dougkwan@google.com>
4033
4034 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
4035
c95e9f27
ST
40362010-09-28 Sriraman Tallam <tmsriram@google.com>
4037
4038 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 4039 function.
c95e9f27
ST
4040 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
4041 virtual function.
4042 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
4043 virtual function.
4044 * icf.cc (get_section_contents): Inline merge sections only when
4045 target allows it.
4046
3cac54d2
RW
40472010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4048
4049 * configure: Regenerate.
4050
2904037a
ILT
40512010-09-17 Ian Lance Taylor <iant@google.com>
4052
4053 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
4054 * testsuite/Makefile.am (memory_test.o): New target.
4055 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
4056 memory_test.t.
4057 * testsuite/Makefile.in: Rebuild.
2904037a 4058
bca7fb63
DK
40592010-09-17 Doug Kwan <dougkwan@google.com>
4060
4061 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
4062 defintion if relocation uses GOT entries of the symbol.
4063 * testsuite/icf_safe_test.sh: Fix test.
4064 * testsuite/icf_safe_so_test.sh: Fix test.
4065
4ef28648
CC
40662010-09-16 Cary Coutant <ccoutant@google.com>
4067
4068 * script_sections.cc (class Memory_region): Remove "NULL" from
4069 vector initializations.
4070
793990de
CC
40712010-09-15 Cary Coutant <ccoutant@google.com>
4072
4073 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
4074 Resolve forwarding symbols.
4075
81e015e2
DK
40762010-09-15 Doug Kwan <dougkwan@google.com>
4077
4078 * gold/testsuite/script_test_3.t: Add ARM special sections.
4079 * gold/testsuite/script_test_4.t: Same.
4080 * gold/testsuite/script_test_5.t: Same.
4081 * gold/testsuite/script_test_6.t: Same.
4082 * gold/testsuite/script_test_7.t: Same.
4083 * gold/testsuite/script_test_7.t: Same.
4084 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
4085
36171d64
CC
40862010-09-14 Cary Coutant <ccoutant@google.com>
4087
4088 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
4089 (Target_x86_64::Relocate::relocate_tls): Replace check for
4090 saw_tls_block_reloc_ with test for executable section.
4091
d89051bd
CC
40922010-09-12 Cary Coutant <ccoutant@google.com>
4093
4094 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
4095 position-independent executables to shared libraries need dynamic
4096 relocations.
4097 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
4098 position-independent executables.
4099 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
4100 * testsuite/Makefile.in: Regenerate.
4101
fca41f0f
NC
41022010-09-10 Nick Clifton <nickc@redhat.com>
4103
4104 PR gold/11997
4105 * testsuite/memory_test.t: Discard any sections that are not
4106 needed.
4107
6695e4b3
L
41082010-09-09 H.J. Lu <hongjiu.lu@intel.com>
4109
4110 PR gold/11996
4111 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
4112 "This::" to work around a bug in gcc 4.2.
4113
4114 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
4115
0f72bf6f
RÁE
41162010-09-09 Rafael Espindola <espindola@google.com>
4117
4118 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
4119 sections with different PF_X flags in the same segment.
4120 (Layout::find_first_load_seg): Search all segments to find the first
4121 one.
4122 * options.h (rosegment): New.
4123
41242010-09-08 Rafael Espindola <espindola@google.com>
a6577478 4125
05a79166 4126 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 4127
aa98ff75
DK
41282010-09-08 Doug Kwan <dougkwan@google.com>
4129
4130 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
4131 (Arm_relobj::do_relocate_sections): Add new parameter for output
4132 file to match the parent.
4133 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
4134 of local symbols instead of input values. Update code to track
4135 changes in gold::relocate_section.
4136 * object.cc (Sized_relobj::compute_final_local_value): New methods.
4137 (Sized_relobj::compute_final_local_value_internal): New methods.
4138 (Sized_relobj::do_finalize_local_symbols): Move code from loop
4139 body into private version of Sized_relobj::compute_final_local_value.
4140 Call the inline method.
4141 * object.h (Symbol_value::Symbol_value): Define destructor. Free
4142 merged symbol value if there is one.
4143 (Symbol_value::has_output_value): New method defintiion.
4144 (Sized_relobj::Compute_final_local_value_status): New enum type.
4145 (Sized_relobj::compute_final_local_value): New methods.
4146 (Sized_relobj::compute_final_local_value_internal): New methods.
4147 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
4148 and arm_cortex_a8.sh.
4149 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
4150 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
4151 New tests.
4152 * Makefile.in: Regenerate.
4153 * testsuite/arm_bl_out_of_range.s: Update test.
4154 * testsuite/thumb_bl_out_of_range.s: Ditto.
4155 * testsuite/thumb_blx_out_of_range.s: Ditto.
4156 * testsuite/arm_branch_out_of_range.sh: New file.
4157 * testsuite/arm_cortex_a8.sh: Ditto.
4158 * testsuite/arm_cortex_a8_b.s: Ditto.
4159 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
4160 * testsuite/arm_cortex_a8_b_local.s: Ditto.
4161 * testsuite/arm_cortex_a8_bl.s: Ditto.
4162 * testsuite/arm_cortex_a8_blx.s: Ditto.
4163 * testsuite/arm_cortex_a8_local.s: Ditto.
4164 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
4165 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
4166
05a79166
L
41672010-09-08 Rafael Espindola <espindola@google.com>
4168
4169 * Makefile.am (memory_test.stdout): Run readelf with -W.
4170 * Makefile.in: Regenerate.
4171 * testsuite/memory_test.sh: Make the regexps accept both 32 and
4172 64 bit output.
4173
33dbc701
RÁE
41742010-09-08 Rafael Espindola <espindola@google.com>
4175
4176 * script-sections.cc (Script_sections::add_memory_region): Convert
4177 field precision to int.
4178 * script.cc (script_set_section_region, script_set_section_region):
4179 Convert field precision to int.
4180
731ca54a
RÁE
41812010-09-08 Rafael Espindola <espindola@google.com>
4182
4183 * arm.cc (do_finalize_sections): Create the __exidx_start and
4184 __exdix_end symbols even when the section is missing.
4185
7f8cd844
NC
41862010-09-08 Nick Clifton <nickc@redhat.com>
4187
4188 * README: Remove claim that MEMORY is not supported.
4189 * expression.cc (script_exp_function_origin)
4190 (script_exp_function_length): Move from here to ...
4191 * script.cc: ... here.
4192 (script_set_section_region, script_add_memory)
4193 (script_parse_memory_attr, script_include_directive): New
4194 functions.
4195 * script-sections.cc
4196 (class Memory_region): New class.
4197 (class Output_section_definition): Add set_memory_region,
4198 set_section_vma, set_section_lma and get_section_name methods.
4199 (class Script_Sections): Add add_memory_region,
4200 find_memory_region, find_memory_region_origin,
4201 find_memory_region_length and set_memory_region methods.
4202 Have set_section_addresses method walk the list of set memory
4203 regions.
4204 Extend the print methos to display memory regions.
4205 * script-sections.h: Add prototypes for new methods.
4206 Add enum for MEMORY region attributes.
4207 * yyscript.y: Add support for parsing MEMORY regions.
4208 * script-c.h: Add prototypes for new functions.
4209 * testsuite/Makefile.am: Add test of MEMORY region functionality.
4210 * testsuite/Makefile.in: Regenerate.
4211 * testsuite/memory_test.sh: New script.
4212 * testsuite/memory_test.s: New assembler source file.
4213 * testsuite/memory_test.t: New linker script.
4214
a4649286
DK
42152010-08-27 Doug Kwan <dougkwan@google.com>
4216
4217 * gold/resolve.cc (Symbol_table::should_override): Let a weak
4218 reference override an existing dynamic weak reference.
4219 * testsuite/Makefile.am: Add new test dyn_weak_ref.
4220 * testsuite/Makefile.in: Regenerate.
4221 * testsuite/dyn_weak_ref.sh: New file.
4222 * testsuite/dyn_weak_ref_1.c: Ditto.
4223 * testsuite/dyn_weak_ref_2.c: Ditto.
4224
b56648ad
ILT
42252010-08-27 Ian Lance Taylor <iant@google.com>
4226
4227 * incremental.h (class Incremental_input_entry): Add virtual
4228 destructor.
4229
809313cb
ILT
42302010-08-27 Ian Lance Taylor <iant@google.com>
4231
4232 * testsuite/start_lib_test_3.c: Mark t3 as used.
4233
11e32464
NC
42342010-08-27 Nick Clifton <nickc@redhat.com>
4235
4236 * options.cc (version_script): Fix small typo in previous
4237 whitespace tidyup.
4238
ca09d69a
NC
42392010-08-25 Nick Clifton <nickc@redhat.com>
4240
4241 * archive.cc: Formatting fixes: Remove whitespace between
4242 typename and following asterisk. Remove whitespace between
4243 function name and opening parenthesis.
4244 * archive.h: Likewise.
4245 * arm.cc: Likewise.
4246 * attributes.cc: Likewise.
4247 * attributes.h: Likewise.
4248 * common.cc: Likewise.
4249 * copy-relocs.cc: Likewise.
4250 * dirsearch.h: Likewise.
4251 * dynobj.cc: Likewise.
4252 * ehframe.cc: Likewise.
4253 * ehframe.h: Likewise.
4254 * expression.cc: Likewise.
4255 * fileread.cc: Likewise.
4256 * fileread.h: Likewise.
4257 * gc.h: Likewise.
4258 * gold-threads.cc: Likewise.
4259 * gold.cc: Likewise.
4260 * i386.cc: Likewise.
4261 * icf.h: Likewise.
4262 * incremental-dump.cc: Likewise.
4263 * incremental.cc: Likewise.
4264 * layout.cc: Likewise.
4265 * layout.h: Likewise.
4266 * main.cc: Likewise.
4267 * merge.cc: Likewise.
4268 * merge.h: Likewise.
4269 * object.cc: Likewise.
4270 * object.h: Likewise.
4271 * options.cc: Likewise.
4272 * options.h: Likewise.
4273 * output.cc: Likewise.
4274 * output.h: Likewise.
4275 * plugin.cc: Likewise.
4276 * plugin.h: Likewise.
4277 * powerpc.cc: Likewise.
4278 * reloc.cc: Likewise.
4279 * script-c.h: Likewise.
4280 * script-sections.cc: Likewise.
4281 * script.cc: Likewise.
4282 * stringpool.cc: Likewise.
4283 * symtab.cc: Likewise.
4284 * symtab.h: Likewise.
4285 * target.cc: Likewise.
4286 * timer.cc: Likewise.
4287 * timer.h: Likewise.
4288 * version.cc: Likewise.
4289 * x86_64.cc: Likewise.
4290
b8fa8750
NC
42912010-08-24 Nick Clifton <nickc@redhat.com>
4292
4293 PR 11899
4294 * layout.cc (segment_precedes): Sort segments by their physical
4295 addresses, if they have been set.
4296
9919d93b
CC
42972010-08-23 Cary Coutant <ccoutant@google.com>
4298
4299 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
4300 symbols data.
4301 (Lib_group::include_member): Unlock object after deleting its
4302 symbols data.
4303 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
4304 the bug fixed here.
4305
97b4be1c
CC
43062010-08-19 Neil Vachharajani <nvachhar@google.com>
4307 Cary Coutant <ccoutant@google.com>
4308
4309 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
4310 constructor, and set_blocker.
4311 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
4312 readsyms_blocker_.
4313 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
4314 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
4315 * testsuite/Makefile.am (start_lib_test): New test case.
4316 * testsuite/Makefile.in: Regenerate.
4317 * testsuite/start_lib_test_main.c: New file.
4318 * testsuite/start_lib_test_1.c: New file.
4319 * testsuite/start_lib_test_2.c: New file.
4320 * testsuite/start_lib_test_3.c: New file.
4321
dd0b1884
ILT
43222010-08-19 Ian Lance Taylor <iant@google.com>
4323
4324 * Makefile.in: Rebuild with automake 1.11.1.
4325 * aclocal.m4: Likewise.
4326 * testsuite/Makefile.in: Likewise.
4327
7223e9ca
ILT
43282010-08-19 Ian Lance Taylor <iant@google.com>
4329
4330 PR 10893
4331 * i386.cc (class Output_data_plt_i386): Update declarations.
4332 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
4333 local_ifuncs_ fields.
4334 (Target_i386::do_plt_section_for_global): New function.
4335 (Target_i386::do_plt_section_for_local): New function.
4336 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
4337 parameter; change all callers. Initialize global_ifuncs_ and
4338 local_ifuncs_. If doing a static link define __rel_iplt_start and
4339 __rel_iplt_end.
4340 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
4341 (Output_data_plt_i386::add_local_ifunc_entry): New function.
4342 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
4343 symbols.
4344 (Target_i386::make_plt_section): New function, broken out of
4345 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
4346 (Target_i386::make_plt_entry): Call make_plt_section.
4347 (Target_i386::make_local_ifunc_plt_entry): New function.
4348 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
4349 (Target_i386::Scan::local): Handle IFUNC symbols. Add
4350 R_386_IRELATIVE to switch.
4351 (Target_i386::Scan::global): Likewise.
4352 (Target_i386::Relocate::relocate): Likewise.
4353 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
4354 switch.
4355 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
4356 (Target_x86_64::do_plt_section_for_global): New function.
4357 (Target_x86_64::do_plt_section_for_local): New function.
4358 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
4359 parameter; change all callers. If doing a static link define
4360 __rela_iplt_start and __rela_iplt_end.
4361 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
4362 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
4363 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
4364 to point to .plt.
4365 (Target_x86_64::make_local_ifunc_plt_entry): New function.
4366 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
4367 switch.
4368 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
4369 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
4370 R_X86_64_IRELATIVE to switch.
4371 (Target_x86_64::Scan::global): Likewise.
4372 (Target_x86_64::Relocate::relocate): Likewise.
4373 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
4374 switch.
4375 * target.h (class Target): Add plt_section_for_global and
4376 plt_section_for_local functions. Add do_plt_section_for_global
4377 and do_plt_section_for_local virtual functions.
4378 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
4379 clarifying comments.
4380 (Symbol::use_plt_offset): Handle IFUNC symbol.
4381 * object.cc (Sized_relobj::Sized_relobj): Initialize
4382 local_plt_offsets_.
4383 (Sized_relobj::local_has_plt_offset): New function.
4384 (Sized_relobj::local_plt_offset): New function.
4385 (Sized_relobj::set_local_plt_offset): New function.
4386 (Sized_relobj::do_count): Handle IFUNC symbol.
4387 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
4388 a bit away from input_shndx_ field. Add set_is_func_symbol and
4389 is_ifunc_symbol functions.
4390 (class Sized_relobj): Update declarations. Remove Tls_got_entry
4391 and Local_tls_got_offsets. Define Local_plt_offsets. Add
4392 local_plt_offsets_ field.
4393 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
4394 * output.h (class Output_section_data): Add non-const
4395 output_section function.
4396 (class Output_data_got): Update declarations.
4397 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
4398 Add use_plt_offset parameter to global and local constructors.
4399 Change all callers. Change local_sym_index_ field to 31 bits.
4400 Change GSYM_CODE and CONSTANT_CODE accordingly.
4401 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
4402 doing a static link don't set sh_link field.
4403 (Output_data_got::Got_entry::write): Use PLT offset if
4404 appropriate.
4405 (Output_data_got::add_global_plt): New function.
4406 (Output_data_got::add_local_plt): New function.
4407 * target-reloc.h (relocate_section): Handle IFUNC symbol.
4408 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
4409 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
4410 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
4411 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
4412 IFUNC conditional.
4413 * testsuite/ifunc-sel.h: New file.
4414 * testsuite/ifuncmain1.c: New file.
4415 * testsuite/ifuncmain1vis.c: New file.
4416 * testsuite/ifuncmod1.c: New file.
4417 * testsuite/ifuncdep2.c: New file.
4418 * testsuite/ifuncmain2.c: New file.
4419 * testsuite/ifuncmain3.c: New file.
4420 * testsuite/ifuncmod3.c: New file.
4421 * testsuite/ifuncmain4.c: New file.
4422 * testsuite/ifuncmain5.c: New file.
4423 * testsuite/ifuncmod5.c: New file.
4424 * testsuite/ifuncmain6pie.c: New file.
4425 * testsuite/ifuncmod6.c: New file.
4426 * testsuite/ifuncmain7.c: New file.
4427 * configure, testsuite/Makefile.in: Rebuild.
4428
56f75c03
ILT
44292010-08-18 Ian Lance Taylor <iant@google.com>
4430
4431 * incremental.cc
4432 (Output_section_incremental_inputs::write_input_files): Add cast
4433 to avoid signed/unsigned comparison warning.
4434 (Output_section_incremental_inputs::write_info_blocks): Likewise.
4435
55455f89
CC
44362010-08-12 Cary Coutant <ccoutant@google.com>
4437
4438 * common.cc (Sort_commons::operator()): Remove unnecessary code.
4439
e2054bcb
ILT
44402010-08-13 Ian Lance Taylor <iant@google.com>
4441
4442 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
4443
74f67560
DK
44442010-08-12 Cary Coutant <ccoutant@google.com>
4445 Doug Kwan <dougkwan@google.com>
4446
4447 * resolve.cc (Symbol_table::should_override): When a weak dynamic
4448 defintion overrides non-weak undef, remember that the original undef
4449 is not weak.
4450 * symtab.cc (Symbol_table::sized_write_global): For undef without
4451 an original weak binding, set binding to global in output.
4452 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
4453 * testsuite/Makefile.in: Regenerate.
4454 * testsuite/strong_ref_weak_def.sh: New file.
4455 * testsuite/strong_ref_weak_def_1.c: Ditto.
4456 * testsuite/strong_ref_weak_def_2.c: Ditto.
4457
d1238d12
CC
44582010-08-12 Cary Coutant <ccoutant@google.com>
4459
4460 * testsuite/incremental_test.sh: Rewrite.
4461 * testsuite/incremental_test_1.c: Rewrite.
4462 * testsuite/incremental_test_2.c: Rewrite.
4463
0e70b911
CC
44642010-08-12 Cary Coutant <ccoutant@google.com>
4465
4466 * arm.cc (Target_arm::got_size): Add const.
4467 (Target_arm::got_entry_count): New function.
4468 (Target_arm::plt_entry_count): New function.
4469 (Target_arm::first_plt_entry_offset): New function.
4470 (Target_arm::plt_entry_size): New function.
4471 (Output_data_plt_arm::entry_count): New function.
4472 (Output_data_plt_arm::first_plt_entry_offset): New function.
4473 (Output_data_plt_arm::get_plt_entry_size): New function.
4474 * i386.cc (Target_i386::got_size): Add const.
4475 (Target_i386::got_entry_count): New function.
4476 (Target_i386::plt_entry_count): New function.
4477 (Target_i386::first_plt_entry_offset): New function.
4478 (Target_i386::plt_entry_size): New function.
4479 (Output_data_plt_i386::entry_count): New function.
4480 (Output_data_plt_i386::first_plt_entry_offset): New function.
4481 (Output_data_plt_i386::get_plt_entry_size): New function.
4482 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
4483 find_incremental_inputs_sections. Dump incremental_got_plt section.
4484 * incremental.cc: Include target.h.
4485 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
4486 parameter. Adjust all callers. Find incremental_got_plt section.
4487 (Incremental_inputs::create_data_sections): Create incremental_got_plt
4488 section.
4489 (Output_section_incremental_inputs::set_final_data_size): Calculate
4490 size of incremental_got_plt section.
4491 (Output_section_incremental_inputs::do_write): Write the
4492 incremental_got_plt section.
4493 (Got_plt_view_info): New struct.
4494 (Local_got_offset_visitor): New class.
4495 (Global_got_offset_visitor): New class.
4496 (Global_symbol_visitor_got_plt): New class.
4497 (Output_section_incremental_inputs::write_got_plt): New function.
4498 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
4499 Add parameter. Adjust all callers.
4500 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4501 (Incremental_inputs::got_plt_section): New function.
4502 (Incremental_inputs::got_plt_section_): New data member.
4503 (Incremental_got_plt_reader): New class.
4504 * layout.cc (Layout::create_incremental_info_sections): Add the
4505 incremental_got_plt section.
4506 * object.h (Got_offset_list::get_list): New function.
4507 (Got offset_list::for_all_got_offsets): New function.
4508 (Sized_relobj::local_got_offset_list): New function.
4509 * powerpc.cc (Target_powerpc::got_size): Add const.
4510 (Target_powerpc::got_entry_count): New function.
4511 (Target_powerpc::plt_entry_count): New function.
4512 (Target_powerpc::first_plt_entry_offset): New function.
4513 (Target_powerpc::plt_entry_size): New function.
4514 (Output_data_plt_powerpc::entry_count): New function.
4515 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
4516 (Output_data_plt_powerpc::get_plt_entry_size): New function.
4517 * sparc.cc (Target_sparc::got_size): Add const.
4518 (Target_sparc::got_entry_count): New function.
4519 (Target_sparc::plt_entry_count): New function.
4520 (Target_sparc::first_plt_entry_offset): New function.
4521 (Target_sparc::plt_entry_size): New function.
4522 (Output_data_plt_sparc::entry_count): New function.
4523 (Output_data_plt_sparc::first_plt_entry_offset): New function.
4524 (Output_data_plt_sparc::get_plt_entry_size): New function.
4525 * symtab.h (Symbol::got_offset_list): New function.
4526 (Symbol_table::for_all_symbols): New function.
4527 * target.h (Sized_target::got_entry_count): New function.
4528 (Sized_target::plt_entry_count): New function.
4529 (Sized_target::plt_entry_size): New function.
4530 * x86_64.cc (Target_x86_64::got_size): Add const.
4531 (Target_x86_64::got_entry_count): New function.
4532 (Target_x86_64::plt_entry_count): New function.
4533 (Target_x86_64::first_plt_entry_offset): New function.
4534 (Target_x86_64::plt_entry_size): New function.
4535 (Output_data_plt_x86_64::entry_count): New function.
4536 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
4537 (Output_data_plt_x86_64::get_plt_entry_size): New function.
4538
09ec0418
CC
45392010-08-12 Cary Coutant <ccoutant@google.com>
4540
4541 * archive.cc: Include incremental.h.
4542 (Archive::Archive): Initialize incremental_info_.
4543 (Archive::include_member): Record archive members in incremental info.
4544 (Add_archive_symbols::run): Record begin and end of an archive in
4545 incremental info.
4546 (Lib_group::include_member): Record objects in incremental info.
4547 * archive.h (Incremental_archive_entry): Forward declaration.
4548 (Archive::set_incremental_info): New member function.
4549 (Archive::incremental_info): New member function.
4550 (Archive::Unused_symbol_iterator): New class.
4551 (Archive::unused_symbols_begin): New member function.
4552 (Archive::unused_symbols_end): New member function.
4553 (Archive::incremental_info_): New data member.
4554 * incremental-dump.cc (find_input_containing_global): New function.
4555 (dump_incremental_inputs): Dump new incremental info sections.
4556 * incremental.cc: Include symtab.h.
4557 (Output_section_incremental_inputs): New class.
4558 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
4559 new incremental info sections.
4560 (Sized_incremental_binary::do_check_inputs): Likewise.
4561 (Incremental_inputs::report_archive): Remove.
4562 (Incremental_inputs::report_archive_begin): New function.
4563 (Incremental_inputs::report_archive_end): New function.
4564 (Incremental_inputs::report_object): New function.
4565 (Incremental_inputs::finalize_inputs): Remove.
4566 (Incremental_inputs::report_input_section): New function.
4567 (Incremental_inputs::report_script): Rewrite.
4568 (Incremental_inputs::finalize): Do nothing but finalize string table.
4569 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
4570 (Incremental_inputs::sized_create_inputs_section_data): Remove.
4571 (Incremental_inputs::create_data_sections): New function.
4572 (Incremental_inputs::relocs_entsize): New function.
4573 (Output_section_incremental_inputs::set_final_data_size): New function.
4574 (Output_section_incremental_inputs::do_write): New function.
4575 (Output_section_incremental_inputs::write_header): New function.
4576 (Output_section_incremental_inputs::write_input_files): New function.
4577 (Output_section_incremental_inputs::write_info_blocks): New function.
4578 (Output_section_incremental_inputs::write_symtab): New function.
4579 * incremental.h (Incremental_script_entry): Forward declaration.
4580 (Incremental_object_entry): Forward declaration.
4581 (Incremental_archive_entry): Forward declaration.
4582 (Incremental_inputs): Forward declaration.
4583 (Incremental_inputs_header_data): Remove.
4584 (Incremental_inputs_header): Remove.
4585 (Incremental_inputs_header_write): Remove.
4586 (Incremental_inputs_entry_data): Remove.
4587 (Incremental_inputs_entry): Remove.
4588 (Incremental_inputs_entry_write): Remove.
4589 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
4590 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
4591 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
4592 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
4593 Likewise.
4594 (Incremental_input_entry): New class.
4595 (Incremental_script_entry): New class.
4596 (Incremental_object_entry): New class.
4597 (Incremental_archive_entry): New class.
4598 (Incremental_inputs::Incremental_inputs): Initialize new data members.
4599 (Incremental_inputs::report_inputs): Remove.
4600 (Incremental_inputs::report_archive): Remove.
4601 (Incremental_inputs::report_archive_begin): New function.
4602 (Incremental_inputs::report_archive_end): New function.
4603 (Incremental_inputs::report_object): Change prototype.
4604 (Incremental_inputs::report_input_section): New function.
4605 (Incremental_inputs::report_script): Change prototype.
4606 (Incremental_inputs::get_reloc_count): New function.
4607 (Incremental_inputs::set_reloc_count): New function.
4608 (Incremental_inputs::create_data_sections): New function.
4609 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
4610 (Incremental_inputs::inputs_section): New function.
4611 (Incremental_inputs::symtab_section): New function.
4612 (Incremental_inputs::relocs_section): New function.
4613 (Incremental_inputs::get_stringpool): Add const.
4614 (Incremental_inputs::command_line): Add const.
4615 (Incremental_inputs::inputs): Remove.
4616 (Incremental_inputs::command_line_key): New function.
4617 (Incremental_inputs::input_file_count): New function.
4618 (Incremental_inputs::input_files): New function.
4619 (Incremental_inputs::relocs_entsize): New function.
4620 (Incremental_inputs::sized_create_inputs_section_data): Remove.
4621 (Incremental_inputs::finalize_inputs): Remove.
4622 (Incremental_inputs::Input_info): Remove.
4623 (Incremental_inputs::lock_): Remove.
4624 (Incremental_inputs::inputs_): Change type.
4625 (Incremental_inputs::inputs_map_): Remove.
4626 (Incremental_inputs::current_object_entry_): New data member.
4627 (Incremental_inputs::inputs_section_): New data member.
4628 (Incremental_inputs::symtab_section_): New data member.
4629 (Incremental_inputs::relocs_section_): New data member.
4630 (Incremental_inputs::reloc_count_): New data member.
4631 (Incremental_inputs_reader): New class.
4632 (Incremental_symtab_reader): New class.
4633 (Incremental_relocs_reader): New class.
4634 * layout.cc (Layout::finalize): Move finalization of incremental info
4635 and creation of incremental info sections to follow finalization of
4636 symbol table. Set offsets for postprocessing sections.
4637 (Layout::create_incremental_info_sections): Call
4638 Incremental_inputs::create_data_sections. Add incremental symtab
4639 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
4640 sections to layout after input sections.
4641 * layout.h (struct Timespec): Forward declaration.
4642 (Layout::incremental_inputs): Add const.
4643 (Layout::create_incremental_info_sections): Add parameter.
4644 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
4645 * object.cc: Include incremental.h.
4646 (Relobj::finalize_incremental_relocs): New function.
4647 (Sized_relobj::do_layout): Record input sections in incremental info.
4648 * object.h (Object::output_section): New function.
4649 (Object::output_section_offset): Moved from Relobj.
4650 (Object::get_incremental_reloc_base): New function.
4651 (Object::get_incremental_reloc_count): New function.
4652 (Object::do_output_section): New function.
4653 (Object::do_output_section_offset): Moved from Relobj.
4654 (Object::do_get_incremental_reloc_base): New function.
4655 (Object::do_get_incremental_reloc_count): New function.
4656 (Object::Object): Initialize new data members.
4657 (Relobj::output_section): Renamed do_output_section and moved to
4658 protected.
4659 (Relobj::output_section_offset): Moved to Object.
4660 (Relobj::do_get_incremental_reloc_base): New function.
4661 (Relobj::do_get_incremental_reloc_count): New function.
4662 (Relobj::allocate_incremental_reloc_counts): New function.
4663 (Relobj::count_incremental_reloc): New function.
4664 (Relobj::finalize_incremental_relocs): New function.
4665 (Relobj::next_incremental_reloc_index): New function.
4666 (Relobj::reloc_counts_): New data member.
4667 (Relobj::reloc_bases_): New data member.
4668 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
4669 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
4670 (Sized_relobj::incremental_relocs_scan): New function.
4671 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4672 (Sized_relobj::incremental_relocs_write): New function.
4673 (Sized_relobj::incremental_relocs_write_reltype): New function.
4674 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
4675 incremental link.
4676 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
4677 archives and object files elsewhere.
4678 (Add_symbols::run): Report object files here.
4679 (Finish_group::run): Report end of archive at end of group.
4680 * reloc.cc: Include layout.h, incremental.h.
4681 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
4682 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
4683 (Sized_relobj::incremental_relocs_scan): New function.
4684 (Sized_relobj::incremental_relocs_scan_reltype): New function.
4685 (Sized_relobj::do_relocate_sections): Write incremental relocations.
4686 (Sized_relobj::incremental_relocs_write): New function.
4687 (Sized_relobj::incremental_relocs_write_reltype): New function.
4688 * script.cc (read_input_script): Rewrite test for incremental link.
4689 Change call to Incremental_inputs::report_script.
4690 * symtab.h (Symbol_table::first_global_index): New function.
4691 (Symbol_table::output_count): New function.
4692
ce0d1972
DK
46932010-08-12 Doug Kwan <dougkwan@google.com>
4694
4695 * arm.cc (Target_arm::merge_object_attributes): Check command line
4696 options --no-wchar-size-warning and --no-enum-size-warning.
4697 * options.h (General_options): Add ld-compatible options
4698 --no-enum-size-warning and --no-wchar-size-warning.
4699
6e5710ce
ILT
47002010-08-04 Ian Lance Taylor <iant@google.com>
4701
4702 * x86_64.cc (Target_x86_64::Scan::local): Use
4703 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
4704 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
4705 (Target_x86_64::Scan::global): Likewise.
4706 (Target_x86_64::Relocate::relocate): Likewise.
4707 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
4708 Likewise.
4709
fef830db
CC
47102010-08-03 Cary Coutant <ccoutant@google.com>
4711
4712 * merge.cc (Output_merge_string::do_add_input_section): Count strings
4713 to reserve space in merged_strings vector. Keep total input size
4714 for stats.
4715 (Output_merge_string::do_print_merge_stats): Print total input size.
4716 * merge.h (Output_merge_string): Add input_size_ field.
4717 * stringpool.cc (Stringpool_template::string_length): Move
4718 implementations out of Stringpool_template class and place in
4719 stringpool.h.
4720 * stringpool.h (string_length): Move out of Stringpool_template.
4721
1e3811b0
ILT
47222010-08-03 Ian Lance Taylor <iant@google.com>
4723
4724 PR 11712
4725 * layout.cc (relaxation_loop_body): If address of load segment is
4726 set, adjust address to include headers if possible.
4727
7af0c620
ILT
47282010-08-03 Ian Lance Taylor <iant@google.com>
4729
4730 * version.cc (version_string): Bump to 1.10.
4731
22f0da72
ILT
47322010-08-03 Ian Lance Taylor <iant@google.com>
4733
4734 PR 11805
4735 * layout.h (enum Output_section_order): Define.
4736 (class Layout): Update declarations.
4737 * layout.cc (Layout::get_output_section): Add order parameter.
4738 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
4739 is_first_non_relro parameters. Change all callers.
4740 (Layout::choose_output_section): Likewise.
4741 (Layout::add_output_section_data): Likewise.
4742 (Layout::make_output_section): Likewise. Set order.
4743 (Layout::default_section_order): New function.
4744 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
4745 * output.cc (Output_section::Output_section): Initialize order_.
4746 Don't initialize deleted fields.
4747 (Output_segment::Output_segment): Don't initialize deleted
4748 fields.
4749 (Output_segment::add_output_section_to_load): New function
4750 replacing add_output_section. Change all callers to call this or
4751 add_output_section_to_nonload.
4752 (Output_segment::add_output_section_to_nonload): New function.
4753 (Output_segment::remove_output_section): Rewrite.
4754 (Output_segment::add_initial_output_data): Likewise.
4755 (Output_segment::has_any_data_sections): Likewise.
4756 (Output_segment::is_first_section_relro): Likewise.
4757 (Output_segment::maximum_alignment): Likewise.
4758 (Output_segment::has_dynamic_reloc): New function replacing
4759 dynamic_reloc_count. Change all callers.
4760 (Output_segment::has_dynamic_reloc_list): New function replacing
4761 dynamic_reloc_count_list. Change all callers.
4762 (Output_segment::set_section_addresses): Rewrite.
4763 (Output_segment::set_offset): Rewrite.
4764 (Output_segment::find_first_and_last_list): Remove.
4765 (Output_segment::set_tls_offsets): Rewrite.
4766 (Output_segment::first_section_load_address): Likewise.
4767 (Output_segment::output_section_count): Likewise.
4768 (Output_segment::section_with_lowest_load_address): Likewise.
4769 (Output_segment::write_section_headers): Likewise.
4770 (Output_segment::print_sections_to_map): Likewise.
4771 * output.h (class Output_data): Remove dynamic_reloc_count_
4772 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
4773 (Output_data::add_dynamic_reloc): Rewrite.
4774 (Output_data::has_dynamic_reloc): New function.
4775 (Output_data::dynamic_reloc_count): Remove.
4776 (class Output_section): Add order_ field. Remvoe is_relro_local_,
4777 is_last_relro_, is_first_non_relro_, is_interp_,
4778 is_dynamic_linker_section_ fields. Add order and set_order
4779 functions. Remove is_relro_local, set_is_relro_local,
4780 is_last_relro, set_is_last_relro, is_first_non_relro,
4781 set_is_first_non_relro functions, is_interp, set_is_interp,
4782 is_dynamic_linker_section, and set_is_dynamic_linker_section
4783 functions.
4784 (class Output_segment): Change Output_data_list from std::list to
4785 std:;vector. Add output_lists_ field. Remove output_data_ and
4786 output_bss_ fields. Update declarations.
4787
3ff2ccb0
ILT
47882010-08-02 Ian Lance Taylor <iant@google.com>
4789
4790 * arm.cc (Target_arm::gc_process_relocs): Use typename.
4791 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
4792 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
4793
88a4108b
ILT
47942010-08-02 Ian Lance Taylor <iant@google.com>
4795
4796 PR 11855
4797 * script.cc (Script_options::Script_options): Initialize
4798 symbol_definitions_ and symbol_references_.
4799 (Script_options::add_symbol_assignment): Update
4800 symbol_definitions_ and symbol_references_.
4801 (Script_options::add_symbol_reference): New function.
4802 (script_symbol): New function.
4803 * script.h (class Script_options): Add symbol_definitions_ and
4804 symbol_references_ fields.
4805 (Script_options::referenced_const_iterator): New type.
4806 (Script_options::referenced_begin): New function.
4807 (Script_options::referenced_end): New function.
4808 (Script_options::is_referenced): New function.
4809 (Script_options::any_unreferenced): New function.
4810 * script-c.h (script_symbol): Declare.
4811 * yyscript.y (exp): Call script_symbol.
4812 * symtab.cc: Include "script.h".
4813 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
4814 Change all callers. Check symbols referenced by scripts.
4815 (Symbol_table::add_undefined_symbols_from_command_line): Add
4816 layout parameter. Change all callers.
4817 (Symbol_table::do_add_undefined_symbols_from_command_line):
4818 Likewise. Break out loop body. Check symbols referenced by
4819 scripts.
4820 (Symbol_table::add_undefined_symbol_from_command_line): New
4821 function broken out of
4822 do_add_undefined_symbols_from_command_line.
4823 * symtab.h (class Symbol_table): Update declarations.
4824 * archive.cc: Include "layout.h".
4825 (Archive::should_include_member): Add layout parameter. Change
4826 all callers. Check for symbol mentioned in expression.
4827 * archive.h (class Archive): Update declaration.
4828 * object.cc (Sized_relobj::do_should_include_member): Add layout
4829 parameter.
4830 * object.h (Object::should_include_member): Add layout parameter.
4831 Change all callers.
4832 (Object::do_should_include_member): Add layout parameter.
4833 (class Sized_relobj): Update declaration.
4834 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
4835 parameter.
4836 * dynobj.h (class Sized_dynobj): Update declaration.
4837 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
4838 layout parameter.
4839 * plugin.h (class Sized_pluginobj): Update declaration.
4840
5f1ab67a
ILT
48412010-08-02 Ian Lance Taylor <iant@google.com>
4842
4843 PR 11866
4844 * output.cc (Output_segment::set_offset): Search for the first and
4845 last sections rather than assuming that the list is in order.
4846 (Output_segment::find_first_and_last_list): New function.
4847 * output.h (class Output_segment): Update declarations.
4848 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
4849 (relro_strip_test_SOURCES): New variable.
4850 (relro_strip_test_DEPENDENCIES): New variable.
4851 (relro_strip_test_LDFLAGS): New variable.
4852 (relro_strip_test_LDADD): New variable.
4853 (relro_strip_test.so): New target.
4854
a8df5856
ILT
48552010-08-02 Ian Lance Taylor <iant@google.com>
4856
4857 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
4858 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
4859 (Target_i386::got_tlsdesc_section): New function.
4860 (Target_i386::got_section): Create space for GOT entries for
4861 TLSDESC relocations.
4862 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
4863 R_386_TLS_GOTDESC.
4864 (Target_i386::Scan::global): Likewise.
4865 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
4866 using TLSDESC GOT.
4867 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
4868 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
4869 (Target_x86_64::got_tlsdesc_section): New function.
4870 (Target_x86_64::got_section): Create space for GOT entries for
4871 TLSDESC relocations.
4872 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
4873 R_386_TLS_GOTDESC.
4874 (Target_x86_64::Scan::global): Likewise.
4875 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
4876 using TLSDESC GOT.
4877
0c10a0a6
ILT
48782010-08-02 Ian Lance Taylor <iant@google.com>
4879
4880 * testsuite/final_layout.sh: Use dc to convert from hex to
4881 decimal.
4882
41cbeecc
ST
48832010-07-29 Sriraman Tallam <tmsriram@google.com>
4884
4885 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
4886 paramter to the call to gold::gc_process_relocs.
4887 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
4888 paramter to the call to gold::gc_process_relocs.
4889 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
4890 parameter to the call to gold::gc_process_relocs.
4891 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
4892 template parameter to the call to gold::gc_process_relocs.
4893 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
4894 paramter to the call to gold::gc_process_relocs.
4895 * gc.h (get_embedded_addend_size): New function.
4896 (gc_process_relocs): Save the size of the reloc for use by ICF.
4897 * icf.cc (get_section_contents): Get the addend from the text section
4898 for SHT_REL relocation sections.
4899 * icf.h (Icf::Reloc_addend_size_info): New typedef.
4900 (Icf::Reloc_info): Add new member reloc_addend_size_info.
4901 * int_encoding.h (read_from_pointer): New overloaded function.
4902 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
4903 * testsuite/icf_sht_rel_addend_test.sh: New file.
4904 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
4905 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
4906
6ea55b82
RW
49072010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
4908
4909 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
4910 * Makefile.in: Regenerate.
4911 * testsuite/Makefile.in: Regenerate.
4912
9691462b
ILT
49132010-07-27 Jeffrey Yasskin <jyasskin@google.com>
4914
4915 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
4916 * gold/testsuite/debug_msg.cc: Likewise.
4917 * gold/testsuite/odr_violation1.cc
4918 * gold/testsuite/odr_violation2.cc
4919
76897331
CC
49202010-07-21 Cary Coutant <ccoutant@google.com>
4921
4922 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
4923 string, and length fields.
4924 (Output_merge_string::Merged_strings_list): New type.
4925 (Output_merge_string::Merged_strings_lists): New typedef.
4926 (Output_merge_string): Replace merged_strings_ with
4927 merged_strings_lists_.
4928 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
4929 Merged_strings_list per input object and section. Don't store pointer
4930 to the string. Don't store length with each merged string entry.
4931 (Output_merge_string::finalize_merged_data): Loop over list of merged
4932 strings lists. Recompute length of each merged string.
4933
78384e8f
CC
49342010-07-15 Cary Coutant <ccoutant@google.com>
4935
4936 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
4937 here.
4938
783659f9
ILT
49392010-07-14 Ian Lance Taylor <iant@google.com>
4940
4941 * descriptors.cc (Descriptors::open): Report correct name in error
4942 message.
4943
131687b4
DK
49442010-07-13 Doug Kwan <dougkwan@google.com>
4945
4946 * arm.cc (Arm_input_section::Arm_input_section): For a
4947 SHT_ARM_EXIDX section, always keeps the input sections.
4948 (Arm_input_section::set_exidx_section_link): New method.
4949 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
4950 has_errors_ to false.
4951 (Arm_exidx_input_section::has_errors,
4952 Arm_exidx_input_section::set_has_errors): New methods.
4953 (Arm_exidx_input_section::has_errors_): New data member.
4954 (Arm_relobj::get_exidx_shndx_list): New method.
4955 (Arm_output_section::append_text_sections_to_list): Do not skip
4956 section without SHF_EXECINSTR.
4957 (Arm_output_section::fix_exidx_coverage): Skip input sections with
4958 errors.
2e702c99 4959 (Arm_relobj::make_exidx_input_section): Add new parameter for text
131687b4
DK
4960 section header. Make error messages more verbose. Check for
4961 a non-executable section linked to an EXIDX section.
4962 (Arm_relobj::do_read_symbols): Remove error checking, which has been
4963 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
4964 check that there is no deferred EXIDX section if we exit early.
4965 Instead of not making an EXIDX section in case of an error, make one
4966 and set the has_errors flag of it.
4967 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
4968 in a relocatable link.
4969 (Target_arm::do_relax): Look for the EXIDX output section instead of
4970 assuming that it is called .ARM.exidx.
2e702c99 4971 (Target_arm::fix_exidx_coverage): Add a new parameter for input
131687b4
DK
4972 section list. Do not check for SHF_EXECINSTR section flags but
4973 skip any input section with errors.
4974 * output.cc (Output_section::Output_section): Initialize
4975 always_keeps_input_sections_ to false.
4976 (Output_section::add_input_section): Check for
4977 always_keeps_input_sections_.
4978 * output.h (Output_section::always_keeps_input_sections,
4979 Output_section::set_always_keeps_input_sections): New methods.
4980 (Output_section::always_keeps_input_sections): New data member.
4981
69517287
RÁE
49822010-07-13 Rafael Espindola <espindola@google.com>
4983
4984 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
4985 * fileread.h (Input_file): Add try_extra_search_path and find_file.
4986
82742395
ILT
49872010-07-13 Philip Herron <herron.philip@googlemail.com>
4988 Ian Lance Taylor <iant@google.com>
4989
4990 * output.h (Output_section_lookup_maps::add_merge_section):
4991 Correct check of whether value was inserted.
4992 (Output_section_lookup_maps::add_merge_input_section): Likewise.
4993 (Output_section_lookup_maps::add_relaxed_input_section):
4994 Likewise.
4995 * arm.cc (Target_arm::got_section): Remove used local os.
4996 * i386.cc (Target_i386::got_section): Likewise.
4997 * x86_64.cc (Target_x86_64::got_section): Likewise.
4998 * sparc.cc (Target_sparc::got_section): Likewise.
4999 (Target_sparc::relocate): Remove unused local have_got_offset.
5000 * powerpc.cc (Target_powerpc::relocate): Likewise.
5001
f2d707b5
ILT
50022010-07-13 Ian Lance Taylor <iant@google.com>
5003
241531d6
ILT
5004 * compressed_output.cc (zlib_decompress): Fix signature in
5005 !HAVE_ZLIB_H case.
5006
f2d707b5
ILT
5007 * archive.cc (Archive::include_member): Unlock an external member
5008 of a thin archive. Don't bother to delete an object we know is
5009 NULL.
5010
a2e47362
CC
50112010-07-12 Cary Coutant <ccoutant@google.com>
5012
5013 * compressed_output.cc (zlib_decompress): New function.
5014 (get_uncompressed_size): New function.
5015 (decompress_input_section): New function.
5016 * compressed_output.h (get_uncompressed_size): New function.
5017 (decompress_input_section): New function.
5018 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
5019 Handle compressed debug sections.
5020 * layout.cc (is_compressed_debug_section): New function.
5021 (Layout::output_section_name): Map compressed section names to
5022 canonical names.
5023 * layout.h (is_compressed_debug_section): New function.
5024 (is_debug_info_section): Recognize compressed debug sections.
5025 * merge.cc: Include compressed_output.h.
5026 (Output_merge_data::do_add_input_section): Handle compressed
5027 debug sections.
5028 (Output_merge_string::do_add_input_section): Handle compressed
5029 debug sections.
5030 * object.cc: Include compressed_output.h.
5031 (Sized_relobj::Sized_relobj): Initialize new data members.
5032 (build_compressed_section_map): New function.
5033 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
5034 * object.h (Object::section_is_compressed): New method.
5035 (Object::do_section_is_compressed): New method.
5036 (Sized_relobj::Compressed_section_map): New type.
5037 (Sized_relobj::do_section_is_compressed): New method.
5038 (Sized_relobj::compressed_sections_): New data member.
5039 * output.cc (Output_section::add_input_section): Handle compressed
5040 debug sections.
5041 * reloc.cc: Include compressed_output.h.
5042 (Sized_relobj::write_sections): Handle compressed debug sections.
5043
ce279a62
CC
50442010-07-08 Cary Coutant <ccoutant@google.com>
5045
5046 * resolve.cc (Symbol_table::resolve): Remember whether undef was
5047 weak when resolving to a dynamic def.
5048 (Symbol_table::should_override): Add adjust_dyndef flag; set it
5049 for weak undef/dynamic def cases. Adjust callers.
5050 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
5051 undef_binding_weak_.
5052 (Symbol_table::sized_write_globals): Adjust symbol binding.
5053 (Symbol_table::sized_write_symbol): Add binding parameter.
5054 * symtab.h (Symbol::set_undef_binding): New method.
5055 (Symbol::is_undef_binding_weak): New method.
5056 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
5057 (Symbol_table::should_override): Add new parameter.
5058 (Symbol_table::sized_write_symbol): Add new parameter.
5059
5060 * testsuite/weak_undef_file1.cc: Add new test case.
5061 * testsuite/weak_undef_file2.cc: Fix header comment.
5062 * testsuite/weak_undef_test.cc: Add new test case.
5063
b2286c10
DK
50642010-06-29 Doug Kwan <dougkwan@google.com>
5065
5066 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
5067 Initialize USE_SYMBOL_.
5068 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
5069 definition.
5070 (Arm_reloc_property::uses_symbol_): New data member declaration.
5071 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
5072 uses symbol value and symbol is undefined but not weakly undefined.
5073
4802450a
RÁE
50742010-06-28 Rafael Espindola <espindola@google.com>
5075
5076 * plugin.cc (Plugin::load): Use dlerror.
5077
e5ca47ba
ILT
50782010-06-26 Jeffrey Yaskin <jyasskin@google.com>
5079
5080 * symtab.cc (detect_odr_violations): When reporting an ODR
5081 violation, report an object where the symbol is defined.
5082
8a75a161
DK
50832010-06-25 Doug Kwan <dougkwan@google.com>
5084
5085 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
5086 (Target_arm::section_may_have_icf_unsafe_pointers): New method
5087 definition.
5088 (Target_arm::Scan::local_reloc_may_be_function_pointer,
5089 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
5090 target hook to detect function points.
5091 (Target_arm::Scan::possible_function_pointer_reloc): New method.
5092 * icf.h (Icf::check_section_for_function_pointers): Change type of
5093 parameter SECTION_NAME to const reference to std::string. Use
5094 target hook to determine if section may have unsafe pointers.
5095 * target.h (Target::section_may_have_icf_unsafe_pointers): New
5096 method definition.
5097
42218b9f
RÁE
50982010-06-21 Rafael Espindola <espindola@google.com>
5099
5100 * fileread.cc (Input_file::find_fie): New
5101 (Input_file::open): Use Input_file::find_fie.
5102 * fileread.h (Input_file::find_fie): New
5103 * plugin.cc (set_extra_library_path): New.
5104 (Plugin::load): Add set_extra_library_path to the transfer vector.
5105 (Plugin_manager::set_extra_library_path): New.
5106 (Plugin_manager::add_input_file): Use the extra search path if set.
5107 (set_extra_library_path(): New.
5108 * plugin.h (Plugin_manager): Add set_extra_library_path and
5109 extra_search_path_.
5110
a0506cca
CC
51112010-06-19 Cary Coutant <ccoutant@google.com>
5112
5113 * layout.cc (gdb_sections): Add .debug_types.
5114 (lines_only_debug_sections): Likewise.
5115
6508b958
RÁE
51162010-06-18 Rafael Espindola <espindola@google.com>
5117
5118 * plugin.cc (add_input_file,add_input_library)
5119 (Plugin_manager::add_input_file): Make filename arguments const.
5120 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
5121 const.
5122
3e235302
DK
51232010-06-16 Doug Kwan <dougkwan@google.com>
5124
5125 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
5126 .ARM.attributes section if we have not merged any input
5127 attributes sections.
5128
106e8a6c
DK
51292010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5130
5131 * arm.cc: Allow combining objects with no EABI version
5132 information.
5133
91ff43fe
RÁE
51342010-06-15 Rafael Espindola <espindola@google.com>
5135
5136 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
5137
68ed838c
ILT
51382010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5139
5140 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
5141 (struct iovec): Correct !HAVE_READV definition.
5142
f3a2388f
CC
51432010-06-10 Cary Coutant <ccoutant@google.com>
5144
5145 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
5146 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
5147 reloc sections.
5148 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
5149
5150 PR 11683
5151 * symtab.h (Symbol::is_placeholder): New member function.
5152 * target-reloc.h (relocate_section): Check for placeholder symbols.
5153
5154 * testsuite/Makefile.am (plugin_test_8): New test.
5155 (plugin_test_9): New test.
5156 * testsuite/Makefile.in: Regenerate.
5157
e1df38aa
NC
51582010-06-09 Nick Clifton <nickc@redhat.com>
5159
5160 * yyscript.y (input_list_element): Allow strings prefixed with
5161 the '-' character. Treat these as libraries.
5162 * script.cc (script_add_library): New function. Adds a library
5163 specified by "-l<name>" found in an input script.
5164 * script-c.h: Add prototype for script_add_library.
5165
25bbe950
DK
51662010-06-07 Doug Kwan <dougkwan@google.com>
5167
5168 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
5169 Restrict stub-group size to be within long conditional branch
5170 range when working around cortex-A8 erratum.
5171
0f32ea4c
ILT
51722010-06-07 Damien Diederen <dd@crosstwine.com>
5173
5174 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
5175 #ifdef typo.
5176
8fe2a369
ST
51772010-06-03 Sriraman Tallam <tmsriram@google.com>
5178
5179 PR gold/11658
5180 * output.cc
5181 (Output_section::Input_section_sort_entry::compare_section_ordering):
5182 Change to return non-zero correctly.
5183 (Output_section::Input_section_sort_section_order_index_compare
5184 ::operator()): Change to fix ambiguity in comparisons.
5185
6e9ba2ca
ST
51862010-06-01 Sriraman Tallam <tmsriram@google.com>
5187
5188 * gold.h (is_wildcard_string): New function.
5189 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
5190 (Layout::layout_eh_frame): Ditto.
5191 (Layout::find_section_order_index): New method.
5192 (Layout::read_layout_from_file): New method.
5193 * layout.h (Layout::find_section_order_index): New method.
5194 (Layout::read_layout_from_file): New method.
5195 (Layout::input_section_position_): New private member.
5196 (Layout::input_section_glob_): New private member.
5197 * main.cc (main): Call read_layout_from_file here.
5198 * options.h (--section-ordering-file): New option.
5199 * output.cc (Output_section::input_section_order_specified_): New
5200 member.
5201 (Output_section::Output_section): Initialize new member.
5202 (Output_section::add_input_section): Add new parameter.
5203 Keep input sections when --section-ordering-file is used.
5204 (Output_section::set_final_data_size): Sort input sections when
5205 section ordering file is specified.
5206 (Output_section::Input_section_sort_entry): Add new parameter.
5207 Check sorting type.
5208 (Output_section::Input_section_sort_entry::compare_section_ordering):
5209 New method.
5210 (Output_section::Input_section_sort_compare::operator()): Change to
5211 consider section_order_index.
5212 (Output_section::Input_section_sort_init_fini_compare::operator()):
5213 Change to consider section_order_index.
5214 (Output_section::Input_section_sort_section_order_index_compare
5215 ::operator()): New method.
5216 (Output_section::sort_attached_input_sections): Change to sort
5217 according to section order when specified.
e1df38aa
NC
5218 (Output_section::add_input_section<32, true>): Add new parameter.
5219 (Output_section::add_input_section<64, true>): Add new parameter.
5220 (Output_section::add_input_section<32, false>): Add new parameter.
5221 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
5222 * output.h (Output_section::add_input_section): Add new parameter.
5223 (Output_section::input_section_order_specified): New
5224 method.
5225 (Output_section::set_input_section_order_specified): New method.
5226 (Input_section::Input_section): Initialize section_order_index_.
5227 (Input_section::section_order_index): New method.
5228 (Input_section::set_section_order_index): New method.
5229 (Input_section::section_order_index_): New member.
5230 (Input_section::Input_section_sort_section_order_index_compare): New
5231 struct.
5232 (Output_section::input_section_order_specified_): New member.
5233 * script-sections.cc (is_wildcard_string): Delete and move modified
5234 method to gold.h.
5235 (Output_section_element_input::Output_section_element_input): Modify
5236 call to is_wildcard_string.
5237 (Output_section_element_input::Input_section_pattern
5238 ::Input_section_pattern): Ditto.
5239 (Output_section_element_input::Output_section_element_input): Ditto.
5240 * testsuite/Makefile.am (final_layout): New test case.
5241 * testsuite/Makefile.in: Regenerate.
5242 * testsuite/final_layout.cc: New file.
5243 * testsuite/final_layout.sh: New file.
5244
3537c84b
RÁE
52452010-06-01 Rafael Espindola <espindola@google.com>
5246
5247 * plugin.cc (Plugin::load): Pass the output name to the plugin.
5248
105b6afd
RÁE
52492010-06-01 Rafael Espindola <espindola@google.com>
5250
5251 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
5252 visibility of symbols.
5253
29e11421
DK
52542010-05-27 Doug Kwan <dougkwan@google.com>
5255
5256 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
5257 from start of output section instead of address for a local symbol
5258 in a merged or relaxed section when doing a relocatable link.
5259
5e0f337e
RÁE
52602010-05-26 Rafael Espindola <espindola@google.com>
5261
5262 PR 11604
5263 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
5264 adding sections the garbage collector removed.
5265 * gold/testsuite/Makefile.am: Add test.
5266 * gold/testsuite/Makefile.in: Regenerate.
5267 * gold/testsuite/plugin_test_7.sh: New.
5268 * gold/testsuite/plugin_test_7_1.c: New.
5269 * gold/testsuite/plugin_test_7_2.c: New.
5270
f4187277
RÁE
52712010-05-26 Rafael Espindola <espindola@google.com>
5272
5273 * script-sections.cc (Output_section_definition::set_section_addresses):
5274 Check for --section-start.
5275
5c388529
DK
52762010-05-26 Doug Kwan <dougkwan@google.com>
5277
5278 * arm.cc (Arm_scan_relocatable_relocs): New class.
5279 (Target_arm::relocate_special_relocatable): New method.
5280 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
5281 (Arm_relocate_functions::thumb_branch_common): Same.
5282 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
5283 instead of Default_scan_relocatable_relocs.
5284 * target-reloc.h (relocate_for_relocatable): Let target handle
5285 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
5286 * target.h (Sized_target::relocate_special_relocatable): New method.
5287
bca1c3ae
ILT
52882010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5289
5290 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
5291
0439c796
DK
52922010-05-23 Doug Kwan <dougkwan@google.com>
5293
5294 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
5295 instead of a cast.
5296 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
5297 with a direct branch, not a conditional branch, to a stub.
5298 * merge.cc (Output_merge_base::record_input_section): New method
5299 defintion.
5300 (Output_merge_data::do_add_input_section): Record input section if
5301 keeps-input-sections flag is set.
5302 (Output_merge_string::do_add_input_section): Ditto.
5303 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
5304 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
5305 INPUT_SECTIONS_.
5306 (Output_merge_base::keeps_input_sections,
5307 Output_merge_base::set_keeps_input_sections,
5308 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
5309 method definitions.
5310 (Output_merge_base::Input_sections): New type declaration.
5311 (Output_merge_base::input_sections_begin,
5312 Output_merge_base::input_sections_end,
5313 Output_merge_base::do_set_keeps_input_sections): New method definitions.
5314 (Output_merge_base::bool keeps_input_sections_,
5315 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
5316 Output_merge_base::input_sections_): New data members.
5317 (Output_merge_data::do_set_keeps_input_sections): New method
5318 defintion.
5319 (Output_merge_string::do_set_keeps_input_sections): Ditto.
5320 * output.cc (Output_section::Input_section::relobj): Move method
5321 defintion from class declaration to here and handle merge sections.
5322 (Output_section::Input_section::shndx): Ditto.
5323 (Output_section::Output_section): Remove initializations of removed
5324 data members and initialize new data member LOOKUP_MAPS_.
5325 (Output_section::add_input_section): Set keeps-input-sections flag
5326 for a newly created merge output section as appropriate. Adjust code
5327 to use Output_section_lookup_maps class.
5328 (Output_section::add_relaxed_input_section): Adjst code for lookup
5329 maps code refactoring.
2e702c99 5330 (Output_section::add_merge_input_section): Add a new parameter
0439c796
DK
5331 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
5332 class. If adding input section to a newly created merge output
5333 section fails, remove the new merge section.
5334 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 5335 Adjust code for use of the Output_section_lookup_maps class.
2e702c99 5336 (Output_section::find_merge_section): Ditto.
0439c796 5337 (Output_section::build_lookup_maps): New method defintion.
2e702c99 5338 (Output_section::find_relaxed_input_section): Adjust code to use
0439c796
DK
5339 Output_section_lookup_maps class.
5340 (Output_section::get_input_sections): Export merge sections. Adjust
5341 code to use Output_section_lookup_maps class.
5342 (Output_section:::add_script_input_section): Adjust code to use
5343 Output_section_lookup_maps class. Update lookup maps for merge
5344 sections also.
5345 (Output_section::discard_states): Use Output_section_lookup_maps.
5346 (Output_section::restore_states): Same.
5347 * output.h (Merge_section_properties): Move class defintion out of
5348 Output_section.
5349 (Output_section_lookup_maps): New class.
5350 (Output_section::Input_section::is_merge_section): New method
5351 defintion.
5352 (Output_section::Input_section::relobj): Move defintion out of class
5353 defintion. Declare method only.
5354 (Output_section::Input_section::shndx): Ditto.
5355 (Output_section::Input_section::output_merge_base): New method defintion.
2e702c99 5356 (Output_section::Input_section::u2_.pomb): New union field.
0439c796
DK
5357 (Output_section::Merge_section_by_properties_map,
5358 Output_section::Output_section_data_by_input_section_map,
5359 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
5360 Remove types.
2e702c99 5361 (Output_section::add_merge_input_section): Add new parameter
0439c796
DK
5362 KEEPS_INPUT_SECTIONS.
5363 (Output_section::build_lookup_maps): New method declaration.
5364 (Output_section::merge_section_map_,
5365 Output_section::merge_section_by_properties_map_,
5366 Output_section::relaxed_input_section_map_,
5367 Output_section::is_relaxed_input_section_map_valid_): Remove data
5368 members.
5369 (Output_section::lookup_maps_): New data member.
5370
76295588
L
53712010-05-21 Doug Kwan <dougkwan@google.com>
5372
5373 PR gold/11619
5374 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
5375 avoid a compilation error.
5376
d103a984
RÁE
53772010-05-19 Rafael Espindola <espindola@google.com>
5378
5379 * script-sections.cc (Output_section_definition::allocate_to_segment):
5380 Update the phdrs_list even when the output section is NULL.
5381 * testsuite/Makefile.am: Add test.
5382 * testsuite/Makefile.in: Regenerate.
5383 * testsuite/script_test_9.cc: New.
5384 * testsuite/script_test_9.sh: New.
5385 * testsuite/script_test_9.t: New.
5386
6625d24e
DK
53872010-05-19 Doug Kwan <dougkwan@google.com>
5388
5389 * arm.cc (Arm_input_section::original_size): New method.
5390 (Arm_input_section::do_addralign): Add a cast.
5391 (Arm_input_section::do_output_offset): Remove static cast.
5392 (Arm_input_section::original_addralign,
5393 Arm_input_section::original_size_): Change type to uint32_t.
5394 (Arm_input_section::init): Add safe casts for section alignment
5395 and size.
5396 (Arm_input_section::set_final_data_size): Do not set address and
5397 offset of stub table.
5398 (Arm_output_section::fix_exidx_coverage): Change use of of
5399 Output_section::Simple_input_section to that of
5400 Output_section::Input_section.
5401 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
5402 except for the first pass.
5403 * output.cc (Output_section::get_input_sections): Change type of
5404 input_sections to std::list<Input_section>.
5405 (Output_section::add_script_input_section): Rename from
5406 Output_section::add_simple_input_section. Change type of SIS
5407 parameter from Simple_input_section to Input_section.
5408 * output.h (Output_section::Simple_input_section): Remove class.
5409 (Output_section::Input_section): Change class visibility to public.
5410 (Output_section::Input_section::addralign): Use stored alignments
5411 for special input sections if set.
5412 (Output_section::Input_section::set_addralign): New method.
5413 (Output_section::get_input_sections): Change parameter type from
5414 list of Simple_input_section to list of Input_section.
5415 (Output_section::add_script_input_section): Rename from
5416 Output_section::add_simple_input_section. Change first parameter's
5417 type from Simple_input_section to Input_section and remove the
5418 second and third parameters.
5419 * script-sections.cc (Input_section::Input_section_list): Change
5420 type to list of Output_section::Input_section/
5421 (Input_section_info::Input_section_info): Change parameter type of
5422 INPUT_SECTION to Output_section::Input_section.
5423 (Input_section_info::input_section): Change return type.
5424 (Input_section_info::input_section_): Change type to
5425 Output_section::Input_section.
5426 (Output_section_element_input::set_section_addresses): Adjust code
5427 to use Output_section::Input_section instead of
5428 Output_section::Simple_input_section. Adjust code for renaming
5429 of Output_section::add_simple_input_section.
5430 (Orphan_output_section::set_section_addresses): Ditto.
5431
e1e82ea4
RW
54322010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5433
5434 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
5435 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
5436
91e75c8a
RÁE
54372010-05-18 Rafael Espindola <espindola@google.com>
5438
5439 * options.cc (General_options::finalize): Handle -nostdlib.
5440 * options.h (nostdlib): New option.
5441 * script.cc (script_add_search_dir): Handle -nostdlib.
5442
da59ad79
DK
54432010-05-12 Doug Kwan <dougkwan@google.com>
5444
5445 * arm.cc (Target_arm::do_finalize_sections): Create an empty
5446 attributes section only if there no attributes section after merging.
5447 (Target_arm::merge_object_attributes): Move value of
e1df38aa 5448 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
5449 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
5450 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
5451 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
5452 and arm_attr_merge_7.stdout.
5453 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
5454 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
5455 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
5456 arm_attr_merge_7b.o): New rules.
5457 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
5458 arm_attr_merge_7
5459 * testsuite/Makefile.in: Regenerate.
5460 * testsuite/arm_attr_merge.sh: New file.
5461 * testsuite/arm_attr_merge_[67][ab].s: Same.
5462
3e01a7fd
NC
54632010-05-05 Nick Clifton <nickc@redhat.com>
5464
5465 * po/es.po: Updated Spanish translation.
5466
7ad2014a
L
54672010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5468
5469 * Makefile.am (install-exec-local): Properly install gold as
5470 default cross linker.
5471 * Makefile.in: Regenerated.
5472
4fda8867
NC
54732010-04-27 H.J. Lu <hongjiu.lu@intel.com>
5474 Nick Clifton <nickc@redhat.com>
5475
5476 * configure.ac (install_as_default): Define and set to false
5477 unless --enable-gold or --enable-gold=both/gold has been
5478 specified.
5479 * configure: Regenerate.
5480
5481 * Makefile.am (install-exec-local): Install the executable as
5482 'ld.gold'. If install_as_default is true then also install it as
5483 'ld'.
5484 * Makefile.in: Regenerated.
5485
bd288ea2
ILT
54862010-04-24 Ian Lance Taylor <iant@google.com>
5487
5488 * layout.cc (Layout::layout_reloc): In relocatable link don't
5489 combine reloc sections for grouped sections.
5490
ef38fd8a
ST
54912010-04-23 Sriraman Tallam <tmsriram@google.com>
5492
5493 * gc.h (gc_process_relocs): Pass information on relocs pointing to
5494 sections that are not ordinary to icf.
5495 * icf.cc (get_section_contents): Handle relocation pointing to section
5496 with no object or shndx information.
5497 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
5498 * testsuite/Makefile.in: Regenerate.
5499 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
5500 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
5501
f6973bdc
ILT
55022010-04-22 Ian Lance Taylor <iant@google.com>
5503
5504 * expression.cc (Expression::Expression_eval_info): Add
5505 result_alignment_pointer field.
5506 (Expression::eval_with_dot): Add result_alignment_pointer
5507 parameter. Change all callers.
5508 (Expression::eval_maybe_dot): Likewise.
5509 (class Binary_expression): Add alignment_pointer parameter to
5510 left_value and right_value. Change all callers.
5511 (BINARY_EXPRESSION): Set result alignment.
5512 (class Trinary_expression): Add alignment_pointer parameter to
5513 arg2_value and arg3_value. Change all callers.
5514 (Trinary_cond::value): Set result alignment.
5515 (Max_expression::value, Min_expression::value): Likewise.
5516 (Align_expression::value): Likewise.
5517 * script-sections.cc (class Sections_element): Add dot_alignment
5518 parameter to set_section_addresses virtual function. Update
5519 instantiations.
5520 (class Output_section_element): Likewise.
5521 (Script_sections::create_segments): Add dot_alignment parameter.
5522 Change all callers.
5523 (Script_sections::create_segments_from_phdrs_clause): Likewise.
5524 (Script_sections::set_phdrs_clause_addresses): Likewise.
5525 * script-sections.h: Update declarations.
5526 * script.h: Update declarations.
5527 * output.h (Output_segment::set_minimum_p_align): Don't decrease
5528 min_p_align.
5529 * testsuite/script_test_3.t: Set large alignment.
5530 * testsuite/script_test_3.sh: Make sure that at least one LOAD
5531 segment has expected alignment.
5532
9c9c98a5
NC
55332010-04-22 Nick Clifton <nickc@redhat.com>
5534
5535 * po/gold.pot: Updated by the Translation project.
5536 * po/vi.po: Updated Vietnamese translation.
5537
2253bfba
L
55382010-04-22 H.J. Lu <hongjiu.lu@intel.com>
5539
5540 * testsuite/Makefile.am (check_PROGRAMS): Add
5541 icf_virtual_function_folding_test.
5542 * testsuite/Makefile.in: Regenerated.
5543
85fdf906
AH
55442010-04-15 Andrew Haley <aph@redhat.com>
5545
5546 * options.h (merge_exidx_entries): New option.
5547 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
5548 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
5549 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
5550 (Target_arm::merge_exidx_entries): New function.
5551 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
5552 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
5553 to Arm_exidx_fixup constructor.
5554 Add new arg, merge_exidx_entries.
5555 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
5556 Arm_output_section::fix_exidx_coverage.
5557
ce97fa81
ST
55582010-04-18 Sriraman Tallam <tmsriram@google.com>
5559
5560 * icf.cc (get_section_contents): Check for preemptible functions.
5561 Ignore addend when appropriate.
5562 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
5563 section folded.
5564 (add_from_relobj): Check for section folded.
5565 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
5566 * symtab.h (should_add_dynsym_entry): Add new parameter.
5567 * target-reloc.h (scan_relocs): Check for section folded.
5568 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
5569 Check reloc types for function pointers in shared objects.
5570 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
5571 case.
5572 (icf_preemptible_functions_test): New test case.
5573 (icf_string_merge_test): New test case.
5574 * testsuite.Makefile.in: Regenerate.
5575 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
5576 bar_glob. Refactor code.
5577 * testsuite/icf_preemptible_functions_test.cc: New file.
5578 * testsuite/icf_preemptible_functions_test.sh: New file.
5579 * testsuite/icf_string_merge_test.cc: New file.
5580 * testsuite/icf_string_merge_test.sh: New file.
5581 * testsuite/icf_virtual_function_folding_test.cc: New file.
5582 * testsuite/icf_virtual_function_folding_test.sh: New file.
5583
04ceb17c
DK
55842010-04-14 Doug Kwan <dougkwan@google.com>
5585
5586 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
5587 for local symbol recounting if we remove a section due to ICF.
5588 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
5589 there are no regular objects in input.
5590
153e7da4
DK
55912010-04-13 Doug Kwan <dougkwan@google.com>
5592
5593 * arm.cc (Arm_input_section::set_final_data_size): Compute
5594 accurate final data size instead of using current data size.
5595
4dbd9faf
DK
55962010-04-09 Doug Kwan <dougkwan@google.com>
5597
5598 * layout.cc (Layout::choose_output_section): Handle script section
5599 types.
5600 (Layout::make_output_section_for_script): Add section type parameter.
5601 Handle script section types.
5602 * layout.h (Layout::make_output_section_for_script): Add section
5603 type parameter.
5604 * output.cc (Output_section::Output_section): Initialize data member
5605 is_noload_.
5606 (Output_section::do_reset_address_and_file_offset): Do not set address
5607 to 0 if section is a NOLOAD section.
5608 * output.h (Output_section::is_noload): New method.
5609 (Output_section::set_is_noload): Ditto.
5610 (Output_section::is_noload_): New data member.
5611 * script-c.h (Script_section_type): New enum type.
5612 (struct Parser_output_section_header): Add new file section_type.
5613 * script-sections.cc (Sections_element::output_section_name): Add
5614 parameter for returning script section type.
5615 (Output_section_definition::output_section_name): Ditto.
5616 (Output_section_definition::section_type)P; New method.
5617 (Output_section_definiton::script_section_type_name): Ditto.
5618 (Output_section_definition::script_section_type_): New data member.
5619 (Output_section_definition::Output_section_definition): Initialize
5620 data member Output_section_definition::script_section_type_.
5621 (Output_section_definition::create_sections): Pass script section type
5622 to Layout::make_output_section_for_script.
5623 (Output_section_definition::output_section_name): Return script
5624 section type to caller.
5625 (Output_section_definition::set_section_address): Do not advance
5626 dot value and load address if section type is NOLOAD. Set address
5627 of NOLOAD sections regardless of section flags.
5628 (Output_section_definition::print): Print section type if it is
5629 not SCRIPT_SECTION_TYPE_NONE.
5630 (Output_section_definition::section_type): New method.
5631 (Output_section_definition::script_section_type_name): Ditto.
5632 (Script_sections::output_section_name): Add new parameter
5633 PSECTION_TYPE for returning script section type. Pass it to
5634 section elements. Handle discard sections.
5635 (Sort_output_sections::operator()): Handle NOLOAD sections.
5636 * script-sections.h (Script_sections::Section_type): New enum type.
2e702c99 5637 (Script_sections::output_section_name): Add a new parameter for
4dbd9faf
DK
5638 returning script section type.
5639 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
5640 INFO and NOLOAD.
5641 * yyscript.y (union): Add new field SECTION_TYPE.
5642 (COPY, DSECT, INFO, NOLOAD): New tokens.
5643 (opt_address_and_section_type): Change type to output_section_header.
5644 (section_type): New non-terminal
5645 (section_header): Handle section type.
2253bfba 5646 (opt_address_and_section_type): Return section type value.
4dbd9faf 5647
721ea635
L
56482010-04-09 H.J. Lu <hongjiu.lu@intel.com>
5649
5650 * testsuite/plugin_common_test_1.c (foo): Add prototype.
5651 * testsuite/plugin_common_test_2.c (foo): Likewise.
5652
6bf924b0
DK
56532010-04-08 Doug Kwan <dougkwan@google.com>
5654
5655 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
5656 Output_merge_data.
5657 * output.cc (Output_section::add_merge_input_section): Simplify
5658 code and return status of Output_merge_base::add_input_section.
e1df38aa 5659 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
5660 returns true.
5661
24af6f92
DK
56622010-04-07 Doug Kwan <dougkwan@google.com>
5663
5664 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
5665 if section is marked as containing instructions but has no mapping
5666 symbols.
5667 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
5668 correct section index.
5669 (Arm_relobj::find_linked_text_section): Ditto.
5670
00698fc5
CC
56712010-04-07 Cary Coutant <ccoutant@google.com>
5672
5673 * archive.cc (include_member): Destroy Read_symbols_data object before
5674 releasing file.
5675 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
5676 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
5677 (Read_symbols_data::~Read_symbols_data) New destructor.
5678 (Section_relocs::Section_relocs) New constructor.
5679 (Section_relocs::~Section_relocs) New destructor.
5680 (Read_relocs_data::Read_relocs_data) New constructor.
5681 (Read_relocs_data::~Read_relocs_data) New destructor.
5682 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
5683 pointers to NULL after deleting.
5684
7296d933
DK
56852010-04-07 Doug Kwan <dougkwan@google.com>
5686
5687 * arm.cc: Replace "endianity" with "endianness" in comments.
5688 (Arm_exidx_cantunwind): Ditto.
5689 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
5690 (Arm_relobj::merge_flags_and_attributes): New method.
5691 (Arm_relobj::merge_flags_and_attributes_): New data member.
5692 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
5693 (Arm_relobj::scan_sections_for_stubs): Ditto.
5694 (Arm_relobj::do_read_symbols): Check to see if we really want to
5695 merge processor-specific flags and attributes. Exit early if
5696 an object is empty except for section names and the undefined symbol.
5697 (Target_arm::do_finalize_sections): Move check for ELF format to
5698 Arm_relobj::do_read_symbols. Merge processor specific flags and
5699 attributes from a regular object only when we have determined that
5700 it is aapropriate. Do not create an .ARM.attributes section in
5701 output if there is no regular input object.
5702 (Target_arm::merge_processor_specific_flags): Check
5703 --warn-mismatch before printing any error.
5704 (Target_arm::merge_object_attributes): Ditto.
5705 * gold.cc (queue_middle_tasks): Handle the case in which there is
5706 no regular object in input.
5707 * options.cc (General_options::parse_EB): New method.
5708 (General_options::parse_EL): Same.
5709 (General_options::General_options): Initialize endianness_.
5710 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
5711 New options.
5712 (General_options::Endianness): New enum.
5713 (General_options::endianness): New method.
5714 (General_options::endianness_): New data member.
5715 * parameters.cc (Parameters::set_options): Check target endianness.
5716 (Parameters::set_target_once): Ditto.
5717 (Parameters::check_target_endianness): New method.
5718 (parameters_force_valid_target): If either -EL or -EB is specified,
5719 use it to define endianness of default target.
5720 * parameters.h (Parameters::check_target_endianness): New method
5721 declaration.
5722 * target.h (class Target): Change "endianity" to "endianness"
5723 in comments.
5724
efc8d4f2
RW
57252010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5726
5727 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
5728 * configure: Regenerate.
5729 * Makefile.in: Regenerate.
5730 * testsuite/Makefile.in: Regenerate.
5731
be234d88
CC
57322010-04-06 Cary Coutant <ccoutant@google.com>
5733
5734 gcc PR lto/42757
5735 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
5736 prevailing definitions of common symbols.
5737 * testsuite/plugin_test_6.sh: New test case.
5738 * testsuite/plugin_common_test_1.c: New test case.
5739 * testsuite/plugin_common_test_2.c: New test case.
5740 * testsuite/Makefile.am (plugin_test_6): New test case.
5741 * testsuite/Makefile.in: Regenerate.
5742
bd32c6bd
NC
57432010-04-06 Nick Clifton <nickc@redhat.com>
5744
5745 * po/vi.po: New Vietnamese translation.
5746
323c532f
DK
57472010-03-30 Doug Kwan <dougkwan@google.com>
5748
5749 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
5750
4fcd97eb
DK
57512010-03-25 Doug Kwan <dougkwan@google.com>
5752
5753 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
5754 to avoid a conversion warning on a 32-bit host.
5755
4ebf39db
ILT
57562010-03-24 Ian Lance Taylor <iant@google.com>
5757
5758 * testsuite/script_test_3.t: Add a TLS segment.
5759 * testsuite/Makefile.am (check_PROGRAMS): Add
5760 tls_phdrs_script_test.
5761 (tls_phdrs_script_test_SOURCES): Define.
5762 (tls_phdrs_script_test_DEPENDENCIES): Define.
5763 (tls_phdrs_script_test_LDFLAGS): Define.
5764 (tls_phdrs_script_test_LDADD): Define.
5765 * testsuite/Makefile.in: Rebuild.
5766
4a599bdd
CC
57672010-03-23 Cary Coutant <ccoutant@google.com>
5768
5769 * fileread.cc (find_or_make_view): Fix comment.
5770
6c93b22c
ILT
57712010-03-23 Ian Lance Taylor <iant@google.com>
5772
5773 * script-sections.cc (class Orphan_section_placement): Define
5774 PLACE_TLS and PLACE_TLS_BSS.
5775 (Orphan_section_placement::Orphan_section_placement): Initialize
5776 new places.
5777 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
5778 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
5779 (tls_script_test_SOURCES): Define.
5780 (tls_script_test_DEPENDENCIES): Define.
5781 (tls_script_test_LDFLAGS): Define.
5782 (tls_script_test_LDADD): Define.
5783 * testsuite/Makefile.in: Rebuild.
5784
a2c7281b
DK
57852010-03-22 Doug Kwan <dougkwan@google.com>
5786
5787 * arm.cc (Arm_relocate_functions::abs8,
5788 Arm_relocate_functions::abs16): Use correct check for overflow
5789 specified in the ARM ELF specs.
5790 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
5791 target of a BLX instruction specially.
5792 (Reloc_stub::stub_type_for_reloc): Ditto.
5793 (Relocate::relocate): Use symbolic names instead of numeric relocation
5794 codes to report error.
5795 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
5796 workaround.
5797 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
5798 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
5799 thumb2_blx_out_of_range.stdout
5800 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
5801 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
5802 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
5803 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
5804 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
5805 thumb2_blx_in_range, thumb2_blx_in_range.o,
5806 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
5807 thumb2_blx_out_of_range.o): New rules.
2e702c99 5808 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
a2c7281b
DK
5809 thumb2_blx_in_range and thumb2_blx_out_of_range.
5810 * testsuite/Makefile.in: Regenerate.
5811 * arm_branch_in_range.sh: Add tests for THUMB BLX.
5812 * testsuite/thumb_blx_in_range.s: New file.
5813 * testsuite/thumb_blx_out_of_range.s: New file.
5814
b0193076
RÁE
58152010-03-22 Rafael Espindola <espindola@google.com>
5816
5817 * archive.cc (Should_include): Move to archive.h.
5818 (should_include_member): Make it a member of Archive.
5819 (Lib_group): New.
5820 (Add_lib_group_symbols): New.
5821 * archive.h: Include options.h.
5822 (Archive_member): Moved from Archive.
5823 (Should_include): Moved from archive.cc.
5824 (Lib_group): New.
5825 (Add_lib_group_symbols): New.
5826 * dynobj.cc (do_should_include_member): New.
5827 * dynobj.h (do_should_include_member): New.
5828 * gold.cc (queue_initial_tasks): Update call to queue.
5829 * main.cc (main): Print lib group stats.
5830 * object.cc (do_should_include_member): New.
5831 * object.h: Include archive.h.
5832 (Object::should_include_member): New.
5833 (Object::do_should_include_member): New.
5834 (Sized_relobj::do_should_include_member): New.
5835 * options.cc (General_options::parse_start_lib): New.
5836 (General_options::parse_end_lib): New.
5837 (Input_arguments::add_file): Handle lib groups.
5838 (Input_arguments::start_group): Check we are not in a lib.
5839 (Input_arguments::start_lib): New.
5840 (Input_arguments::end_lib): New.
5841 * options.h (General_options): Add start_lib and end_lib.
5842 (Input_argument::lib_): New.
5843 (Input_argument::lib): New.
5844 (Input_argument::is_lib): New.
5845 (Input_file_lib): New.
5846 (Input_arguments::in_lib_): New.
5847 (Input_arguments::in_lib): New.
5848 (Input_arguments::start_lib): New.
5849 (Input_arguments::end_lib_): New.
5850 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
5851 in unused members as preempted.
5852 (Sized_pluginobj::do_should_include_member): New.
5853 * plugin.h (Sized_pluginobj::do_should_include_member): New.
5854 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
5855 return the blocker.
5856 (Read_symbols::do_whole_lib_group): New.
5857 (Read_symbols::do_lib_group): New.
5858 (Read_symbols::do_read_symbols): Handle lib groups.
5859 (Read_symbols::get_name): Handle lib groups.
5860 * readsyms.h (Read_symbols): Add an archive member pointer.
5861 (Read_symbols::do_whole_lib_group): New.
5862 (Read_symbols::do_lib_group): New.
5863 (Read_symbols::member_): New.
5864 * script.cc (read_input_script): Update call to queue_soon.
5865
d099120c
DK
58662010-03-19 Doug Kwan <dougkwan@google.com>
5867
5868 * arm.cc (Stub_table::Stub_table): Initialize new data members
5869 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
5870 (Stub_table::add_reloc_stub): Assign stub offset and update
5871 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
5872 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
5873 New data members.
2e702c99 5874 (Stub_table::update_data_size_and_addralign): Use
d099120c
DK
5875 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
5876 instead of going over all reloc stubs.
2e702c99 5877 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
d099120c
DK
5878 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
5879 Stringpool_template::offset_ to size of Stringpool_char.
2e702c99 5880 (Stringpool_template::new_key_offset): Remove code to initialize
d099120c
DK
5881 Stringpool_template::offset_.
5882 * stringpool.h (Stringpool_template::set_no_zero_null): Set
5883 Stringpool_template::offset_ to zero.
5884
1aa37384
DK
58852010-03-15 Doug Kwan <dougkwan@google.com>
5886
5887 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
5888 offset_.
5889 (Stringpool_template::new_key_offset): New method.
5890 (Stringpool_template::add_string): Assign offsets when adding new
5891 strings.
5892 (Stringpool_template::set_string_offsets): Do not set string offsets
5893 when not optimizing.
5894 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
5895 member size_.
2e702c99
RM
5896 (Chunked_vector::clear): Clear size_.
5897 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
5898 (Chunked_vector::size): Return size_.
5899 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 5900 (Chunked_vector::size_): New data member.
1aa37384
DK
5901 (Stringpool_template::set_no_zero_null): Assert string set is empty.
5902 (Stringpool_template::new_key_offset): New method declaration.
5903 (Stringpool_template::offset_): New data member.
5904
b672b057
RÁE
59052010-03-15 Rafael Espindola <espindola@google.com>
5906
5907 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
5908 Add_symbols' constructor.
5909 * readsyms.h (Add_symbols): Remove the input_group member.
5910
b6848d3c
ILT
59112010-03-10 Ian Lance Taylor <iant@google.com>
5912
5913 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
5914 target to ask whether a reference to a symbol requires a stack
5915 split.
5916 * target.h (Target::is_call_to_non_split): New function.
5917 (Target::do_is_call_to_non_split): Declare virtual function.
5918 * target.cc: Include "symtab.h".
5919 (Target::do_is_call_to_non_split): New function.
5920 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
5921
a2a5469e
CC
59222010-03-10 Cary Coutant <ccoutant@google.com>
5923
5924 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
5925 (File_read::open[1]): Remove initial mapping of whole_file_view_.
5926 (File_read::open[2]): Add whole_file_view_ to list of views.
5927 (File_read::make_view): Remove test of whole_file_view_.
5928 (File_read::find_or_make_view): Create whole_file_view_ if
5929 necessary.
5930 (File_read::clear_views): Replace bool parameter with enum;
5931 adjust all callers. Don't delete views with permanent data;
5932 do delete cached views and views from archives if
5933 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
5934 if clearing the corresponding view.
5935 * fileread.h (File_read::Clear_views_mode): New enum.
5936 (File_read::View::is_permanent_view): New method.
5937 (File_read::clear_views): Replace bool parameter
5938 with enum; adjust all callers.
5939 * options.h (General_options): Change keep_files_mapped option;
5940 add map_whole_files.
5941 * readsyms.cc (Add_symbols::run): Delete sd_ object before
5942 releasing the file.
5943 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
5944 the file.
5945
8861f32b
DM
59462010-03-10 David S. Miller <davem@davemloft.net>
5947
5948 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
5949
d62d0f5f
ST
59502010-03-09 Sriraman Tallam <tmsriram@google.com>
5951
5952 * icf.cc (get_section_contents): Add '@' marker after processing the
5953 merge reloc.
5954
9177756d
DK
59552010-03-08 Doug Kwan <dougkwan@google.com>
5956
5957 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
5958 due to a conversion warning.
5959 (Arm_relobj::update_output_local_symbol_count): Check for local
5960 symbol with unset output index.
5961
9e9e071b
ILT
59622010-03-05 Ian Lance Taylor <iant@google.com>
5963
5964 * options.h (class General_options): Add --spare-dynamic-tags.
5965 * output.cc (Output_data_dynamic::set_final_data_size): Implement
5966 --spare-dynamic-tags.
5967
a81ee015
ILT
59682010-03-05 Ian Lance Taylor <iant@google.com>
5969
5970 * incremental.cc: Include "libiberty.h".
5971
44ec90b9
RO
59722010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
5973
5974 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
5975 function, is_info_ member.
5976 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
5977 (Versions::Versions): Update caller.
5978 (Versions::define_base_version): Likewise.
5979 (Versions::add_def): Likewise.
5980
0897ed3b
ST
59812010-03-03 Sriraman Tallam <tmsriram@google.com>
5982
5983 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
5984 (Scan::possible_function_pointer_reloc): New function.
5985 (Scan::local_reloc_may_be_function_pointer): Change to call
5986 possible_function_pointer_reloc.
5987 (Scan::global_reloc_may_be_function_pointer): Ditto.
5988 * icf.h (Icf::check_section_for_function_pointers): Change to reject
5989 relocations in ".data.rel.ro._ZTV" section.
5990 * testsuite/icf_safe_so_test.sh: Change to pass i386.
5991 * testsuite/icf_safe_so_test.cc: Ditto.
5992 * testsuite/icf_safe_test.cc: Ditto.
5993 * testsuite/icf_safe_test.sh: Ditto.
5994
d3bbad62
ILT
59952010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5996 Ian Lance Taylor <iant@google.com>
5997
5998 * target-reloc.h (relocate_section): Check the symbol table index
5999 for -1U before setting the local symbol index.
6000 (scan_relocatable_relocs): If copying the relocation, record that
6001 the local symbol is required.
6002 * object.h (Symbol_value::is_output_symtab_index_set): New
6003 function.
6004 (Symbol_value::may_be_discarded_from_output_symtab): New
6005 function.
6006 (Symbol_value::has_output_symtab_entry): New function.
6007 (Symbol_value::needs_output_symtab_entry): Remove.
6008 (Symbol_value::output_symtab_index): Make sure the symbol index is
6009 set.
6010 (Symbol_value::set_output_symtab_index): Make sure the symbol
6011 index is not set. Make sure the new index is valid.
6012 (Symbol_value::set_must_have_output_symtab_entry): New function.
6013 (Symbol_value::has_output_dynsym_entry): New function.
6014 (Symbol_value::set_output_dynsym_index): Make sure the new index
6015 is valid.
6016 (Sized_relobj::set_must_have_output_symtab_entry): New function.
6017 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
6018 local symbol if permitted.
6019 (Sized_relobj::do_finalize_local_symbols): Call
6020 is_output_symtab_index_set rather than needs_output_symtab_entry.
6021 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
6022 rather than needs_output_symtab_entry. Call
6023 has_output_dynsym_entry rather than needs_output_dynsym_entry.
6024 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
6025 is_output_symtab_index_set rather than needs_output_symtab_entry.
6026 * testsuite/discard_locals_relocatable_test.c: New file.
6027 * testsuite/discard_locals_test.sh: Test -r.
6028 * testsuite/Makefile.am (check_DATA): Add
6029 discard_locals_relocatable_test1.syms,
6030 discard_local_relocatable_test2.syms.
6031 (MOSTLYCLEANFILES): Likewise. Also add
6032 discard_locals_relocatable_test1.lout and
6033 discard_locals_relocatable_test2.out.
6034 (discard_locals_relocatable_test1.syms): New target.
6035 (discard_locals_relocatable_test.o): New target.
6036 (discard_locals_relocatable_test1.out): New target.
6037 (discard_locals_relocatable_test2.syms): New target.
6038 (discard_locals_relocatable_test2.out): New target.
6039 (various): Add missing ../ld-new dependencies.
6040 * testsuite/Makefile.in: Rebuild.
6041
7e8ccf26
NC
60422010-03-03 Nick Clifton <nickc@redhat.com>
6043
6044 * po/fi.po: New Finnish translation.
6045
2a0ff005
DK
60462010-03-01 Doug Kwan <dougkwan@google.com>
6047
6048 * layout.cc (Layout::Layout): Force section types of .init_array*,
6049 .preinit_array* and .fini_array* sections.
6050 * output.cc (Output_section::Input_section_sort_entry::has_priority):
6051 Fix check of return value of std::string::find.().
6052 (Output_section::Input_section_sort_compare::operator()): Remove
6053 comment about .init_array.
6054 (Output_section::Input_section_sort_init_fini_compare::operator()):
6055 New method.
6056 (Output_section::sort_attached_input_sections): Handle .init_array
6057 and .fini_array specially.
6058 * output.h (Output_section::Inut_section_sort_compare): Update
6059 comment.
6060 (Output_section::Input_section_sort_init_fini_compare): New struct.
6061
c3e4ae29
DK
60622010-02-26 Doug Kwan <dougkwan@google.com>
6063
6064 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
6065 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
6066 * testsuite/debug_msg.sh: Avoid matching source line number for
6067 use of global variable undef_int.
6068
2fd9ae7a
DK
60692010-02-26 Doug Kwan <dougkwan@google.com>
6070
6071 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
6072 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
6073 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
6074 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
6075 * options.cc (General_options::General_options): Initialize member
6076 fix_v4bx_.
6077 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
6078 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
6079 and rm_no_fix_v4bx.stdout
6080 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
6081 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
6082 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
6083 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
6084 and arm_no_fix_v4bx.
6085 * Makefile.in: Regenerate.
6086 * testsuite/arm_fix_v4bx.s: New file.
6087 * testsuite/arm_fix_v4bx.sh: Ditto.
6088
67ec7d0b
DK
60892010-02-24 Doug Kwan <dougkwan@google.com>
6090
6091 * arm.cc (Target_arm::got_section): Make the .got section the first
6092 non RELRO section in the data segment.
6093 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
6094 suffixes of section names.
6095
10165461
DK
60962010-02-24 Doug Kwan <dougkwan@google.com>
6097
6098 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
6099 flags and attributes merging if an input file is a binary file.
6100 * fileread.cc (Input_file::open): Record format of original file.
6101 * fileread.h (Input_file::Format): New enum type.
2e702c99 6102 (Input_file::Input_file): Initialize data member format_.
10165461
DK
6103 (Input_file::format): New method definition.
6104 (Input_file::format_):: New data member.
6105
4a54abbb
DK
61062010-02-24 Doug Kwan <dougkwan@google.com>
6107
6108 * arm.cc (Arm_output_data_got): New class.
6109 (ARM_TCB_SIZE): New constant
6110 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
6111 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
6112 If user uses a script with a SECTIONS clause, issue only a warning
6113 for a misplaced EXIDX input section. Otherwise, issue an error.
2e702c99 6114 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4a54abbb
DK
6115 garbage collection.
6116 (Target_arm::got_mode_index_entry): Handle static linking.
6117 (Target_arm::Scan::local): Ditto.
6118 (Target_arm::Scan::global): Ditto.
6119 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
6120 all incorrectly implemented relocations.
e1df38aa 6121 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
6122 Arm_output_section::fix_exidx_coverage.
6123 * layout.cc (Layout::section_name_mapping): Remove trailing dots
6124 from ".ARM.exidx." and ".ARM.extab.".
6125
ca419a6f
ILT
61262010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6127
6128 * arm.cc (Target_arm::do_finalize_sections): Create attribute
6129 section if it does not already exist.
6130 * attributes.cc (Attributes_section_data::Attributes_section_data):
6131 Don't crash if size is zero.
6132
135b9c78
ILT
61332010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6134 Ian Lance Taylor <iant@google.com>
6135
6136 * gold.cc (queue_middle_tasks): If no input files were opened,
6137 exit.
6138 * workqueue.h (Task_function::Task_function): Assert that there is
6139 a blocker.
6140
bb0bfe4f
DK
61412010-02-22 Doug Kwan <dougkwan@google.com>
6142
6143 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
6144 * icf.cc (get_section_contents): Cast snprintf arguments to long long
6145 types to avoid warnings due to different uint64_t implementations
6146 on different hosts.
6147
2a2b6d42
DK
61482010-02-21 Doug Kwan <dougkwan@google.com>
6149
6150 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
6151 handling of the maximum backward branch offset.
2e702c99 6152 (Arm_relocate_functions::thumb_branch_common): Ditto.
2a2b6d42
DK
6153 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
6154 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 6155 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
6156 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
6157 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
6158 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
6159 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
6160 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
6161 thumb_bl_out_of_range thumb_bl_out_of_range.o,
6162 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
6163 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
6164 thumb2_bl_out_of_range.o): New rules.
6165 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
6166 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
6167 thumb2_bl_out_of_range
6168 * testsuite/Makefile.in: Regenerate.
6169 * testsuite/arm_bl_in_range.s: New file.
6170 * testsuite/arm_bl_out_of_range.s: Ditto.
6171 * testsuite/arm_branch_in_range.sh: Ditto.
6172 * testsuite/arm_branch_range.t: Ditto.
6173 * testsuite/thumb2_branch_range.t: Ditto.
6174 * testsuite/thumb_bl_in_range.s: Ditto.
6175 * testsuite/thumb_bl_out_of_range.s: Ditto.
6176 * testsuite/thumb_branch_range.t: Ditto.
6177
b487ad64
ST
61782010-02-20 Sriraman Tallam <tmsriram@google.com>
6179
6180 * gc.h (gc_process_relocs): Change vectors to point to the new list.
6181 Add reloc offset information.
6182 * icf.cc (get_section_contents): Change iterators to point to the new
6183 vectors. Add reloc offset information to the contents.
6184 * icf.h (Icf::Sections_reachable_info): New typedef.
6185 (Icf::Sections_reachable_list): New typedef.
6186 (Icf::Offset_info): New typedef.
6187 (Icf::Reloc_info): New struct typedef.
6188 (Icf::Reloc_info_list): New typedef.
6189 (Icf::symbol_reloc_list): Delete method.
6190 (Icf::addend_reloc_list): Delete method.
6191 (Icf::section_reloc_list): Delete method.
6192 (Icf::reloc_info_list): New method.
6193 (Icf::reloc_info_list_): New member.
6194
f96accdf
DK
61952010-02-19 Doug Kwan <dougkwan@google.com>
6196
6197 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
6198 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
6199 * arm.cc (Arm_relocation_functions): New forward declaration.
6200 (Target_arm::Target_arm): Initialize new data members
6201 got_mod_index_offset_ and tls_base_symbol_defined_.
6202 (Target_arm::Relocate::relocate_tls): New method.
6203 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
6204 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
6205 New methods.
2e702c99 6206 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
f96accdf
DK
6207 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
6208 (Target_arm::got_mod_index_offset_,
6209 Target_arm::tls_base_symbol_defined_): New data members.
6210 (Target_arm::Scan::local, Target::Scan::global,
6211 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
6212 relocations.
6213
c8761b9a
DK
62142010-02-18 Doug Kwan <dougkwan@google.com>
6215
6216 * arm.cc (Arm_relobj::find_linked_text_section): New method.
6217 (Arm_relobj::make_exidx_input_section): Pass section index of linked
6218 text section as a parameter becuase some broken tools may not set
6219 the link in section header.
6220 (Target_arm::has_got_section): New method.
6221 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
6222 without any mapping symbol as data only. Remove warning.
6223 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
6224 link in its section header, try to discover the link by inspecting the
6225 REL31 relocation at the beginning of the section.
6226 (Target_arm::Scan::check_non_pic): Report name of offending relocation
6227 in error message.
6228 (Target_arm::Scan::global): Treat any reference to the symbol
6229 _GLOBAL_OFFSET_TABLE_ as a GOT access.
6230
21bb3914
ST
62312010-02-12 Sriraman Tallam <tmsriram@google.com>
6232
6233 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
6234 (Scan::global_reloc_may_be_function_pointer): New function.
6235 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6236 (Scan::global_reloc_may_be_function_pointer): New function.
6237 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
6238 (Scan::global_reloc_may_be_function_pointer): New function.
6239 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
6240 (Scan::global_reloc_may_be_function_pointer): New function.
6241 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
6242 (Scan::global_reloc_may_be_function_pointer): New function.
6243 (Scan::possible_function_pointer_reloc): New function.
6244 (Target_x86_64::can_check_for_function_pointers): New function.
6245 * gc.h (gc_process_relocs): Scan relocation types to determine if
6246 function pointers were taken for targets that support it.
6247 * icf.cc (Icf::find_identical_sections): Include functions for
6248 folding in safe ICF whose pointer is not taken.
6249 * icf.h (Secn_fptr_taken_set): New typedef.
6250 (fptr_section_id_): New member.
6251 (section_has_function_pointers): New function.
6252 (set_section_has_function_pointers): New function.
6253 (check_section_for_function_pointers): New function.
6254 * options.h: Fix comment for safe ICF option.
6255 * target.h (can_check_for_function_pointers): New function.
6256 * testsuite/Makefile.am: Add icf_safe_so_test test case.
6257 Modify icf_safe_test for X86-64.
6258 * testsuite/Makefile.in: Regenerate.
6259 * testsuite/icf_safe_so_test.cc: New file.
6260 * testsuite/icf_safe_so_test.sh: New file.
6261 * testsuite/icf_safe_test.cc (kept_func_3): New function.
6262 (main): Change to take pointer to function kept_func_3.
6263 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
6264 folding is done correctly for X86-64.
6265
0da6fa6c
DM
62662010-02-12 David S. Miller <davem@davemloft.net>
6267
6268 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
6269 is_symbolless parameter.
6270 (Output_reloc<SHT_REL>::is_symbolless): New.
6271 (Output_reloc<SHT_REL>::is_symbolless_): New.
6272 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
6273 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
6274 (Output_reloc<SHT_RELA>::is_symbolless): New.
6275 (Output_data_reloc::add_global): Handle is_symbolless.
6276 (Output_data_reloc::add_global_relative): Likewise.
6277 (Output_data_reloc::add_local): Likewise.
6278 (Output_data_reloc::add_local_relative): Likewise.
6279 (Output_data_reloc::add_symbolless_global_addend): New.
6280 (Output_data_reloc::add_symbolless_local_addend): New.
6281 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
6282 is_symbolless.
6283 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
6284 instead of ->is_relative_
6285 (Output_reloc::write): Likewise.
6286 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
6287 (Output_reloc::write_rel): Simplify.
6288
6289 * sparc.cc (Target_sparc::Scan::local): Use
6290 ->add_symbolless_local_addend as needed.
6291 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
6292 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
6293 based upon relocation offset.
6294
e4782e83
DK
62952010-02-11 Doug Kwan <dougkwan@google.com>
6296
6297 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
6298 (Target_arm::Scan::global): Ditto. Also remove a comment before the
6299 beginning of function.
6300 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
6301 and MOVT_ABS relocations. Those are non issued in scanning. Fix
6302 parameter is_32bit in calls to should_apply_static_reloc.
6303 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
6304 (check_DATA): Add arm_abs_global.stdout.
6305 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
6306 arm_abs_global.stdout): New rules.
6307 (MOSTLLYCLEANFILES): Add arm_abs_global
6308 * Makefile.in: Regenerate.
6309 * testsuite/arm_abs_global.s: New file.
6310 * testsuite/arm_abs_global.sh: Ditto.
6311 * testsuite/arm_abs_lib.s: Ditto.
6312
93ceb764
ILT
63132010-02-11 Ian Lance Taylor <iant@google.com>
6314
6315 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
6316 Read_relocs task.
6317 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
6318 Allocate_commons_task first.
6319 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
6320 task, rather than symtab_lock_.
6321 (Gc_process_relocs::~Gc_process_relocs): New function.
6322 (Gc_process_relocs::is_runnable): Check this_blocker_.
6323 (Gc_process_relocs::locks): Use next_blocker_ rather than
6324 blocker_.
6325 (Scan_relocs::~Scan_relocs): New function.
6326 (Scan_relocs::is_runnable): Check this_blocker_ rather than
6327 symtab_lock_.
6328 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
6329 next_blocker_.
6330 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
6331 fields. Add this_blocker_ and next_blocker_ fields. Adjust
6332 constructor accordingly.
6333 (class Gc_process_relocs): Likewise.
6334 (class Scan_relocs): Likewise.
6335 * common.h (class Allocate_commons_task): Remove symtab_lock_
6336 field, and corresponding constructor parameter.
6337 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
6338 symtab_lock_.
6339 (Allocate_commons_task::locks): Likewise.
6340
114dfbe1
ILT
63412010-02-11 Ian Lance Taylor <iant@google.com>
6342
6343 * gold-threads.h (class Once): Define.
6344 (class Initialize_lock): Rewrite as child of Once.
6345 * gold-threads.cc (class Once_initialize): Define.
6346 (once_pointer_control): New static variable.
6347 (once_pointer, once_arg): New static variables.
6348 (c_run_once): New static function.
6349 (Once::Once, Once::run_once, Once::internal_run): New functions.
6350 (class Initialize_lock_once): Remove.
6351 (initialize_lock_control): Remove.
6352 (initialize_lock_pointer): Remove.
6353 (initialize_lock_once): Remove.
6354 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
6355 (Initialize_lock::initialize): Rewrite.
6356 (Initialize_lock::do_run_once): New function.
6357 * archive.cc (Archive::interpret_header): Only clear name if it is
6358 not already empty.
6359 * fileread.cc: Include "gold-threads.h"
6360 (file_counts_lock): New static variable.
6361 (file_counts_initialize_lock): Likewise.
6362 (File_read::release): Only increment counts when using --stats.
6363 Use a lock around the increment.
6364 * parameters.cc (class Set_parameters_target_once): Define.
6365 (set_parameters_target_once): New static variable.
6366 (Parameters::Parameters): Move here from parameters.h.
6367 (Parameters::set_target): Rewrite.
6368 (Parameters::set_target_once): New function.
6369 (Parameters::clear_target): Move here and rewrite.
6370 * parameters.h (class Parameters): Update declarations. Add
6371 set_parameters_target_once_ field.
6372 (Parameters::Parameters): Move to parameters.cc.
6373 (Parameters::clear_target): Likewise.
6374 * readsyms.cc (Read_symbols::do_group): Create a Start_group
6375 task.
6376 (Start_group::~Start_group): New function.
6377 (Start_group::is_runnable): New function.
6378 (Start_group::locks, Start_group::run): New functions.
6379 (Finish_group::run): Change saw_undefined to size_t.
6380 * readsyms.h (class Start_group): Define.
6381 (class Finish_group): Change saw_undefined_ field to size_t.
6382 (Finish_group::Finish_group): Remove saw_undefined and
6383 this_blocker parameters. Change all callers.
6384 (Finish_group::set_saw_undefined): New function.
6385 (Finish_group::set_blocker): New function.
6386 * symtab.h (class Symbol_table): Change saw_undefined to return
6387 size_t. Change saw_undefined_ field to size_t.
6388 * target-select.cc (Set_target_once::do_run_once): New function.
6389 (Target_selector::Target_selector): Initialize set_target_once_
6390 field. Don't initialize lock_ and initialize_lock_ fields.
6391 (Target_selector::instantiate_target): Rewrite.
6392 (Target_selector::set_target): New function.
6393 * target-select.h (class Set_target_once): Define.
6394 (class Target_selector): Update declarations. Make
6395 Set_target_once a friend. Remove lock_ and initialize_lock_
6396 fields. Add set_target_once_ field.
6397
fa17a3f4
ILT
63982010-02-10 Ian Lance Taylor <iant@google.com>
6399
6400 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
6401 queueing any tasks.
6402 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
6403 (queue_middle_tasks): Add all blockers before queueing any tasks.
6404 (queue_final_tasks): Likewise.
6405 * token.h (Task_token::add_blockers): New function.
6406 * object.h (Input_objects::number_of_relobjs): New function.
6407
c7177d31
ILT
64082010-02-10 Ian Lance Taylor <iant@google.com>
6409
5de0e392
ILT
6410 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
6411 shared, not if not position independent.
6412 * x86_64.cc (Relocate::relocate_tls): Likewise.
6413 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
6414 (tls_pie_pic_test): New target.
6415 * testsuite/Makefile.in: Rebuild.
6416
c7177d31
ILT
6417 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
6418 (tls_test_main_pie.o, tls_test_pie.o): New targets.
6419 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
6420 * testsuite/Makefile.in: Rebuild.
6421
684b268a
DM
64222010-02-09 David S. Miller <davem@davemloft.net>
6423
6424 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
6425 R_SPARC_RELATIVE using ->add_local_relative().
6426 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
6427
612a8d3d
DM
6428 * output.h (Output_data_dynamic::add_section_size): New method
6429 that takes two Output_data objects.
6430 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
6431 entry param. Handle it in initializers.
6432 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
6433 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
6434 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
6435 arg.
6436 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
6437 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
6438 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
6439 for dynrel_includes_plt.
6440 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6441 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6442 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
6443 before .rela.plt
6444 (Target_sparc::do_finalize_sections): Update to pass true for
6445 dynrel_includes_plt.
6446 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
6447 output before .rela.plt
6448 (Target_powerpc::do_finalize_sections): Update to pass true for
6449 dynrel_includes_plt when 32-bit.
6450
cb1be87e
DK
64512010-02-08 Doug Kwan <dougkwan@google.com>
6452
6453 * arm.cc (Arm_relobj::simple_input_section_output_address): New
6454 method.
6455 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
6456 Arm_relobj::scan_section_for_cortex_a8_stubs,
6457 Arm_relobj::do_relocation_section): Instead of calling
6458 Output_section::output_address, use faster
6459 Arm_relobj::simple_input_section_output_address.
6460
705b5121
DM
64612010-02-08 David S. Miller <davem@davemloft.net>
6462
6463 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
6464 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
6465 relocation helper function.
6466
024c4466
DM
6467 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
6468 just like R_SPARC_GOT{10,13,22}.
6469 (Target_sparc::Scan::local): Likewise.
6470 (Target_sparc::Relocate:relocate): Likewise.
6471
9109c078
ILT
64722010-02-06 Ian Lance Taylor <iant@google.com>
6473
6474 * configure.ac: Rewrite targetobjs duplicate removal code to use
6475 only shell constructs.
6476 * configure: Rebuild.
6477
cf846138
DK
64782010-02-05 Doug Kwan <dougkwan@google.com>
6479
6480 PR 11247
6481 * arm.cc (Arm_relobj::section_is_scannable): New method.
6482 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
6483 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
6484
6cfaf60b
DK
64852010-02-04 Doug Kwan <dougkwan@google.com>
6486
6487 PR 11247
6488 * arm-reloc-property.cc (cstdio): Include.
6489 * configure.ac (targetobjs): Remove duplicates.
6490 * configure: Regenerate.
6491 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
6492 big and little endian version for a given address size.
6493
5c57f1be
DK
64942010-02-03 Doug Kwan <dougkwan@google.com>
6495
6496 * arm-reloc-property.cc
6497 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6498 definition.
6499 * arm-reloc-property.h
6500 (Arm_reloc_property_table::get_implemented_static_reloc_property):
6501 New method definition.
6502 (Arm_reloc_property_table::reloc_name_in_error_message): New method
6503 declaration.
6504 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
6505 overflow to N.
6506 (GOT_PREL): Change implemented to Y.
6507 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
6508 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
6509 (Arm_relocate_functions::movw_abs_nc): Remove method.
6510 (Arm_relocate_functions::movt_abs): Ditto.
6511 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
6512 (Arm_relocate_functions::thm_movt_abs): Ditto.
6513 (Arm_relocate_functions::movw_rel_nc): Ditto.
6514 (Arm_relocate_functions::movw_rel): Ditto.
6515 (Arm_relocate_functions::movt_rel): Ditto.
6516 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
6517 (Arm_relocate_functions:thm_movw_rel): Ditto.
6518 (Arm_relocate_functions:thm_movt_rel): Ditto.
6519 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
6520 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
6521 New method definitions.
6522 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
6523 (Arm_relocation_functions::arm_grp_ldr): Ditto.
6524 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
6525 (Arm_relocation_functions::arm_grp_ldc): Ditto.
6526 (Target_arm::Relocate::relocate): Check for non-static or
6527 unimplemented relocation code and exit early. Change calls to
6528 Target_arm::reloc_uses_thumb_bit and
6529 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
6530 instead. Refactor code to handle similar relocations to increase
6531 code sharing. Remove check for unsupported relocation code in switch
6532 statement.
6533 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
6534 relocation property table to find out size. Change error message to
6535 print out the name of a relocation code instead of the numeric value.
6536 (Target_arm::scan_reloc_for_stub): Use relocation property table
6537 instead of calling Target_arm::reloc_uses_thumb_bit().
6538
218c5831
DK
65392010-02-02 Doug Kwan <dougkwan@google.com>
6540
6541 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
6542 types of relaxed input section.
6543
0d31c79d
DK
65442010-02-02 Doug Kwan <dougkwan@google.com>
6545
6546 * Makefile.am (HFILES): Add arm-reloc-property.h.
6547 (DEFFILES): New.
2e702c99
RM
6548 (TARGETSOURCES): Add arm-reloc-property.cc
6549 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
0d31c79d
DK
6550 (libgold_a_SOURCES): $(DEFFILES)
6551 * Makefile.in: Regenerate.
6552 * arm-reloc-property.cc: New file.
6553 * arm-reloc-property.h: New file.
6554 * arm-reloc.def: New file.
6555 * arm.cc: Update comments.
6556 (arm-reloc-property.h): New included header.
6557 (arm_reloc_property_table): New global variable.
6558 (Target_arm::do_select_as_default_target): New method definition.
6559 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
6560 arm-reloc-property to targ_extra_obj.
6561 * parameters.cc (set_parameters_target): Call
6562 Target::select_as_default_target().
6563 * target.h (Target::select_as_default_target): New method definition.
6564 (Target::do_select_as_default_target): Same.
6565
546c7457
DK
65662010-02-01 Doug Kwan <dougkwan@google.com>
6567
6568 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
6569 first_output_text_section_.
6570 (Arm_exidx_fixup::first_output_text_section): New method definition.
6571 (Arm_exidx_fixup::first_output_text_section_): New data member.
6572 (Arm_exidx_fixup::process_exidx_section): Record the first text
6573 output section seen.
6574 (Arm_output_section::fix_exidx_coverage): Set correct linked section
6575 and entsize in output section header.
6576
11b861d5
DK
65772010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6578
6579 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
6580 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
6581 (Arm_relocate_functions::thm_alu11): New Method.
6582 (Arm_relocate_functions::thm_pc8): New Method.
6583 (Arm_relocate_functions::thm_pc12): New Method.
6584 (Target_arm::Scan::local): Handle the relocations.
6585 (Target_arm::Scan::global): Likewise.
6586 (Target_arm::Relocate::relocate): Likewise.
6587 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6588
c9a2c125
DK
65892010-01-29 Doug Kwan <dougkwan@google.com>
6590
6591 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
6592 of relocation types as ld.
6593
1521477a
DK
65942010-01-29 Doug Kwan <dougkwan@google.com>
6595
6596 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
6597 to public.
6598 (Arm_relocate_functions::thumb_branch_common): Ditto.
6599 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
6600 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
6601 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
6602 Arm_relocate_functions::jump24): Remove.
6603 (Target_arm::Relocate::relocate): Adjust code to call
6604 Arm_relocation_functions::arm_branch_common and
6605 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 6606 wrappers. Merge switch-cases together to reduce source code size.
1521477a 6607
e7eca48c
DK
66082010-01-29 Doug Kwan <dougkwan@google.com>
6609
6610 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
6611 output_local_symbol_count_needs_update_.
6612 (Arm_relobj::output_local_symbol_count_needs_update,
6613 Arm_relobj::set_output_local_symbol_count_needs_update,
6614 Arm_relobj::update_output_local_symbol_count): New methods.
6615 (Arm_relobj::output_local_symbol_count_needs_update_): New data
6616 member.
6617 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
6618 of pointed function as in a R_ARM_PREL31 relocation.
6619 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
6620 for output local symbol count updating.
6621 (Target_arm::do_relax): Update output local symbol counts in objects
6622 if necessary.
6623 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
6624
02961d7e
ILT
66252010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6626
6627 * arm.cc: Added support for the ARM relocations:
6628 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
6629 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
6630 (Arm_relocate_functions::movw_rel_nc): Renamed (was
6631 movw_prel_nc).
6632 (Arm_relocate_functions::movw_rel): New method.
6633 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
6634 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
6635 thm_movw_prel_nc).
6636 (Arm_relocate_functions::thm_movw_rel): New method.
6637 (Arm_relocate_functions::thm_movt_rel): Renamed (was
6638 thm_movt_prel).
6639 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
6640 relocations.
6641 (Target_arm::Scan::global): Likewise.
6642 (Target_arm::Relocate::relocate): Likewise.
6643 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6644 Likewise.
6645
b10d2873
ILT
66462010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6647
6648 * arm.cc: Added support for ARM group relocations.
6649 (Target_arm::reloc_needs_sym_origin): New method.
6650 (Arm_relocate_functions::calc_grp_kn): New method.
6651 (Arm_relocate_functions::calc_grp_residual): New method.
6652 (Arm_relocate_functions::calc_grp_gn): New method.
6653 (Arm_relocate_functions::arm_grp_alu): New Method.
6654 (Arm_relocate_functions::arm_grp_ldr): New Method.
6655 (Arm_relocate_functions::arm_grp_ldrs): New Method.
6656 (Arm_relocate_functions::arm_grp_ldc): New Method.
6657 (Target_arm::Scan::local): Handle the ARM group relocations.
6658 (Target_arm::Scan::global): Likewise.
6659 (Target_arm::Relocate::relocate): Likewise.
6660 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6661 Likewise.
6662
2b328d4e
DK
66632010-01-26 Doug Kwan <dougkwan@google.com>
6664
6665 * arm.cc (set): Include.
6666 (class Arm_exidx_fixup): Change type of last_input_section_ to const
6667 pointer type.
2e702c99 6668 (Arm_output_section::Text_section_list): New type.
2b328d4e
DK
6669 (Arm_output_section::append_text_sections_to_list): New method.
6670 (Arm_output_section::fix_exidx_coverage): Ditto.
6671 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
2e702c99 6672 (Arm_relobj::convert_input_section_to_relaxed_section): Use
2b328d4e
DK
6673 Relobj::set_section_offset() instead of
6674 Sized_relobj::invalidate_section_offset().
2e702c99 6675 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
2b328d4e
DK
6676 parameter for section headers. Ignore relocation sections for
6677 unallocated sections and EXIDX sections.
6678 (Target_arm::fix_exidx_coverage): New method.
6679 (Target_arm::output_section_address_less_than): New type.
6680 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
6681 linked text section instead of the EXIDX section.
6682 (Arm_output_section::create_stub_group): Add an assertion to check
6683 that this is not an EXIDX output section.
6684 (Arm_output_section::append_text_sections_to_list): New method.
6685 (Arm_output_section::fix_exidx_coverage): Ditto.
6686 (Arm_relobj::scan_sections_for_stubs): Adjust call to
2e702c99 6687 Arm_relobj::section_needs_reloc_stub_scanning.
2b328d4e
DK
6688 (Target_arm::do_relax): Fix EXIDX output section coverage in the
6689 first pass.
6690 (Target_arm::fix_exidx_coverage): New method.
6691 * object.h (Relobj::set_output_section): New method.
6692 (Sized_relobj::invalidate_section_offset): Remove method.
6693 (Sized_relobj::do_invalidate_section_offset): Remove method.
6694 (Sized_relobj::do_set_section_offset): Handle offset value -1.
6695
c7f3c371
DK
66962010-01-25 Doug Kwan <dougkwan@google.com>
6697
6698 * arm.cc (Arm_exidx_merged_section::do_output_offset):
6699 Fix warning due to signed and unsigned comparison on a 32-bit host.
6700
8923b24c
DK
67012010-01-22 Doug Kwan <dougkwan@google.com>
6702
6703 * arm.cc (Target_arm::do_relax): Record an output section for section
6704 offset adjustment it contains any stub table that has changed.
6705 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
6706 offsets in an output section if necessary.
6707 * output.cc (Output_section::Output_section): Initialize
6708 section_offsets_need_adjustments_.
6709 (Output_section::add_input_section_for_script): Renamed to
6710 Output_section::add_simple_input_section.
6711 (Output_section::save_states): Add a comment.
6712 (Output_section::discard_states): New method defintion.
6713 (Output_section::adjust_section_offsets): Same.
6714 * output.h (Output_section::add_input_section_for_script): Renamed to
6715 Output_section::add_simple_input_section.
6716 (Output_section::discard_states): New method declaration.
6717 (Output_section::adjust_section_offsets): Same.
6718 (Output_section::section_offsets_need_adjustment,
6719 Output_section::set_section_offsets_need_adjustment): New method
6720 definitions.
6721 (Output_section::section_offsets_need_adjustment_): New data member.
6722 * script-sections.cc
6723 (Output_section_element_input::set_section_address): Adjust code for
6724 renaming of Output_section::add_input_section_for_script.
6725 (Orphan_output_section::set_section_address): Same.
6726
9b2fd367
DK
67272010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6728
6729 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
6730 Fix_v4bx enum values .
6731 * gold/options.h (General_options): New option definitions.
6732 (General_options::fix_v4bx): New method.
6733 (General_options::Fix_v4bx): New enum.
6734 * gold/options.cc (General_options::parse_fix_v4bx): New method.
6735 (General_options::parse_fix_v4bx_interworking): New method.
6736
80d0d023
DK
67372010-01-22 Doug Kwan <dougkwan@google.com>
6738
6739 * arm.cc (Arm_exidx_fixup): New class.
6740
af2cdeae
DK
67412010-01-21 Doug Kwan <dougkwan@google.com>
6742
6743 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
6744 classes.
6745 (Arm_exidx_section_offset_map): New type.
6746
993d07c1
DK
67472010-01-21 Doug Kwan <dougkwan@google.com>
6748
6749 * arm.cc (Arm_exidx_input_section): New class.
6750 (Arm_relobj::exidx_input_section_by_link,
6751 Arm_relobj::exidx_input_section_by_shndx,
6752 Arm_relobj::make_exidx_input_section): New methods.
6753 (read_arm_attributes_section): Remove.
6754 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
6755 information about them.
6756 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
6757 to here.
6758
5ac169d4
DK
67592010-01-20 Doug Kwan <dougkwan@google.com>
6760
6761 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
6762 Input_section_specifier to Section_id.
6763 (Target_arm::new_arm_input_section: Adjust code for change of key
6764 type.
6765 (Target_arm::find_arm_input_section): Ditto.
6766 * gc.h (object.h): Include for Section_id nand Section_id_hash.
6767 (Section_id): Remove.
6768 (Garbage_collection::Section_id_hash): Remove.
6769 * icf.h (object.h): Include for Section_id nand Section_id_hash.
6770 (Section_id): Remove.
6771 (Icf::Section_id_hash): Remove.
6772 * object.h (Section_id, Const_section_id, Section_id_hash,
6773 Const_section_id_hash): New type definitions.
6774 * output.cc (Output_section::add_relaxed_input_section): Change to
6775 use Const_section_id instead of Input_section_specifier as key type.
6776 (Output_section::add_merge_input_section): Ditto.
6777 (Output_section::build_relaxation_map): Change to use Section_id
6778 instead of Input_section_specifier as key type.
2e702c99 6779 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5ac169d4
DK
6780 Ditto.
6781 (Output_section::convert_input_sections_to_relaxed_sections): Change
6782 to use Const_section_id instead of Input_section_specifier as key type.
2e702c99 6783 (Output_section::find_merge_section): Ditto.
5ac169d4
DK
6784 (Output_section::find_relaxed_input_section): Ditto.
6785 * output.h (Input_section_specifier): Remove class.
6786 (Output_section::Output_section_data_by_input_section_map): Change
6787 key type to Const_section_id.
6788 (Output_section::Output_relaxed_input_section_by_input_section_map):
6789 Ditto.
6790 (Output_section::Relaxation_map): Change key type to Section_id.
6791
a2162063
ILT
67922010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6793
6794 * gold/arm.cc: Added support for R_ARM_V4BX relocation
6795 (class Arm_v4bx_stub): New class.
6796 (DEF_STUBS): Updated definition to support v4_veneer_bx.
6797 (Stub_factory::make_arm_v4bx_stub): New method.
6798 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
6799 (Stub_table::empty): Handle v4bx stubs.
6800 (Stub_table::add_arm_v4bx_stub): New method.
6801 (Stub_table::find_arm_v4bx_stub): New method.
6802 (Arm_relocate_functions::v4bx): New method.
6803 (Target_arm::fix_v4bx): New method.
6804 (Target_arm::Target_arm): Handle R_ARM_V4BX.
6805 (Stub_table::relocate_stubs): Likewise.
6806 (Stub_table::do_write): Likewise.
6807 (Stub_table::update_data_size_and_addralign): Likewise.
6808 (Stub_table::finalize_stubs): Likewise.
6809 (Target_arm::Scan::local): Likewise.
6810 (Target_arm::Scan::global): Likewise.
6811 (Target_arm::do_finalize_sections): Likewise.
6812 (Target_arm::Relocate::relocate): Likewise.
6813 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6814 Likewise.
6815 (Target_arm::scan_reloc_for_stub): Likewise.
6816 (Target_arm::scan_reloc_section_for_stubs): Likewise.
6817
5696ab0b
ILT
68182010-01-19 Ian Lance Taylor <iant@google.com>
6819
6820 * output.cc (Output_section_headers::do_sized_write): Write large
6821 segment count to sh_info field.
6822 (Output_file_header::do_sized_write): For large segment count,
6823 write PN_XNUM to e_phnum field.
6824
800d0f56
ILT
68252010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6826
6827 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
6828 (Arm_relocate_functions::thm_jump8): New function.
6829 (Arm_relocate_functions::thm_jump11): New function.
6830 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
6831 R_ARM_THM_JUMP11.
6832 (Target_arm::Scan::global): Likewise.
6833 (Target_arm::Relocate::relocate): Likewise.
6834 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6835 Likewise.
6836
41263c05
DK
68372010-01-14 Doug Kwan <dougkwan@google.com>
6838
6839 * arm.cc (map, utility): Include headers.
6840 (Target_arm::apply_cortex_a8_workaround): New method.
6841 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
6842 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
6843 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
6844 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
6845 the --[no-]fix-cortex-a8 command line options.
6846 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
6847 (Target_arm::relocate_stub): Use addend in instruction template.
6848 * options.h (DEFINE_bool): Set the user-set flag.
6849 (General_options): Add --[no-]-fix-cortex options.
6850 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 6851 : Update fast look-up map after conversion.
41263c05 6852
459e9b03
ST
68532010-01-14 Sriraman Tallam <tmsriram@google.com>
6854
6855 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
6856 in the first pass of do_layout.
6857
b521dfe4
DK
68582010-01-13 Doug Kwan <dougkwan@google.com>
6859
6860 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
6861 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
6862 apparent compiler problem of not folding static constant integral
6863 data members of elfcpp::Elf_sizes<32>.
6864
44272192
DK
68652010-01-13 Doug Kwan <dougkwan@google.com>
6866
6867 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
6868 Arm_relobj::section_needs_cortex_a8_stub_scanning,
6869 Arm_relobj::scan_section_for_cortex_a8_erratum,
6870 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
6871 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
6872 sections to scan for relocation stubs into a new method
6873 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
6874 relocation and Cortex-A8 stub scanning.
6875 (Target_arm::do_relax): Force stubs to be after stubbed sections
6876 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 6877 the beginning of a new relaxation pass. Update a comment.
44272192
DK
6878 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
6879
44b71ece
ILT
68802010-01-12 Ian Lance Taylor <iant@google.com>
6881
6882 * target-reloc.h (visibility_error): New inline function.
6883 (relocate_section): Call visibility_error.
6884 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
6885 (MOSTLYCLEANFILES): Likewise.
6886 (protected_4_pic.o, protected_3.err): New targets.
6887 * testsuite/protected_4.cc: New file.
6888
a120bc7f
DK
68892010-01-12 Doug Kwan <dougkwan@google.com>
6890
6891 * arm.cc (Cortex_a8_reloc): New class.
6892 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
6893 and cortex_a8_relocs_info_.
6894 (Target_arm::fix_cortex_a8): New method definition.
6895 (Target_arm::Cortex_a8_relocs_info): New type.
6896 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
6897 New data member declarations.
6898 (Target_arm::scan_reloc_for_stub): Record information about
6899 relocations for THUMB branches that might be exempted from the
6900 Cortex-A8 workaround.
6901 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
6902 at the beginning of a relaxation pass.
6903
20138696
DK
69042010-01-12 Doug Kwan <dougkwan@google.com>
6905
6906 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
6907 (Arm_relobj::Mapping_symbol_position,
6908 Arm_reloj::Mapping_symbol_position_less,
6909 Arm_relobj::Mapping_symbols_info): New types.
6910 (Target_arm::is_mapping_symbol_name): New method definition.
6911 (Arm_relobj::do_count_local_symbols): Save information about mapping
6912 symbols.
6913
089d69dc
DK
69142010-01-11 Doug Kwan <dougkwan@google.com>
6915
6916 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
6917 Arm_relocate_functions::thumb32_branch_upper,
6918 Arm_relocate_functions::thumb32_branch_lower,
6919 Arm_relocate_functions::thumb32_cond_branch_offset,
6920 Arm_relocate_functions::thumb32_cond_branch_upper,
6921 Arm_relocate_functions::thumb32_cond_branch_lower,
6922 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
6923 branch offset encoding.
6924 (Arm_relocate_functions::thumb_branch_common): Use new branch
6925 offset encoding methods to avoid code duplication.
6926 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
6927 (Stub_addend_reader::operator()): Use new branch encoding method
6928 to avoid code duplication.
6929
99e5bff2
DK
69302010-01-11 Doug Kwan <dougkwan@google.com>
6931
6932 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
6933 (Target_arm::do_finalize_sections): Define special EXIDX section
6934 symbols only if referenced.
6935 * gc.h (Garbage_collection::add_reference): New method.
6936 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
6937 code duplication.
6938
98e090bd
ILT
69392010-01-11 Ian Lance Taylor <iant@google.com>
6940
d0a91bd8
ILT
6941 * script.cc (Version_script_info::build_expression_list_lookup):
6942 Change complaing about duplicate wildcard match from error to
6943 warning.
6944
98e090bd
ILT
6945 * script.cc (class Lazy_demangler): Recreate--revert part of patch
6946 of 2009-12-30.
6947 (Version_script_info::Version_script_info): Initialize globs_,
6948 default_version_, default_is_global_, and exact_. Don't
6949 initialize globals_ or locals_.
6950 (Version_script_info::build_lookup_tables): Build local symbols
6951 first.
6952 (Version_script_info::unquote): New function.
6953 (Version_script_info::add_exact_match): New function.
6954 (Version_script_info::build_expression_list_lookup): Remove lookup
6955 parameter. Add is_global parameter. Change all callers. Handle
6956 wildcard pattern specially. Unquote pattern. Call
6957 add_exact_match.
6958 (Version_script_info::get_name_to_match): New function.
6959 (Version_script_info::get_symbol_version): New function.
6960 (Version_script_info::get_symbol_version_helper): Remove.
6961 (Version_script_info::check_unmatched_names): Call unquote.
6962 * script.h (class Version_script_info): Change get_symbol_version
6963 to be non-inline and add is_global parameter; change all callers.
6964 Rewrite symbol_is_local. Update declarations. Define struct
6965 Version_tree_match, Exact, Globs. Don't define struct Lookup.
6966 Remove globals_ and locals_ members. Add exact_, globs_,
6967 default_version_, is_global_.
6968 (Version_script_info::Glob): Remove pattern, add expression and
6969 is_global. Update constructor. Change all callers.
6970 * dynobj.cc (Versions::finalize): Mark the version symbol as the
6971 default version.
6972 (Versions::symbol_section_contents): If a symbol is undefined, or
6973 defined in a dynamic object, set the version index to
6974 VER_NDX_LOCAL.
6975 * symtab.cc (Symbol_table::add_from_relobj): Don't call
6976 symbol_is_local.
6977 (Symbol_table::add_from_pluginobj): Likewise.
6978 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
6979
d56962d3
DK
69802010-01-11 Doug Kwan <dougkwan@google.com>
6981
6982 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
6983 (incremental_dump_LDADD): Add linking option for libintl.
6984 * Makefile.in: Regenerate.
6985
94e6ee91
L
69862010-01-11 H.J. Lu <hongjiu.lu@intel.com>
6987
6988 PR gold/11144
6989 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
6990 instead of -Ds.
6991 * testsuite/Makefile.in: Regenerated.
6992
e96c574b
DK
69932010-01-10 Doug Kwan <dougkwan@google.com>
6994
6995 * options.h (DEFINE_var): Use parentheses around argument varname__
6996 in macro body to avoid any unintended subsequent substitutions.
6997
7198066b
ILT
69982010-01-10 Ian Lance Taylor <iant@google.com>
6999
ba4d53bf
ILT
7000 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
7001 candidates before doing symbol resolution.
7002
7198066b
ILT
7003 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
7004 ODR candidates if only one is weak.
7005
a2beed37
ILT
70062010-01-08 Ian Lance Taylor <iant@google.com>
7007
7008 * script.cc (Version_script_info::build_expression_list_lookup):
7009 Don't warn about ambiguous version, just record the ambiguity.
7010 (Version_script_info::get_symbol_version_helper): Give error if
7011 version is ambiguous.
7012
2fb7225c
DK
70132010-01-08 Doug Kwan <dougkwan@google.com>
7014
7015 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
7016 prev_data_size_ and prev_addralign_. Remove initializer for
7017 deleted data member has_been_changed_.
7018 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
7019 to determine if the table is empty.
7020 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
7021 Remove.
7022 (Stub_table::add_reloc_stub): Define method in class definition
7023 instead of just declaring it there.
7024 (Stub_table::add_cortex_a8_stub): New method definition.
7025 (Stub_table::update_data_size_and_addralign): Ditto.
7026 (Stub_table::finalize_stubs): Ditto.
7027 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
7028 (Stub_table::do_addralign_): Return address alignment in the
7029 (Stub_table::do_reset_address_and_file_offset): Define method in
7030 class definition instead of declaring it there. Set current data
7031 size to be the data size of the previous pass.
7032 (Stub_table::set_final_data_size): Use current data size as the
7033 final data size.
7034 (Stub_table::relocate_stub): Change parameter type of stub from
7035 Reloc_stub pointer to Stub pointer.
7036 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
7037 (Stub_table::Cortex_a8_stub_list): New typedef.
7038 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
7039 Stub_table::prev_addralign_): New data member.
7040 (Arm_relobj::Arm_relobj): Initialize data member
7041 section_has_cortex_a8_workaround_.
7042 (Arm_relobj::section_has_cortex_a8_workaround,
7043 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
7044 definitions.
7045 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
7046 declarations.
7047 (Target_arm::relocate_stub): Change parameter type of stub from
7048 Reloc_stub pointer to Stub pointer.
7049 (Insn_template::size, Insn_template::alignment): Handle
7050 THUMB16_SPECIAL_TYPE.
7051 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
7052 Stub_table::update_data_size_and_addralign,
7053 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
7054 definitions.
2e702c99 7055 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
2fb7225c
DK
7056 (Stub_table::do_write): Ditto.
7057 (Target_arm::do_relax): Adjust code for changes in Stub_table.
7058
880cd20d
ILT
70592010-01-08 Ian Lance Taylor <iant@google.com>
7060
7061 PR 11108
7062 * symtab.h (class Symbol): Remove fields is_target_special_ and
7063 has_plt_offset_. Add field is_defined_in_discarded_section_.
7064 (Symbol::is_defined_in_discarded_section): New function.
7065 (Symbol::set_is_defined_in_discarded_section): New function.
7066 (Symbol::has_plt_offset): Rewrite.
7067 (Symbol::set_plt_offset): Verify that new offset is not -1U.
7068 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
7069 Don't initialize is_target_special_ or has_plt_offset_.
7070 Initialize is_defined_in_discarded_section_.
7071 (Symbol_table::add_from_relobj): If appropriate, set
7072 is_defined_in_discarded_section.
7073 * resolve.cc (Symbol::override_base_with_special): Don't test
7074 is_target_special_. Change has_plt_offset_ to has_plt_offset().
7075 * target-reloc.h (relocate_section): Do special handling for
7076 symbols defined in discarded sections for global symbols as well
7077 as local symbols.
7078
2703e3eb
ILT
70792010-01-08 Ian Lance Taylor <iant@google.com>
7080
7081 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
7082 the SHT_SYMTAB case.
7083
339d40a3
ILT
70842010-01-08 Ian Lance Taylor <iant@google.com>
7085
7086 * object.cc (Sized_relobj::do_layout): Don't get confused if
7087 layout_eh_frame returns NULL.
7088
abecea76
ILT
70892010-01-08 Ian Lance Taylor <iant@google.com>
7090
7091 PR 11084
7092 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
7093 dynamic symbol table, use the normal symbol table.
7094 (Sized_dynobj::do_read_symbols): Remove assertion about type of
7095 symbol table.
7096
6b7dd3f3
ILT
70972010-01-08 Ian Lance Taylor <iant@google.com>
7098
7099 PR 11072
7100 * layout.cc (Layout::include_section): Remove .gnu_debuglink
7101 sections.
7102
36c50e63
L
71032010-01-08 H.J. Lu <hongjiu.lu@intel.com>
7104
7105 * version.cc (print_version): Change to "Copyright 2010".
7106
e291e7b9
ILT
71072010-01-08 Ian Lance Taylor <iant@google.com>
7108
7109 PR 10287
7110 PR 11063
7111 * i386.cc (class Target_i386): Change return type of plt_section
7112 to be non-const.
7113 (class Output_data_plt_i386): Add tls_desc_rel_ field.
7114 (Output_data_plt_i386::Output_data_plt_i386): Initialize
7115 tls_desc_rel_ field.
7116 (Output_data_plt_i386::rel_tls_desc): New function.
7117 (Target_i386::rel_tls_desc_section): New function.
7118 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
7119 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
7120 R_386_TLS_DESC reloc in rel_tls_desc_section.
7121 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
7122 Define struct Tlsdesc_info.
7123 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
7124 (Target_x86_64::do_reloc_symbol_index): New function.
7125 (Target_x86_64::add_tlsdesc_info): New function.
7126 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
7127 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
7128 tlsdesc_rel_ field.
7129 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
7130 all callers.
7131 (Output_data_plt_x86_64::rela_tlsdesc): New function.
7132 (Target_x86_64::rela_tlsdesc_section): New function.
7133 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
7134 handling.
7135 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
7136 (Target_x86_64::do_reloc_addend): New function.
7137 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
7138 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
7139 declarations. Define TARGET_CODE. Add arg field to u1_ union.
7140 (Output_reloc::type): New function.
7141 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
7142 (Output_reloc::is_target_specific): New function.
7143 (Output_reloc::target_arg): New function.
7144 (class Output_reloc) [SHT_RELA]: Add four new constructors for
7145 absolute relocs and target specific relocs.
7146 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
7147 add_target_specific.
7148 (class Output_data_reloc) [SHT_RELA]: Likewise.
7149 * output.cc (Output_reloc::Output_reloc): Add four new versions
7150 for absolute relocs and target specific relocs.
7151 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
7152 (Output_reloc::get_symbol_index): Likewise.
7153 (Output_reloc::local_section_offset): Check that local_sym_index_
7154 is not TARGET_CODE or 0.
7155 (Output_reloc::symbol_value): Likewise.
7156 (Output_reloc::write) [SHT_RELA]: Call target for target specific
7157 reloc.
7158 * target.h (class Target): Add reloc_symbol_index and reloc_addend
7159 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
7160 functions.
7161 * layout.cc (add_target_dynamic_tags): Use output section for
7162 DT_PLTRELSZ and DT_JMPREL.
7163
3a44184e
ILT
71642010-01-07 Ian Lance Taylor <iant@google.com>
7165
7166 PR 11061
7167 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
7168 function.
7169 (class Output_data_reloc_generic): Define.
7170 (class Output_data_reloc_base): Change base class to
7171 Output_data_reloc_generic. Change add() method to call
7172 bump_relative_reloc_count for a relative reloc. Remove
7173 sort_relocs_ field.
7174 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
7175 to sort_relocs().
7176 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
7177 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
7178 appropriate.
7179 * layout.h (class Layout): Update declaration.
7180
ea715a34
ILT
71812010-01-07 Ian Lance Taylor <iant@google.com>
7182
7183 * output.h (class Output_data): Add const version of
7184 output_section and do_output_section.
7185 (class Output_section_data): Add const version of
7186 do_output_section.
7187 (class Output_section): Likewise.
7188 * layout.cc (Layout::add_target_dynamic_tags): New function.
7189 * layout.h (class Layout): Update declarations.
7190 * arm.cc (Target_arm::do_finalize_sections): Use
7191 add_target_dynamic_tags.
7192 * i386.cc (Target_i386::do_finalize_sections): Likewise.
7193 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
7194 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
7195 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
7196
659948a4
ILT
71972010-01-07 Ian Lance Taylor <iant@google.com>
7198
7199 PR 11042
7200 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
7201 object as needed.
7202
9d3b86f6
ILT
72032010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
7204 Ian Lance Taylor <iant@google.com>
7205
7206 PR 11019
7207 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
7208 Xindex::read_symtab_xindex.
7209
bb0d3eb0
DK
72102010-01-07 Doug Kwan <dougkwan@google.com>
7211
7212 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
7213 (Insn_template::thumb16_bcond_insn): New method declaration.
7214 (Insn_template): Fix spelling.
7215 (Stub::thumb16_special): New method declaration.
7216 (Stub::do_write): Define virtual method which was previously pure
7217 virtual.
7218 (Stub::do_thumb16_special): New method declaration.
7219 (Stub::do_fixed_endian_write): New template member.
7220 (Reloc_stub::do_write): Remove.
7221 (Reloc_stub::do_fixed_endian_write): Remove.
7222 (Cortex_a8_stub): New class definition.
7223 (Stub_factory::make_cortex_a8_stub): New method definition.
7224 (Stub_factory::Stub_factory): Add missing static storage class
7225 qualifier for elf32_arm_stub_a8_veneer_blx.
7226
ffeef7df
ILT
72272010-01-07 Ian Lance Taylor <iant@google.com>
7228
dc3f80fe
ILT
7229 PR 10980
7230 * options.h (class General_options): Add --warn-unresolved-symbols
7231 and --error-unresolved-symbols.
7232 * errors.cc (Errors::undefined_symbol): Implement
7233 --warn-unresolved-symbols.
7234
ffeef7df
ILT
7235 * options.h (class General_options): Add -z text and -z textoff.
7236 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
7237
f1ec9ded
ST
72382010-01-06 Sriraman Tallam <tmsriram@google.com>
7239
7240 * gc.h (Garbage_collection::Cident_section_map): New typedef.
7241 (Garbage_collection::cident_sections): New function.
7242 (Garbage_collection::add_cident_section): New function.
7243 (Garbage_collection::cident_sections_): New member.
7244 (gc_process_relocs): Add references to sections whose names are C
7245 identifiers.
7246 * gold.h (cident_section_start_prefix): New constant.
7247 (cident_section_stop_prefix): New constant.
7248 (is_cident): New function.
7249 * layout.cc (Layout::define_section_symbols): Replace string constants
7250 with the newly defined constants.
7251 * object.cc (Sized_relobj::do_layout): Track sections whose names are
7252 C identifiers.
7253 * testsuite/Makefile.am: Add gc_orphan_section_test.
7254 * testsuite/Makefile.in: Regenerate.
7255 * testsuite/gc_orphan_section_test.cc: New file.
7256 * testsuite/gc_orphan_section_test.sh: New file.
7257
6eda8c29
ILT
72582010-01-06 Ian Lance Taylor <iant@google.com>
7259
b9674e17
ILT
7260 PR 10980
7261 * options.h (class General_options): Add --warn-shared-textrel.
7262 * layout.cc (Layout::finish_dynamic_section): Implement
7263 --warn-shared-textrel.
7264
6eda8c29
ILT
7265 PR 10980
7266 * options.h (class General_options): Add --warn-multiple-gp.
7267
32dcd44e
ILT
72682010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7269
7270 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
7271 $(THREADSLIB) and $(LIBDL).
7272 * Makefile.in: Rebuild.
7273
a192ba05
ILT
72742010-01-06 Ian Lance Taylor <iant@google.com>
7275
7276 PR 10980
7277 * options.cc (General_options::parse_section_start): New function.
7278 (General_options::section_start): New function.
7279 (General_options::General_options): Initialize all members.
7280 * options.h: Include <map>
7281 (class General_options): Add --section-start. Add section_starts_
7282 member.
7283 * layout.cc (Layout::attach_allocated_section_to_segment): If
7284 --section-start was used, set the address of the segment. Remove
7285 local sort_sections.
7286 (Layout::relaxation_loop_body): If the address of the load segment
7287 has been set by --section-start, don't use it.
7288 * output.h (Output_segment::update_flags_for_output_section): New
7289 function.
7290 * output.cc (Output_segment::add_output_section): Call
7291 update_flags_for_output_section.
7292
dde3f402
ILT
72932010-01-05 Ian Lance Taylor <iant@google.com>
7294
62dfdd4d
ILT
7295 PR 10980
7296 * options.h (class General_options): Add --undefined-version.
7297 * script.cc (struct Version_expression): Add was_matched_by_symbol
7298 field.
7299 (Version_script_info::matched_symbol): New function.
7300 (Version_script_info::get_symbol_version_helper): Call
7301 matched_symbol.
7302 (Version_script_info::check_unmatched_names): New function.
7303 * script.h (class Version_script_info): Update declarations.
7304 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
7305
9c4ae156
ILT
7306 * options.h (class General_options): Use DEFINE_bool_alias for
7307 allow_multiple_definition.
7308 * resolve.cc (Symbol_table::should_override): Don't test
7309 allow_multiple_definition.
7310
dde3f402
ILT
7311 PR 10980
7312 * options.h (class General_options): Add --cref.
7313 * main.cc (main): Print cref table if --cref. Don't close mapfile
7314 until after printing cref table.
7315 * cref.cc: Include "symtab.h".
7316 (class Cref_inputs): Define Cref_table_compare and Cref_table.
7317 (Cref_table_compare::operator()): New function.
7318 (Cref_inputs::gather_cref): New function.
7319 (filecol): New static const.
7320 (Cref_inputs::print_cref): New function.
7321 (Cref::print_cref): New function.
7322 * cref.h: Include <cstdio>.
7323 (class Cref): Update declarations.
7324 * mapfile.h (Mapfile::file): New function.
7325 * object.h (class Object): Define Symbols. Declare virtual
7326 do_get_global_symbols.
7327 (Object::get_global_symbols): New function.
7328 * object.cc (Input_objects::add_object): Pass object to cref_ if
7329 --cref.
7330 (Input_objects::archive_start): Likewise.
7331 (Input_objects::archive_stop): Likewise.
7332 (Input_objects::print_cref): New function.
7333 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
7334 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
7335 --cref.
7336 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
7337 function.
7338 * plugin.h (class Sized_pluginobj): Update declarations.
7339
8781f709
ILT
73402010-01-05 Ian Lance Taylor <iant@google.com>
7341
7342 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
7343 to is_default_version. Rename insdef to insdefault.
7344 (Symbol_table::add_from_relobj): Rename def to is_default_version
7345 and local to is_forced_local.
7346 (Symbol_table::add_from_pluginobj): Likewise.
7347 (Symbol_table::add_from_dynobj): Likewise.
7348 (Symbol_table::define_special_symbol): Rename insdef to
7349 insdefault.
7350
fe35d28d
ILT
73512010-01-04 Ian Lance Taylor <iant@google.com>
7352
30bc8c46
ILT
7353 PR 10980
7354 * options.h (class General_options): Add
7355 --allow-multiple-definition and -z muldefs.
7356 * resolve.cc (Symbol_table::should_override): Don't warn about a
7357 multiple symbol definition if --allow-multiple-definition or -z
7358 muldefs.
7359
7eaea549
ILT
7360 PR 10980
7361 * options.h (class General_options): Add --add-needed and
7362 --copy-dt-needed-entries. Tweak --as-needed help entry.
7363 * object.cc (Input_objects::check_dynamic_dependencies): Give an
7364 error if --copy-dt-needed-entries aka --add-needed is used and
7365 would cause a change in behaviour.
7366
fe35d28d
ILT
7367 PR 10980
7368 * options.h (class General_options): Add -G as a short version of
7369 --shared. Add no-op options -assert, -g, and -i.
7370
55a2bb35
ST
73712010-01-04 Sriraman Tallam <tmsriram@google.com>
7372
7373 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
7374 check for .text or .gnu.linkonce.t sections.
7375 * icf.cc (Icf::find_identical_sections): Ditto.
7376 Change the detection for mangled function name within the section
7377 name.
7378 * icf.h (is_section_foldable_candidate): New function.
7379
719328e1
ILT
73802009-12-30 Ian Lance Taylor <iant@google.com>
7381
7382 PR 10980
7383 * options.h (class General_options): Permit two dashes with
7384 --retain-symbols-file.
7385
d7bb5745
ILT
73862009-12-30 Ian Lance Taylor <iant@google.com>
7387
403a15dd
ILT
7388 PR 10979
7389 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
7390 don't put the file header and segment headers in the text
7391 segment.
7392
eda294df
ILT
7393 PR 10979
7394 * common.cc (Sort_commons::operator()): Stabilize sort when both
7395 entries are NULL.
7396 (Symbol_table::do_allocate_commons_list): When allocating common
7397 symbols, skip a symbol which is no longer common.
7398 * symtab.h (Symbol::is_common): Test whether the symbol comes from
7399 an object before checking its type.
7400 * testsuite/common_test_2.c: New file.
7401 * testsuite/common_test_3.c: New file.
7402 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
7403 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
7404 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
7405 (common_test_2_pic.o, common_test_2.so): New targets.
7406 (common_test_3_pic.o, common_test_3.so): New targets.
7407 * testsuite/Makefile.in: Rebuild.
7408
d7bb5745
ILT
7409 PR 10979
7410 * script.cc (read_input_script): If we see a new SECTIONS clause,
7411 and we have added an input section, give an error.
7412 * layout.h (class Layout): Add have_added_input_section function.
7413 Add have_added_input_section_ field.
7414 * layout.cc (Layout::Layout): Initialize
7415 have_added_input_section_.
7416 (Layout::layout): Set have_added_input_section_.
7417 (Layout::layout_eh_frame): Likewise.
7418
fc59c572
ILT
74192009-12-30 Ian Lance Taylor <iant@google.com>
7420
7421 PR 10931
7422 * options.h (class General_options): Add --sort-common option.
7423 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
7424 * common.cc (Sort_common): Add sort_order parameter to
7425 constructor. Add sort_order_ field.
7426 (Sort_commons::operator): Check sort_order_.
7427 (Symbol_table::allocate_commons): Determine the sort order.
7428 (Symbol_table::do_allocate_commons): Add sort_order parameter.
7429 Change all callers.
7430 (Symbol_table::do_allocate_commons_list): Likewise.
7431
1c74fab0
ILT
74322009-12-30 Ian Lance Taylor <iant@google.com>
7433
7434 PR 10916
7435 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
7436 symbols from this object, don't change the visibility of an
7437 undefined symbol.
7438 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
7439
6affe781
ILT
74402009-12-30 Ian Lance Taylor <iant@google.com>
7441
7442 PR 10861
7443 * script.h (class Version_script_info): Define Language enum.
7444 Update declarations. Define Glob, Exact, and Lookup types. Add
7445 new fields globals_, locals_, and is_finalized_.
7446 * script.cc: Various formatting fixes.
7447 (class Parser_closure): Change language_stack_ from a vector of
7448 std::string to one of Version_script_info::Language. Adjust all
7449 uses accordingly.
7450 (class Lazy_demangler): Remove.
7451 (struct Version_expression): Change language from std::string to
7452 Version_script_info::Language.
7453 (Version_script_info::Version_script_info): New function.
7454 (Version_script_info::~Version_script_info): Don't call clear.
7455 (Version_script_info::finalize): New function.
7456 (Version_script_info::build_lookup_tables): New function.
7457 (Version_script_info::build_expression_list_lookup): New
7458 function.
7459 (Version_script_info::get_symbol_version_helper): Rewrite to use
7460 lookup tables.
7461 (Version_script_info::print_expression_list): Adjust to use
7462 Version_script_info::Language.
7463 (script_push_lex_into_version_mode): Check that the version script
7464 has not been finalized.
7465 (version_script_push_lang): Change language string to
7466 Version_script_info::Language.
7467 * options.cc (Command_line::version_script): New function.
7468 * options.h (class General_options): Add finalize_dynamic_list
7469 function. Change version_script from declaration to definition.
7470 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
7471 * testsuite/version_script.map: Remove duplicate def of foo.
7472 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
7473 version_script.map.
7474 * testsuite/Makefile.in: Rebuild.
7475
818bf354
ILT
74762009-12-30 Ian Lance Taylor <iant@google.com>
7477
7478 PR 10843
7479 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
7480 if the input symbol index is 0, make the output symbol index 0.
7481
ebcc8304
ILT
74822009-12-30 Ian Lance Taylor <iant@google.com>
7483
7484 PR 10670
7485 * options.h (class General_options): Add -x/--discard-all.
7486 * object.cc (Sized_relobj::do_count_local_symbols): Handle
7487 --discard-all. If the local symbol needs a dynamic entry, check
7488 that before handling --discard-locals.
7489
176fe33f
ILT
74902009-12-30 Ian Lance Taylor <iant@google.com>
7491
bb321bb1
ILT
7492 PR 10450
7493 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
7494 flags to PF_R.
7495 (Output_segment::add_output_section): Don't change the flags if
7496 the type is PT_TLS.
7497
176fe33f
ILT
7498 PR 10450
7499 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
7500 GNU hash table if they need a dynamic value. Otherwise, don't add
7501 them if they are defined in a dynamic object or are forced local.
7502
e8cd95c7
ILT
75032009-12-29 Ian Lance Taylor <iant@google.com>
7504
1b81fb71
ILT
7505 PR 10450
7506 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
7507 .gnu.hash table for a 32-bit target.
7508
8d6d383d
ILT
7509 PR 10450
7510 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
7511 regular and a dynamic object only needs a dynamic symbol table
7512 entry if it is externally visible.
7513
e785ec03
ILT
7514 PR 10450
7515 * i386.cc (class Target_i386): Initialize global_offset_table_ in
7516 constructor. Add global_offset_table_ field.
7517 (Target_i386::got_section): Set global_offset_table_.
7518 (Target_i386::do_finalize_sections): Set global_offset_table_
7519 size.
7520 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
7521 in constructor. Add global_offset_table_ field.
7522 (Target_x86_64::got_section): Set global_offset_table_.
7523 (Target_x86_64::do_finalize_sections): Set global_offset_table_
7524 size.
7525
1a2dff53
ILT
7526 * layout.cc (Layout::Layout): Initialize increase_relro_.
7527 (Layout::get_output_section): Add is_relro, is_last_relro, and
7528 is_first_non_relro parameters. Change all callers.
7529 (Layout::choose_output_section): Likewise.
7530 (Layout::add_output_section_data): Likewise.
7531 (Layout::make_output_section): Likewise.
7532 (Layout::set_segment_offsets): Clear increase_relro when using a
7533 linker script.
7534 * layout.h (class Layout): Add increase_relro method. Add
7535 increase_relro_ field. Update declarations.
7536 * output.cc (Output_section::Output_section): Initialize
7537 is_last_relro_ and is_first_non_relro_.
7538 (Output_segment::add_output_section): Group relro sections is
7539 do_sort is true. Handle is_last_relro and is_first_non_relro.
7540 (Output_segment::maximum_alignment): Remove relro handling.
7541 (Output_segment::set_section_addresses): Add increase_relro
7542 parameter. Change all callers. Add initial alignment to align
7543 relro sections on separate page. Remove old relro handling.
7544 (Output_segment::set_section_list_addresses): Remove in_relro
7545 parameter. Change all callers.
7546 (Output_segment::set_offset): Add increase parameter. Change all
7547 callers. Remove old relro handling.
7548 * output.h (class Output_section): Add new methods: is_last_relro,
7549 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
7550 Add is_last_relro_ and is_first_non_relro_ fields.
7551 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
7552 Create separate .got.plt section. Call increase_relro.
7553 * x86_64.cc (Target_x86_64::got_section): Likewise.
7554 * testsuite/relro_script_test.t: Add .got.plt.
7555
f0ba79e2
ILT
7556 PR 10450
7557 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
7558 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
7559 (Layout::finalize): Call set_dynamic_symbol_size.
7560 (Layout::set_dynamic_symbol_size): New function.
7561 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
7562 set_dynamic_symbol_size.
7563
e8cd95c7
ILT
7564 PR 10450
7565 * output.h (class Output_section): Add is_entsize_zero_ field.
7566 * output.cc (Output_section::Output_section): Initialize
7567 is_entsize_zero_.
7568 (Output_section::set_entsize): If two different entsizes are
7569 requested, force it to zero.
7570 (Output_section::add_input_section): Set flags for .debug_str
7571 before updating section flags. Set entsize.
7572 (Output_section::update_flags_for_input_section): Set SHF_MERGE
7573 and SHF_STRING if all input sections have those flags.
7574
3e1b9a8a
RÁE
75752009-12-29 Rafael Espindola <espindola@google.com>
7576
7577 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
7578 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
7579 reporting.
3e1b9a8a 7580
3dcad376
ST
75812009-12-29 Sriraman Tallam <tmsriram@google.com>
7582
7583 * options.cc (General_options::parse_version): Allow -v to exit
7584 without an error if there is nothing to link.
7585
084e2665
ILT
75862009-12-29 Ian Lance Taylor <iant@google.com>
7587
7588 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
7589 using a version of gcc before 4.1.
7590 * configure: Rebuild.
7591
250acde3
CD
75922009-12-28 Chris Demetriou <cgd@google.com>
7593
7594 * attributes.cc (Output_attributes_section_data::do_write): Use
7595 std::vector::front rather than std::vector::data.
7596
99fff23b
ILT
75972009-12-28 Ian Lance Taylor <iant@google.com>
7598
7599 * symtab.h (class Symbol_table): Add enum Defined.
7600 * resolve.cc (Symbol_table::should_override): Add defined
7601 parameter. Change all callers. Test whether object is NULL
7602 before calling a method on it.
7603 (Symbol_table::report_resolve_problem): Add defined parameter.
7604 Change all callers.
7605 (Symbol_table::should_override_with_special): Likewise.
7606 * symtab.cc (Symbol_table::define_in_output_data): Add defined
7607 parameter. Change all callers.
7608 (Symbol_table::do_define_in_output_data): Likewise.
7609 (Symbol_table::define_in_output_segment): Likewise.
7610 (Symbol_table::do_define_in_output_segment): Likewise.
7611 (Symbol_table::define_as_constant): Likewise.
7612 (Symbol_table::do_define_as_constant): Likewise.
7613 * script.h (class Symbol_assignment): Add is_defsym parameter to
7614 constructor; change all callers.
7615 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
7616 parameter. Change all callers. Add is_defsym_ field.
7617 (class Parser_closure): Add parsing_defsym parameter to
7618 constructor; change all callers. Add parsing_defsym accessor
7619 function. Add parsing_defsym_ field.
7620
556bd683
ILT
76212009-12-28 Ian Lance Taylor <iant@google.com>
7622
7623 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 7624 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 7625
1782c879
ILT
76262009-12-23 Ian Lance Taylor <iant@google.com>
7627
7628 * i386.cc (Target_i386::do_calls_non_split): Recognize
7629 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
7630 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
7631 -fsplit-stack prologue when using %r11.
1782c879 7632
329ca2b1
ST
76332009-12-21 Sriraman Tallam <tmsriram@google.com>
7634
7635 * options.cc (General_options::parse_version): Make -v continue and do
7636 the link like GNU ld does.
7637
d675ff46
RÁE
76382009-12-17 Rafael Avila de Espindola <espindola@google.com>
7639
7640 * Makefile.am (CCFILES): Add timer.cc.
7641 (HFILES): Add timer.h.
7642 * configure.ac: Check for sysconf and times.
7643 * main.cc: include timer.h.
7644 (main): Use Timer instead of get_run_time.
7645 * timer.cc: New.
7646 * timer.h: New.
7647 * workqueue.cc: include timer.h.
7648 (Workqueue::find_and_run_task):
7649 Report user, sys and wall time.
7650 * Makefile.in: Regenerate.
7651 * config.in: Regenerate.
7652 * configure: Regenerate.
7653
d6344fb5
DK
76542009-12-16 Doug Kwan <dougkwan@google.com>
7655
7656 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
7657 sections.
7658 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
7659 relaxed input sections.
7660 * output.cc (Output_section::find_relaxed_input_section): Change
7661 return type to Output_relaxed_input_section pointer. Adjust code
7662 for new type of relaxed_input_section_map_.
7663 * output.h (Output_section::find_relaxed_input_section): Change
7664 return type to Output_relaxed_input_section pointer.
7665 (Output_section::Output_relaxed_input_section_by_input_section_map):
7666 New type.
7667 (Output_section::relaxed_input_section_map_): Change type to
7668 Output_section::Output_relaxed_input_section_by_input_section_map.
7669 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
7670 input section.
7671
0e0d5469
ILT
76722009-12-15 Ian Lance Taylor <iant@google.com>
7673
7674 * layout.cc (Layout::create_shstrtab): Only write out after input
7675 sections if we are compressing debug sections.
7676
0649a889
ILT
76772009-12-15 Ian Lance Taylor <iant@google.com>
7678
7679 * archive.cc (Archive::add_symbols): Only look up a symbol without
7680 a version if there is, in fact, a version.
7681
2ea97941
ILT
76822009-12-14 Ian Lance Taylor <iant@google.com>
7683
7684 Revert -Wshadow changes, all changes from:
7685 2009-12-11 Doug Kwan <dougkwan@google.com>
7686 2009-12-11 Nick Clifton <nickc@redhat.com>
7687 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
7688
b0eec2cc
DK
76892009-12-11 Doug Kwan <dougkwan@google.com>
7690
7691 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
7692 due to -Wshadow.
7693 * attributes.cc (Object_attribute::size): Ditto.
7694 (Attributes_section_data::size): Ditto.
7695 (Attributes_section_data::Attributes_section_data): Ditto.
7696 (Output_attributes_section_data::do_write): Ditto.
7697 * attributes.h (Object_attribute::set_type): Ditto.
7698 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
7699
91d6fa6a
NC
77002009-12-11 Nick Clifton <nickc@redhat.com>
7701
7702 * archive.cc: Fix shadowed variable warnings.
7703 * arm.cc: Likewise.
7704 * compressed_output.cc: Likewise.
7705 * compressed_output.h: Likewise.
7706 * configure: Likewise.
7707 * dwarf_reader.cc: Likewise.
7708 * dynobj.cc: Likewise.
7709 * dynobj.h: Likewise.
7710 * ehframe.cc: Likewise.
7711 * ehframe.h: Likewise.
7712 * errors.cc: Likewise.
7713 * expression.cc: Likewise.
7714 * fileread.cc: Likewise.
7715 * fileread.h: Likewise.
7716 * freebsd.h: Likewise.
7717 * i386.cc: Likewise.
7718 * icf.cc: Likewise.
7719 * incremental.h: Likewise.
7720 * layout.cc: Likewise.
7721 * layout.h: Likewise.
7722 * mapfile.cc: Likewise.
7723 * merge.cc: Likewise.
7724 * merge.h: Likewise.
7725 * object.cc: Likewise.
7726 * object.h: Likewise.
7727 * options.h: Likewise.
7728 * output.cc: Likewise.
7729 * output.h: Likewise.
7730 * parameters.cc: Likewise.
7731 * plugin.cc: Likewise.
7732 * powerpc.cc: Likewise.
7733 * reduced_debug_output.cc: Likewise.
7734 * reduced_debug_output.h: Likewise.
7735 * reloc.cc: Likewise.
7736 * reloc.h: Likewise.
7737 * resolve.cc: Likewise.
7738 * script-sections.cc: Likewise.
7739 * script.cc: Likewise.
7740 * script.h: Likewise.
7741 * sparc.cc: Likewise.
7742 * symtab.cc: Likewise.
7743 * symtab.h: Likewise.
7744 * target-select.cc: Likewise.
7745 * target-select.h: Likewise.
7746 * token.h: Likewise.
7747 * workqueue.cc: Likewise.
7748 * workqueue.h: Likewise.
7749 * x86_64.cc: Likewise.
7750
a0351a69
DK
77512009-12-10 Doug Kwan <dougkwan@google.com>
7752
7753 * arm.cc (attributes.h): New include.
7754 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
7755 (Arm_relobj::~Arm_relobj): Delete object pointed by
7756 attributes_section_data_.
7757 (Arm_relobj::attributes_section_data): New method definition.
7758 (Arm_relobj::attributes_section_data_): New data member declaration.
7759 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
7760 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
7761 attributes_section_data_.
7762 (Arm_dynobj::attributes_section_data): New method definition.
7763 (Arm_dynobj::attributes_section_data_): New data member declaration.
7764 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
7765 initialization value of may_use_blx_ to false.
2e702c99 7766 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
a0351a69
DK
7767 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
7768 object attributes to compute results instead of hard-coding.
7769 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
7770 Target_arm::get_secondary_compatible_arch,
7771 Target_arm::set_secondary_compatible_arch
7772 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7773 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
7774 New method declarations.
7775 (Target_arm::get_aeabi_object_attribute): New method definition.
7776 (Target_arm::attributes_section_data_): New data member declaration.
7777 (read_arm_attributes_section): New template definition.
7778 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
7779 (Arm_dynobj::do_read_symbols): Ditto.
7780 (Target_arm::do_finalize_sections): Merge attributes sections from
7781 input. Check for BLX use after attributes section merging.
7782 Fix __exidx_start and __exidx_end visibility. Create an
7783 .ARM.attributes section if necessary.
7784 (Target_arm::get_secondary_compatible_arch,
7785 Target_arm::set_secondary_compatible_arch,
7786 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
7787 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 7788 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
7789 New method definitions.
7790
b59befec
ILT
77912009-12-09 Ian Lance Taylor <iant@google.com>
7792
7793 * plugin.cc (Plugin::load): Don't cast from void* to a function
7794 pointer.
7795
1276bc89
ILT
77962009-12-09 Ian Lance Taylor <iant@google.com>
7797
7798 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
7799 information fields.
7800
2f2de248
L
78012009-12-09 H.J. Lu <hongjiu.lu@intel.com>
7802
7803 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
7804 Replace two_file_shared_1.so with two_file_shared_2.so.
7805 * testsuite/Makefile.in: Regenerated.
7806
4f787271
DK
78072009-12-08 Doug Kwan <dougkwan@google.com>
7808
7809 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
7810 (HFILES): Add attributes.h and int_encoding.h.
7811 * Makefile.in: Regenerate.
7812 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
7813 function definitions to int_encoding.cc
7814 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
7815 prototypes to int_encoding.h
7816 * reduced_debug_output.cc (int_encoding.h): New include.
7817 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
7818 function definitions to int_encoding.cc
7819 (insert_into_vector, read_from_pointer): Move template definitions to
7820 int_encoding.h
7821 * attributes.cc: New file.
7822 * attributes.h: New file.
7823 * int_encoding.cc: New file.
7824 * int_encoding.h: New file.
7825
20b52f1a
RÁE
78262009-12-07 Rafael Avila de Espindola <espindola@google.com>
7827
7828 PR gold/11055
7829 * incremental-dump.cc (dump_incremental_inputs): New.
7830 (main): Use dump_incremental_inputs.
7831
53d7974c
L
78322009-12-07 H.J. Lu <hongjiu.lu@intel.com>
7833
7834 PR gold/10893
7835 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
7836 checking elfcpp::STT_FUNC.
7837 (Target_i386::Relocate::relocate): Likewise.
7838 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
7839
7840 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
7841 symbols from shared libraries into normal FUNC symbols.
7842
7843 * symtab.h (Symbol): Add is_func and use it.
7844
05a352e6
DK
78452009-12-05 Doug Kwan <dougkwan@google.com>
7846
7847 * arm.cc (Target_arm::arm_info): Initialize new fields
7848 attributes_section and attributes_vendor.
7849 * i386.cc (Target_i386::i386_info): Same.
7850 * object.cc (Sized_relobj::do_layout): Skip attribute section.
7851 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
7852 fields attributes_section and attributes_vendor.
53d7974c 7853 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
7854 * target.h (Target::attributes_section, Target::attributes_vendor,
7855 Target::is_attributes_section, Target::attribute_arg_type,
7856 Target::attributes_order): New method definitions.
7857 (Target::Target_info::attributes_section,
7858 Target::Target_info::attributes_vendor): New fields.
7859 (Target::do_attribute_arg_type, Target::do_attributes_order): New
7860 virtual method definitions.
7861 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
7862 attributes_section and attributes_vendor.
7863 * testsuite/testfile.cc (Target_test::test_target_info): Same.
7864
f4e5969c
DK
78652009-12-05 Doug Kwan <dougkwan@google.com>
7866
7867 * arm.cc: Update comments about interworking and stub generation.
7868 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
7869 considered as non-PIC.
7870 (Arm_relocate_functions::base_abs): Fix formatting.
7871 (Arm_relocate_functions::got_prel): Fix comment. Change interface
7872 of function to use GOT entry address instead of offset.
7873 (Target_arm::Scan::global): Issue an error if a symbol would need a
7874 PLT does not get one because it is untyped. Remove code to create
7875 dynamic symbols for relative branches.
7876 (Target_arm::Relocate::relocate: Use 0 instead of false since function
7877 takes unsigned integer instead of boolean.
7878
1abce4a6
L
78792009-12-05 H.J. Lu <hongjiu.lu@intel.com>
7880
7881 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
7882 (two_file_test_LDADD): Likewise.
7883 (common_test_1_LDADD): Likewise.
7884 (exception_test_LDADD) Likewise.
7885 (weak_test_LDADD): Likewise.
7886 (many_sections_test_LDADD): Likewise.
7887 (initpri1_LDADD): Likewise.
7888 (script_test_1_LDADD): Likewise.
7889 (script_test_2_LDADD): Likewise.
7890 (justsyms_LDADD): Likewise.
7891 (binary_test_LDADD): Likewise.
7892 (large_LDADD): Likewise.
7893 * testsuite/Makefile.in: Regenerated.
7894
adcf2816 78952009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 7896
adcf2816
L
7897 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
7898 (Symbol_table::override_with_special): Likewise.
7899 (Symbol_table::add_from_object): Likewise.
7900
28e67f5d
RÁE
79012009-12-04 Rafael Avila de Espindola <espindola@google.com>
7902
7903 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
7904 Don't set the data_offset twice.
7905
ae10a101
RÁE
79062009-12-04 Rafael Avila de Espindola <espindola@google.com>
7907
7908 * testsuite/Makefile.in: Regenerate.
7909
f59f41f3
DK
79102009-12-03 Doug Kwan <dougkwan@google.com>
7911
7912 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
7913 (Target_arm::do_finalize_sections): Add parameter for symbol table
7914 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
7915 * i386.cc (Target_i386::do_finalize_sections): Add an additional
7916 parameter for symbol table pointer.
7917 * layout.cc (Layout::finalize): Call Target::finalize_sections with
7918 an additional parameter for a pointer to symbol table.
7919 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
7920 parameter for a symbol table pointer.
7921 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
7922 * target.h (Target::finalize_sections, Target::do_finalize_sections):
7923 Ditto.
7924 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
7925 parameter for a symbol table pointer.
7926
ca55d848
RÁE
79272009-12-03 Rafael Avila de Espindola <espindola@google.com>
7928
7929 * incremental.cc (Incremental_inputs_header)
7930 (Incremental_inputs_header_write, Incremental_inputs_entry)
7931 (Incremental_inputs_entry_write): Move ...
7932 * incremental.h (Incremental_inputs_header)
7933 (Incremental_inputs_header_write, Incremental_inputs_entry)
7934 (Incremental_inputs_entry_write): here.
7935
3aec4f9c
RÁE
79362009-12-02 Rafael Avila de Espindola <espindola@google.com>
7937
7938 * incremental.cc (make_sized_incremental_binary): Set the target.
7939 Error if it is incompatible.
7940 * output.h (Output_file): Add filename method.
7941
9c0ae74d
RÁE
79422009-12-02 Rafael Avila de Espindola <espindola@google.com>
7943
7944 * incremental.cc (Incremental_inputs_entry): Remove unused argument
7945 from the get_* methods.
7946
a45500ae
RÁE
79472009-12-02 Rafael Avila de Espindola <espindola@google.com>
7948
7949 * incremental-dump.cc (main): Check that the offeset of a script is 0.
7950 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
7951 Write 0 for the data_offset of scripts.
7952
325e6408
RÁE
79532009-12-02 Rafael Avila de Espindola <espindola@google.com>
7954
7955 * testsuite/Makefile.am: Add the incremental_test.sh test.
7956 * testsuite/incremental_test.sh: New.
7957 * testsuite/incremental_test_1.c: New.
7958 * testsuite/incremental_test_2.c: New.
7959
954c3e2e
RÁE
79602009-12-01 Rafael Avila de Espindola <espindola@google.com>
7961
7962 * incremental-dump.cc (main): Fix typos.
7963
f8086623
RÁE
79642009-11-27 Rafael Avila de Espindola <espindola@google.com>
7965
7966 PR gold/11025
7967 * incremental-dump.cc (main): Use llu to print 64 bit values.
7968
3b0dd6ac
L
79692009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
7970 H.J. Lu <hongjiu.lu@intel.com>
7971
7972 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
7973 $(LIBDL).
7974 (incremental_dump_LDADD): Likewise.
7975 * Makefile.in: Regenerated.
7976
a6d1ef57 79772009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 7978
a6d1ef57
DK
7979 Revert:
7980
7981 2009-11-25 Doug Kwan <dougkwan@google.com>
7982
7983 * arm.cc (Target_arm::Target_arm): Move method definition
7984 outside of class definition. Add code to handle
7985 --target1-rel, --target1-abs and --target2= options.
7986 (Target_arm::get_reloc_reloc_type): Change method to be
7987 non-static and const.
7988 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
7989 New data member declaration.
7990 (Target_arm::Scan::local, Target_arm::Scan::global,
7991 Target_arm::Relocate::relocate,
7992 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7993 Adjust call to Target_arm::get_real_reloc_type.
7994 (Target_arm::get_real_reloc_type): Use command line options
7995 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
7996 * options.h (--target1-rel, --target1-abs, --target2): New
7997 ARM-only options.
7998
50aeb7d4
DK
79992009-11-25 Doug Kwan <dougkwan@google.com>
8000
8001 * arm.cc (Target_arm::Target_arm): Move method definition outside of
8002 class definition. Add code to handle --target1-rel, --target1-abs
8003 and --target2= options.
8004 (Target_arm::get_reloc_reloc_type): Change method to be non-static
8005 and const.
8006 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
8007 member declaration.
8008 (Target_arm::Scan::local, Target_arm::Scan::global,
8009 Target_arm::Relocate::relocate,
8010 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
8011 call to Target_arm::get_real_reloc_type.
8012 (Target_arm::get_real_reloc_type): Use command line options to
8013 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
8014 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
8015 options.
8016
51938283
DK
80172009-11-25 Doug Kwan <dougkwan@google.com>
8018
8019 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
8020 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
8021 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
8022 formatting.
8023 (Arm_relocate_functions::thm_call): Replace body with a call to
8024 Arm_relocate_functions::thumb_branch_common.
8025 (Arm_relocate_functions::thm_jump24,
8026 Arm_relocate_functions::thm_xpc22): New method definitions.
8027 (Arm_relocate_functions::thumb_branch_common): New method definition.
8028 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
8029 operator.
8030 (Target_arm::Relocate::relocate): Adjust call to thm_call.
8031 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
8032
e2b8f3c4
RÁE
80332009-11-24 Rafael Avila de Espindola <espindola@google.com>
8034
8035 * Makefile.am: Build incremental-dump
8036 * Makefile.in: Regenerate.
8037 * incremental-dump.cc: New.
8038 * incremental.cc (Incremental_inputs_header_data,
8039 Incremental_inputs_entry_data): Move to incremental.h
8040 * incremental.h: (Incremental_inputs_header_data,
8041 Incremental_inputs_entry_data): Move from incremental.cc
8042
bcba9aec
RÁE
80432009-11-24 Rafael Avila de Espindola <espindola@google.com>
8044
8045 * incremental.cc (Incremental_inputs_header,
8046 Incremental_inputs_header_write, Incremental_inputs_entry,
8047 Incremental_inputs_entry_write): Add a typedef with the data type.
8048
7c3afe08
RÁE
80492009-11-24 Rafael Avila de Espindola <espindola@google.com>
8050
8051 * incremental.cc (Incremental_inputs_header,
8052 Incremental_inputs_header_write, Incremental_inputs_entry,
8053 Incremental_inputs_entry_write): Update comment about which
8054 type has the filed descriptions.
8055
d204b6e9
DK
80562009-11-15 Doug Kwan <dougkwan@google.com>
8057
8058 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
8059 (Arm_relocate_functions::arm_branch_common): Change method defintion
8060 in class definition to a method declaration and update list of formal
8061 parameters.
8062 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
8063 Arm_relocation_functions::jump24): Adjust call to
8064 Arm_relocate_functions::arm_branch_common. Update list of formal
8065 parameters.
8066 (Arm_relocate_functions::xpc25): New method definition.
8067 (Arm_relocate_functions::arm_branch_common): Move method defintion
8068 out from class definition. Use stubs for mode-switching and extending
8069 branch ranges.
8070 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
8071 specially. Change code to enable use of stubs in ARM branches.
8072
43d12afe
DK
80732009-11-10 Doug Kwan <dougkwan@google.com>
8074
8075 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
8076 in method declaration.
8077 (Target_arm::relocate_stub): New method declaration.
8078 (Target_arm::default_target): Change to return a pointer instead of
8079 a const reference.
8080 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
8081 Target_arm::default_target.
8082 (Arm_Relobj::do_relocate_sections): Remove options paramater in
8083 method definition.
8084 (Target_arm::relocate_section): Adjust view.
8085 (Target_arm::relocate_stub): New method definition.
8086
ac33a407
DK
80872009-11-10 Doug Kwan <dougkwan@google.com>
8088
8089 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
8090 a format warning.
8091 * incremental.cc (open_incremental_binary): Initialized local
8092 variables to avoid warnings.
8093 * object.cc (make_elf_object): Ditto.
8094 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
8095 a format warning.
e1df38aa 8096
88ee28e9
L
8097009-11-09 H.J. Lu <hongjiu.lu@intel.com>
8098
8099 PR gold/10930
8100 * testsuite/plugin_test.c: Include "config.h".
8101
2daedcd6
DK
81022009-11-09 Doug Kwan <dougkwan@google.com>
8103
8104 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
8105 (arm_symbol_value): Remove.
8106 (Arm_relocate_functions::arm_branch_common,
8107 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
8108 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
8109 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
8110 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
8111 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
8112 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
8113 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
8114 Arm_relocate_functions::thm_mobw_abs_nc,
8115 Arm_relocate_functions::thm_mov_abs,
8116 Arm_relocate_functions::movw_prel_nc,
8117 Arm_relocate_functions::thm_movt_abs,
8118 Arm_relocate_functions::movt_prel,
8119 Arm_relocate_functions::thm_movw_prel_nc,
8120 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
8121 (Target_arm::Relocate::relocate): Only decompose address into two
8122 parts if relocation type uses the thumb-bit and pass the actual
8123 bit instead of a flag indicating that the thumb-bit is used. Adjust
8124 calls to methods in Arm_relocate_functions for this change.
8125
1276bc89 81262009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
8127
8128 PR 10925
8129 * reloc.cc: Instantiate
8130 Sized_relobj::initialize_input_to_output_maps and
8131 Sized_relobj:free_input_to_output_maps.
8132
e53ad1b5
ILT
81332009-11-06 Ian Lance Taylor <iant@google.com>
8134
8135 PR 10876
8136 * defstd.cc (in_segment): Set only_if_ref true for "end".
8137
eb44217c
DK
81382009-11-06 Doug Kwan <dougkwan@google.com>
8139
8140 * arm.cc (class Reloc_stub): Correct a comment.
8141 (Target_arm::Target_arm): Initialize arm_input_section_map_.
8142 (Target_arm::scan_section_for_stubs): New method declaration.
8143 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
8144 Change methods from private to protected.
8145 (Target_arm::do_may_relax): New method definition.
8146 (Target_arm::do_relax, Target_arm::group_sections,
8147 Target_arm::scan_reloc_for_stub,
8148 Target_arm::scan_reloc_section_for_stubs): New method declarations.
8149 (Target_arm::arm_input_section_map_): New data member declaration.
8150 (Target_arm::scan_reloc_for_stub,
8151 Target_arm::scan_reloc_section_for_stubs,
8152 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
8153 Target_arm::do_relax): New method definitions.
8154
5d329b7d
ILT
81552009-11-06 Mikolaj Zalewski <mikolaj@google.com>
8156
8157 * configure.ac: Check for (struct stat)::st_mtim
8158 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
8159 * config.in: Regenerate.
8160 * configure: Regenerate.
8161
96a0d71b
ILT
81622009-11-05 Ian Lance Taylor <iant@google.com>
8163
8164 PR 10910
8165 * output.cc (Output_segment::add_output_section): Add missing
8166 return statement.
8167
594c8e5e
ILT
81682009-11-04 Ian Lance Taylor <iant@google.com>
8169
8170 PR 10880
8171 * object.h (class Object): Add is_needed and set_is_needed
8172 methods. Add is_needed_ field. Make bool fields into bitfields.
8173 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
8174 defined in a dynamic object and referenced by a regular object,
8175 set is_needed for the dynamic object.
8176 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
8177 if the file is marked with as_needed and it is not needed.
8178
22b127cc
ILT
81792009-11-04 Ian Lance Taylor <iant@google.com>
8180
8181 PR 10887
8182 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
8183 tags if data is discarded by linker script.
8184 * i386.cc (Target_i386::do_finalize_sections): Likewise.
8185 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
8186 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
8187 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
8188
f5c870d2
ILT
81892009-11-04 Ian Lance Taylor <iant@google.com>
8190
8191 * layout.cc (Layout::get_output_section): Add is_interp and
8192 is_dynamic_linker_section parameters. Change all callers.
8193 (Layout::choose_output_section): Likewise.
8194 (Layout::make_output_section): Likewise.
8195 (Layout::add_output_section_data): Add is_dynamic_linker_section
8196 parameter. Change all callers.
8197 * layout.h (class Layout): Update declarations.
8198 * output.h (class Output_section): Add is_interp, set_is_interp,
8199 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
8200 Add is_interp_, is_dynamic_linker_section_ fields. Change
8201 generate_code_fills_at_write_ to a bitfield.
8202 * output.cc (Output_section::Output_sections): Initialize new
8203 fields.
8204 (Output_segment::add_output_section): Add do_sort parameter.
8205 Change all callers.
8206
1ae4d23b
ILT
82072009-11-03 Ian Lance Taylor <iant@google.com>
8208
8209 PR 10860
8210 * options.h (class General_options): Add --warn-common.
8211 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
8212 merging two common symbols.
8213 (Symbol_table::should_override): Handle --warn-common when merging
8214 a common symbol with a defined symbol. Use report_resolve_problem
8215 for multiple definitions.
8216 (Symbol_table::report_resolve_problem): New function.
8217 * symtab.h (class Symbol_table): Declare report_resolve_problem.
8218
55da9579
DK
82192009-11-03 Doug Kwan <dougkwan@google.com>
8220
8221 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
8222 stub_factory_.
8223 (Target_arm::stub_factory): New method definition.
8224 (Target_arm::new_arm_input_section,
8225 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
8226 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 8227 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
8228 New type definitions.
8229 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
8230 member declarations.
8231 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
8232 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
8233 New method definitions.
8234
37a9ac43
ILT
82352009-11-03 Ian Lance Taylor <iant@google.com>
8236
8237 * options.h (class General_options): Add --warn_constructors.
8238
b3d6a3d4
ILT
82392009-11-03 Ian Lance Taylor <iant@google.com>
8240
8241 PR 10893
8242 * defstd.cc (in_section): Add entries for __rel_iplt_start,
8243 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
8244
934b01dd
ILT
82452009-11-03 Ian Lance Taylor <iant@google.com>
8246
8247 PR 10895
8248 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
8249 --msgid-bugs-address.
8250 (install-pdf): New target.
8251 (install-data_yes): Look up one directory to find mkinstalldirs.
8252
03c1939b
L
82532009-11-03 H.J. Lu <hongjiu.lu@intel.com>
8254
8255 * po/Make-in (.po.gmo): Don't generate .gmo files in source
8256 tree.
8257
ebd95253
DK
82582009-10-30 Doug Kwan <dougkwan@google.com>
8259
8260 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
8261
e9bbb538
DK
82622009-10-30 Doug Kwan <dougkwan@google.com>
8263
8264 * arm.cc (Stub_addend_reader): New struct template definition
8265 and partial specializations.
8266 (Stub_addend_reader::operator()): New method definition for a
8267 partially specialized template.
8268
d5b40221
DK
82692009-10-30 Doug Kwan <dougkwan@google.com>
8270
8271 * arm.cc (Arm_relobj::processor_specific_flags): New method
8272 definition.
8273 (Arm_relobj::do_read_symbols): New method declaration.
8274 (Arm_relobj::processor_specific_flags_): New data member declaration.
8275 (Arm_dynobj): New class definition.
8276 (Target_arm::do_finalize_sections): Add input_objects parameter.
8277 (Target_arm::do_adjust_elf_header): New method declaration.
8278 (Target_arm::are_eabi_versions_compatible,
8279 (Target_arm::merge_processor_specific_flags): New method declaration.
8280 (Target_arm::do_make_elf_object): New overloaded method definitions
8281 and declaration.
8282 (Arm_relobj::do_read_symbols): New method definition.
8283 (Arm_dynobj::do_read_symbols): Ditto.
8284 (Target_arm::do_finalize_sections): Add input_objects parameters.
8285 Merge processor-specific flags from all input objects.
8286 (Target_arm::are_eabi_versions_compatible,
8287 Target_arm::merge_processor_specific_flags,
8288 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
8289 New method definitions.
8290 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
8291 Input_objects pointer type parameter.
8292 * layout.cc (Layout::finalize): Pass input objects to target's.
8293 finalize_sections function.
8294 * output.cc (Output_file_header::do_sized_write): Set ELF file
8295 header's processor-specific flags.
8296 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
8297 Input_objects pointer type parameter.
8298 * sparc.cc (Target_sparc::do_finalize_sections): Same.
8299 * target.h (Input_objects): New forward class declaration.
8300 (Target::processor_specific_flags,
8301 Target::are_processor_specific_flags_sect): New method definitions.
8302 (Target::finalize_sections): Add input_objects parameter.
8303 (Target::Target): Initialize processor_specific_flags_ and
8304 are_processor_specific_flags_set_.
8305 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
8306 parameter.
8307 (Target::set_processor_specific_flags): New method definition.
8308 (Target::processor_specific_flags_,
8309 Target::are_processor_specific_flags_set_): New data member
8310 declarations.
8311 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
8312 Input_objects pointer type parameter.
8313
ebabffbd
DK
83142009-10-30 Doug Kwan <dougkwan@google.com>
8315
8316 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
8317
ad0f2072
ILT
83182009-10-28 Ian Lance Taylor <iant@google.com>
8319
8320 * object.h (class Relobj): Drop options parameter from
8321 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
8322 do_scan_relocs, do_relocate. Change all callers.
8323 (class Sized_relobj): Drop options parameters from
8324 do_gc_process_relocs, do_scan_relocs, do_relocate,
8325 do_relocate_sections, relocate_sections, emit_relocs_scan,
8326 emit_relocs_scan_reltype. Change all callers.
8327 (struct Relocate_info): Remove options field and all references to
8328 it.
8329 * reloc.h (class Read_relocs): Remove options constructor
8330 parameter and options_ field. Change all callers.
8331 (class Gc_process_relocs, class Scan_relocs): Likewise.
8332 (class Relocate_task): Likewise.
8333 * target-reloc.h (scan_relocs): Remove options parameter. Change
8334 all callers.
8335 (scan_relocatable_relocs): Likewise.
8336 * target.h (class Sized_target): Remove options parameter from
8337 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
8338 all callers.
8339 * gc.h (gc_process_relocs): Remove options parameter. Change all
8340 callers.
8341 * arm.cc: Update functions to remove options parameters.
8342 * i386.cc: Likewise.
8343 * powerpc.cc: Likewise.
8344 * sparc.cc: Likewise.
8345 * x86_64.cc: Likewise.
8346 * testsuite/testfile.cc: Likewise.
8347
8ffa3667
DK
83482009-10-28 Doug Kwan <dougkwan@google.com>
8349
8350 * arm.cc (Arm_relobj): New class definition.
e1df38aa 8351 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
8352 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
8353 New method definitions.
8354
40f36857
CC
83552009-10-28 Cary Coutant <ccoutant@google.com>
8356
8357 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
8358 (Plugin::cleanup_done_): New member.
8359 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
8360 (Plugin_manager::cleanup_done_): Remove.
8361 (Plugin_manager::add_input_file): Edit error message.
8362 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
8363 (Plugin_manager::cleanup): Remove use of cleanup_done_.
8364
2c849493
ILT
83652009-10-27 Mikolaj Zalewski <mikolajz@google.com>
8366
8367 * fileread.cc: (File_read::View::~View): Use the new
8368 data_ownership_ filed.
8369 (File_read::~File_read): Dispose the new whole_file_view_.
8370 (File_read::open): Mmap the whole file if needed.
8371 (File_read::open): Use whole_file_view_ instead of contents_.
8372 (File_read::find_view): Use whole_file_view_ if applicable.
8373 (File_read::do_read): Use whole_file_view_ instead of contents_.
8374 (File_read::make_view): Use whole_file_view_ instead of contents_,
8375 update File_read::View::View call.
8376 (File_read::find_or_make_view): Update File_read::View::View
8377 call.
8378 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
8379 remove contents_
8380 (File_read::View::Data_ownership): New enum.
8381 (File_read::View::View): Replace bool mapped_ with Data_ownership
8382 argument.
8383 (File_read::View::mapped_): Remove (replaced by data_ownership_).
8384 (File_read::View::data_ownership_): New field.
8385 (File_read::contents_): Remove (replaced by whole_file_view_).
8386 (File_read::whole_file_view_): New field.
8387 * options.h (class General_options): Add --keep-files-mapped.
8388
24998053
CC
83892009-10-27 Cary Coutant <ccoutant@google.com>
8390
8391 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
8392 * testsuite/Makefile.am (plugin_test_5): New test case.
8393 * testsuite/Makefile.in: Regenerate.
8394
72adc4fa
DK
83952009-10-25 Doug Kwan <dougkwan@google.com>
8396
8397 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
8398 from private to protected to allow access by child class.
8399 (Sized_relobj::do_relocate_sections): New method declaration.
8400 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 8401 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
8402 Sized_relobj::relocate_sections. Instantiate template explicitly
8403 for different target sizes and endianity.
8404
07f508a2
DK
84052009-10-24 Doug Kwan <dougkwan@google.com>
8406
8407 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
8408 (Arm_input_section::as_arm_input_section): New method.
8409 (Arm_output_section): New class definition.
8410 (Arm_output_section::create_stub_group,
8411 Arm_output_section::group_sections): New method definitions.
8412
10ad9fe5
DK
84132009-10-22 Doug Kwan <dougkwan@google.com>
8414
8415 * arm.cc (Arm_input_section): New class definition.
8416 (Arm_input_section::init, Arm_input_section:do_write,
8417 Arm_input_section::set_final_data_size,
8418 Arm_input_section::do_reset_address_and_file_offset): New method
8419 definitions.
8420
56ee5e00
DK
84212009-10-21 Doug Kwan <dougkwan@google.com>
8422
8423 * arm.cc (Stub_table, Arm_input_section): New forward class
8424 declarations.
8425 (Stub_table): New class defintion.
8426 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
8427 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
8428 New method definition.
8429
b569affa
DK
84302009-10-21 Doug Kwan <dougkwan@google.com>
8431
8432 * arm.cc: Update copyright comments.
8433 (Target_arm): New forward class template declaration.
8434 (Arm_address): New type.
8435 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
8436 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
8437 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
8438 constants.
8439 (Insn_template): Same.
8440 (DEF_STUBS): New macro.
8441 (Stub_type): New enum type.
8442 (Stub_template): New class definition.
8443 (Stub): Same.
8444 (Reloc_stub): Same.
8445 (Stub_factory): Same.
8446 (Target_arm::Target_arm): Initialize may_use_blx_ and
8447 should_force_pic_veneer_.
8448 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
8449 Target_arm::should_force_pic_veneer,
8450 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
8451 Target_arm::using_thumb_only, Target_arm:;default_target): New
8452 method defintions.
8453 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
8454 New data member declarations.
8455 (Insn_template::size, Insn_template::alignment): New method defintions.
8456 (Stub_template::Stub_template): New method definition.
8457 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
8458 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
8459 (Stub_factory::Stub_factory): New method definition.
8460 * gold.h (string_hash): New template.
8461 * output.h (Input_section_specifier::hash_value): Use
8462 gold::string_hash.
8463 (Input_section_specifier::string_hash): Remove.
8464 * stringpool.cc (Stringpool_template::string_hash): Use
8465 gold::string_hash.
8466
6c172549
DK
84672009-10-20 Doug Kwan <dougkwan@google.com>
8468
8469 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
8470 symbols of relaxed input sections.
8471 * output.h (Output_section::find_relaxed_input_section): Make
8472 method public.
8473
c5617f2f
DK
84742009-10-16 Doug Kwan <dougkwan@google.com>
8475
8476 * dynobj.cc (Versions::Versions): Initialize version_script_.
8477 Only insert base version symbol definition for a shared object
8478 if version script defines any version versions.
8479 (Versions::define_base_version): New method definition.
8480 (Versions::add_def): Check that base version is not needed.
8481 (Versions::add_need): Define base version lazily.
8482 * dynobj.h (Versions::define_base_version): New method declaration.
8483 (Versions::needs_base_version_): New data member declaration.
8484 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
8485 (check_DATA): Add no_version_test.stdout.
8486 (libno_version_test.so, no_version_test.o no_version_test.stdout):
8487 New make rules.
8488 * testsuite/Makefile.in: Regenerate.
8489 * testsuite/no_version_test.c: New file.
8490 * testsuite/no_version_test.sh: Ditto.
8491
3c12dcdb
DK
84922009-10-16 Doug Kwan <dougkwan@google.com>
8493
8494 * expression.cc (class Segment_start_expression): New class definition.
8495 (Segment_start_expression::value): New method definition.
8496 (script_exp_function_segment_start): Return a new
8497 Segment_start_expression.
8498 * gold/script-c.h (script_saw_segment_start_expression): New function
8499 prototype.
8500 * script-sections.cc (Script_sections::Script_sections): Initialize
8501 SAW_SEGMENT_START_EXPRESSION_ to false.
8502 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
8503 and -Tbbs options to specify section addresses if given in
8504 command line and no SEGMENT_START expression is seen in a script.
8505 * script-sections.h (Script_sections::saw_segment_start_expression,
8506 Script_sections::set_saw_segment_start_expression): New method
8507 definition.
8508 (Script_sections::saw_segment_start_expression_): New data member
8509 declaration.
8510 * script.cc (script_saw_segment_start_expression): New function.
8511 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
8512 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
8513 script_test_7.sh and script_test_8.sh.
8514 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
8515 script_test_8.stdout.
8516 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
8517 (script_test_6, script_test_6.stdout, script_test_7,
8518 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
8519 * Makefile.in: Regenerate.
8520 * testsuite/script_test_6.sh: New file.
8521 * testsuite/script_test_6.t: Same.
8522 * testsuite/script_test_7.sh: Same.
8523 * testsuite/script_test_7.t: Same.
8524 * testsuite/script_test_8.sh: Same.
8525
64b1ae37
DK
85262009-10-16 Doug Kwan <dougkwan@google.com>
8527
8528 * output.cc (Output_segment::set_section_list_address): Cast
8529 expressions to unsigned long long type to avoid format warnings.
8530
661be1e2
ILT
85312009-10-15 Ian Lance Taylor <iant@google.com>
8532
12edd763 8533 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 8534 dot assignment to script_sections_.
12edd763
ILT
8535 * script-sections.cc (Script_sections::add_dot_assignment):
8536 Initialize if necessary.
8537
68b6574b
ILT
8538 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
8539 program headers with no load segment if there is a linker script.
8540
661be1e2
ILT
8541 * layout.cc (Layout::set_segment_offsets): Align the file offset
8542 to the segment aligment for -N or -n with no load segment.
8543 * output.cc (Output_segment::add_output_section): Don't crash if
8544 the first section is a TLS section.
8545 (Output_segment::set_section_list_addresses): Print an error
8546 message if the address moves backward in a linker script.
8547 * script-sections.cc
8548 (Output_section_element_input::set_section_addresses): Don't
8549 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
8550 (Orphan_output_section::set_section_addresses): Likewise.
8551
f15f61a7
DK
85522009-10-15 Doug Kwan <dougkwan@google.com>
8553
8554 * layout.cc (Layout::finish_dynamic_section): Generate tags
8555 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
8556 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
8557 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
8558
82bb573a
ILT
85592009-10-14 Ian Lance Taylor <iant@google.com>
8560
8561 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
8562 fields.
8563 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
8564 data_shdr fields of relinfo.
8565 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
8566 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
8567 R_386_TLS_LDO_32, adjust based on section flags.
8568 (Target_i386::Relocate::fix_up_ldo): Remove.
8569
374ad285
ILT
85702009-10-13 Ian Lance Taylor <iant@google.com>
8571
8572 Add support for -pie.
8573 * options.h (class General_options): Add -pie and
8574 --pic-executable.
8575 (General_options::output_is_position_independent): Test -pie.
8576 (General_options::output_is_executable): Return true if not shared
8577 and not relocatable.
8578 (General_options::output_is_pie): Remove.
8579 * options.cc (General_options::finalize): Reject incompatible uses
8580 of -pie.
8581 * gold.cc (queue_middle_tasks): A -pie link is not static.
8582 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
8583 * symtab.cc (Symbol::final_value_is_known): Return false if
8584 output_is_position_independent.
8585 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
8586 output_is_position_independent.
8587 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
8588 output_is_position_independent.
8589 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
8590 output_is_position_independent.
8591 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
8592 two_file_pie_test.
8593 (basic_pie_test.o, basic_pie_test): New targets.
8594 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
8595 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
8596 (two_file_pie_test): New target.
8597 * testsuite/Makefile.in: Rebuild.
8598 * README: Remove note saying that -pie is not supported.
8599
c6585162
ILT
86002009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
8601
8602 * options.h (class General_options): Add -init and -fini.
8603 * layout.cc (Layout::finish_dynamic_section): Emit
8604 given init and fini functions.
8605
032ce4e9
ST
86062009-10-13 Sriraman Tallam <tmsriram@google.com>
8607
8608 * gc.h (gc_process_relocs): Check if icf is enabled using new
8609 function.
8610 * gold.cc (queue_initial_tasks): Likewise.
8611 (queue_middle_tasks): Likewise.
8612 * object.cc (do_layout): Likewise.
8613 * symtab.cc (is_section_folded): Likewise.
8614 * main.cc (main): Likewise.
8615 * reloc.cc (Read_relocs::run): Likewise.
8616 (Sized_relobj::do_scan_relocs): Likewise.
8617 * icf.cc (is_function_ctor_or_dtor): New function.
8618 (Icf::find_identical_sections): Check if function is ctor or dtor when
8619 safe icf is chosen.
8620 * options.h (General_options::icf): Change option to be an enum.
8621 (Icf_status): New enum.
8622 (icf_enabled): New method.
8623 (icf_safe_folding): New method.
8624 (set_icf_status): New method.
8625 (icf_status_): New variable.
8626 * (options.cc) (General_options::finalize): Set icf_status_.
8627 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
8628 icf_test and icf_keep_unique_test to use the --icf enum flag.
8629 * testsuite/icf_safe_test.sh: New file.
e1df38aa 8630 * testsuite/icf_safe_test.cc: New file.
032ce4e9 8631
f345227a
ST
86322009-10-12 Sriraman Tallam <tmsriram@google.com>
8633
8634 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
8635 includes to gc.h and icf.h.
8636 * arm.cc: Include gc.h.
8637 * gold.cc: Likewise.
8638 * i386.cc: Likewise.
8639 * powerpc.cc: Likewise.
8640 * sparc.cc: Likewise.
8641 * x86_64.cc: Likewise.
8642 * gc.h: Include icf.h.
8643
1c7814ed
ILT
86442009-10-11 Ian Lance Taylor <iant@google.com>
8645
8646 * plugin.cc: Include "gold.h" before other header files.
8647
ae3b5189
CD
86482009-10-10 Chris Demetriou <cgd@google.com>
8649
8650 * options.h (Input_file_argument::Input_file_type): New enum.
8651 (Input_file_argument::is_lib_): Replace with...
8652 (Input_file_argument::type_): New member.
8653 (Input_file_argument::Input_file_argument): Take Input_file_type
8654 'type' rather than boolean 'is_lib' as second argument.
8655 (Input_file_argument::is_lib): Use type_.
8656 (Input_file_argument::is_searched_file): New function.
8657 (Input_file_argument::may_need_search): Handle is_searched_file.
8658 * options.cc (General_options::parse_library): Support -l:filename.
8659 (General_options::parse_just_symbols): Update for Input_file_argument
8660 changes.
8661 (Command_line::process): Likewise.
8662 * archive.cc (Archive::get_file_and_offset): Likewise.
8663 * plugin.cc (Plugin_manager::release_input_file): Likewise.
8664 * script.cc (read_script_file, script_add_file): Likewise.
8665 * fileread.cc (Input_file::Input_file): Likewise.
8666 (Input_file::will_search_for): Handle is_searched_file.
8667 (Input_file::open): Likewise.
8668 * readsyms.cc (Read_symbols::get_name): Likewise.
8669 * testsuite/Makefile.am (searched_file_test): New test.
8670 * testsuite/Makefile.in: Regenerate.
8671 * testsuite/searched_file_test.cc: New file.
8672 * testsuite/searched_file_test_lib.cc: New file.
8673
f3048a1d
ILT
86742009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8675 Ian Lance Taylor <iant@google.com>
8676
8677 * descriptor.cc: Include <cstdio> and "binary-io.h".
8678 (Descriptors::open): Open the files in binary mode always.
8679 * script.cc (Lex::get_token): Treat \r as whitespace.
8680
d4780e57
ILT
86812009-10-09 Ian Lance Taylor <iant@google.com>
8682
8683 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
8684
d9a893b8
ILT
86852009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8686 Ian Lance Taylor <iant@google.com>
8687
8688 * configure.ac: Check for readv function also.
8689 * fileread.cc (readv): Define if not HAVE_READV.
8690 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
8691 does not exist.
8692 * config.in: Regenerate.
8693 * configure: Regenerate.
8694
c0a62865
DK
86952009-10-09 Doug Kwan <dougkwan@google.com>
8696
8697 * layout.cc (Layout::make_output_section): Call target hook to make
8698 ordinary output section.
8699 (Layout::finalize): Adjust parameter list of call the
8700 Target::may_relax().
8701 * layout.h (class Layout::section_list): New method.
8702 * merge.h (Output_merge_base::entsize): Change visibility to public.
8703 (Output_merge_base::is_string, Output_merge_base::do_is_string):
8704 New methods.
8705 (Output_merge_string::do_is_string): New method.
8706 * object.cc (Sized_relobj::do_setup): renamed from
8707 Sized_relobj::set_up.
8708 * object.h (Sized_relobj::adjust_shndx,
8709 Sized_relobj::initializ_input_to_output_maps,
8710 Sized_relobj::free_input_to_output_maps): Change visibilities to
8711 protected.
8712 (Sized_relobj::setup): Virtualize.
8713 (Sized_relobj::do_setup): New method declaration.
8714 (Sized_relobj::invalidate_section_offset,
8715 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
8716 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
8717 * options.cc (parse_int): New function.
8718 * options.h (parse_int): New declaration.
8719 (DEFINE_int): New macro.
8720 (stub_group_size): New option.
8721 * output.cc (Output_section::Output_section): Initialize memebers
8722 merge_section_map_, merge_section_by_properties_map_,
8723 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
8724 (Output_section::add_input_section): Handled deferred code-fill
8725 generation and remove an old comment.
8726 (Output_section::add_relaxed_input_section): New method definition.
8727 (Output_section::add_merge_input_section): Use merge section by
8728 properties map to speed to search. Update merge section maps
8729 as appropriate.
8730 (Output_section::build_relaxation_map): New method definition.
8731 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
8732 Same.
8733 (Output_section::relax_input_section): Renamed to
8734 Output_section::convert_input_sections_to_relaxed_sections and change
8735 interface to take a vector of pointers to relaxed sections.
8736 (Output_section::find_merge_section,
8737 Output_section::find_relaxed_input_section): New method definitions.
8738 (Output_section::is_input_address_mapped,
8739 Output_section::output_offset, Output_section::output_address):
8740 Use output section data maps to speed up searching.
8741 (Output_section::find_starting_output_address): Add comments.
8742 (Output_section::do_write,
8743 Output_section::write_to_postprocessing_buffer): Do code-fill
8744 generation as appropriate.
8745 (Output_section::get_input_sections): Invalidate relaxed input section
8746 map.
8747 (Output_section::restore_states): Adjust type of checkpoint .
8748 Invalidate relaxed input section map.
8749 * output.h (Output_merge_base): New class declaration.
8750 (Input_section_specifier): New class defintion.
8751 (class Output_relaxed_input_section) Change base class to
8752 Output_section_data_build.
8753 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
8754 base class initializer.
8755 (Output_section::add_relaxed_input_section): New method declaration.
8756 (Output_section::Input_section): Change visibility to protected.
2e702c99 8757 (Output_section::Input_section::relobj,
c0a62865
DK
8758 Output_section::Input_section::shndx): Handle relaxed input sections.
8759 Output_section::input_sections) Change visibility to protected. Also
8760 define overload to return a non-const pointer.
8761 (Output_section::Merge_section_properties): New class defintion.
8762 (Output_section::Merge_section_by_properties_map,
8763 Output_section::Output_section_data_by_input_section_map,
8764 Output_section::Relaxation_map): New types.
8765 (Output_section::relax_input_section): Rename method to
8766 Output_section::convert_input_sections_to_relaxed_sections and change
8767 interface to take a vector of relaxed section pointers.
8768 (Output_section::find_merge_section,
8769 Output_section::find_relaxed_input_section,
8770 Output_section::build_relaxation_map,
8771 Output_section::convert_input_sections_in_list_to_relaxed_sections):
8772 New method declarations.
8773 (Output_section::merge_section_map_
8774 Output_section::merge_section_by_properties_map_,
8775 Output_section::relaxed_input_section_map_,
8776 Output_section::is_relaxed_input_section_map_valid_,
8777 Output_section::generate_code_fills_at_write_): New data members.
8778 * script-sections.cc
8779 (Output_section_element_input::set_section_addresses): Call
8780 current_data_size and addralign methods of relaxed input sections.
8781 (Orphan_output_section::set_section_addresses): Call current_data_size
8782 and addralign methods of relaxed input sections.
8783 * symtab.cc (Symbol_table::compute_final_value): Extract template
8784 from the body of Symbol_table::sized_finalize_symbol.
8785 (Symbol_table::sized_finalized_symbol): Call
8786 Symbol_table::compute_final_value.
8787 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
8788 (Symbol_table::compute_final_value): New templated method declaration.
8789 * target.cc (Target::do_make_output_section): New method defintion.
8790 * target.h (Target::make_output_section): New method declaration.
8791 (Target::relax): Add more parameters for input objects, symbol table
8792 and layout. Adjust call to do_relax.
8793 (Target::do_make_output_section): New method declaration.
8794 (Target::do_relax): Add parameters for input objects, symbol table
8795 and layout.
8796
d446d6c4
ILT
87972009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8798
8799 * pread.c: Include stdio.h.
8800
bc06c745
ILT
88012009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8802
8803 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
8804 defined.
8805
75aea3d0
ILT
88062009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
8807
8808 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
8809 Change read_shndx type to unsigned int.
8810 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
8811 int.
8812 (Sized_dwarf_line_info::read_line_mappings): Likewise.
8813 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
8814 Change read_shndx type to unsigned int.
8815 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
8816 int.
8817 (Sized_dwarf_line_info::read_line_mappings): Likewise.
8818 * layout.cc (Layout::create_symtab_sections): Cast the result of
8819 local_symcount * symsize to off_t in the gold_assert.
8820
be8fcb75
ILT
88212009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8822
8823 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
8824 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
8825 R_ARM_BASE_ABS.
8826 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
8827 (Arm_relocate_functions::thm_abs5): New function.
8828 (Arm_relocate_functions::abs12): New function.
8829 (Arm_relocate_functions::abs16): New function.
8830 (Arm_relocate_functions::base_abs): New function.
8831 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
8832 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
8833 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
8834 R_ARM_BASE_ABS.
8835 (Scan::global): Likewise.
8836 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
8837 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
8838 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
8839 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
8840 R_ARM_BASE_ABS.
8841
c2a122b6
ILT
88422009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8843
8844 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
8845 (Arm_relocate_functions::movt_prel): New function.
8846 (Arm_relocate_functions::thm_movw_prel_nc): New function.
8847 (Arm_relocate_functions::thm_movt_prel): New function.
8848 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
8849 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
8850 (Scan::global, Relocate::relocate): Likewise.
8851 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8852
c4aa1e2d
ILT
88532009-10-09 Mikolaj Zalewski <mikolajz@google.com>
8854
8855 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
8856 Incremental_checker.
8857 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
8858 unsigned int.
8859 (class Incremental_inputs_header): New class.
8860 (Incremental_inputs_header_writer): Edit comment.
8861 (Incremental_inputs_entry): New class.
8862 (Incremental_inputs_entry_writer): Edit comment.
8863 (Sized_incremental_binary::do_find_incremental_inputs_section):
8864 Add *strtab_shndx parameter, fill it.
8865 (Sized_incremental_binary::do_check_inputs): New method.
8866 (Incremental_checker::can_incrementally_link_output_file): Use
8867 Sized_incremental_binary::check_inputs.
8868 (Incremental_inputs::report_command_line): Save command line in
8869 command_line_.
8870 * incremental.h:
8871 (Incremental_binary::find_incremental_inputs_section): New
8872 method.
8873 (Incremental_binary::do_find_incremental_inputs_section): Add
8874 strtab_shndx parameter.
8875 (Incremental_binary::do_check_inputs): New pure virtual method.
8876 (Sized_incremental_binary::do_check_inputs): Declare.
8877 (Incremental_checker::Incremental_checker): Add incremental_inputs
8878 parameter, use it to initialize incremental_inputs_.
8879 (Incremental_checker::incremental_inputs_): New field.
8880 (Incremental_checker::command_line): New method.
8881 (Incremental_checker::inputs): New method.
8882 (Incremental_checker::command_line_): New field.
8883
c549a694
ILT
88842009-10-09 Mikolaj Zalewski <mikolajz@google.com>
8885
8886 * incremental.cc: Include <cstdarg> and "target-select.h".
8887 (vexplain_no_incremental): New function.
8888 (explain_no_incremental): New function.
8889 (Incremental_binary::error): New method.
8890 (Sized_incremental_binary::do_find_incremental_inputs_section): New
8891 method.
8892 (make_sized_incremental_binary): New function.
8893 (open_incremental_binary): New function.
8894 (can_incrementally_link_file): Add checks if output is ELF and has
8895 inputs section.
8896 * incremental.h: Include "elfcpp_file.h" and "output.h".
8897 (Incremental_binary): New class.
8898 (Sized_incremental_binary): New class.
8899 (open_incremental_binary): Declare.
8900 * object.cc (is_elf_object): Use
8901 elfcpp::Elf_recognizer::is_elf_file.
8902 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
8903 * output.h (Output_file::filesize): New method.
8904
fd3c5f0b
ILT
89052009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8906
8907 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
8908 New function.
8909 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
8910 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
8911 function.
8912 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
8913 function.
8914 (Arm_relocate_functions::movw_abs_nc): New function.
8915 (Arm_relocate_functions::movt_abs): New function.
8916 (Arm_relocate_functions::thm_movw_abs_nc): New function.
8917 (Arm_relocate_functions::thm_movt_abs): New function.
8918 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
8919 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
8920 (Scan::global): Likewise.
8921 (Relocate::relocate): Likewise.
8922 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8923
7f5309a5
ILT
89242009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
8925
8926 * arm.cc (Arm_relocate_functions::got_prel) New function.
8927 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
8928 (Relocate::relocate): Likewise.
8929 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
8930
364c7fa5
ILT
89312009-10-06 Ian Lance Taylor <iant@google.com>
8932
8933 * options.h (class General_options): Define
8934 split_stack_adjust_size parameter.
8935 * object.h (class Object): Add uses_split_stack_ and
8936 has_no_split_stack_ fields. Add uses_split_stack and
8937 has_no_split_stack accessor functions. Declare
8938 handle_split_stack_section.
8939 (class Reloc_symbol_changes): Define.
8940 (class Sized_relobj): Define Function_offsets. Declare
8941 split_stack_adjust, split_stack_adjust_reltype, and
8942 find_functions.
8943 * object.cc (Object::handle_split_stack_section): New function.
8944 (Sized_relobj::do_layout): Call handle_split_stack_section.
8945 * dynobj.cc (Sized_dynobj::do_layout): Call
8946 handle_split_stack_section.
8947 * reloc.cc (Sized_relobj::relocate_sections): Call
8948 split_stack_adjust for executable sections in split_stack
8949 objects. Pass reloc_map to relocate_section.
8950 (Sized_relobj::split_stack_adjust): New function.
8951 (Sized_relobj::split_stack_adjust_reltype): New function.
8952 (Sized_relobj::find_functions): New function.
8953 * target-reloc.h: Include "object.h".
8954 (relocate_section): Add reloc_symbol_changes parameter. Change
8955 all callers.
8956 * target.h (class Target): Add calls_non_split method. Declare
8957 do_calls_non_split virtual method. Declare match_view and
8958 set_view_to_nop.
8959 * target.cc: Include "elfcpp.h".
8960 (Target::do_calls_non_split): New function.
8961 (Target::match_view): New function.
8962 (Target::set_view_to_nop): New function.
8963 * gold.cc (queue_middle_tasks): Give an error if mixing
8964 split-stack and non-split-stack objects with -r.
8965 * i386.cc (Target_i386::relocate_section): Add
8966 reloc_symbol_changes parameter.
8967 (Target_i386::do_calls_non_split): New function.
8968 * x86_64.cc (Target_x86_64::relocate_section): Add
8969 reloc_symbol_changes parameter.
8970 (Target_x86_64::do_calls_non_split): New function.
8971 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
8972 parameter.
8973 * powerpc.cc (Target_powerpc::relocate_section): Add
8974 reloc_symbol_changes parameter.
8975 * sparc.cc (Target_sparc::relocate_section): Add
8976 reloc_symbol_changes parameter.
8977 * configure.ac: Call AM_CONDITIONAL for the default target.
8978 * configure: Rebuild.
8979 * testsuite/Makefile.am (TEST_AS): New variable.
8980 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
8981 (check_DATA): Add split_i386 and split_x86_64 files.
8982 (SPLIT_DEFSYMS): Define.
8983 (split_i386_[1234n].o): New targets.
8984 (split_i386_[124]): New targets.
8985 (split_i386_[1234r].stdout): New targets.
8986 (split_x86_64_[1234n].o): New targets.
8987 (split_x86_64_[124]): New targets.
8988 (split_x86_64_[1234r].stdout): New targets.
8989 (MOSTLYCLEANFILES): Add new executables.
8990 * testsuite/split_i386.sh: New file.
8991 * testsuite/split_x86_64.sh: New file.
8992 * testsuite/split_i386_1.s: New file.
8993 * testsuite/split_i386_2.s: New file.
8994 * testsuite/split_i386_3.s: New file.
8995 * testsuite/split_i386_4.s: New file.
8996 * testsuite/split_i386_n.s: New file.
8997 * testsuite/split_x86_64_1.s: New file.
8998 * testsuite/split_x86_64_2.s: New file.
8999 * testsuite/split_x86_64_3.s: New file.
9000 * testsuite/split_x86_64_4.s: New file.
9001 * testsuite/split_x86_64_n.s: New file.
9002 * testsuite/testfile.cc (Target_test): Update relocation_section
9003 function.
9004 * testsuite/Makefile.in: Rebuild.
9005
e8a9fcda
ILT
90062009-10-06 Ian Lance Taylor <iant@google.com>
9007
9008 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
9009 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
9010 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
9011 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
9012 the address on ldo_addrs_.
9013 (Target_i386::Relocate::fix_up_ldo): New function.
9014
e99daf92
ILT
90152009-10-06 Rafael Espindola <espindola@google.com>
9016
9017 * plugin.cc (add_input_library): New.
9018 (Plugin::load): Add add_input_library to tv.
9019 (Plugin_manager::add_input_file): Add the is_lib argument.
9020 (add_input_file): Update call to Plugin_manager::add_input_file.
9021 (add_input_library): New.
9022 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
9023
966d4097
DK
90242009-09-30 Doug Kwan <dougkwan@google.com>
9025
9026 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
9027 symbol and call Symbol::may_need_copy_reloc to determine if
9028 a copy reloc is needed.
9029 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
9030 nocopyreloc is given in command line.
9031 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
9032 given in command line.
9033 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
9034 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
9035 of the removed Target_i386::may_need_copy_reloc.
9036 * options.h (copyreloc): New option with default value false.
9037 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9038 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
9039 instead of the removed Target_powerpc::may_need_copy_reloc.
9040 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
9041 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
9042 instead of the removed Target_sparc::may_need_copy_reloc.
9043 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
9044 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
9045 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
9046 instead of the removed Target_x86_64::may_need_copy_reloc.
9047
029ba973
ILT
90482009-09-30 Ian Lance Taylor <iant@google.com>
9049
9050 * object.h (class Object): Remove target_ field, and target,
9051 sized_target, and set_target methods.
9052 (Object::sized_target): Remove.
9053 (class Sized_relobj): Update declarations. Remove sized_target.
9054 * object.cc (Sized_relobj::setup): Remove target parameter.
9055 Change all callers.
9056 (Input_objects::add_object): Don't do anything with the target.
9057 (make_elf_sized_object): Add punconfigured parameter. Change all
9058 callers. Set or test parameter target.
9059 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
9060 Change all callers.
9061 * parameters.cc (Parameters::set_target): Change parameter type to
9062 be non-const.
9063 (Parameters::default_target): Remove.
9064 (set_parameters_target): Change parameter type to be non-const.
9065 (parameters_force_valid_target): New function.
9066 (parameters_clear_target): New function.
9067 * parameters.h (class Parameters): Update declarations. Remove
9068 default_target method. Add sized_target and clear_target
9069 methods. Change target_ to be non-const.
9070 (set_parameters_target): Update declaration.
9071 (parameters_force_valid_target): Declare.
9072 (parameters_clear_target): Declare.
9073 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
9074 as NULL if we aren't searching.
9075 (Add_symbols::run): Don't check for compatible target.
9076 * fileread.cc (Input_file::open_binary): Call
9077 parameters_force_valid_target.
9078 * gold.cc (queue_middle_tasks): Likewise.
9079 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
9080 set_target on object.
9081 * dynobj.h (class Sized_dynobj): Update declarations.
9082 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
9083 make_elf_object returns NULL.
9084 (Archive::include_member): Don't check whether object target is
9085 compatible.
9086 * output.cc (Output_section::add_input_section): Get target from
9087 parameters.
9088 (Output_section::relax_input_section): Likewise.
9089 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
9090 parameters.
9091 (Sized_relobj::do_scan_relocs): Likewise.
9092 (Sized_relobj::relocate_sections): Likewise.
9093 * resolve.cc (Symbol_table::resolve): Likewise.
9094 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
9095 parameter. Change all callers.
9096 (Symbol_table::add_from_object): Get target from parameters.
9097 (Symbol_table::add_from_relobj): Don't check object target.
9098 (Symbol_table::add_from_dynobj): Likewise.
9099 (Symbol_table::define_special_symbol): Get target from
9100 parameters.
9101 * symtab.h (class Symbol_table): Update declaration.
9102 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
9103 parameter. Change all callers. Clear parameter target.
9104 (Binary_test): Test target here.
9105 * testsuite/object_unittest.cc (gold_testsuite): Remove
9106 target_test_pointer parameter. Change all callers.
9107 (Object_test): Test target here.
9108
a6a22b83
ILT
91092009-09-26 Ian Lance Taylor <iant@google.com>
9110
9111 * testsuite/initpri1.c: Don't try to use constructor priorities if
9112 compiling with gcc before 4.3.
9113
6a8f49fe
ILT
91142009-09-22 Mikolaj Zalewski <mikolajz@google.com>
9115
9116 * testsuite/retain_symbols_file_test.sh (check_present): Change
9117 output file name to retain_symbols_file_test.stdout.
9118 (check_absent): Likewise.
9119
8c604651
CS
91202009-09-18 Craig Silverstein <csilvers@google.com>
9121
9122 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
9123 * options.cc: Include <cerrno> and <fstream>.
9124 (General_options::finalize): Parse -retain-symbols-file tag.
9125 * options.h: New flag.
9126 (General_options): New method should_retain_symbol, new
9127 variable symbols_to_retain.
9128 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
9129 should_retain_symbol map.
9130 * testsuite/Makefile.am (retain_symbols_file_test): New test.
9131 * testsuite/Makefile.in: Regenerate.
9132 * testsuite/retain_symbols_file_test.sh: New file.
9133
ca58b19f
NC
91342009-09-18 Nick Clifton <nickc@redhat.com>
9135
9136 * po/es.po: Updated Spanish translation.
9137
20e6d0d6
DK
91382009-09-17 Doug Kwan <dougkwan@google.com>
9139
9140 * debug.h (DEBUG_RELAXATION): New constant.
9141 (DEBUG_ALL): Add DEBUG_RELAXATION.
9142 (debug_string_to_enum): Add relaxation debug option.
9143 * layout.cc
9144 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
9145 Layout::Relaxation_debug_check::read_sections,
9146 Layout::Relaxation_debug_check::read_sections): New method definitions.
9147 (Layout::Layout): Initialize data members
9148 record_output_section_data_from_scrips_,
9149 script_output_section_data_list_ and relaxation_debug_check_.
9150 (Layout::save_segments, Layout::restore_segments,
9151 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9152 Layout::relaxation_loop_body): New method definitions.
9153 (Layout::finalize): Support relaxation. Move section layout code to
9154 Layout::relaxation_loop_body.
9155 (Layout::set_asection_address_from_script): Move code for orphan
9156 section placement out.
9157 (Layout::place_orphan_sections_in_script): New method definition.
9158 * layout.h (Output_segment_headers, Output_file_header):
9159 New forward class declarations.
9160 (Layout::~Layout): Define.
9161 (Layout::new_output_section_data_from_script): New method definition.
9162 (Layout::place_orphan_sections_in_script): New method declaration.
9163 (Layout::Segment_states): New type declaration.
9164 (Layout::save_segments, Layout::restore_segments,
9165 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
9166 Layout::relaxation_loop_body): New method declarations.
9167 (Layout::Output_section_data_list): New type declaration.
9168 (Layout::Relaxation_debug_check): New class definition.
9169 (Layout::record_output_section_data_from_script_,
9170 Layout::script_output_section_data_list_, Layout::segment_states_,
9171 Layout::relaxation_debug_check_): New data members.
9172 * output.cc: (Output_section_headers::do_size): New method definition.
9173 (Output_section_headers::Output_section_headers): Move size
9174 computation to Output_section_headers::do_size.
9175 (Output_segment_headers::do_size): New method definition.
e1df38aa 9176 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
9177 Output_file_header::do_size and call it.
9178 (Output_file_header::do_size): New method definition.
9179 (Output_data_group::Output_data_group): Adjust call to
9180 Output_section_data.
9181 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
9182 (Output_symtab_xindex::do_write): Add array bound check.
2e702c99 9183 (Output_section::Input_section::print_to_mapfile): Handle
20e6d0d6
DK
9184 RELAXED_INPUT_SECTION_CODE.
9185 (Output_section::Output_section): Initialize data member checkpoint_.
9186 (Output_section::~Output_section): Delete checkpoint object pointed
9187 by checkpoint_.
9188 (Output_section::add_input_section): Always add an Input_section if
9189 relaxing.
9190 (Output_section::add_merge_input_section): Add assert.
9191 (Output_section::relax_input_section): New method definition.
9192 (Output_section::set_final_data_size): Set load address to zero for
9193 an unallocated section.
9194 (Output_section::do_address_and_file_offset_have_reset_values):
9195 New method definition.
9196 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
9197 Handle relaxed input section.
9198 (Output_section::sort_attached_input_sections): Checkpoint input
9199 section list lazily.
9200 (Output_section::get_input_sections): Change type of input_sections to
9201 list of Simple_input_section pointers. Checkpoint input section list
9202 lazily. Also handle relaxed input sections.
9203 (Output_section::add_input_section_for_script): Take a reference to
9204 a Simple_input_section object instead of Relobj pointer and section
9205 index as parameter. Handle relaxed input sections.
9206 (Output_section::save_states, Output_section::restore_states): New
9207 method definitions.
9208 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
9209 (Output_data::is_data_size_fixed): New method definition.
9210 (Output_data::reset_addresss_and_file_offset): Do not reset data size
9211 if it is fixed.
9212 (Output_data::address_and_file_offset_have_reset_values): New method
9213 definition.
9214 (Output_data::do_address_and_file_offset_have_reset_values): New method
9215 definition.
9216 (Output_data::set_data_size): Check that data size is not fixed.
9217 (Output_data::fix_data_size): New method definition.
9218 (Output_data::is_data_size_fixed_): New data member.
9219 (Output_section_headers::set_final_data_size): New method definition.
9220 (Output_section_headers::do_size): New method declaration.
9221 (Output_segment_headers::set_final_data_size): New method definition.
9222 (Output_segment_headers::do_size): New method declaration.
9223 (Output_file_header::set_final_data_size)::New method definition.
9224 (Output_file_header::do_size)::New method declaration.
9225 (Output_section_data::Output_section_data): Add new parameter
9226 is_data_size_fixed and use it to fix data size.
9227 (Output_data_const::Output_data_const): Adjust call to base class
9228 constructor and fix data size.
9229 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
9230 base class constructor and fix data size.
9231 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
9232 base class constructor and fix data size.
9233 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
9234 class constructor and fix data size.
9235 (Output_data_group::set_final_data_size): New method definition.
9236 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
9237 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
9238 class constructor and fix data size.
9239 (Output_relaxed_input_section): New class definition.
9240 (Output_section::Simple_input_section): New class definition.
9241 (Output_section::get_input_sections): Adjust parameter list.
9242 (Output_section::add_input_section_for_script): Same.
9243 (Output_section::save_states, Output_section::restore_states,
9244 Output_section::do_address_and_file_offset_have_reset_values,
9245 (Output_section::Input_section::Input_section): Handle
9246 RELAXED_INPUT_SECTION_CODE. Add new overload for
9247 Output_relaxed_input_section.
9248 (Output_section::Input_section::is_input_section,
9249 Output_section::Input_section::set_output_section): Handle relaxed
9250 input section.
9251 (Output_section::Input_section::is_relaxed_input_section,
9252 Output_section::Input_section::output_section_data,
9253 Output_section::Input_section::relaxed_input_section): New method
9254 definitions.
9255 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
9256 value.
9257 (Output_section::Input_section::u1_): Update comments.
9258 (Output_section::Input_section::u2_): Add new union member poris.
9259 (Output_section::Checkpoint_output_section): New classs definition.
9260 (Output_section::relax_input_section): New method declaration.
9261 (Output_section::checkpoint_): New data member.
9262 (Output_segment): Update comments.
9263 (Output_segment::Output_segment): Un-privatize copy constructor.
9264 (Output_segment::operator=): Un-privatize.
9265 * script-sections.cc (Output_section_element::Input_section_list):
9266 Change element type to Output_section::Simple_input_section.
9267 (Output_section_element_dot_assignment::set_section_addresses):
9268 Register output section data for relaxation clean up.
9269 (Output_data_exression::Output_data_expression): Adjust call to base
9270 constructor to fix data size.
9271 (Output_section_element_data::set_section_addresses): Register
9272 Output_data_expression object for relaxation clean up.
9273 (struct Input_section_info): Replace Relobj pointer and section index
9274 pair with Output_section::Simple_input_section and Convert struct to a
9275 class.
9276 (Input_section_sorter::operator()): Adjust access to
e1df38aa 9277 Input_section_info data member to use accessors.
20e6d0d6
DK
9278 (Output_section_element_input::set_section_addresses): Use layout
9279 parameter. Adjust code to use Output_section::Simple_input_section
9280 and Input_secction_info classes. Register filler for relaxation
9281 clean up.
9282 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
9283 and section index pair with Output_section::Simple_input_section
9284 class. Adjust code accordingly.
9285 (Phdrs_element::release_segment): New method definition.
9286 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
9287 segment list.
9288 (Script_sections::release_segments): New method definition.
9289 * gold/script-sections.h (Script_sections::release_segments): New
9290 method declaration.
9291 * gold/target.h (Target::may_relax, Target::relax,
9292 Target::do_may_relax, Target::do_relax): New method definitions.
9293
5e445df6
ILT
92942009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
9295
9296 * arm.cc (has_signed_unsigned_overflow): New function.
9297 (Arm_relocate_functions::abs8): New function.
9298 (Target_arm::Scan::local): Handle R_ARM_ABS8.
9299 (Target_arm::Scan::global): Likewise.
9300 (Target_arm::relocate::relocate): Likewise.
9301 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
9302 Likewise.
9303
8c604651 93042009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
9305
9306 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
9307 * testsuite/Makefile.in: Regenerate.
9308
1e9cc1c2
NC
93092009-09-11 Nick Clifton <nickc@redhat.com>
9310
9311 * po/gold.pot: Updated by the Translation project.
9312
6a89f575
CC
93132009-09-08 Cary Coutant <ccoutant@google.com>
9314
9315 * output.cc (Output_file::open): Add execute permission to empty file.
9316 * testsuite/Makefile.am (permission_test): New test.
9317 * testsuite/Makefile.in: Regenerate.
9318
fdcac5af
ILT
93192009-09-02 Ian Lance Taylor <iant@google.com>
9320
9321 * output.cc (Output_file::resize): Call map_no_anonymous rather
9322 than map.
9323
44453f85
ILT
93242009-09-01 Mikolaj Zalewski <mikolajz@google.com>
9325
9326 * gold.cc: Include "incremental.h".
9327 (queue_initial_tasks): Call Incremental_checker methods.
9328 * incremental.cc: Include "output.h".
9329 (Incremental_checker::can_incrementally_link_output_file): New
9330 method.
9331 * incremental.h (Incremental_checker): New class.
9332
9333 * output.cc (Output_file::open_for_modification): New method.
9334 (Output_file::map_anonymous): Changed return type to bool. Record
9335 map in base_ field.
9336 (Output_file::map_no_anonymous): New method, broken out of map.
9337 (Output_file::map): Use map_no_anonymous and map_anonymous.
9338 * output.h (class Output_file): Update declarations.
9339
293c1386
CC
93402009-08-24 Cary Coutant <ccoutant@google.com>
9341
9342 * options.h (Command_line::Pre_options): New class.
9343 (Command_line::pre_options): New member.
9344 * options.cc (gold::options::ready_to_register): New variable.
9345 (One_option::register_option): Do nothing if not registering options.
9346 Assert if same short option registered twice.
9347 (General_options::General_options): Turn off option registration when
9348 done constructing.
9349 (Command_line::Pre_options::Pre_options): New constructor.
9350
f773f3d2
CC
93512009-08-24 Cary Coutant <ccoutant@google.com>
9352
06a73cfe
CC
9353 * options.h (General_options::no_keep_memory): Remove incorrect
9354 short option.
f773f3d2 9355
a15af8e2
RW
93562009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9357
9358 * Makefile.am (am__skiplex, am__skipyacc): New.
9359 * Makefile.in: Regenerate.
9360
c462b41b
RW
93612009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
9362
14ec8efd
RW
9363 * Makefile.am (AM_CPPFLAGS): Renamed from ...
9364 (INCLUDES): ... this.
9365 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
9366 (AM_CPPFLAGS): Renamed from ...
9367 (INCLUDE): ... this.
9368 * Makefile.in, testsuite/Makefile.in: Regenerate.
9369
81ecdfbb
RW
9370 * Makefile.in: Regenerate.
9371 * aclocal.m4: Likewise.
9372 * config.in: Likewise.
9373 * configure: Likewise.
9374 * testsuite/Makefile.in: Likewise.
9375
c462b41b
RW
9376 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9377 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
9378 * Makefile.in: Regenerate.
9379 * testsuite/Makefile.in: Regenerate.
9380
2da73f13
CC
93812009-08-19 Cary Coutant <ccoutant@google.com>
9382
9383 * resolve.cc (Symbol_table::resolve): Don't complain about defined
9384 symbols in shared libraries overridden by hidden or internal symbols
9385 in the main program.
9386
2db70501
CD
93872009-08-19 Chris Demetriou <cgd@google.com>
9388
9389 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
9390 checking source file names in error messages.
9391
f733487b
DK
93922009-08-18 Doug Kwan <dougkwan@google.com>
9393
9394 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
9395 an elcpp::Ehdr as parameter. Adjust call to set_target.
9396 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
9397 an elfcpp::Ehdr as parameter.
9398 * object.cc (Object::set_target): Remove the version that looks up
9399 a target and sets it.
9400 (Sized_relobj::setup): Take a Target object instead of
9401 an elfcpp::Ehdr as parameter. Adjust call to set_target.
9402 (make_elf_sized_object): Find target and ask target to
9403 make an ELF object.
9404 * object.h: (Object::set_target): Remove the version that looks up
9405 a target and sets it.
9406 (Sized_relobj::setup): Take a Target object instead of
9407 an elfcpp:Ehdr as parameter.
9408 * target.cc: Include dynobj.h.
9409 (Target::do_make_elf_object_implementation): New.
2e702c99 9410 (Target::do_make_elf_object): New.
f733487b
DK
9411 * target.h (Target::make_elf_object): New template declaration.
9412 (Target::do_make_elf_object): New method declarations.
9413 (Target::do_make_elf_object_implementation): New template declaration.
9414
cc70f101
ILT
94152009-08-14 Ian Lance Taylor <iant@google.com>
9416
9417 * gold.h (FUNCTION_NAME): Define.
9418 (gold_unreachable): Use FUNCTION_NAME.
9419
ef5e0cb1
ST
94202009-08-12 Sriraman Tallam <tmsriram@google.com>
9421
9422 * icf.cc (Icf::find_identical_sections): Issue a warning when a
9423 symbol in the --keep-unique list is not found.
9424
48c187ce
ST
94252009-08-12 Sriraman Tallam <tmsriram@google.com>
9426
9427 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
9428 been maked as --keep-unique.
9429 (Icf::unfold_section): New function.
9430 * icf.h (Icf::unfold_section): New function.
9431 * options.h (General_options::keep_unique): New option.
9432 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
9433 * testsuite/Makefile.in: Regenerate.
9434 * testsuite/icf_keep_unique_test.sh: New file.
9435 * testsuite/icf_keep_unique_test.cc: New file.
9436
645afe0c
CC
94372009-08-12 Cary Coutant <ccoutant@google.com>
9438
9439 PR 10471
9440 * resolve.cc (Symbol_table::resolve): Check for references from
9441 dynamic objects to hidden and internal symbols.
9442 * testsuite/Makefile.am (hidden_test.sh): New test.
9443 * testsuite/Makefile.in: Regenerate.
9444 * testsuite/hidden_test.sh: New script.
9445 * testsuite/hidden_test_1.c: New test source.
9446 * testsuite/hidden_test_main.c: New test source.
9447
11af873f
DK
94482009-08-11 Doug Kwan <dougkwan@google.com>
9449
9450 * arm.cc: Update comments.
9451 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
9452 segment to locate the .ARM.exidx section if present.
9453
b9f7d72d
DK
94542009-08-09 Doug Kwan <dougkwan@google.com>
9455
9456 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
9457 patch.
9458
ddd3c53c
ST
94592009-08-07 Sriraman Tallam <tmsriram@google.com>
9460 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
9461 compiler warnings.
9462
27721062
ST
94632009-08-06 Sriraman Tallam <tmsriram@google.com>
9464
9465 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
9466 valid tls_segment only for non-debug-section relocations.
9467 * testsuite/Makefile.am: Add gc_tls_test.
9468 * testsuite/Makefile.in: Regenerate.
9469 * testsuite/gc_tls_test.cc: New file.
9470 * testsuite/gc_tls_test.sh: New file.
9471
ef15dade 94722009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 9473
ef15dade
ST
9474 * icf.cc: New file.
9475 * icf.h: New file.
9476 * Makefile.am (CCFILES): Add icf.cc.
9477 (HFILES): Add icf.h
9478 * Makefile.in: Regenerate.
9479 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
9480 * gc.h (gc_process_relocs): Populate lists used by icf to contain
9481 section, symbol and addend information for the relocs.
9482 * gold.cc (queue_middle_tasks): Call identical code folding.
9483 * gold.h: Add defines for multimap.
9484 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
9485 to the call of finalize_local_symbols.
9486 * main.cc (main): Create object of class Icf.
9487 * object.cc (Sized_relobj::do_layout): Allow this function to be
9488 called twice during icf.
9489 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
9490 to sections marked as identical by icf.
9491 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
9492 when available.
9493 (Sized_relobj::do_section_entsize): New function.
9494 * object.h (Object::section_entsize): New function.
9495 (Object::do_section_entsize): New pure virtual function.
9496 (Relobj::finalize_local_symbols): Add new parameter.
9497 (Relobj::do_section_entsize): New function.
9498 * options.h (General_options::icf): New option.
9499 (General_options::icf_iterations): New option.
9500 (General_options::print_icf_sections): New option.
9501 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
9502 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
9503 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
9504 icf.
9505 * symtab.cc (Symbol_table::is_section_folded): New function.
9506 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
9507 to sections marked as identical by icf.
9508 * symtab.h (Symbol_table::set_icf): New function.
9509 (Symbol_table::icf): New function.
9510 (Symbol_table::is_section_folded): New function.
9511 (Symbol_table::icf_): New data member.
9512 * target-reloc.h (relocate_section): Ignore sections folded by icf.
9513 * testsuite/Makefile.am: Add commands to build icf_test.
9514 * testsuite/Makefile.in: Regenerate.
9515 * testsuite/icf_test.sh: New file.
9516 * testsuite/icf_test.cc: New file.
9517
c3b65ac4
CD
95182009-07-24 Chris Demetriou <cgd@google.com>
9519
9520 * layout.cc (is_compressible_debug_section): Fix incorrect
9521 comment about compressed section names.
9522
1caf2c51
ILT
95232009-07-20 Ian Lance Taylor <ian@airs.com>
9524
9525 PR 10419
9526 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
9527
1ef4d87f
ILT
95282009-07-16 Ian Lance Taylor <iant@google.com>
9529
9530 PR 10400
9531 * layout.h: #include <map>.
9532 (class Kept_section): Change from struct to class. Add accessors
9533 and setters. Add section size to Comdat_group mapping. Change
9534 Comdat_group to std::map. Add is_comdat_ field. Add
9535 linkonce_size field in union.
9536 (class Layout): Update declaration of find_or_add_kept_section.
9537 Don't declare find_kept_object.
9538 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
9539 parameter. Add object, shndx, is_comdat, and is_group_name
9540 parameters. Change all callers. Adjust for new Kept_section.
9541 (Layout::find_kept_object): Remove.
9542 * object.cc (Sized_relobj::include_section_group): Update use of
9543 Kept_section. Rename secnum to shndx. Only record
9544 Kept_comdat_section if sections are the same size.
9545 (Sized_relobj::include_linkonce_section): Update use of
9546 Kept_section. Only record Kept_comdat_section if sections are the
9547 same size. Set size of linkonce section.
9548 (Sized_relobj::map_to_kept_section): Update call to
9549 get_kept_comdat_section.
9550 * object.h (class Sized_relobj): Rename fields in
9551 Kept_comdat_section to drop trailing underscores; change object
9552 field to Relobj*. Change Kept_comdat_section_table to store
9553 struct rather than pointer.
9554 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
9555 Add kept_object and kept_shndx parameters. Change all callers.
9556 (Sized_relobj::get_kept_comdat_section): Change return type to
9557 bool. Add kept_object and kept_shndx parameters. Change all
9558 callers.
9559 * plugin.cc (Pluginobj::include_comdat_group): Update call to
9560 Layout::find_or_add_kept_section.
9561
37c3b7b0
ILT
95622009-07-09 Ian Lance Taylor <iant@google.com>
9563
9564 * merge.cc (Object_merge_map::initialize_input_to_output_map):
9565 Reserve space in the hash table.
9566
98fa85cb
ILT
95672009-07-06 Mikolaj Zalewski <mikolajz@google.com>
9568
9569 * fileread.cc (File_read::get_mtime): New method.
9570 * fileread.h (Timespec): New structure.
9571 (File_read::get_mtime): New method.
9572 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
9573 Renamed from timestamp_nsec.
9574 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
9575 Elf_Xword.
e1df38aa 9576 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 9577 timestamp_nsec.
e1df38aa 9578 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
9579 (Incremental_inputs::report_obejct): Save mtime; style fix.
9580 (Incremental_inputs::report_script): Save mtime; style fix.
9581 (Incremental_inputs::finalize_inputs): Style fix.
9582 (Incremental_inputs::finalize): Style fix.
9583 (Incremental_inputs::create_input_section_data): Store inputs
9584 mtime.
9585 * incremental.h (Incremental_inputs::report_script): Add mtime
9586 argument.
9587 (Incremental_inputs::Input_info::Input_info): Intialize only one
9588 union member.
9589 (Incremental_inputs::Input_info::archive): Move to nameless
9590 union.
9591 (Incremental_inputs::Input_info::obejct): Move to nameless union.
9592 (Incremental_inputs::Input_info::script): Move to nameless union.
9593 (Incremental_inputs::mtime): New field.
9594 * script.cc (read_input_script): Pass file mtime to
9595 Incremental_input.
9596 * script.h (Script_info::inputs): Style fix.
9597
c9d70757
ILT
95982009-07-01 Ian Lance Taylor <ian@airs.com>
9599
9600 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
9601 instead of 32.
9602
9c547ec3
ILT
96032009-06-24 Ian Lance Taylor <iant@google.com>
9604
9605 PR 10156
9606 * layout.cc (Layout::choose_output_section): If we find an
9607 existing section, update the flags.
9608 (Layout::create_notes): New function, broken out of
9609 Layout::finalize.
9610 (Layout::finalize): Don't create note sections.
9611 (Layout::create_note): Don't crash if linker script discards
9612 section.
9613 (Layout::create_gold_note): Likewise.
9614 (Layout::create_build_id): Likewise. Don't set
9615 after_input_sections on the section.
9616 (Layout::create_executable_stack_info): Remove target parameter.
9617 Change caller.
9618 * layout.h (class Layout): Declare create_notes. Update
9619 declaration of create_executable_stack_info.
9620 * gold.cc (queue_middle_tasks): Call create_notes.
9621 * output.cc (Output_section::update_flags_for_input_section): Move
9622 here from output.h. If SHF_ALLOC flag is newly set, mark address
9623 invalid.
9624 * output.h (Output_data::mark_address_invalid): New function.
9625 (class Output_section): Only declare, not define,
9626 update_flags_for_input_section. Remove set_flags.
9627
55458500
ILT
96282009-06-24 Ian Lance Taylor <iant@google.com>
9629
9630 * script-sections.cc (Output_section_definition::
9631 set_section_addresses): Rename shadowing local load_address to
9632 laddr.
9633
1307d6cd
ILT
96342009-06-24 Ian Lance Taylor <iant@google.com>
9635
9636 PR 10244
9637 * reloc.cc (relocate_sections): Skip empty relocation sections.
9638
ec3f783e
ILT
96392009-06-23 Ian Lance Taylor <iant@google.com>
9640
9641 PR 10156
9642 * layout.cc (Layout::create_note): Use choose_output_section
9643 rather than make_output_section.
9644
459c9f1c
ILT
96452009-06-23 Ian Lance Taylor <iant@google.com>
9646
9647 PR 10237
9648 * options.cc (General_options::parse_V): Set printed_version_.
9649 (General_options::General_options): Initialize printed_version_.
9650 * options.h (class General_options): Add printed_version_ field.
9651 * gold.cc (queue_initial_tasks): If there are no input files,
9652 don't give a fatal error if we printed the version information.
9653 (queue_middle_tasks): If using -r with a shared object, give a
9654 fatal error rather than an ordinary error.
9655
1518dc8f
ILT
96562009-06-23 Ian Lance Taylor <iant@google.com>
9657
9658 PR 10219
9659 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
9660 (Layout::make_output_section): Set have_stabstr_section_ if we see
9661 a .stab*str section.
9662 (Layout::finalize): Call link_stabs_sections.
9663 (Layout::link_stabs_sections): New file.
9664 * layout.h (class Layout): Add have_stabstr_section_ field.
9665 Declare link_stabs_sections.
9666
3d857b98
DK
96672009-06-23 Doug Kwan <dougkwan@google.com>
9668
9669 * Makefile.am (libgold_a_LIBADD): New.
9670 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
2e702c99 9671 * Makefile.in: Regenerate.
3d857b98
DK
9672 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
9673 * configure: Regenerate.
9674 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
9675 * fileread.cc: Include sys/state.h
9676 * gold.h: Declare memmem and strndup if found missing.
9677 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
9678
0639a6f6
ILT
96792009-06-23 Ian Lance Taylor <iant@google.com>
9680
9681 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
9682 * configure: Rebuild.
9683
8d63875c
ILT
96842009-06-23 Ian Lance Taylor <iant@google.com>
9685
9686 PR 10147
9687 * object.cc (Object::section_contents): Don't try to get a view if
9688 the section has length zero.
9689 (Object::handle_gnu_warning_section): If the section is empty, use
9690 the name of the section as the warning.
9691
f7c8a183
ILT
96922009-06-23 Ian Lance Taylor <iant@google.com>
9693
9694 PR 10133
9695 * stringpool.h (class Stringpool_template): Add optimize_ field.
9696 (Stringpool_template::set_optimize): New function.
9697 * stringpool.cc (Stringpool_template::Stringpool_template):
9698 Initialize optimize_ field.
9699 (Stringpool_template::set_string_offsets): Test local optimize
9700 fild rather than parameter.
9701 * layout.cc (Layout::Layout): Call set_optimize on the section
9702 name stringpool.
9703
e6a307ba
ILT
97042009-06-22 Ian Lance Taylor <iant@google.com>
9705
9706 PR 10030
9707 * yyscript.y: Parse TARGET.
9708 * script.cc (script_set_target): New function.
9709 * script-c.h (script_set_target): Declare.
9710 * options.cc (General_options::string_to_object_format): Rename
9711 from string_to_object_format in anonymous namespace. Change
9712 callers.
9713 * options.h (class General_options): Declare
9714 string_to_object_format.
9715
3ee173de
ILT
97162009-06-22 Ian Lance Taylor <iant@google.com>
9717
9718 * script-sections.cc (Script_sections::create_segments): Don't put
9719 program headers in a PT_LOAD segment if -n or -N.
9720
97212009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
9722
9723 PR 10141
9724 * options.h (class General_options): Add -z lazy and -z now. Sort
9725 -z options into alphabetical order.
9726 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
9727
cd6739a1 97282009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
9729
9730 * layout.cc (Layout::make_output_section): Call
9731 Target::new_output_section.
9732 (Layout::attach_allocated_section_to_segment): Put large section
9733 sections in a separate load segment with the large segment flag
9734 set.
9735 (Layout::segment_precedes): Sort large data segments after other
9736 load segments.
9737 (align_file_offset): New static function.
9738 (Layout::set_segment_offsets): Use align_file_offset.
9739 * output.h (class Output_section): Add is_small_section_ and
9740 is_large_section_ fields.
9741 (Output_section::is_small_section): New function.
9742 (Output_section::set_is_small_section): New function.
9743 (Output_section::is_large_section): New function.
9744 (Output_section::set_is_large_section): New function.
9745 (Output_section::is_large_data_section): New function.
9746 (class Output_segment): Add is_large_data_segment_ field.
9747 (Output_segment::is_large_data_segment): New function.
9748 (Output_segment::set_is_large_data_segment): New function.
9749 * output.cc (Output_section::Output_section): Initialize new
9750 fields.
9751 (Output_segment::Output_segment): Likewise.
9752 (Output_segment::add_output_section): Add assertion that large
9753 data sections always go in large data segments. Force small data
9754 sections to the end of the list of data sections. Force small BSS
9755 sections to the start of the list of BSS sections. For large BSS
9756 sections to the end of the list of BSS sections.
9757 * symtab.h (class Symbol): Declare is_common_shndx.
9758 (Symbol::is_defined): Check Symbol::is_common_shndx.
9759 (Symbol::is_common): Likewise.
9760 (class Symbol_table): Define enum Commons_section_type. Update
9761 declarations. Add small_commons_ and large_commons_ fields.
9762 * symtab.cc (Symbol::is_common_shndx): New function.
9763 (Symbol_table::Symbol_table): Initialize new fields.
9764 (Symbol_table::add_from_object): Put small and large common
9765 symbols in the right list.
9766 (Symbol_table::sized_finalized_symbol): Check
9767 Symbol::is_common_shndx.
9768 (Symbol_table::sized_write_globals): Likewise.
9769 * common.cc (Symbol_table::do_allocate_commons): Allocate new
9770 common symbol lists. Don't call do_allocate_commons_list if the
9771 list is empty.
9772 (Symbol_table::do_allocate_commons_list): Remove is_tls
9773 parameter. Add comons_section_type parameter. Change all
9774 callers. Handle small and large common symbols.
9775 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
9776 Symbol::is_common_shndx.
9777 * resolve.cc (symbol_to_bits): Likewise.
9778 * target.h (Target::small_common_shndx): New function.
9779 (Target::small_common_section_flags): New function.
9780 (Target::large_common_shndx): New function.
9781 (Target::large_common_section_flags): New function.
9782 (Target::new_output_section): New function.
9783 (Target::Target_info): Add small_common_shndx, large_common_shndx,
9784 small_common_section_flags, and large_common_section_flags
9785 fields.
9786 (Target::do_new_output_section): New virtual function.
9787 * arm.cc (Target_arm::arm_info): Initialize new fields.
9788 * i386.cc (Target_i386::i386_info): Likewise.
9789 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
9790 Likewise.
9791 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
9792 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
9793 (Target_x86_64::do_new_output_section): New function.
9794 * configure.ac: Define conditional MCMODEL_MEDIUM.
9795 * testsuite/Makefile.am (check_PROGRAMS): Add large.
9796 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
9797 (large_LDFLAGS): Define.
9798 * testsuite/large.c: New file.
9799 * testsuite/testfile.cc (Target_test::test_target_info):
9800 Initialize new fields.
9801 * configure, testsuite/Makefile.in: Rebuild.
9802
bb04269c
DK
98032009-06-05 Doug Kwan <dougkwan@google.com>
9804
9805 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 9806 * Makefile.in: Regenerate.
bb04269c
DK
9807 * i386.cc (class Target_i386): Define new virtual method to
9808 override do_is_local_label_name in parent.
9809 * object.cc (Sized_relobj::do_count_local_symbols): Discard
9810 local symbols if --discard-locals or -X is given.
9811 * options.h (class General_options): Declare new options
9812 '--discard-locals' and '-X' for discarding locals.
9813 * target.h (class Target): Define new methods is_local_label_name.
9814 Declare new virtual method do_is_local_label_name.
9815 * target.cc: New file.
9816 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
9817 (check_SCRIPTS): Add discard_locals_test.sh.
9818 (check_DATA): Add discard_local_tests.syms.
9819 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
9820 (discard_local_tests.syms, discard_locals_test.o): New make rules.
9821 * testsuite/Makefile.in: Regenerate.
9822 * testsuite/discard_locals_test.c: New file.
9823 * testsuite/discard_locals_test.sh: Same.
9824
805bb01c
DK
98252009-06-05 Doug Kwan <dougkwan@google.com>
9826
9827 * object.cc (Sized_relobj::Sized_relobj): Initialize
9828 discarded_eh_frame_shndx_ to -1U.
9829 (Sized_relobj::do_layout): Record index of a discard .eh_frame
9830 section.
9831 (Sized_relobj::do_count_local_symbols): Skip local symbols in
9832 a discarded .eh_frame section.
9833 (Sized_relobj::do_finalize_local_symbols): Ditto.
9834 * object.h (class Sized_relobj): Declare new member
9835 discarded_eh_frame_shndx_.
9836 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
9837 (local_labels_test.o, local_labels_test): New rules.
9838 * testsuite/Makefile.in: Regenerate.
9839
1dcd334d
DK
98402009-06-04 Doug Kwan <dougkwan@google.com>
9841
9842 * layout.cc (Layout::section_name_mapping): Add mapping for
9843 special ARM sections.
9844
96d49306
DK
98452009-06-03 Doug Kwan <dougkwan@google.com>
9846
9847 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
9848 (utils::has_overflow): Same.
9849
dff16297
ILT
98502009-06-03 Ian Lance Taylor <iant@google.com>
9851
9852 * layout.cc (Layout::section_name_mapping): New array, replacing
9853 Layout::linkonce_mapping.
9854 (Layout::section_name_mapping_count): New variable, replacing
9855 Layout::linkonce_mapping_count.
9856 (Layout::linkonce_output_name): Remove.
9857 (Layout::output_section_name): Rewrite.
9858 * layout.h (class Layout): Rename Linkonce_mapping to
9859 Section_name_mapping, linkonce_mapping to section_name_mapping,
9860 linkonce_mapping_count to section_name_mapping_count. Don't
9861 declare linkonce_output_name.
9862
c121c671
DK
98632009-06-03 Doug Kwan <dougkwan@google.com>
9864
9865 * gold/arm.cc (namespace utils): New.
9866 (Target_arm::reloc_is_non_pic): Define new method.
9867 (class Arm_relocate_functions): New.
9868 (Target_arm::Relocate::relocate): Handle relocation types used by
9869 Android.
9870
07800fab
ILT
98712009-06-03 Ian Lance Taylor <iant@google.com>
9872
9873 * arm.cc (Target_arm::scan::global): Use || instead of |.
9874
c121c671
DK
98752009-06-02 Doug Kwan <dougkwan@google.com>
9876
9877 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
9878 issued_non_pic_error_.
9879 (class Target_arm::Scan): Declare new method check_non_pic.
9880 Define new method symbol_needs_plt_entry.
9881 Declare new data member issued_non_pic_error_.
9882 (class Target_arm::Relocate): Declare new method
9883 should_apply_static_reloc.
9884 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
9885 (Target_arm::Scan::check_non_pic): Define new method.
9886 (Target_arm::Scan::local): Handle a small subset of reloc types used
9887 by Android.
9888 (Target_arm::Scan::local): Same.
9889 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
9890
b19b0c6d
ILT
98912009-05-31 Mikolaj Zalewski <mikolajz@google.com>
9892
9893 * incremental.cc (Incremental_inputs::report_command_line): Filter
9894 out --incremental-* options.
9895
94cdfcff
DK
98962009-05-29 Doug Kwan <dougkwan@google.com>
9897
9898 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
9899 template class.
9900 (class Target_arm): Update comment.
9901 (Target_arm::Target_arm): Initialize new data members GOT_,
9902 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
9903 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
9904 and Target_arm::rel_dyn_section.
9905 Declare new_enum Target_arm::Got_type.
9906 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
9907 and DYNBSS_.
9908 Update commments for member do_dynsym_value.
9909 (Target_arm::got_size, Target_arm::plt_section,
9910 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
9911 new methods inside class defintion.
9912 (Target_arm::got_section): Define new method.
9913 (Target_arm::rel_dyn_section): Same.
9914 (Output_data_plt_arm): New template class.
9915 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
9916 (Output_data_plt_arm:do_adjust_output_section): Define new method.
9917 (Output_data_plt_arm::add_entry): Same.
9918 (Output_data_plt_arm::first_plt_entry): Define new
9919 static data member for PLT instruction template.
9920 (Output_data_plt_arm::plt_entry): Same.
9921 (Output_data_plt_arm::do_write): Define new method.
9922 (Target_arm::make_plt_entry): Same.
9923 (Target_arm::do_finalize_sections): Same.
9924 (Target_arm::do_dynsym_value): Same.
9925
4a657b0d
DK
99262009-05-28 Doug Kwan <dougkwan@google.com>
9927
9928 * Makefile.am (TARGETSOURCES): Add arm.cc.
9929 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
9930 * Makefile.in: Regenerate.
9931 * arm.cc: New file.
9932 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
9933
e7ae8c36
DK
99342009-05-26 Doug Kwan <dougkwan@google.com>
9935
9936 * options.cc (General_options::parse_exclude_libs). Fix a comment.
9937 (General_options::check_excluded_libs): Strip off directories in
9938 archive name before matching like GNU ld does.
9939 * testsuite/Makefile.am (MOSTLYCLEANFILES,
9940 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
9941 (exclude_libs_test_LDFLAGS): Add linker option
9942 -Wl,--exclude-libs,libexclude_libs_test_3
9943 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
9944 an explicit archive without using -l.
9945 (alt/libexclude_libs_test_3.a): New make rule.
9946 * testsuite/Makefile.in: Regenerate.
9947 * testsuite/exclude_libs_test.c : Declare lib3_default().
9948 (main): Call it.
9949 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
9950 * exclude_libs_test_3.c: New file.
9951
f12e7348
NC
99522009-05-26 Nick Clifton <nickc@redhat.com>
9953
9954 * po/id.po: New Indonesian translation.
9955 * po/gold.pot: Updated template file.
9956
4daadc0d
ST
99572009-05-22 Sriraman Tallam <tmsriram@google.com>
9958
e1df38aa 9959 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
9960 gc_comdat_test files. Add -Wl,--gc-sections to build
9961 gc_comdat_test.
9962 * testsuite/Makefile.in: Regenerate.
9963 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
9964
531813ad
ST
99652009-05-21 Sriraman Tallam <tmsriram@google.com>
9966
9967 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
9968 kept comdat section was garbage collected.
9969 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
9970 * testsuite/Makefile.in: Regenerate.
9971 * testsuite/gc_comdat_test.sh: New file.
9972 * testsuite/gc_comdat_test_1.cc: New file.
9973 * testsuite/gc_comdat_test_2.cc: New file.
9974
65514900
CC
99752009-05-19 Doug Kwan <dougkwan@google.com>
9976
9977 * archive.cc (Archive::Archive): Move constructor from archive.h
9978 to here. Initialize no_export_.
9979 (Archive::get_elf_object_for_member): Set no_export flag of object.
9980 * archive.h (Archive::Archive): Move constructor body to
9981 archive.cc.
9982 (Archive::no_export): New method.
9983 (Archive::no_export_): New field.
9984 * object.h (Object::Object): Initialize no_export_ to false.
9985 (Object::no_export, Object::set_no_export): New methods.
9986 (Object::no_export_): New field.
9987 * options.cc (General_options::parse_exclude_libs): New method.
9988 (General_options::check_excluded_libs) Same.
9989 * options.h (exclude_libs): New option.
9990 (General_options::check_excluded_libs): New method declaration.
9991 (General_options::excluded_libs_): New field.
9992 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
9993 default or protected visibility if an object has no-export flag set.
9994 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
9995 (check_SCRIPTS): Add exclude_libs_test.sh.
9996 (check_DATA): Add exclude_libs_test.syms.
9997 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
9998 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
9999 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
10000 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
10001 (exclude_libs_test.syms, libexclude_libs_test_1.a,
10002 libexclude_libs_test_2.a): New rules.
10003 * testsuite/Makefile.in: Regenerate.
10004 * testsuite/exclude_libs_test.c: New file.
10005 * testsuite/exclude_libs_test.sh: Ditto.
10006 * testsuite/exclude_libs_test_1.c: Ditto.
10007 * testsuite/exclude_libs_test_2.c: Ditto.
10008
1b77ea50
ILT
100092009-05-15 Ian Lance Taylor <iant@google.com>
10010
10011 * configure.ac: Check for declarations for cases where libiberty.h
10012 checks HAVE_DECL_xxx.
10013 * configure, config.in: Rebuild.
10014
072fe7ce
ILT
100152009-05-15 Mikolaj Zalewski <mikolajz@google.com>
10016
10017 * gold.h (Incremental_argument_list): Remove (invalid) forward
10018 declaration.
10019 * incremental.cc (Incremental_inputs::report_achive): New method.
10020 (Incremental_inputs::report_object): New method.
10021 (Incremental_inputs::report_script): New method.
10022 (Incremental_inputs::finalize_inputs): New method.
10023 (Incremental_inputs::finalize): Call finalize_inputs().
10024 (Incremental_inputs::sized_create_incremental_inputs_section_data):
10025 Create inputs entries.
10026 * incremental.h (Incremental_input_type): New enum.
10027 (Incremental_inputs::Incremental_input): Initialize new fields.
10028 (Incremental_inputs::report_inputs): New method.
10029 (Incremental_inputs::report_achive): New method.
10030 (Incremental_inputs::report_object): New method.
10031 (Incremental_inputs::report_script): New method.
10032 (Incremental_inputs::finalize_inputs): New method.
10033 (Incremental_inputs::Input_info): New struct.
10034 (Incremental_inputs::Input_info_map): New typedef.
10035 (Incremental_inputs::lock_): New field.
10036 (Incremental_inputs::Inputs_): New field.
10037 (Incremental_inputs::Inputs_map): New field.
10038 * main.cc (main): Call Incremental_input::report_inputs.
10039 * options.h (Input_argument_list): Typedef moved from
10040 Input_arguments.
10041 (Input_file_group::Files): Remove, use ::Input_argument_list.
10042 (Input_file_group::Input_argument_list): Remove, use
10043 ::Input_argument_list.
10044 * plugin.cc (Plugin_manager::add_input_file): Add error in
10045 incremental build.
10046 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
10047 functions.
10048 * script.cc (read_input_script): Call
10049 Incremental_input::report_script.
10050 * script.h (Script_info): New class.
10051
b0481b0b
ILT
100522009-04-27 Ian Lance Taylor <iant@google.com>
10053
10054 * x86_64.cc (do_adjust_output_section): Set entsize to
10055 plt_entry_size.
10056
b22a5a41 100572009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
10058
10059 * output.cc (Output_file::close): After short writes, continue
10060 writing from the correct offset in the buffer being written.
10061
40fde488
CD
100622009-04-23 Chris Demetriou <cgd@google.com>
10063
10064 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
10065 * configure: Regenerate.
10066 * config.in: Regenerate.
10067 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
10068 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
10069
3ce2c28e
ILT
100702009-04-21 Mikolaj Zalewski <mikolajz@google.com>
10071
10072 * incremental.cc (Incremental_inputs_header_data): Renamed from
10073 Incremental_input_header_data.
10074 (Incremental_inputs_header_data::data_size): New field.
10075 (Incremental_inputs_header_data::put_input_file_count): Renamed
10076 from input_file_count.
10077 (Incremental_inputs_header_data::put_command_line_offset): Renamed
10078 from command_line_offset.
10079 (Incremental_inputs_header_data::put_reserved): Renamed from
10080 put_reserved.
10081 (Incremental_inputs_entry_data): Renamed from
10082 Incremental_input_entry_data.
10083 (Incremental_inputs_entry_data::data_size): New field.
10084 (Incremental_inputs::report_command_line): New method.
10085 (Incremental_inputs::finalize): New method.
10086 (Incremental_inputs::create_incremental_inputs_data): New method.
10087 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
10088 * incremental.h: New file.
10089 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
10090 (Layout::finalize): Create incremental inputs section in
10091 incremental builds.
10092 (Layout::create_incremental_info_sections): New method.
10093 * layout.h (Layout::incremental_inputs): New method.
10094 (Layout::create_incremental_info_sections): New method.
10095 (Layout::incremental_inputs_): New field.
10096 * main.cc (main): Notify Incremental_input of the command line.
10097
e55bde5e
ILT
100982009-04-01 Ian Lance Taylor <iant@google.com>
10099 Mikolaj Zalewski <mikolajz@google.com>
10100
10101 * gold.h (reserve_unordered_map): Define, three versions, one for
10102 each version of Unordered_map.
10103 * layout.cc (Layout::Layout): Remove options parameter. Add
10104 number_of_input_files parameter. Don't initialize options_.
10105 Initialize number_of_input_files_ and resized_signatures_. Move
10106 sections_are_attached_.
10107 (Layout::layout_group): Reserve space for group_signatures_.
10108 (Layout::find_or_add_kept_section): Change name parameter to be a
10109 reference. Resize signatures_ map when it gets large enough.
10110 (Layout::layout_eh_frame): Use parameters->options() instead of
10111 this->options_.
10112 (Layout::make_output_section): Likewise.
10113 (Layout::attach_allocated_section_to_segment): Likewise.
10114 (Layout::finalize, Layout::create_executable_stack): Likewise.
10115 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
10116 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
10117 * layout.h (class Layout): Update declarations. Remove options_
10118 field. Add number_of_input_files_ and resized_signatures_
10119 fields. Move sections_are_attached_ field.
10120 * main.cc (main): Pass number of input files to Layout
10121 constructor. Don't pass options.
10122
154b857c
ILT
101232009-03-30 Ian Lance Taylor <iant@google.com>
10124
10125 * ffsll.c (ffsll): Correct implementation.
10126
2f35ab9b
ILT
101272009-03-27 Ian Lance Taylor <iant@google.com>
10128
fd03461a
ILT
10129 * ffsll.c: New file.
10130 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
10131 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
10132 * ftruncate.c (ftruncate): Declare before definition.
10133 * mremap.c (mremap): Likewise.
10134 * pread.c (pread): Likewise.
10135 * configure, Makefile.in, config.in: Rebuild.
10136
2f35ab9b
ILT
10137 * mremap.c: New file.
10138 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
10139 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
10140 (mremap): Declare if HAVE_MREMAP is not defined.
10141 * configure, Makefile.in, config.in: Rebuild.
10142
33aea2fd
CC
101432009-03-27 Cary Coutant <ccoutant@google.com>
10144
10145 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
10146 position independent.
10147 * sparc.cc (Target_sparc::check_non_pic): Likewise.
10148 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
10149
6d479619
CC
101502009-03-24 Cary Coutant <ccoutant@google.com>
10151
10152 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
10153 an executable.
10154 (needs_dynamic_reloc): Likewise.
10155
afc06bb8
ILT
101562009-03-24 Ian Lance Taylor <iant@google.com>
10157
10158 * yyscript.y (file_cmd): Recognize EXTERN.
10159 (extern_name_list, extern_name_list_body): New nonterminals.
10160 * script.cc (script_add_extern): Define.
10161 * script-c.h (script_add_extern): Declare.
10162
f6060a4d
ILT
101632009-03-24 Rafael Avila de Espindola <espindola@google.com>
10164
10165 * object.cc (is_elf_object): Define.
10166 * object.h (is_elf_object): Declare.
10167 * archive.cc (Archive::get_elf_object_for_member): Call
10168 is_elf_object.
33aea2fd 10169 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 10170
26736d8e
ILT
101712009-03-24 Elliott Hughes <enh@google.com>
10172
10173 * output.cc (Output_file::map_anonymous): Define.
10174 (Output_file::map): Use map_anonymous. If the regular mmap fails,
10175 try an anonymous one. Report the size if the mmap fails.
10176 * output.h (class Output_file): Declare map_anonymous.
10177
22fd9730
ILT
101782009-03-24 Ian Lance Taylor <iant@google.com>
10179
10180 * target-select.cc (instantiate_target): Don't acquire the lock if
10181 the instantiated_target_ field has already been set.
10182
cb010894
ILT
101832009-03-23 Ian Lance Taylor <iant@google.com>
10184
7f055c20
ILT
10185 * gold-threads.h (class Initialize_lock): Define.
10186 * gold-threads.cc (class Initialize_lock_once): Define.
10187 (initialize_lock_control): New static variable.
10188 (initialize_lock_pointer): New static variable.
10189 (initialize_lock_once): New static function.
10190 (Initialize_lock::Initialize_lock): Define.
10191 (Initialize_lock::initialize): Define.
10192 * target-select.h: Include "gold-threads.h".
10193 (class Target_selector): Add lock_ and initialize_lock_ fields.
10194 Don't define instantiate_target, just declare it.
10195 * target-select.cc (Target_selector::Target_selector): Initialize
10196 new fields.
10197 (Target_selector::instantiate_target): Define.
10198 * descriptors.h: Include "gold-threads.h".
10199 (class Descriptors): Add initialize_lock_ field.
10200 * descriptors.cc (Descriptors::Descriptors): Initialize new
10201 field.
10202 (Descriptors::open): Use initialize_lock_ field
10203 * errors.h (class Errors): Add initialize_lock_ field.
10204 * errors.cc (Errors::Errors): Initialize new field.
10205 (Errors::initialize_lock): Use initialize_lock_ field.
10206 * powerpc.cc (class Target_selector_powerpc): Remove
10207 instantiated_target_ field. In do_recognize call
10208 instantiate_target rather than do_instantiate_target. In
10209 do_instantiate_target just allocate a new target.
10210 * sparc.cc (class Target_selector_sparc): Likewise.
10211
36959681
ILT
10212 * freebsd.h: New file.
10213 * i386.cc: Include "freebsd.h".
10214 (Target_i386): Derive from Target_freebsd rather than
10215 Sized_target.
10216 (Target_selector_i386): Derive from Target_selector_freebsd rather
10217 than Target_selector.
10218 * x86_64.cc: Include "freebsd.h".
10219 (Target_x86_64): Derive from Target_freebsd rather than
10220 Sized_target.
10221 (Target_selector_x86_64): Derive from Target_selector_freebsd
10222 rather than Target_selector.
10223 * target.h (class Target): Add adjust_elf_header and
10224 do_adjust_elf_header.
10225 * output.cc (Output_file_header:: do_sized_write): Call target
10226 adjust_elf_header routine.
10227 * configure.tgt: Set targ_osabi.
10228 * configure.ac: Define GOLD_DEFAULT_OSABI.
10229 * parameters.cc (Parameters::default_target): Pass
10230 GOLD_DEFAULT_OSABI to select_target.
10231 * target-select.h (class Target_selector): Make instantiate_target
10232 protected rather than private.
10233 * Makefile.am (HFILES): Add freebsd.h.
10234 * configure, Makefile.in, config.in: Rebuild.
10235
cb010894
ILT
10236 * merge.cc (do_add_input_section): Correct pend value. Change
10237 message about last entry not being null terminated from error to
10238 warning.
10239
0e879927
ILT
102402009-03-20 Mikolaj Zalewski <mikolajz@google.com>
10241
10242 * incremental.cc: New file.
10243 * Makefile.am (CCFILES): Add incremental.cc.
10244 * Makefile.in: Rebuild.
10245
41105937
PP
102462009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
10247
10248 * layout.cc (Layout::output_section_name): Preserve names
10249 of '.note.' sections.
e1df38aa 10250
60439920
ILT
102512009-03-19 Ian Lance Taylor <iant@google.com>
10252
10253 * descriptors.cc (Descriptors::open): Check that the options are
10254 valid before using them.
10255
0d371ad3
ILT
102562009-03-18 Ian Lance Taylor <iant@google.com>
10257
10258 * script-sections.h: Include <list>.
10259 (class Script_sections): Change Sections_elements from std::vector
10260 to std::list. Typedef public Elements_iterator. Add
10261 orphan_section_placement_, data_segment_align_start_, and
10262 saw_data_segment_align_ fields. Remove data_segment_align_index_
10263 field.
10264 * script-sections.cc (class Orphan_section_placement): New class.
10265 (class Sections_element): Add virtual functions is_relro and
10266 orphan_section_init. Remove virtual function place_orphan_here.
10267 (class Output_section_definition): Add is_relro and
10268 orphan_section_init. Remove place_orphan_here.
10269 (class Orphan_output_section): Likewise.
10270 (Script_sections::Script_sections): Update for field changes.
10271 (Script_sections::data_segment_align): Set saw_data_segment_align_
10272 and data_segment_align_start_, not data_segment_align_index.
10273 (Script_sections::data_segment_relro_end): Check
10274 saw_data_segment_align_. Use data_segment_align_start_ rather
10275 than data_segment_align_index_.
10276 (Script_sections::place_orphan): Rewrite to use
10277 Orphan_section_placement.
10278
9201d894
ILT
102792009-03-17 Ian Lance Taylor <iant@google.com>
10280
9c5b8369
ILT
10281 * archive.cc (Archive::add_symbols): Check for a version attached
10282 to the symbol name in the archive map.
10283 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
10284 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
10285 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
10286 (ver_test_11.a): New target.
10287 * testsuite/Makefile.in: Rebuild.
10288
9201d894
ILT
10289 * configure.ac: Check for chsize and posix_fallocate. Replace
10290 ftruncate.
10291 * ftruncate.c: New file, from gnulib.
10292 * output.cc (posix_fallocate): Define dummy version if not
10293 HAVE_POSIX_FALLOCATE.
10294 (Output_file::map): Call posix_fallocate rather than lseek and
10295 write.
10296 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
10297 * configure, Makefile.in, config.in: Rebuild.
10298
ef4ab7a8 102992009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 10300
ef4ab7a8
PP
10301 * layout.h (Layout::create_note): Add section_name parameter.
10302 * layout.cc (Layout::create_note): Likewise.
10303 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 10304
8c500701
ILT
103052009-03-17 Ian Lance Taylor <iant@google.com>
10306
e85b18e1
ILT
10307 * descriptors.cc: Include "options.h".
10308 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
10309 (Descriptors::open): Always use O_CLOEXEC when opening a new
10310 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
10311 then set FD_CLOEXEC.
10312
9efe6174
ILT
10313 * sparc.cc (class Target_sparc): Add has_got_section.
10314 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
10315 make sure we have a GOT section.
10316
10317 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
10318 (Target_sparc::Scan::local): Likewise.
10319 (Target_sparc::Scan::global): Likewise.
10320 (Target_sparc::Relocate::relocate): Likewise.
10321 (Target_sparc::Relocate::relocate_tls): Likewise.
10322
8c500701
ILT
10323 * symtab.cc (Symbol_table::define_default_version): New function,
10324 broken out of add_from_object.
10325 (Symbol_table::add_from_object): Call define_default_version.
10326 (Symbol_table::define_special_symbol): Add resolve_oldsym
10327 parameter. Change all callers. If the version for a symbol comes
10328 from a version script, resolve it with the symbol with the same
10329 name with no version. Also add the symbol without a version if
10330 appropriate.
10331 (do_define_in_output_data): If resolving with oldsym, don't delete
10332 sym.
10333 (do_define_in_output_segment): Likewise.
10334 (do_define_as_constant): Likewise.
10335 * symtab.h (class Symbol_table): Update declarations.
10336
f1ed28fb
ILT
103372009-03-13 Ian Lance Taylor <iant@google.com>
10338
15f8229b
ILT
10339 * readsyms.cc (Read_symbols::incompatible_warning): New function.
10340 (Read_symbols::requeue): New function.
10341 (Read_symbols::do_read_symbols): If make_elf_object fails because
10342 the target type is not configured, and the file was searched for,
10343 issue a warning and retry with the next directory.
10344 (Add_symbols::run): If the file has an incompatible format, and
10345 it was searched for, requeue the Read_symbols task. On error,
10346 release the object.
10347 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
10348 dirindex parameter to constructor. Change all callers. Declare
10349 incompatible_warning and requeue.
10350 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
10351 input_argument_ and input_group_ fields. Add them to
10352 constructor. Change all callers.
10353 (class Read_script): Add dirindex_ field. Add it to constructor.
10354 Change all callers.
10355 * archive.cc (Archive::setup): Remove input_objects parameter.
10356 Change all callers.
10357 (Archive::get_file_and_offset): Likewise.
10358 (Archive::read_all_symbols): Likewise.
10359 (Archive::read_symbols): Likewise.
10360 (Archive::get_elf_object_for_member): Remove input_objects
10361 parameter. Add punconfigured parameter. Change all callers.
10362 (Archive::add_symbols): Change return type to bool. Check return
10363 value of include_member.
10364 (Archive::include_all_members): Likewise.
10365 (Archive::include_member): Change return type to bool. Return
10366 false if first included object has incompatible target. Set
10367 included_member_ field.
10368 (Add_archive_symbols::run): If add_symbols returns false, requeue
10369 Read_symbols task.
10370 * archive.h (class Archive): Add included_member_ field.
10371 Initialize it in constructor. Add input_file and searched_for
10372 methods. Update declarations.
10373 (class Add_archive_symbols): Add dirpath_, dirindex_, and
10374 input_argument_ fields. Add them to constructor. Change all
10375 callers.
10376 * script.cc: Include "target-select.h".
10377 (class Parser_closure): Add skip_on_incompatible_target_ and
10378 found_incompatible_target_ fields. Add
10379 skip_on_incompatible_target parameter to constructor. Change all
10380 callers. Add methods skip_on_incompatible_target,
10381 clear_skip_on_incompatible_target, found_incompatible_target, and
10382 set_found_incompatible_target.
10383 (read_input_script): Add dirindex parameter. Change all callers.
10384 If parser finds an incompatible target, requeue Read_symbols
10385 task.
10386 (script_set_symbol): Clear skip_on_incompatible_target in
10387 closure.
10388 (script_add_assertion, script_parse_option): Likewise.
10389 (script_start_sections, script_add_phdr): Likewise.
10390 (script_check_output_format): New function.
10391 * script.h (read_input_script): Update declaration.
10392 * script-c.h (script_check_output_format): Declare.
10393 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
10394 (ignore_cmd): Remove OUTPUT_FORMAT.
10395 * fileread.cc (Input_file::Input_file): Add explicit this.
10396 (Input_file::will_search_for): New function.
10397 (Input_file::open): Add pindex parameter. Change all callers.
10398 * fileread.h (class Input_file): Add input_file_argument method.
10399 Declare will_search_for. Update declarations.
10400 * object.cc (make_elf_object): Add punconfigured parameter.
10401 Change all callers.
10402 * object.h (class Object): Make input_file public. Add
10403 searched_for method.
10404 (make_elf_object): Update declaration.
10405 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
10406 restart search.
10407 * dirsearch.h (class Dirsearch): Update declaration.
10408 * options.h (class General_options): Add --warn-search-mismatch.
10409 * parameters.cc (Parameters::is_compatible_target): New function.
10410 * parameters.h (class Parameters): Declare is_compatible_target.
10411 * workqueue.cc (Workqueue::add_blocker): New function.
10412 * workqueue.h (class Workqueue): Declare add_blocker.
10413
f1ed28fb
ILT
10414 * fileread.cc (Input_file::open): Remove options parameter.
10415 Change all callers.
10416 (Input_file::open_binary): Likewise.
10417 * script.cc (read_input_script): Likewise.
10418 * readsyms.h (class Read_symbols): Remove options_ field. Remove
10419 options parameter from constructor. Change all callers.
10420 (class Read_script): Likewise.
10421 * fileread.h (class Input_file): Update declarations.
10422 * script.h (read_input_script): Update declaration.
10423
34dd024a
NC
104242009-03-10 Nick Clifton <nickc@redhat.com>
10425
10426 * po/es.po: New Spanish translation.
10427
6d71b17c
CC
104282009-03-06 Cary Coutant <ccoutant@google.com>
10429
10430 * options.cc (parse_short_option): Keep dash_z from registering itself.
10431
031cdbed
ILT
104322009-03-03 Ian Lance Taylor <iant@google.com>
10433
10434 PR 9918
10435 * target-reloc.h (relocate_section): Pass output_section to
10436 relocate.
10437 * i386.cc (Target_i386::should_apply_static_reloc): Add
10438 output_section parameter. Change all callers.
10439 (Target_i386::Relocate::relocate): Add output_section parameter.
10440 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10441 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
10442 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
10443 * testsuite/two_file_shared.sh: New script.
10444 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
10445 (check_DATA): Add two_file_shared.dbg.
10446 (two_file_shared.dbg): New target.
10447 * testsuite/Makefile.in: Rebuild.
10448
15d5fa16
ILT
104492009-03-01 Ian Lance Taylor <iant@google.com>
10450
10451 * configure.ac: Check for byteswap.h.
10452 * configure: Rebuild.
10453 * config.in: Rebuild.
10454
8a4c0b0d
ILT
104552009-03-01 Mikolaj Zalewski <mikolajz@google.com>
10456
10457 * layout.cc (Layout::find_or_add_kept_section): New function.
10458 (Layout::add_comdat): Removed.
10459 * layout.h (struct Kept_section): Move out of class Layout.
10460 Remove trailing underscores from field names. Add group_sections
10461 field. Rename group_ field to is_group. Change all uses.
10462 (class Layout): Declare find_or_add_kept_section, not add_comdat.
10463 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
10464 comdat_groups_ field.
10465 (Sized_relobj::include_section_group): Use
10466 find_or_add_kept_section and Kept_section::group_sections.
10467 (Sized_relobj::include_linkonce_section): Likewise.
10468 * object.cc (class Sized_relobj): Don't define Comdat_group or
10469 Comdat_group_table. Remove find_comdat_group and
10470 add_comdat_group. Remove comdat_groups_ field.
10471 * plugin.cc (include_comdat_group): Use
10472 Layout::find_or_add_kept_section.
10473
b4ecf66b
ILT
104742009-02-28 Ian Lance Taylor <iant@google.com>
10475
14359ca0
ILT
10476 * README: --gc-sections and map files are now supported. Document
10477 some build requirements.
10478
b4ecf66b
ILT
10479 PR 6992
10480 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
10481 relocatable link set the value of the section symbol to zero.
10482 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
10483 relocatable link don't include the section address in the local
10484 symbol value.
10485
0602e05a
ILT
104862009-02-27 Ian Lance Taylor <iant@google.com>
10487
fd9d194f
ILT
10488 PR 6811
10489 * options.h (class Search_directory): Add is_system_directory.
10490 (class General_options): Declare is_in_system_directory.
10491 * options.cc (get_relative_sysroot): Make static.
10492 (get_default_sysroot): Make static.
10493 (General_optoins::is_in_system_directory): New function.
10494 * fileread.cc (Input_file::is_in_system_directory): New function.
10495 * fileread.h (class Input_file): Declare is_in_system_directory.
10496 * object.h (class Object): Add is_in_system_directory.
10497 (class Input_objects): Remove system_library_directory_ field.
10498 * object.cc (Input_objects::add_object): Don't set
10499 system_library_directory_.
10500 (input_objects::found_in_system_library_directory): Remove.
10501 * symtab.cc (Symbol_table::write_globals): Remove input_objects
10502 parameter. Change all callers.
10503 (Symbol_table::sized_write_globals): Likewise.
10504 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
10505 Call Object::is_in_system_directory.
10506 * symtab.h (class Symbol_table): Update declarations.
10507
61edd21f
ILT
10508 PR 5990
10509 * descriptors.h (Open_descriptor): Add is_on_stack field.
10510 * descriptors.cc (Descriptors::open): If the descriptor is on the
10511 top of the stack, remove it. Initialize is_on_stack field.
10512 (Descriptors::release): Only add pod to stack if it is not on the
10513 stack already.
10514 (Descriptors::close_some_descriptor): Clear stack_next and
10515 is_on_stack fields.
10516
e29e076a
ILT
10517 PR 7091
10518 * output.cc (Output_section::find_starting_output_address): Rename
10519 from starting_output_address; add PADDR parameter; change return
10520 type.
10521 * output.h (class Output_section): Declare
10522 find_starting_output_address instead of starting_output_address.
10523 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
10524 section symbol for which we can't find a merge section.
10525
0602e05a
ILT
10526 PR 9836
10527 * symtab.cc (Symbol_table::add_from_object): If the visibility is
10528 hidden or internal, force the symbol to be local.
10529 * resolve.cc (Symbol::override_visibility): Define.
10530 (Symbol::override_base): Use override_visibility.
10531 (Symbol_table::resolve): Likewise.
10532 (Symbol::override_base_with_special): Likewise.
10533 (Symbol_table::override_with_special): If the visibility is hidden
10534 or internal, force the symbol to be local.
10535 * symtab.h (class Symbol): Add set_visibility and
10536 override_visibility.
10537 * testsuite/ver_test_1.sh: New file.
10538 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
10539 (check_DATA): Add ver_test_1.syms.
10540 (ver_test_1.syms): New target.
10541 * testsuite/Makefile.in: Rebuild.
10542
401a9a73
CC
105432009-02-25 Cary Coutant <ccoutant@google.com>
10544
10545 * layout.cc (Layout::choose_output_section): Don't rename sections
10546 when using a linker script that has a SECTIONS clause.
10547 * Makefile.in: Regenerate.
10548
10549 * testsuite/Makefile.am (script_test_5.sh): New test case.
10550 * testsuite/Makefile.in: Regenerate.
10551 * testsuite/script_test_5.cc: New file.
10552 * testsuite/script_test_5.sh: New file.
10553 * testsuite/script_test_5.t: New file.
10554
f488e4b0
CC
105552009-02-13 Rafael Avila de Espindola <espindola@google.com>
10556
10557 * archive.cc (Archive::include_member): Update calls to add_symbols.
10558 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
10559 the Layout argument.
10560 * dynobj.h (do_add_symbols): Add the Layout argument.
10561 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
10562 Layout argument.
10563 * object.h (Object::add_symbols): Add the Layout argument.
10564 (Object::do_add_symbols): Add the Layout argument.
10565 (Sized_relobj::do_add_symbols): Add the Layout argument.
10566 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
10567 Unify the two versions.
10568 (Add_plugin_symbols): Remove.
10569 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
10570 (Sized_pluginobj::do_add_symbols): Unify the two versions.
10571 (Add_plugin_symbols): Remove.
10572 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
10573 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
10574 (Add_symbols::run): Make it work with Pulginobj.
10575
89dd1680
ILT
105762009-02-06 Ian Lance Taylor <iant@google.com>
10577
10578 * object.cc (Sized_relobj::do_layout): Make info message start
10579 with lower case letter.
10580
266d0a74
ILT
105812009-02-06 Mikolaj Zalewski <mikolajz@google.com>
10582
602b464e
ILT
10583 * binary.cc: Fix file comment.
10584
266d0a74
ILT
10585 * options.h (enum Incremental_disposition): Define.
10586 (class General_options): Add new options: --incremental,
10587 --incremental_changed, --incremental_unchanged,
10588 --incremental_unknown. Add incremental_disposition_ and
10589 implicit_incremental_ fields.
10590 (General_options::incremental_disposition): New function.
10591 (class Position_dependent_options): Add incremental_disposition
10592 option.
10593 (Position_dependent_options::copy_from_options): Set incremental
10594 dispositions.
10595 * options.cc (General_options::parse_incremental_changed): New
10596 function.
2e702c99
RM
10597 (General_options::parse_incremental_unchanged): New function.
10598 (General_options::parse_incremental_unknown): New function.
10599 (General_options::General_options): Initialize new fields
266d0a74 10600 incremental_disposition_ and implicit_incremental_.
2e702c99 10601 (General_options::finalize): Check for uasge of --incremental-*
266d0a74
ILT
10602 without --incremental.
10603
f073bbf7
CD
106042009-02-06 Chris Demetriou <cgd@google.com>
10605
10606 * gold.h (gold_undefined_symbol): Change to take only a Symbol
10607 pointer and to report location as the file name associated with
10608 the symbol.
10609 (gold_undefined_symbol_at_location): New function to replace the
10610 old gold_undefined_symbol functionality.
10611 * target-reloc.h (relocate_section): Update to use
10612 gold_undefined_symbol_at_location.
10613 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
10614 Call gold_undefined_symbol function rather than gold_error.
10615 * errors.h (Errors::undefined_symbol): Take location as a
10616 string, rather than calculating it from a relocation.
10617 * errors.cc (Errors::fatal): Print "fatal error:" before the
10618 formatted message.
10619 (Errors::error, Errors::error_at_location): Print "error: "
10620 before the formatted message.
10621 (Errors::undefined_symbol): Take location as a string, rather
10622 than calculating it from a relocation.
10623 (gold_undefined_symbol_at_location): New function akin to
10624 old gold_undefined_symbol, calculates location from relocation.
10625 (gold_undefined_symbol): Change to take only a Symbol pointer
10626 and to report location as the file name associated with the symbol.
10627 * testsuite/debug_msg.sh: Update for changed error messages.
10628 * testsuite/undef_symbol.sh: Likewise.
10629
8e94a90c
ILT
106302009-02-04 Duncan Sands <baldrick@free.fr>
10631
10632 PR 9812
10633 * reduced_debug_output.h
10634 (Output_reduced_debug_abbrev_section::failed): Use format for
10635 gold_warning.
10636 (Output_reduced_debug_info_section::faild): Likewise.
10637
88a0e15b
ILT
106382009-01-31 Mikolaj Zalewski <mikolajz@google.com>
10639
10640 * script.cc (Lazy_demangler): New class.
2e702c99 10641 (Version_script_info::get_symbol_version_helper): Demangle a
88a0e15b
ILT
10642 symbol only once.
10643
5efc7cd2
CC
106442009-01-29 Cary Coutant <ccoutant@google.com>
10645
10646 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
10647 to __tls_get_addr.
10648 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
10649
e0ebcf42
ILT
106502009-01-28 Ian Lance Taylor <iant@google.com>
10651
5efc7cd2 10652 * version.cc (version_string): Bump to 1.9.
75fe7426 10653
e0ebcf42
ILT
10654 * gold.h: Include <cstring> and <stdint.h>.
10655 * version.cc: Include <cstdio>.
10656 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
10657 warning.
10658 * reduced_debug_output.cc (insert_into_vector): Rename from
10659 Insert_into_vector; change all callers. Use Swap_unaligned to
10660 avoid aliasing issue; remove union since it is unnecessary.
10661
8e2813be 106622009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
10663
10664 * Makefile.am (CCFILES): Add gc.cc.
10665 (HFILES): Add gc.h.
10666 * Makefile.in: Regenerate.
10667 * gold.cc (Gc_runner): New class.
10668 (queue_initial_tasks): Call garbage collection related tasks
10669 when corresponding options are invoked.
10670 (queue_middle_gc_tasks): New function.
10671 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
10672 processed early before laying out sections during garbage collection.
10673 * gold.h (queue_middle_gc_tasks): New function.
10674 (is_prefix_of): Move from "layout.cc".
10675 * i386.cc (Target_i386::gc_process_relocs): New function.
10676 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
10677 * main.cc (main): Create object of class "Garbage_collection".
10678 * object.cc (Relobj::copy_symbols_data): New function.
10679 (Relobj::is_section_name_included): New function.
e1df38aa
NC
10680 (Sized_relobj::do_layout): Allow this function to be called twice
10681 during garbage collection and defer layout of section during the
6d03d481
ST
10682 first call.
10683 * object.h (Relobj::get_symbols_data): New function.
10684 (Relobj::is_section_name_included): New function.
10685 (Relobj::copy_symbols_data): New function.
10686 (Relobj::set_symbols_data): New function.
10687 (Relobj::get_relocs_data): New function.
10688 (Relobj::set_relocs_data): New function.
10689 (Relobj::is_output_section_offset_invalid): New pure virtual function.
10690 (Relobj::gc_process_relocs): New function.
10691 (Relobj::do_gc_process_relocs): New pure virtual function.
10692 (Relobj::sd_): New data member.
10693 (Sized_relobj::is_output_section_offset_invalid): New function.
10694 (Sized_relobj::do_gc_process_relocs): New function.
10695 * options.h (General_options::gc_sections): Modify to not be a no-op.
10696 (General_options::print_gc_sections): New option.
10697 * plugin.cc (Plugin_finish::run): Remove function call to
10698 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
10699 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
10700 * reloc.cc (Read_relocs::run): Add task to process relocs and
10701 determine unreferenced sections when doing garbage collection.
10702 (Gc_process_relocs): New class.
10703 (Sized_relobj::do_gc_process_relocs): New function.
10704 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
10705 sections that are garbage collected.
10706 * reloc.h (Gc_process_relocs): New class.
10707 * sparc.cc (Target_sparc::gc_process_relocs): New function.
10708 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
10709 symbols whose corresponding sections are garbage collected.
10710 (Symbol_table::Symbol_table): Add new parameter for the garbage
10711 collection object.
10712 (Symbol_table::gc_mark_undef_symbols): New function.
10713 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10714 (Symbol_table::gc_mark_dyn_syms): New function.
10715 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
10716 as garbage.
10717 (Symbol_table::add_from_object): Likewise.
10718 (Symbol_table::add_from_relobj): When building shared objects, do not
10719 treat externally visible symbols as garbage.
10720 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
10721 table information for static and relocatable links.
10722 * symtab.h (Symbol_table::set_gc): New function.
10723 (Symbol_table::gc): New function.
10724 (Symbol_table::gc_mark_undef_symbols): New function.
10725 (Symbol_table::gc_mark_symbol_for_shlib): New function.
10726 (Symbol_table::gc_mark_dyn_syms): New function.
10727 (Symbol_table::gc_): New data member.
e1df38aa 10728 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
10729 function.
10730 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
10731 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
10732
3b293544
CF
107332009-01-20 Chris Faylor <me.sourceware@sourceware.org>
10734
10735 * options.h (General_options::gc_sections): Define as a no-op for now.
10736 (General_options::no_keep_memory): Ditto.
10737 (General_options::Bshareable): Define.
10738 * options.cc (General_options::finalize): Honor -Bshareable.
10739
83d22aa8
AS
107402009-01-20 Andreas Schwab <schwab@suse.de>
10741
10742 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
10743 read the value in the contents, since we don't use it. Use the
10744 template endianness when writing.
10745 (Relocate::relocate): Use it for R_PPC_REL16_HA.
10746
cd536b21
AS
107472009-01-19 Andreas Schwab <schwab@suse.de>
10748
10749 * configure.tgt (powerpc64-*): Fix targ_obj.
10750
99e9a495
ILT
107512009-01-15 Ian Lance Taylor <iant@google.com>
10752
10753 * object.cc (Sized_relobj::write_local_symbols): Don't write out
10754 local symbols when stripping all symbols.
10755
bbbfea06
CC
107562009-01-14 Cary Coutant <ccoutant@google.com>
10757
99e9a495 10758 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 10759
0f7c0701
CC
107602009-01-14 Cary Coutant <ccoutant@google.com>
10761
10762 * archive.cc (Archive::get_elf_object_for_member): Remove call
10763 to File_read::claim_for_plugin.
10764 * descriptors.cc (Descriptors::open): Remove reference to
10765 is_claimed.
10766 (Descriptors::claim_for_plugin): Remove.
10767 * descriptors.h (Descriptors::claim_for_plugin): Remove.
10768 (Descriptors::is_claimed): Remove.
10769 (claim_descriptor_for_plugin): Remove.
10770 * fileread.cc (File_read::claim_for_plugin): Remove.
10771 * fileread.h (File_read::claim_for_plugin): Remove.
10772 (File_read::descriptor): Reopen descriptor if necessary.
10773 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
10774 (Plugin_manager::all_symbols_read): Add task parameter. Change
10775 all callers.
10776 (Plugin_manager::get_input_file): New function.
10777 (Plugin_manager::release_input_file): New function.
10778 (Pluginobj::Pluginobj): Add filesize parameter and initialize
10779 corresponding data member.
10780 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
10781 and pass to base constructor. Change all callers.
10782 (get_input_file, release_input_file): New functions.
10783 (make_sized_plugin_object): Add filesize parameter. Change all callers.
10784 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
10785 (Plugin_manager::all_symbols_read): Add task parameter.
10786 (Plugin_manager::get_input_file): New function.
10787 (Plugin_manager::release_input_file): New function.
10788 (Plugin_manager::task_): New data member.
10789 (Pluginobj::Pluginobj): Add filesize parameter.
10790 (Pluginobj::filename): New function.
10791 (Pluginobj::descriptor): New function.
10792 (Pluginobj::filesize): New function.
10793 (Pluginobj::filesize_): New data member.
10794 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
10795 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
10796 File_read::claim_for_plugin; use Object::unlock to unlock the file.
10797
10798 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
10799 with archive libraries.
10800 * testsuite/Makefile.in: Regenerate.
10801 * testsuite/plugin_test.c (struct sym_info): New type.
10802 (get_input_file, release_input_file): New static variables.
10803 (onload): Capture new transfer vector entries.
10804 (claim_file_hook): Stop reading at end of file according to filesize.
10805 Factor out parsing of readelf output into separate function.
10806 (all_symbols_read_hook): Exercise get_input_file and release_input_file
10807 APIs and get the source file name from the symbol table. Convert
10808 source file name to corresponding object file name. Print info
10809 message when adding new input files.
10810 (parse_readelf_line): New function.
10811 * testsuite/plugin_test_1.sh: Add checks for new info messages.
10812 * testsuite/plugin_test_2.sh: Likewise.
10813 * testsuite/plugin_test_3.sh: Likewise.
10814 * testsuite/plugin_test_4.sh: New test case.
10815
62a6d109
ILT
108162009-01-07 Ian Lance Taylor <iant@google.com>
10817
10818 * version.cc (version_string): Bump to 1.8.
10819
483620e8
CC
108202008-12-23 Cary Coutant <ccoutant@google.com>
10821
10822 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
10823 * plugin.cc (Plugin_manager::finish): Rename as
10824 layout_deferred_objects. Move cleanup to separate function.
10825 (Plugin_manager::cleanup): New function.
10826 (Plugin_finish::run): Call layout_deferred_objects and cleanup
10827 separately.
10828 * plugin.h (Plugin_manager::finish): Rename as
10829 layout_deferred_objects.
10830 (Plugin_manager::cleanup): New function.
10831 (Plugin_manager::cleanup_done): New field.
10832
d66a9eb3
CC
108332008-12-23 Cary Coutant <ccoutant@google.com>
10834
10835 * plugin.cc (is_visible_from_outside): New function.
10836 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
10837 so we don't return "IR only" status for exported symbols or -r links.
10838
10839 * testsuite/Makefile.am (plugin_test_3): New test case.
10840 * testsuite/Makefile.in: Regenerate.
10841 * testsuite/plugin_test_3.sh: New file.
10842
5995b570
CC
108432008-12-22 Cary Coutant <ccoutant@google.com>
10844
10845 * object.cc (Sized_relobj::layout_section): New function.
10846 (Sized_relobj::do_layout): Defer layout of input sections until after
10847 plugin has provided replacement files.
10848 (Sized_relobj::do_layout_deferred_sections): New function.
10849 * object.h (Relobj::set_section_offset): Remove virtual keyword.
10850 (Relobj::layout_deferred_sections): New function.
10851 (Relobj::do_layout_deferred_sections): New function.
10852 (Sized_relobj::do_layout_deferred_sections): New function.
10853 (Sized_relobj::layout_section): New function.
10854 (Sized_relobj::Deferred_layout): New structure.
10855 (Sized_relobj::deferred_layout_): New field.
10856 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
10857 Change all callers. Layout deferred sections.
10858 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
10859 references.
10860 (Plugin_hook::run): Move code from do_plugin_hook inline.
10861 (Plugin_hook::do_plugin_hook): Remove.
10862 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
10863 (Plugin_manager::finish): Renamed, was cleanup.
10864 (Plugin_manager::should_defer_layout): New function.
10865 (Plugin_manager::add_deferred_layout_object): New function.
10866 (Plugin_manager::Deferred_layout_list): New type.
10867 (Plugin_manager::deferred_layout_objects_): New field.
10868 (Plugin_hook::do_plugin_hook): Remove.
10869
ee769c88
ILT
108702008-12-17 Ian Lance Taylor <iant@google.com>
10871
10872 * options.h (class General_options): Add --no case for
10873 --export-dynamic.
10874
abc8dcba
CC
108752008-12-16 Cary Coutant <ccoutant@google.com>
10876
10877 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
10878 vector.
10879 (Plugin_manager::claim_file): Create plugin object even if
10880 plugin did not call the add_symbols callback.
10881 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
10882 asking for more symbols than were added.
10883 * testsuite/Makefile.am (plugin_test_1): Add test case with
10884 no global symbols.
10885 (empty.syms): New target.
10886 * testsuite/Makefile.in: Regenerate.
10887 * testsuite/plugin_test.c (claim_file_hook): Add new debug
10888 message. Don't call add_symbols if no globals.
10889 (all_symbols_read_hook): Don't provide replacement for empty
10890 claimed file.
10891
b0074644
ILT
108922008-12-12 Ian Lance Taylor <iant@google.com>
10893
68943102
ILT
10894 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
10895 r_type == 0 for a local symbol with r_sym == 0.
10896 (scan_relocatable_relocs): Pass r_sym to
10897 local_non_section_strategy.
10898 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
10899 r_sym parameter.
10900
b0074644
ILT
10901 * configure.ac: Update test for TLS descriptors: they are
10902 supported as of glibc 2.9.
10903 * configure: Rebuild.
10904
c2508178
ILT
109052008-12-11 Ian Lance Taylor <iant@google.com>
10906
10907 PR 7091
10908 * target-reloc.h (Default_scan_relocatable_relocs): For each
10909 function, map r_type == 0 to RELOC_DISCARD.
10910
2756a258
CC
109112008-12-10 Cary Coutant <ccoutant@google.com>
10912
10913 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
10914 object to override a kept COMDAT group from a plugin object.
10915
bb6f53d3
ILT
109162008-12-09 Ian Lance Taylor <iant@google.com>
10917
fbc558e1
ILT
10918 PR 7088
10919 * yyscript.y (file_cmd): Handle INPUT.
10920
bb6f53d3
ILT
10921 * testsuite/initpri1.c: Change all declarations to be full
10922 prototypes by adding void, to avoid compiler warnings.
10923
4674ecfc
CC
109242008-12-05 Rafael Avila de Espindola <espindola@google.com>
10925
10926 * options.cc (General_options::parse_plugin_opt): New.
10927 (General_options::add_plugin): The argument now is just the filename.
10928 (General_options::add_plugin_option): New.
10929 * options.h (plugin_opt): New.
10930 (add_plugin): Change argument name.
10931 (add_plugin_option): New.
10932 * plugin.cc (Plugin::load): Don't parse the plugin option.
10933 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
10934 (Plugin::add_option): New.
10935 (Plugin::args_): Change type.
10936 (Plugin::filename_): New.
10937 (Plugin_manager::add_plugin_option): New.
10938 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
10939 * testsuite/Makefile.in: Regenerate.
10940
fd06b4aa
CC
109412008-12-05 Cary Coutant <ccoutant@google.com>
10942
10943 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
10944 Handle --strip-lto-sections option.
10945 * options.h (strip_lto_sections): New option.
10946
6c52134c
CC
109472008-12-01 Cary Coutant <ccoutant@google.com>
10948
10949 * plugin.cc (ld_plugin_message): Change format parameter to const.
10950 Fix mismatch between new[] and delete.
10951
a45248e0
CC
109522008-11-14 Cary Coutant <ccoutant@google.com>
10953
10954 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
10955 instead of -1U.
10956
c82fbeee
CS
109572008-11-05 Craig Silverstein <csilvers@google.com>
10958
10959 * options.cc (General_options::parse_dynamic_list): New function.
10960 * options.h (General_options): New flags dynamic_list,
10961 dynamic_list_data, dynamic_list_cpp_new, and
10962 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
10963 (General_options::in_dynamic_list): New function.
10964 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
10965 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
10966 (Lex::can_continue_name): Likewise.
10967 (yylex): Likewise.
10968 (read_script_file): New parameter script_options.
10969 (read_dynamic_list): New function.
10970 (Script_options::define_dynamic_list): New function.
10971 (dynamic_list_keyword_parsecodes): New variable.
10972 (dynamic_list_keywords): New variable.
10973 * script.h (Script_options::define_dynamic_list): New function
10974 prototype.
10975 (read_dynamic_list): New function prototype.
10976 * symtab.cc (strprefix): New macro.
10977 (Symbol::should_add_dynsym_entry): Support dynamic_list,
10978 dynamic_list_data, dynamic_list_cpp_new, and
10979 dynamic_list_cpp_typeinfo.
10980 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
10981 (dynamic_list_expr): New rule.
10982 (dynamic_list_nodes): Likewise.
10983 (dynamic_list_node): Likewise.
10984 * testsuite/Makefile.am (dynamic_list): New test.
10985 * testsuite/Makefile.in: Regenerated.
10986 * testsuite/dynamic_list.t: New file.
10987 * testsuite/dynamic_list.sh: New file.
10988
e0bb29a5
CS
109892008-11-05 Craig Silverstein <csilvers@google.com>
10990
10991 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
10992 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
10993 (t11_last): Likewise.
10994 * testsuite/ver_test_6.c (main): Likewise.
10995
4e1e25e0
CC
109962008-10-07 Cary Coutant <ccoutant@google.com>
10997
10998 * options.c (General_options::finalize): Add check for -static and
10999 -shared.
11000 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
11001 is not empty.
11002
92f03fcb
CC
110032008-10-02 Cary Coutant <ccoutant@google.com>
11004
11005 * plugin.cc (make_sized_plugin_object): Fix conditional
11006 compilation to work when not all targets are enabled.
11007
fbd8a257
CC
110082008-09-29 Cary Coutant <ccoutant@google.com>
11009
11010 * archive.cc (Archive::get_file_and_offset): Use filename instead
11011 of name to get library path.
11012 (Archive::include_member): Unlock external member of a thin archive.
11013
11014 * testsuite/Makefile.am (TEST_AR): New variable.
11015 (thin_archive_test_1): New test.
11016 (thin_archive_test_2): New test.
81636b3f
CC
11017 * testsuite/Makefile.in: Regenerate.
11018 * testsuite/thin_archive_main.cc: New file.
11019 * testsuite/thin_archive_test_1.cc: New file.
11020 * testsuite/thin_archive_test_2.cc: New file.
11021 * testsuite/thin_archive_test_3.cc: New file.
11022 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 11023
eff45813
CC
110242008-09-29 Cary Coutant <ccoutant@google.com>
11025
11026 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
11027 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
11028 instead of -1U.
11029 (Sized_relobj::do_finalize_local_symbols): Likewise.
11030 (Sized_relobj::map_to_kept_section): Likewise.
11031 * object.h (Sized_relobj::invalid_address): New constant.
11032 (Sized_relobj::do_output_section_offset): Check for invalid_address
11033 and return -1ULL.
11034 * output.cc (Output_reloc::local_section_offset): Use constant
11035 invalid_address instead of -1U.
11036 (Output_reloc::get_address): Likewise.
11037 (Output_section::output_address): Change -1U to -1ULL.
11038 * output.h (Output_reloc::invalid_address): New constant.
11039 * reloc.cc (Sized_relobj::write_sections): Use constant
11040 invalid_address instead of -1U.
11041 (Sized_relobj::relocate_sections): Likewise.
11042 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
11043 values for merge sections.
11044 * target-reloc.h (relocate_for_relocatable): Use constant
11045 invalid_address instead of -1U.
11046
89fc3421
CC
110472008-09-19 Cary Coutant <ccoutant@google.com>
11048
11049 Add plugin functionality for link-time optimization (LTO).
11050 * configure.ac (plugins): Add --enable-plugins option.
11051 * configure: Regenerate.
11052 * config.in: Regenerate.
11053 * Makefile.am (LIBDL): New variable.
11054 (CCFILES): Add plugin.cc.
11055 (HFILES): Add plugin.h.
11056 (ldadd_var): Add LIBDL.
11057 * Makefile.in: Regenerate.
11058
11059 * archive.cc: Include "plugin.h".
11060 (Archive::setup): Don't preread archive symbols when using a plugin.
11061 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
11062 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
11063 files.
11064 (Archive::include_member): Add symbols from plugin objects.
11065 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
11066 * descriptors.cc (Descriptors::open): Check for file descriptors
11067 abandoned by plugins.
11068 (Descriptors::claim_for_plugin): New function.
11069 * descriptors.h (Descriptors::claim_for_plugin): New function.
11070 (Open_descriptor::is_claimed): New field.
11071 (claim_descriptor_for_plugin): New function.
11072 * fileread.cc (File_read::claim_for_plugin): New function.
11073 * fileread.h (File_read::claim_for_plugin): New function.
11074 (File_read::descriptor): New function.
11075 * gold.cc: Include "plugin.h".
11076 (queue_initial_tasks): Add task to call plugin hooks for generating
11077 new object files.
11078 * main.cc: Include "plugin.h".
11079 (main): Load plugin libraries.
11080 * object.h (Pluginobj): Declare.
11081 (Object::pluginobj): New function.
11082 (Object::do_pluginobj): New function.
11083 (Object::set_target): New function.
11084 * options.cc: Include "plugin.h".
11085 (General_options::parse_plugin): New function.
11086 (General_options::General_options): Initialize plugins_ field.
11087 (General_options::add_plugin): New function.
11088 * options.h (Plugin_manager): Declare.
11089 (General_options): Add --plugin option.
11090 (General_options::has_plugins): New function.
11091 (General_options::plugins): New function.
11092 (General_options::add_plugin): New function.
11093 (General_options::plugins_): New field.
11094 * plugin.cc: New file.
11095 * plugin.h: New file.
11096 * readsyms.cc: Include "plugin.h".
11097 (Read_symbols::do_read_symbols): Check for archive before checking
11098 for ELF file. Call plugin hooks to claim files.
11099 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
11100 from a real object file; force override when processing replacement
11101 files.
11102 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
11103 (Symbol::init_base_object): Likewise.
11104 (Symbol::init_base_output_data): Likewise.
11105 (Symbol::init_base_output_segment): Likewise.
11106 (Symbol::init_base_constant): Likewise.
11107 (Symbol::init_base_undefined): Likewise.
11108 (Symbol::output_section): Assert that object is not a plugin.
11109 (Symbol_table::add_from_pluginobj): New function.
11110 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
11111 undefined.
11112 (Symbol_table::sized_write_globals): Likewise.
11113 (Symbol_table::add_from_pluginobj): Instantiate template.
11114 * symtab.h (Sized_pluginobj): Declare.
11115 (Symbol::in_real_elf): New function.
11116 (Symbol::set_in_real_elf): New function.
11117 (Symbol::in_real_elf_): New field.
11118 (Symbol_table::add_from_pluginobj): New function.
11119
11120 * testsuite/Makefile.am (AM_CFLAGS): New variable.
11121 (LIBDL): New variable.
11122 (LDADD): Add LIBDL.
11123 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
11124 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
11125 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
11126 (MOSTLYCLEANFILES): Likewise.
11127 * testsuite/Makefile.in: Regenerate.
11128 * testsuite/plugin_test.c: New file.
11129 * testsuite/plugin_test_1.sh: New file.
11130 * testsuite/plugin_test_2.sh: New file.
11131
de31bda5
ILT
111322008-09-16 Ian Lance Taylor <iant@google.com>
11133
9c2d0ef9
ILT
11134 * target-reloc.h (relocate_section): Check whether a symbol is
11135 defined by the ABI before reporting an undefined symbol error.
11136 * target.h (Target::is_defined_by_abi): Make parameter const.
11137 (Target::do_is_defined_by_abi): Likewise.
11138 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
11139 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
11140 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
11141 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
11142 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
11143 * testsuite/Makefile.in: Rebuild.
11144
de31bda5
ILT
11145 * fileread.cc (make_view): Add casts to avoid warning.
11146
9fa33bee
AO
111472008-09-16 Alexandre Oliva <aoliva@redhat.com>
11148
11149 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
11150 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11151
183fd0e3
AO
111522008-09-16 Alexandre Oliva <aoliva@redhat.com>
11153
11154 * options.h (General_options::output_is_executable): New.
11155 (General_options::output_is_pie): New.
11156 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
11157 for shared libraries.
11158 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
11159
7be8330a
CD
111602008-09-11 Chris Demetriou <cgd@google.com>
11161
11162 * options.h (origin): New -z option.
11163 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
11164 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
11165 in DT_FLAGS_1.
11166
a9caad02
CC
111672008-09-05 Cary Coutant <ccoutant@google.com>
11168
11169 * fileread.cc (File_read::make_view): Add check for attempt to map
11170 beyond end of file.
11171
ae6dce4d
CC
111722008-09-05 Cary Coutant <ccoutant@google.com>
11173
11174 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
11175 explicit instantiations.
11176
d7ab2a47
KVH
111772008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
11178
11179 PR gold/6858
11180 * options.cc (General_options::finalize): Allow undefined symbols
11181 in shlibs if linking -shared.
11182
11183 PR gold/6859
11184 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
11185 symbols as not needing a dynsym entry.
11186
1e52a9c1
CS
111872008-08-20 Craig Silverstein <csilvers@google.com>
11188
11189 * fileread.cc (File_read::open): Do not lock the file unless it
11190 was successfully opened.
11191
d85c80a3
CC
111922008-08-14 Cary Coutant <ccoutant@google.com>
11193
11194 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
11195 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
11196 * testsuite/tls_test.cc (struct int128): 128-bit struct
11197 for testing TLS relocs with non-zero addend.
11198 (v12): New TLS variable.
11199 (t12): New test.
11200 (t_last): Add check for v12.
11201 * testsuite/tls_test.h (t12): New function.
11202 * testsuite/tls_test_main.cc (thread_routine): Call new test.
11203
2d924fd9
ILT
112042008-08-13 Ian Lance Taylor <iant@google.com>
11205
11206 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
11207 set tls_segment_ or relro_segment_.
11208 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
11209 when appropriate.
11210 * output.h (Output_section::clear_is_relro): New function.
11211 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
11212 sections specially even when output_data_ is empty.
11213 (Output_segment::maximum_alignment): When first section is relro,
11214 only force alignment for PT_LOAD segments.
11215 * script.cc (script_data_segment_align): New function.
11216 (script_data_segment_relro_end): New function.
11217 * script-c.h (script_data_segment_align): Declare.
11218 (script_data_segment_relro_end): Declare.
11219 * script-sections.h (class Script_sections): Declare
11220 data_segment_align and data_segment_relro_end. Add fields
11221 segment_align_index_ and saw_relro_end_.
11222 * script-sections.cc (class Sections_element): Add set_is_relro
11223 virtual function. Add new bool* parameter to place_orphan_here.
11224 Add get_output_section virtual function.
11225 (class Output_section_definition): Add set_is_relro. Add new
11226 bool* parameter to place_orphan_here. Add get_output_section.
11227 Add is_relro_ field.
11228 (Output_section_definition::Output_section_definition): Initialize
11229 evaluated_address_, evaluated_load_address, evaluated_addralign_,
11230 and is_relro_ fields.
11231 (Output_section_definition::place_orphan_here): Add is_relro
11232 parameter.
11233 (Output_section_definition::set_section_addresses): Set relro for
11234 output section.
11235 (Output_section_definition::alternate_constraint): Likewise.
11236 (class Orphan_output_section): Add new bool* parameter to
11237 place_orphan_here. Add get_output_section.
11238 (Orphan_output_section::place_orphan_here): Add is_relro
11239 parameter.
11240 (Script_sections::Script_sections): Initialize
11241 data_segment_align_index_ and saw_relro_end_.
11242 (Script_sections::data_segment_align): New function.
11243 (Script_sections::data_segment_relro_end): New function.
11244 (Script_sections::place_orphan): Set or clear is_relro.
11245 (Script_sections::set_section_addresses): Force alignment of first
11246 TLS section.
11247 * yyscript.y (exp): Call script_data_segment_align and
11248 script_data_segment_relro_end.
11249 * testsuite/relro_script_test.t: New file.
11250 * testsuite/relro_test.cc (using_script): Declare.
11251 (t1, t2): Test using_script.
11252 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
11253 (relro_script_test_SOURCES): Define.
11254 (relro_script_test_DEPENDENCIES): Define.
11255 (relro_script_test_LDFLAGS): Define.
11256 (relro_script_test_LDADD): Define.
11257 (relro_script_test.so): New target.
11258 * testsuite/Makefile.in: Rebuild.
11259
f827c9a9
CC
112602008-08-06 Cary Coutant <ccoutant@google.com>
11261
11262 * archive.cc (Archive::total_archives, Archive::total_members)
11263 (Archive::total_members_loaded): New variables.
11264 (Archive::setup): Add parameter. Add option to preread
11265 archive symbols.
11266 (Archive::read_armap): Add counter.
11267 (Archive::get_file_and_offset): New function.
11268 (Archive::get_elf_object_for_member): New function.
11269 (Archive::read_all_symbols): New function.
11270 (Archive::read_symbols): New function.
11271 (Archive::add_symbols): Add counters.
11272 (Archive::include_all_members): Use armap to find members if it's
11273 already built.
11274 (Archive::include_member): Skip reading symbols if already read.
11275 Factored code into Archive::get_file_and_offset and
11276 Archive::get_elf_object_for_member. Changed call to
11277 Mapfile::report_include_archive_member.
11278 (Archive::print_stats): New function.
11279 * archive.h: Declare Object and Read_symbols_data classes.
11280 (Archive::Archive): Add initializers for new members.
11281 (Archive::setup): Add parameter.
11282 (Archive::print_stats): New function.
11283 (Archive::total_archives, Archive::total_members)
11284 (Archive::total_members_loaded): New variables.
11285 (Archive::get_file_and_offset): New function.
11286 (Archive::get_elf_object_for_member): New function.
11287 (Archive::read_all_symbols): New function.
11288 (Archive::read_symbols): New function.
11289 (Archive::Archive_member): New class.
11290 (Archive::members_): New member.
11291 (Archive::num_members_): New member.
11292 * main.cc: Include archive.h.
11293 (main): Call Archive::print_stats.
11294 * mapfile.cc (Mapfile::report_include_archive_member): Delete
11295 archive parameter; member_name is now the fully-decorated name.
11296 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
11297 * options.h: (General_options): Add --preread-archive-symbols option.
11298 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
11299 Archive::setup.
11300
de4c45bd
ILT
113012008-08-04 Ian Lance Taylor <iant@google.com>
11302
11303 * symtab.h (Symbol::use_plt_offset): New function.
11304 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
11305 * powerpc.cc (Relocate::relocate): Likewise.
11306 * sparc.cc (Relocate::relocate): Likewise.
11307 * x86_64.cc (Relocate::relocate): Likewise.
11308 * testsuite/weak_plt.sh: New test.
11309 * testsuite/weak_plt_main.cc: New test.
11310 * testsuite/weak_plt_shared.cc: New test.
11311 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
11312 (check_PROGRAMS): Add weak_plt.
11313 (check_DATA): Add weak_plt_shared.so.
11314 (weak_plt_main_pic.o, weak_plt): New targets.
11315 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
11316 * testsuite/Makefile.in: Rebuild.
11317
11318 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
11319 gcctestdir/ld.
11320 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
11321 * testsuite/Makefile.in: Rebuild.
11322
323ee3f4
AM
113232008-08-04 Alan Modra <amodra@bigpond.net.au>
11324
11325 * Makefile.am (POTFILES.in): Set LC_ALL=C.
11326 * Makefile.in: Regenerate.
11327 * po/POTFILES.in: Regenerate.
11328
7c07ecec
ILT
113292008-07-29 Ian Lance Taylor <iant@google.com>
11330
11331 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
11332 symbols before other symbols.
11333 * testsuite/script_test_2.cc (test_addr): Declare.
11334 (test_addr_alias): Declare.
11335 (main): Check that test_addr and test_addr_alias have the right
cd536b21 11336 values.
7c07ecec
ILT
11337 * testsuite/script_test_2.t: Define test_addr_alias and
11338 test_addr.
11339
5778530e
ILT
113402008-07-24 Ian Lance Taylor <iant@google.com>
11341
2a00e4fb
ILT
11342 PR 5990
11343 * descriptors.cc: New file.
11344 * descriptors.h: New file.
11345 * gold-threads.h (class Hold_optional_lock): New class.
11346 * fileread.cc: Include "descriptors.h".
11347 (File_read::~File_read): Release descriptor rather than closing
11348 it.
11349 (File_read::open) [file]: Call open_descriptor rather than open.
11350 Set is_descriptor_opened_.
11351 (File_read::open) [memory]: Assert that descriptor is not open.
11352 (File_read::reopen_descriptor): New function.
11353 (File_read::release): Release descriptor.
11354 (File_read::do_read): Make non-const. Reopen descriptor.
11355 (File_read::read): Make non-const.
11356 (File_read::make_view): Reopen descriptor.
11357 (File_read::do_readv): Likewise.
11358 * fileread.h (class File_read): Add is_descriptor_opened_ field.
11359 Update declarations.
11360 * layout.cc: Include "descriptors.h".
11361 (Layout::create_build_id): Use open_descriptor rather than open.
11362 * output.cc: Include "descriptors.h".
11363 (Output_file::open): Use open_descriptor rather than open.
11364 * archive.cc (Archive::const_iterator): Change Archive to be
11365 non-const.
11366 (Archive::begin, Archive::end): Make non-const.
11367 (Archive::count_members): Likewise.
11368 * archive.h (class Archive): Update declarations.
11369 * object.h (Object::read): Make non-const.
11370 * Makefile.am (CCFILES): Add descriptors.cc.
11371 (HFILES): Add descriptors.h.
11372 * Makefile.in: Rebuild.
11373
801647d1
ILT
11374 PR 6716
11375 * gold.h: Always include <clocale>. Add Solaris workarounds
11376 following code in binutils/sysdep.h.
11377
5edd166e
ILT
11378 PR 6048
11379 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
11380 this->eh_frame_hdr_ is NULL before using it.
11381
c89ad728
ILT
11382 * dynobj.cc (Versions::Versions): Update comment.
11383
aa86f06b
ILT
11384 * dynobj.cc (Versions::Versions): If there is an soname, use it as
11385 the base version name.
11386
5778530e
ILT
11387 * stringpool.cc (Stringpool_template::add_with_length): Set key to
11388 array size plus one.
11389 (Stringpool_template::set_string_offsets): Subtract one from key
11390 before using it as an array index.
11391 (Stringpool_template::get_offset_with_length): Likewise.
11392 (Stringpool_template::write_to_buffer): Likewise.
11393 * stringpool.h (Stringpool_template::get_offset_from_key):
11394 Likewise.
11395
057ead22
ILT
113962008-07-23 Ian Lance Taylor <iant@google.com>
11397
7f649c59
ILT
11398 PR 6658
11399 * object.h (Merged_symbol_value::value): Do our best to handle a
11400 negative addend.
11401
057ead22
ILT
11402 PR 6647
11403 * script.cc (Version_script_info::get_versions): Don't add empty
11404 version tag to return value.
11405 (Version_script_info::get_symbol_version_helper): Change return
11406 type to bool. Add pversion parameter. Change all callers.
11407 (script_register_vers_node): Don't require a non-NULL tag.
11408 * script.h (class Version_script_info): Update declarations.
11409 (Version_script_info::get_symbol_version): Change return type to
11410 bool. Add version parameter. Change all callers.
11411 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
11412 handling. Handle an empty version from a version script.
11413 (Symbol_table::define_special_symbol): Likewise.
11414 * testsuite/ver_test_10.script: New file.
11415 * testsuite/ver_test_10.sh: New file.
11416 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
11417 (check_DATA): Add ver_test_10.syms.
11418 (ver_test_10.syms, ver_test_10.so): New target.
11419 * testsuite/Makefile.in: Rebuild.
11420
58e54ac2
CD
114212008-07-23 Simon Baldwin <simonb@google.com>
11422
11423 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
11424 to zero for undefined symbols from dynamic libraries.
11425
95d14cd3
ILT
114262008-07-23 Ian Lance Taylor <iant@google.com>
11427
11428 * symtab.cc (Symbol_table::resolve): Remove version parameter.
11429 Change all callers.
11430 * symtab.h (class Symbol_table): Update declaration.
11431 * testsuite/ver_test_9.cc: New file.
11432 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
11433 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
11434 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
11435 (ver_test_9.so, ver_test_9.o): New targets.
11436 * testsuite/Makefile.in: Rebuild.
11437
92de84a6
ILT
114382008-07-22 Ian Lance Taylor <iant@google.com>
11439
34810851
ILT
11440 * options.h (class General_options): Define --check-sections.
11441 * layout.cc (Layout::set_segment_offsets): Handle
11442 --check-sections.
11443
af6156ef
ILT
11444 * options.h (class General_options): Define -n/--nmagic and
11445 -N/--omagic.
11446 * options.cc (General_options::finalize): For -n/--nmagic or
11447 -N/--omagic, set -static.
11448 * layout.cc (Layout::attach_allocated_section_to_segment): If
11449 -N/--omagic, don't put read-only and read-write sections in
11450 different segments.
11451 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
11452 finding a read-only segment.
11453 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
11454 don't set the minimum segment alignment to the common page size,
11455 and don't set the file offset to the address modulo the page size.
11456 * script-sections.cc (Script_sections::create_segments): If
11457 -n/--omagic, don't put read-only and read-write sections in
11458 different segments.
11459
92de84a6
ILT
11460 * cref.cc: New file.
11461 * cref.h: New file.
11462 * options.h (class General_options): Add --print-symbol-counts.
11463 * main.cc (main): Issue defined symbol report if requested.
11464 * archive.cc (Archive::interpret_header): Make into a const member
11465 function.
11466 (Archive::add_symbols): Call Input_objects::archive_start and
11467 archive_stop.
11468 (Archive::const_iterator): Define new class.
11469 (Archive::begin, Archive::end): New functions.
11470 (Archive::include_all_members): Rewrite to use iterator.
11471 (Archive::count_members): New function.
11472 * archive.h (class Archive): Update declarations.
11473 (Archive::filename): New function.
11474 * object.cc: Include "cref.h".
11475 (Sized_relobj::Sized_relobj): Initialize defined_count_.
11476 (Sized_relobj::do_get_global_symbol_counts): New function.
11477 (Input_objects::add_object): Add object to cross-referencer.
11478 (Input_objects::archive_start): New function.
11479 (Input_objects::archive_stop): New function.
11480 (Input_objects::print_symbol_counts): New function.
11481 * object.h: Declare Cref and Archive.
11482 (Object::get_global_symbol_counts): New function.
11483 (Object::do_get_global_symbol_counts): New pure virtual function.
11484 (class Sized_relobj): Add defined_count_ field. Update
11485 declarations.
11486 (class Input_objects): Add cref_ field. Update constructor.
11487 Update declarations.
11488 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
11489 defined_count_.
11490 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
11491 symbol counts.
11492 (Sized_dynobj::do_get_global_symbol_counts): New function.
11493 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
11494 defined_count_. Update declarations. Define Symbols typedef.
11495 * symtab.cc (Symbol_table::add_from_relobj): Add defined
11496 parameter. Change all callers.
11497 (Symbol_table::add_from_dynobj): Add sympointers and defined
11498 parameters. Change all callers.
11499 * symtab.h (class Symbol_table): Update declarations.
11500 * Makefile.am (CCFILES): Add cref.cc.
11501 (HFILES): Add cref.h.
11502 * Makefile.in: Rebuild.
11503
3f7c5e1d
CD
115042008-07-22 Simon Baldwin <simonb@google.com>
11505
11506 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
11507 to zero when writing undefined symbols.
11508
e0b64032
ILT
115092008-07-22 Ian Lance Taylor <iant@google.com>
11510
11511 * output.cc (Output_section::add_input_section): Don't try to
11512 merge empty merge sections.
11513
096b02cf
CS
115142008-07-21 Craig Silverstein <csilvers@google.com>
11515
11516 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
11517 Include symbol version in error message.
cd536b21 11518
1d1f116d
CD
115192008-07-20 Chris Demetriou <cgd@google.com>
11520
cd536b21 11521 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
11522 (RANDOM_SEED_CFLAGS): New substituted variable.
11523 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
11524 * configure: Rebuild.
11525 * Makefile.in: Likewise.
11526 * testsuite/Makefile.in: Likewise.
11527
a18f591e
ILT
115282008-07-18 Ian Lance Taylor <iant@google.com>
11529
11530 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
11531 where we see NAME/NULL and NAME/VERSION as separate symbols.
11532 * testsuite/ver_test_main.cc (main): Call t4.
11533 (t4, t4_2a): Define.
11534 * testsuite/ver_test_2.cc (t4_2): Define.
11535 * testsuite/ver_test_2.script: Put t4_2a in VER2.
11536 * testsuite/ver_test_4.cc (t4_2a): Define.
11537 * testsuite/ver_test_4.script: Put t4_2a in VER2.
11538 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
11539
c6e3f6ed
ILT
115402008-07-17 Ian Lance Taylor <iant@google.com>
11541
11542 * dynobj.cc (Versions::add_def): If we give an error about a
11543 missing version, go ahead and create the version anyhow.
11544
ef9beddf
ILT
115452008-07-10 Ian Lance Taylor <iant@google.com>
11546
11547 Handle output sections with more than 0x7fffffff bytes.
11548 * object.h (class Relobj): Change map_to_output_ to
11549 output_sections_, and just keep a section pointer. Change all
11550 uses. Move comdat group support to Sized_relobj.
11551 (Relobj::is_section_specially_mapped): Remove.
11552 (Relobj::output_section): Remove poff parameter. Change all
11553 callers.
11554 (Relobj::output_section_offset): New function.
11555 (Relobj::set_section_offset): Rewrite.
11556 (Relobj::map_to_output): Remove.
11557 (Relobj::output_sections): New function.
11558 (Relobj::do_output_section_offset): New pure virtual function.
11559 (Relobj::do_set_section_offset): Likewise.
11560 (class Sized_relobj): Add section_offsets_ field. Add comdat
11561 group support from Relobj. Update declarations.
11562 (Sized_relobj::get_output_section_offset): New function.
11563 (Sized_relobj::do_output_section_offset): New function.
11564 (Sized_relobj::do_set_section_offset): New function.
11565 * object.cc (Relobj::output_section_address): Remove.
11566 (Sized_relobj::Sized_relobj): Initialize new fields.
11567 (Sized_relobj::include_section_group): Cast find_kept_object to
11568 Sized_relobj.
11569 (Sized_relobj::include_linkonce_section): Likewise.
11570 (Sized_relobj::do_layout): Use separate arrays for output section
11571 and output offset.
11572 (Sized_relobj::do_count_local_symbols): Change map_to_output to
11573 output_sections.
11574 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
11575 output_sections and section_offsets.
11576 (Sized_relobj::write_local_symbols): Likewise.
11577 (map_to_kept_section): Compute output address directly.
11578 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
11579 output_sections and section_offsets.
11580 (Sized_relobj::write_sections): Likewise.
11581 (Sized_relobj::relocate_sections): Likewise.
11582 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
11583 * output.h (class Output_reloc): Update declarations. Change
11584 u2_.relobj to Sized_relobj*.
11585 (class Output_data_reloc): Change add functions to use
11586 Sized_relobj*.
11587 * output.cc (Output_reloc::Output_reloc): Change relobj to
11588 Sized_relobj*.
11589 (Output_reloc::local_section_offset): Change return type to
11590 Elf_Addr. Use get_output_section_offset.
11591 (Output_reloc::get_address): Likewise.
11592 (Output_section::is_input_address_mapped): Don't call
11593 is_section_specially_mapped.
11594 (Output_section::output_offset): Likewise.
11595 (Output_section::output_address): Likewise.
11596 (Output_section::starting_output_address): Likewise.
11597 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
11598 parameter to Sized_relobj*.
11599 (Copy_relocs::need_copy_reloc): Likewise.
11600 (Copy_relocs::save): Likewise.
11601 * copy-relocs.h (class Copy_relocs): Update declarations.
11602 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
11603 Sized_relobj*. Change relobj_ field to Sized_relobj*.
11604 * target-reloc.h (relocate_for_relocatable): Change
11605 offset_in_output_section type to Elf_Addr. Change code that uses
11606 it as well.
11607 * layout.cc (Layout::layout): Always set *off.
11608 * mapfile.cc (Mapfile::print_input_section): Use
11609 output_section_offset.
11610 * i386.cc (Target_i386::copy_reloc): Change object parameter to
11611 Sized_relobj*.
11612 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
11613 * sparc.cc (Target_sparc::copy_reloc): Likewise.
11614 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
11615
5cb66f97
ILT
116162008-07-03 Ian Lance Taylor <iant@google.com>
11617
11618 * layout.cc (Layout::include_section): Do not discard unrecognized
11619 SHT_STRTAB sections.
11620
afe47622
CS
116212008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
11622
11623 * script.cc (Lex::can_continue_name): Make '?' allowable in
11624 version-script names.
11625 * testsuite/version_script.map: Change glob pattern to use '?'
11626
5adf9721
ILT
116272008-06-30 Manish Singh <yosh@gimp.org>
11628
11629 PR 6585
11630 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
11631 Correct typo.
11632
e6fde208
ILT
116332008-06-30 Ian Lance Taylor <iant@google.com>
11634
11635 PR 6660
11636 PR 6682
11637 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
11638 versions]: Don't try to read the value in the contents, since we
11639 don't use it. Use the template endianness when writing.
11640
3f2e6a2d
CC
116412008-06-25 Cary Coutant <ccoutant@google.com>
11642
11643 * fileread.cc (File_read::make_view): Assert on zero-length view.
11644 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
11645 symbol table when there are no symbols to read.
11646
c43d3a48
CS
116472008-06-23 Craig Silverstein <csilvers@google.com>
11648
11649 * version.cc (version_string): Bump to 1.7
11650
5f494ea0
CS
116512008-06-18 Craig Silverstein <csilvers@google.com>
11652
11653 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
11654 constant 0xFFFF to type Valtype.
11655 (Powerpc_relocate_functions::rel16_ha): Likewise.
11656
c42e122e
ILT
116572008-06-17 Ian Lance Taylor <iant@google.com>
11658
f34787f8
ILT
11659 * output.h (Output_section::Input_section): Initialize p2align_ to
11660 zero for Output_section_data constructors.
11661 (Output_section::Input_section::addralign): If not an input
11662 section, return the alignment of the Output_section_data.
11663 * testsuite/copy_test.cc: New file.
11664 * testsuite/copy_test_1.cc: New file.
11665 * testsuite/copy_test_2.cc: New file.
11666 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
11667 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
11668 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
11669 (copy_test_1_pic.o, copy_test_1.so): New targets.
11670 (copy_test_2_pic.o, copy_test_2.so): New targets.
11671 * testsuite/Makefile.in: Rebuild.
11672
c42e122e
ILT
11673 * script-sections.cc (Script_sections::place_orphan): Initialize
11674 local variable exact.
11675
ce3ac18a
DE
116762008-06-13 David Edelsohn <edelsohn@gnu.org>
11677
11678 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
11679
42cacb20
DE
116802008-06-12 David Edelsohn <edelsohn@gnu.org>
11681 David S. Miller <davem@davemloft.net>
11682
11683 * powerpc.cc: New file.
11684 * Makefile.am (TARGETSOURCES): Add powerpc.cc
11685 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
11686 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
11687 * Makefile.in: Rebuild.
11688
7b308235
ILT
116892008-06-09 Ian Lance Taylor <iant@google.com>
11690
11691 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
11692 <exception>.
11693 (throwing, orig_terminate): New static variables.
11694 (terminate_handler): New static function.
11695 (t2): Set terminate handler.
11696
f0b886e3
ILT
116972008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
11698
11699 PR 6584
cd536b21 11700 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
11701 alignment.
11702
3e90f135
CC
117032008-05-30 Cary Coutant <ccoutant@google.com>
11704
11705 * archive.cc (Archive::include_all_members) Correct to step
11706 over symbol table and extended name table in thin archives.
11707
e09ad04a
ILT
117082008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
11709
11710 PR 6407
11711 * target-reloc.h (relocate_for_relocatable): Fix new_offset
11712 calculation.
11713
62b01cb5
ILT
117142008-05-28 Caleb Howe <cshowe@google.com>
11715
11716 * reduced_debug_output.cc: New file.
11717 * reduced_debug_output.h: New file.
92de84a6 11718 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
11719 * options.cc (General_options::finalize): Add strip_debug_non_line
11720 to the strip heirarchy.
11721 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
11722 fields.
11723 * layout.cc: Include "reduced_debug_output.h".
11724 (Layout::Layout): Initialize new fields.
11725 (line_only_debug_sections): New static array.
11726 (is_lines_only_debug_sections): New static inline function.
11727 (Layout::include_section): Handle --strip-debug-non-line.
11728 (Layout::make_output_section): If --strip-debug-non-line, build
11729 new output sections for .debug_abbrev and .debug_info.
11730 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
11731 gold. Warn about possible overflow.
11732 (read_signed_LEB_128): Likewise.
11733 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
11734 (read_signed_LEB_128): Declare.
11735 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
11736 (HFILES): Add reduced_debug_output.h.
11737 * Makefile.in: Rebuild.
11738
7d9e3d98
ILT
117392008-05-21 Ian Lance Taylor <iant@google.com>
11740
11741 * mapfile.cc: New file.
11742 * mapfile.h: New file.
11743 * options.h (class General_options): Add -M/--print-map and -Map.
11744 * options.cc (General_options::finalize): Make -M equivalent to
11745 -Map -.
11746 * main.cc: Include <cstdio> and "mapfile.h".
11747 (main): Open mapfile if requested.
11748 * gold.cc (class Middle_runner): Add mapfile_ field. Update
11749 constructor. Change caller.
11750 (queue_initial_tasks): Add mapfile parameter. Change caller.
11751 (queue_middle_tasks): Likewise.
11752 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
11753 declarations.
11754 * archive.cc: Include "mapfile.h".
11755 (Archive::add_symbols): Add mapfile parameter. Change all
11756 callers. Pass mapfile, symbol, and reason to include_member.
11757 (Archive::include_all_members): Add mapfile parameter. Change all
11758 callers.
11759 (Archive::include_member): Add mapfile, sym, and why parameters.
11760 Change all callers. Report inclusion to map file.
11761 * archive.h: Include "fileread.h".
11762 (class Archive): Update declarations.
11763 (Archive::file): New const method.
11764 (class Add_archive_symbols): Add mapfile_ field. Update
11765 constructor. Change all callers.
11766 * readsyms.h (class Read_symbols): Likewise.
11767 (class Finish_group): Likewise.
11768 (class Read_script): Likewise.
11769 * common.cc: Include "mapfile.h".
11770 (Symbol_table::allocate_commons): Add mapfile parameter. Change
11771 all callers.
11772 (Symbol_table::do_allocate_commons): Likewise.
11773 (Symbol_table::do_allocate_commons_list): Likewise. Report common
11774 symbol allocation to mapfile.
11775 * common.h (class Allocate_commons_task): Add mapfile_ field.
11776 Update constructor. Change all callers.
11777 * symtab.h (class Symbol_table): Update declarations.
11778 * layout.cc: Include "mapfile.h".
11779 (Layout_task_runner::run): Print information to mapfile.
11780 (Layout::create_gold_note): Change Output_data_fixed_space to
11781 Output_data_zero_fill.
11782 (Layout::create_build_id): Likewise.
11783 (Layout::print_to_mapfile): New function.
11784 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
11785 constructor. Change caller.
11786 (class Layout): Declare print_to_mapfile.
11787 * output.cc (Output_section::Input_section::print_to_mapfile): New
11788 function.
11789 (Output_section::add_input_section): If producing a map, always
11790 add to input_sections_ list.
11791 (Output_section::do_print_to_mapfile): New function.
11792 (Output_segment::print_sections_to_mapfile): New function.
11793 (Output_segment::print_section_list_to_mapfile): New function.
11794 * output.h: Include "mapfile.h".
11795 (Output_data::print_to_mapfile): New function.
11796 (Output_data::do_print_to_mapfile): New virtual function.
11797 (Output_segment_headers::do_print_to_mapfile): New function.
11798 (Output_file_header::do_print_to_mapfile): New function.
11799 (Output_data_const::do_print_to_mapfile): New function.
11800 (class Output_data_const_buffer): Add map_name_ field. Update
11801 constructor. Change all callers. Add do_print_to_mapfile
11802 function.
11803 (class Output_data_fixed_space): Likewise.
11804 (class Output_data_space): Likewise.
11805 (class Output_data_zero_fill): New class.
11806 (Output_data_strtab::do_print_to_mapfile): New function.
11807 (Output_data_reloc_base::do_print_to_mapfile): New function.
11808 (Output_relocatable_relocs::do_print_to_mapfile): New function.
11809 (Output_data_group::do_print_to_mapfile): New function.
11810 (Output_data_got::do_print_to_mapfile): New function.
11811 (Output_data_dynamic::do_print_to_mapfile): New function.
11812 (Output_symtab_xindex::do_print_to_mapfile): New function.
11813 (class Output_section): Declare do_print_to_mapflie. Declare
11814 print_to_mapfile in Input_section.
11815 (class Output_segment): Declare new functions.
11816 * object.h (Sized_relobj::symbol_count): New function.
11817 * script-sections.cc
11818 (Output_section_element_dot_assignment::set_section_addresses):
11819 Change Output_data_fixed_space to Output_data_zero_fill.
11820 (Output_data_expression::do_print_to_mapfile): New function.
11821 * script.cc (read_input_script): Add mapfile parameter. Change
11822 all callers.
11823 * script.h (read_input_script): Update declaration.
11824 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
11825 (Eh_frame::do_print_to_mapfile): New function.
11826 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
11827 (Output_merge_string::do_print_to_mapfile): New function.
11828 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
11829 function.
11830 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
11831 function.
11832 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
11833 function.
11834 * Makefile.am (CCFILES): Add mapfile.cc.
11835 (HFILES): Add mapfile.h.
11836 * Makefile.in: Rebuild.
11837
9f1d377b
ILT
118382008-05-19 Ian Lance Taylor <iant@google.com>
11839
11840 * options.h (class General_options): Add -z relro.
11841 * layout.cc (Layout::Layout): Initialize relro_segment_.
11842 (Layout::add_output_section_data): Return the output section.
11843 (Layout::make_output_section): Rcognize relro sections and mark
11844 them appropriately.
11845 (Layout::attach_allocated_section_to_segment): Put relro sections
11846 in a PT_GNU_RELRO segment.
11847 (Layout::create_initial_dynamic_sections): Mark the .dynamic
11848 section as relro.
11849 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
11850 PT_TLS segments.
11851 (Layout::linkonce_mapping): Map d.rel.ro.local to
11852 .data.rel.ro.local.
11853 (Layout::output_section_name): Us .data.rel.ro.local for any
11854 section which begins with that.
11855 * layout.h (class Layout): Update add_output_section_data
11856 declaration. Add relro_segment_ field.
11857 * output.cc (Output_section::Output_section): Initialize is_relro_
11858 and is_relro_local_ fields.
11859 (Output_segment::add_output_section): Group relro sections.
11860 (Output_segment::is_first_section_relro): New function.
11861 (Output_segment::maximum_alignment): If there is a relro section,
11862 align the segment to the common page size.
11863 (Output_segment::set_section_addresses): Track whether we are
11864 looking at relro sections. If the last section is a relro
11865 section, align to the common page size.
11866 (Output_segment::set_section_list_addresses): Add in_relro
11867 parameter. Change all callers. Align to the page size when
11868 moving from relro to non-relro section.
11869 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
11870 segment.
11871 * output.h (class Output_section): Add is_relro_ and
11872 is_relro_local_ fields.
11873 (Output_section::is_relro): New function.
11874 (Output_section::set_is_relro): New function.
11875 (Output_section::is_relro_local): New function.
11876 (Output_section::set_is_relro_local): New function.
11877 (class Output_segment): Update declarations.
11878 * i386.cc (Target_i386::got_section): Mark .got section as relro.
11879 * sparc.cc (Target_sparc::got_section): Likewise.
11880 * x86_64.cc (Target_x86_64::got_section): Likewise.
11881 * testsuite/relro_test_main.cc: New file.
11882 * testsuite/relro_test.cc: New file.
11883 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
11884 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
11885 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
11886 (relro_test.so, relro_test_pic.o): New targets.
11887 * testsuite/Makefile.in: Rebuild.
11888
a984ee1d
ILT
118892008-05-16 Ian Lance Taylor <iant@google.com>
11890
01676dcd
ILT
11891 * output.cc (Output_segment::add_output_section): Remove front
11892 parameter.
11893 * output.h (class Output_segment): Remove
11894 add_initial_output_section and overloaded add_output_section.
11895 Update declaration of remaining add_output_section.
11896 * layout.cc (Layout::create_interp): Call add_output_section
11897 rather than add_initial_output_section.
11898 (Layout::finish_dynamic_section): Likewise.
11899
497897f9
ILT
11900 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
11901 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
11902 know the dynamic type.
11903 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
11904 field. Initialize it in constructor.
11905 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
11906 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
11907 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
11908 reloc.
11909
a984ee1d
ILT
11910 * output.cc (Output_reloc::get_address): Change return type to
11911 Elf_Addr.
11912 * output.h (class Output_reloc): Update get_address declaration.
11913 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
11914 for section addresses.
11915
55ba0940
ILT
119162008-05-09 Ian Lance Taylor <iant@google.com>
11917
11918 PR 6493
11919 * gold.cc (gold_nomem): Use return value of write.
11920
75517b77
ILT
119212008-05-08 Ian Lance Taylor <iant@google.com>
11922
11923 * symtab.c (Symbol::init_base_output_data): Add version
11924 parameter. Change all callers.
11925 (Symbol::init_base_output_segment): Likewise.
11926 (Symbol::init_base_constant): Likewise.
11927 (Symbol::init_base_undefined): Likewise.
11928 (Sized_symbol::init_output_data): Likewise.
11929 (Sized_symbol::init_output_segment): Likewise.
11930 (Sized_symbol::init_constant): Likewise.
11931 (Sized_symbol::init_undefined): Likewise.
11932 (Symbol_table::do_define_in_output_data): If the new symbol has a
11933 version, mark it as the default.
11934 (Symbol_table::do_define_in_output_segment): Likewise.
11935 (Symbol_table::do_define_as_constant): Likewise.
11936 * symtab.h (class Symbol): Update declarations.
11937 (class Sized_symbol): Likewise.
11938 * resolve.cc (Symbol::override_version): New function.
c42e122e 11939 (Symbol::override_base): Call override_version.
75517b77
ILT
11940 (Symbol::override_base_with_special): Likewise.
11941 * testsuite/ver_script_8.script: New file.
11942 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
11943 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
11944 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
11945 (ver_test_8_1.so, ver_test_8_2.so): New targets.
11946
f1f70eae
ILT
119472008-05-06 Ian Lance Taylor <iant@google.com>
11948
f3e9c5c5
ILT
11949 PR 6049
11950 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
11951 functions.
11952 (class General_options): Remove existing --undefined, and add
11953 --no-undefined instead. Add new --undefined as synonym for -u.
11954 * archive.cc (Archive::add_symbols): Check whether symbol was
11955 named with -u.
11956 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
11957 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
11958 all uses. Add IS_UNDEFINED. Update declarations to split
11959 different versions of init_base. Declare init_base_undefined.
11960 (Symbol::is_defined): Handle IS_UNDEFINED.
11961 (Symbol::is_undefined): Likewise.
11962 (Symbol::is_weak_undefined): Call is_undefined.
11963 (Symbol::is_absolute): Handle IS_CONSTANT.
11964 (class Sized_symbol): Update declarations to split different
11965 versions of init. Declare init_undefined.
11966 (class Symbol_table): Declare new functions.
11967 * symtab.cc (Symbol::init_base_object): Rename from init_base.
11968 Change all callers.
11969 (Symbol::init_base_output_data): Likewise.
11970 (Symbol::init_base_output_segment): Likewise.
11971 (Symbol::init_base_constant): Likewise.
11972 (Symbol::init_base_undefined): New function.
11973 (Sized_symbol::init_object): Rename from init. Change all
11974 callers.
11975 (Sized_symbol::init_output_data): Likewise.
11976 (Sized_symbol::init_output_segment): Likewise.
11977 (Sized_symbol::init_constant): Likewise.
11978 (Sized_symbol::init_undefined): New function.
11979 (Symbol_table::add_undefined_symbols_from_command_line): New
11980 function.
11981 (Symbol_table::do_add_undefined_symbols_from_command_line): New
11982 function.
11983 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
11984 (Symbol::output_section): Likewise.
11985 (Symbol::set_output_section): Likewise.
11986 (Symbol_table::sized_finalize_symbol): Likewise.
11987 (Symbol_table::sized_write_globals): Likewise.
11988 * resolve.cc (Symbol_table::should_override): Likewise.
11989 (Symbol::override_base_with_special): Likewise.
11990
8bdcdf2c
ILT
11991 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
11992 symbol, change it to have default visibility.
11993 * testsuite/protected_1.cc: New file.
11994 * testsuite/protected_2.cc: New file.
11995 * testsuite/protected_3.cc: New file.
11996 * testsuite/protected_main_1.cc: New file.
11997 * testsuite/protected_main_2.cc: New file.
11998 * testsuite/protected_main_3.cc: New file.
11999 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
12000 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
12001 (protected_1_LDFLAGS, protected_1_LDADD): Define.
12002 (protected_1.so): New target.
12003 (protected_1_pic.o, protected_2_pic.o): New targets.
12004 (protected_3_pic.o): New target.
12005 (check_PROGRAMS): Add protected_2.
12006 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
12007 (protected_2_LDFLAGS, protected_2_LDADD): Define.
12008 * testsuite/Makefile.in: Rebuild.
12009
2b706932
ILT
12010 * options.h (DEFINE_var): Add set_user_set_##varname__.
12011 (DEFINE_bool_alias): New macro.
12012 (class General_options): Define -Bstatic using DEFINE_bool_alias
12013 rather than DEFINE_special. Add --undefined as an alias for -z
12014 defs.
12015 * options.cc (General_options::parse_Bstatic): Remove.
12016
d82a5bcc
ILT
12017 * options.h (class General_options): Add --fatal-warnings.
12018 * main.cc (main): Implement --fatal-warnings.
12019 * errors.h (Errors::warning_count): New function.
12020
f1f70eae
ILT
12021 * options.h (class General_options): Add -Bsymbolic-functions.
12022 * symtab.h (Symbol::is_preemptible): Check for
12023 -Bsymbolic-functions.
12024
8825ac63
ILT
120252008-05-05 Ian Lance Taylor <iant@google.com>
12026
d98bc257
ILT
12027 * options.h (DEFINE_bool): For DASH_Z, create the negative option
12028 as noVARNAME rather than no-VARNAME.
12029 (class General_options): Add option -z combreloc.
12030 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
12031 get_address.
12032 (Output_reloc::sort_before) [SHT_REL]: New function.
12033 (Output_reloc::sort_before) [SHT_RELA]: New function.
12034 (class Output_data_reloc_base): Add sort_relocs_ field. Define
12035 Sort_relocs_comparison.
12036 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
12037 parameter. Change all callers.
12038 (Output_data_reloc::Output_data_reloc) [both versions]: Add
12039 sort_relocs parameter. Change all callers.
12040 * output.cc (Output_reloc::get_address): New function, broken out
12041 of write_rel.
12042 (Output_reloc::write_rel): Call it.
12043 (Output_reloc::compare): New function.
12044 (Output_data_reloc_base::do_write): Optionally sort relocs.
12045
60b2b4e7
ILT
12046 * configure.ac: If targ_extra_obj is set, link it in.
12047 * configure.tgt: Initialize all variables.
12048 (x86_64*): Set targ_extra_obj and targ_extra_size.
12049 * configure: Rebuild.
12050
8825ac63
ILT
12051 * object.cc (Sized_relobj::include_section_group): Adjust section
12052 indexes read from group data. Build vector to pass to
12053 layout_group.
12054 * layout.cc (Layout::layout_group): Add flags and shndxes
12055 parameters. Remove contents parameter. Change caller. Update
12056 explicit instantiations.
12057 * layout.h (class Layout): Update layout_group declaration.
12058 * output.cc (Output_data_group::Output_data_group): Add flags and
12059 input_shndxes parameters. Remove contents parameter. Change
12060 caller.
12061 (Output_data_group::do_write): Change input_sections_ to
12062 input_shndxes_.
12063 * output.h (class Output_data_group): Update constructor
12064 declaration. Rename input_sections_ to input_shndxes_.
12065 * testsuite/many_sections_test.cc: Add template.
12066
e94cf127
CC
120672008-04-30 Cary Coutant <ccoutant@google.com>
12068
4418b2d5
CC
12069 * target-reloc.h (relocate_section): Fix dead-pointer bug.
12070
e94cf127
CC
12071 * layout.cc (Layout::include_section): Refactored check for debug
12072 info section.
12073 (Layout::add_comdat): Add new parameters. Change type
12074 of signature parameter. Add object and shndx to signatures table.
12075 (Layout::find_kept_object): New function.
12076 * layout.h: Include <cstring>.
12077 (Layout::is_debug_info_section): New function.
12078 (Layout::add_comdat): Add new parameters.
12079 (Layout::find_kept_object): New function.
12080 (Layout::Kept_section): New struct.
12081 (Layout::Signatures): Change type of map range.
12082 * object.cc (Relobj::output_section_address): New function.
12083 (Sized_relobj::include_section_group): Add new parameters. Change
12084 calls to Layout::add_comdat. Change to build table of kept comdat
12085 groups and table mapping discarded sections to kept sections.
12086 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
12087 (Sized_relobj::do_layout): Change calls to include_section_group and
12088 include_linkonce_section.
12089 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
12090 value to zero when section is discarded.
12091 (Sized_relobj::map_to_kept_section): New function.
12092 * object.h (Relobj::output_section_address): New function.
12093 (Relobj::Comdat_group): New type.
12094 (Relobj::find_comdat_group): New function.
12095 (Relobj::Comdat_group_table): New type.
12096 (Relobj::Kept_comdat_section): New type.
12097 (Relobj::Kept_comdat_section_table): New type.
12098 (Relobj::add_comdat_group): New function.
12099 (Relobj::set_kept_comdat_section): New function.
12100 (Relobj::get_kept_comdat_section): New function.
12101 (Relobj::comdat_groups_): New field.
12102 (Relobj::kept_comdat_sections_): New field.
12103 (Symbol_value::input_value): Update comment.
12104 (Sized_relobj::map_to_kept_section) New function.
12105 (Sized_relobj::include_linkonce_section): Add new parameter.
12106 * target-reloc.h (Comdat_behavior): New type.
12107 (get_comdat_behavior): New function.
12108 (relocate_section): Add code to map a discarded section to the
12109 corresponding kept section when applying a relocation.
12110
e4e5049b
CS
121112008-04-30 Craig Silverstein <csilvers@google.com>
12112
12113 * dwarf_reader.cc (next_generation_count): New static var.
12114 (Addr2line_cache_entry): New struct.
12115 (addr2line_cache): New static var.
12116 (Dwarf_line_info::one_addr2line): Added caching.
12117 (Dwarf_line_info::clear_addr2line_cache): New function.
12118 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
12119 cache-size parameter.
12120 (Dwarf_line_info::one_addr2line_cache): New function.
12121 * symtab.cc (Symbol_table::detect_odr_violations): Pass
12122 new cache-size argument to one_addr2line(), and clear cache.
12123
d09e9154
CC
121242008-04-28 Cary Coutant <ccoutant@google.com>
12125
12126 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
12127 R_386_PC8 relocations.
12128
7ef73768
ILT
121292008-04-23 Ian Lance Taylor <iant@google.com>
12130
55438702
ILT
12131 * object.cc (Sized_relobj::include_section_group): Check for
12132 invalid section group.
12133
c165fb93
ILT
12134 * object.cc (make_elf_object): Correct test for 64-bit ELF file
12135 header size.
12136
7ef73768
ILT
12137 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
12138 than read for file header.
12139 * archive.cc (Archive::include_member): Likewise.
12140
6194aaab
L
121412008-04-23 Paolo Bonzini <bonzini@gnu.org>
12142
12143 * aclocal.m4: Regenerate.
12144 * configure: Regenerate.
12145
d491d34e
ILT
121462008-04-19 Ian Lance Taylor <iant@google.com>
12147
5ea2bac6
ILT
12148 * version.cc (version_string): Bump to 1.6.
12149
7bc3e21a
ILT
12150 * testsuite/Makefile.am (many_sections_r_test): New target.
12151 (many_sections_r_test_SOURCES): Remove.
12152 (many_sections_r_test_DEPENDENCIES): Remove.
12153 (many_sections_r_test_LDFLAGS): Remove.
12154 (many_sections_r_test_LDADD): Remove.
12155
7fcd3aa9
ILT
12156 * object.cc (Sized_relobj::do_add_symbols): Always pass
12157 local_symbol_count_ to add_from_relobj.
12158
4c94d6ae
ILT
12159 * testsuite/Makefile.am (many_sections_check.h): Only check one in
12160 every thousand variables.
12161 * testsuite/Makefile.in: Rebuild.
12162
d491d34e
ILT
12163 * object.cc (Xindex::initialize_symtab_xindex): New function.
12164 (Xindex::read_symtab_xindex): New function.
12165 (Xindex::sym_xindex_to_shndx): New function.
12166 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
12167 available.
12168 (Sized_relobj::do_initialize_xindex): New function.
12169 (Sized_relobj::do_read_symbols): Adjust section links.
12170 (Sized_relobj::symbol_section_and_value): Add is_ordinary
12171 parameter. Change all callers.
12172 (Sized_relobj::include_section_group): Adjust section links and
12173 symbol section indexes.
12174 (Sized_relobj::do_layout): Adjust section links.
12175 (Sized_relobj::do_count_local_symbols): Adjust section links and
12176 symbol section indexes.
12177 (Sized_relobj::do_finalize_local_symbols): Distinguish between
12178 ordinary and special symbols.
12179 (Sized_relobj::write_local_symbols): Add symtab_xindex and
12180 dynsym_xindex parameters. Change all callers. Adjust section
12181 links. Use SHN_XINDEX when needed.
12182 (Sized_relobj::get_symbol_location_info): Adjust section links.
12183 Don't get fooled by special symbols.
12184 * object.h (class Xindex): Define.
12185 (class Object): Add xindex_ parameter. Declare virtual functoin
12186 do_initialize_xindex.
12187 (Object::adjust_sym_shndx): New function.
12188 (Object::set_xindex): New protected function.
12189 (class Symbol_value): Add is_ordinary_shndx_ field.
12190 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
12191 (Symbol_value::value): Assert ordinary section.
12192 (Symbol_value::initialize_input_to_output_map): Likewise.
12193 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
12194 Change all callers.
12195 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
12196 all callers.
12197 (class Sized_relobj): Update declarations.
12198 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
12199 parameter. Change all callers.
12200 (Sized_relobj::adjust_shndx): New function.
12201 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
12202 field.
12203 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
12204 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
12205 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
12206 (Sized_dynobj::read_dynsym_section): Adjust section links.
12207 (Sized_dynobj::read_dynamic): Likewise.
12208 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
12209 section links.
12210 (Sized_dynobj::do_initialize_xindex): New function.
12211 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
12212 do_initialize_xindex.
12213 (Sized_dynobj::adjust_shndx): New function.
12214 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
12215 dynsym_xindex_ fields.
12216 (Layout::finalize): Add a call to set_section_indexes before
12217 creating the symtab sections.
12218 (Layout::set_section_indexes): Don't do anything if the section
12219 already has a section index.
12220 (Layout::create_symtab_sections): Add shnum parameter. Change
12221 caller. Create .symtab_shndx section if needed.
12222 (Layout::create_shdrs): Add shstrtab_section parameter. Change
12223 caller.
12224 (Layout::allocated_output_section_count): New function.
12225 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
12226 needed.
12227 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
12228 fields. Update declarations.
12229 (Layout::symtab_xindex): New function.
12230 (Layout::dynsym_xindex): New function.
12231 (class Write_symbols_task): Add layout_ field.
12232 (Write_symbols_task::Write_symbols_task): Add layout parameter.
12233 Change caller.
12234 * output.cc (Output_section_headers::Output_section_headers): Add
12235 shstrtab_section parameter. Change all callers.
12236 (Output_section_headers::do_sized_write): Store overflow values
12237 for section count and section string table section index in
12238 section header zero.
12239 (Output_file_header::do_sized_write): Check for overflow of
12240 section count and section string table section index.
12241 (Output_symtab_xindex::do_write): New function.
12242 (Output_symtab_xindex::endian_do_write): New function.
12243 * output.h (class Output_section_headers): Add shstrtab_section_.
12244 Update declarations.
12245 (class Output_symtab_xindex): Define.
12246 (Output_section::has_out_shndx): New function.
12247 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
12248 field.
12249 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
12250 Change all callers.
12251 (Sized_symbol::init): Likewise.
12252 (Symbol::output_section): Check for ordinary symbol.
12253 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
12254 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
12255 callers.
12256 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
12257 Change all callers. Simplify handling of symbols from sections
12258 not included in the link.
12259 (Symbol_table::add_from_dynobj): Handle ordinary symbol
12260 distinction.
12261 (Weak_alias_sorter::operator()): Assert that symbols are
12262 ordinary.
12263 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
12264 distinction.
12265 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
12266 parameters. Change all callers.
12267 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
12268 symbol distinction. Use SHN_XINDEX when needed.
12269 (Symbol_table::write_section_symbol): Add symtab_xindex
12270 parameter. Change all callers.
12271 (Symbol_table::sized_write_section_symbol): Likewise. Use
12272 SHN_XINDEX when needed.
12273 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
12274 declarations.
12275 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
12276 (Symbol::is_defined): Check is_ordinary.
12277 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
12278 (Symbol::is_absolute, Symbol::is_common): Likewise.
12279 (class Sized_symbol): Update declarations.
12280 (class Symbol_table): Update declarations.
12281 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
12282 parameters. Change all callers.
12283 (Sized_symbol::override): Likewise.
12284 (Symbol_table::override): Likewise.
12285 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
12286 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
12287 is_ordinary, and orig_st_shndx parameters. Change all callers.
12288 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
12289 to be in an ordinary section.
12290 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
12291 object and is_ordinary parameters. Change all callers.
12292 (Sized_dwarf_line_info::read_relocs): Add object parameter.
12293 Change all callers. Don't add undefined or non-ordinary symbols
12294 to reloc_map_.
12295 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
12296 Change all callers.
12297 * dwarf_reader.h (class Sized_dwarf_line_info): Update
12298 declarations.
12299 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
12300 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
12301 (Sized_relobj::relocate_sections): Likewise.
12302 * target-reloc.h (scan_relocs): Adjust section symbol index.
12303 (scan_relocatable_relocs): Likewise.
12304 * i386.cc (Scan::local): Check for ordinary symbols.
12305 * sparc.cc (Scan::local): Likewise.
12306 * x86_64.cc (Scan::local): Likewise.
12307 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
12308 to symbol_section_and_value.
12309 * testsuite/many_sections_test.cc: New file.
12310 * testsuite/Makefile.am (BUILT_SOURCES): Define.
12311 (check_PROGRAMS): Add many_sections_test.
12312 (many_sections_test_SOURCES): Define.
12313 (many_sections_test_DEPENDENCIES): Define.
12314 (many_sections_test_LDFLAGS): Define.
12315 (BUILT_SOURCES): Add many_sections_define.h.
12316 (many_sections_define.h): New target.
12317 (BUILT_SOURCES): Add many_sections_check.h.
12318 (many_sections_check.h): New target.
12319 (check_PROGRAMS): Add many_sections_r_test.
12320 (many_sections_r_test_SOURCES): Define.
12321 (many_sections_r_test_DEPENDENCIES): Define.
12322 (many_sections_r_test_LDFLAGS): Define.
12323 (many_sections_r_test_LDADD): Define.
12324 (many_sections_r_test.o): New target.
12325 * testsuite/Makefile.in: Rebuild.
12326
c5818ff1
CC
123272008-04-17 Cary Coutant <ccoutant@google.com>
12328
12329 * errors.cc (Errors::info): New function.
12330 (gold_info): New function.
12331 * errors.h (Errors::info): New function.
12332 * gold.h (gold_info): New function.
12333 * object.cc (Input_objects::add_object): Print trace output.
12334 * options.cc (options::parse_set): New function.
12335 (General_options::parse_wrap): Deleted.
12336 (General_options::General_options): Deleted initializer.
12337 * options.h (options::String_set): New typedef.
12338 (options::parse_set): New function.
12339 (DEFINE_set): New macro.
12340 (General_options::wrap): Changed to use DEFINE_set. Changed
12341 callers of any_wrap_symbols and is_wrap_symbol.
12342 (General_options::trace, General_options::trace_symbol):
12343 New options.
12344 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
12345 (General_options::wrap_symbols_): Deleted.
12346 * symtab.cc (Symbol_table::add_from_object): Print trace output.
12347
b5be4a7c
DM
123482008-04-17 David S. Miller <davem@davemloft.net>
12349
12350 * options.cc (General_options::parse_V): New function.
12351 * options.h: Add entries for -V and -Qy.
12352
155a0dd7
ILT
123532008-04-17 Ian Lance Taylor <iant@google.com>
12354
12355 * common.cc (Symbol_table::allocate_commons): Remove options
12356 parameter. Change caller.
12357 (Symbol_table::do_allocate_commons): Remove options parameter.
12358 Change caller. Just call do_allocate_commons_list twice.
12359 (Symbol_table::do_allocate_commons_list): New function, broken out
12360 of do_allocate_commons.
12361 * common.h (class Allocate_commons_task): Remove options_ field.
12362 Update constructor.
12363 * symtab.cc (Symbol_table::Symbol_table): Initialize
12364 tls_commons_.
12365 (Symbol_table::add_from_object): Put TLS common symbols on
12366 tls_commons_ list.
12367 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
12368 which are IN_OUTPUT_DATA.
12369 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
12370 allocate_commons and do_allocate_commons declarations. Declare
12371 do_allocate_commons_list.
12372 * gold.cc (queue_middle_tasks): Update creation of
12373 Allocate_commons_task to not pass options.
12374 * testsuite/Makefile.am (INCLUDES): Add -I.. .
12375 (TLS_TEST_C_FLAGS): New variable.
12376 (tls_test_c_pic.o): New target.
12377 (tls_test_shared.so): Link in tls_test_c_pic.o.
12378 (tls_test_c_pic_ie.o): New target.
12379 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
12380 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
12381 (tls_test_c.o): New target.
12382 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
12383 (tls_pic_test_LDADD): Likewise.
12384 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
12385 (tls_shared_gd_to_ie_test_LDADD): Likewise.
12386 (tls_test_c_gnu2.o): New target.
12387 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
12388 tls_test_c_gnu2.o.
12389 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
12390 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
12391 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
12392 * testsuite/tls_test.cc: Include "config.h".
12393 (t_last): Call t11_last.
12394 * testsuite/tls_test.h (t11, t11_last): Declare.
12395 * testsuite/tls_test_c.c: New file.
12396 * testsuite/tls_test_main.cc (thread_routine): Call t11.
12397 * configure.ac: Check for OpenMP support.
12398 * configure, config.in, Makefile.in: Rebuild.
12399 * testsuite/Makefile.in: Rebuild.
12400
edfbb029
CC
124012008-04-16 Cary Coutant <ccoutant@google.com>
12402
12403 * i386.cc (Target_i386::define_tls_base_symbol): New function.
12404 (Target_i386::tls_base_symbol_defined_): New field.
12405 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12406 (Target_i386::Scan::global): Likewise.
12407 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
12408 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
12409 (Target_x86_64::tls_base_symbol_defined_): New field.
12410 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
12411 (Target_x86_64::Scan::global): Likewise.
12412
f3c69fca
CC
124132008-04-16 Cary Coutant <ccoutant@google.com>
12414
12415 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
12416 (Symbol::needs_plt_entry): Allow weak undefined symbols.
12417 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
12418 building shared libraries.
12419 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
12420 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
12421 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
12422 * testsuite/Makefile.in: Rebuild.
12423 * testsuite/weak_undef.h: New file.
12424 * testsuite/weak_undef_file1.cc: Add extra test cases.
12425 * testsuite/weak_undef_file2.cc: Likewise.
12426 * testsuite/weak_undef_test.cc: Likewise.
12427
7c414435
DM
124282008-04-16 David S. Miller <davem@davemloft.net>
12429
32b769e1
DM
12430 * sparc.cc (Target_sparc::Scan): Change from struct to class.
12431 Add issued_non_pic_error_ field. Declare check_non_pic.
12432 (Target_sparc::Scan::check_non_pic): New function.
12433 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
12434 (Target_sparc::Scan::global): Likewise.
12435
11936fb1
DM
12436 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
12437 * configure: Rebuild.
12438
7c414435
DM
12439 * options.h (DEFINE_enable): New macro.
12440 (new_dtags): New enable option.
12441 (initfirst, interpose, loadfltr, nodefaultlib,
12442 nodelete, nodlopen, nodump): New -z options.
12443 * layout.cc (Layout:finish_dynamic_section): If new
12444 dtags enabled, emit DT_RUNPATH. Also, emit a
12445 DT_FLAGS_1 containing any specified -z flags.
12446
85c7bf8b
ILT
124472008-04-16 Ian Lance Taylor <iant@google.com>
12448
12c0daef
ILT
12449 * copy-relocs.cc: New file.
12450 * copy-relocs.h: New file.
12451 * reloc.cc: Remove Copy_relocs code.
12452 * reloc.h: Likewise.
12453 * reloc-types.h (struct Reloc_types) [both versions]: Add
12454 get_reloc_addend_noerror.
12455 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
12456 variants of add_global which take an addend which must be zero.
12457 * i386.cc: Include "copy-relocs.h".
12458 (class Target_i386): Change type of copy_relocs_ to variable,
12459 update initializer.
12460 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
12461 Change all callers.
12462 (Target_i386::do_finalize_sections): Change handling of
12463 copy_relocs_.
12464 * sparc.cc: Include "copy-relocs.h".
12465 (class Target_sparc): Change type of copy_relocs_ to variable,
12466 update initializer.
12467 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
12468 Change all callers.
12469 (Target_sparc::do_finalize_sections): Change handling of
12470 copy_relocs_.
12471 * x86_64.cc: Include "copy-relocs.h".
12472 (class Target_x86_64): Change type of copy_relocs_ to variable,
12473 update initializer.
12474 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
12475 class. Change all callers.
12476 (Target_x86_64::do_finalize_sections): Change handling of
12477 copy_relocs_.
12478 * Makefile.am (CCFILES): Add copy-relocs.cc.
12479 (HFILES): Add copy-relocs.h.
12480
4f4995b6
ILT
12481 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
12482
85c7bf8b
ILT
12483 * testsuite/script_test_4.sh: Permit leading zeroes.
12484
4f2a9edd
ILT
124852008-04-15 Ian Lance Taylor <iant@google.com>
12486
e6188289
ILT
12487 * script-sections.cc (Script_sections::create_segments): Use
12488 header_size_adjustment even when there is enough room for the
12489 headers.
12490 * testsuite/script_test_4.sh: New file.
12491 * testsuite/script_test_4.t: New file.
12492 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
12493 (check_DATA): Add script_test_4.stdout.
12494 (MOSTLYCLEANFILES): Likewise.
12495 (script_test_4): New target.
12496 (script_test_4.stdout): New target.
12497 * testsuite/Makefile.in: Rebuild.
12498
4f2a9edd
ILT
12499 * sparc.cc: Add definitions for Output_data_plt_sparc class
12500 constants.
12501
f5314dd5
DM
125022008-04-14 David S. Miller <davem@davemloft.net>
12503
12504 * sparc.cc: New file.
12505 * Makefile.am (TARGETSOURCES): Add sparc.cc
12506 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
12507 * configure.tgt: Document targ_extra_size and
12508 targ_extra_big_endian. Add entries for sparc-* and
12509 sparc64-*.
12510 * configure.ac: Handle targ_extra_size and
12511 targ_extra_big_endian.
12512 * Makefile.in: Rebuild.
12513 * configure: Likewise.
12514 * po/POTFILES.in: Likewise.
12515 * po/gold.pot: Likewise.
12516
154e0e9a
ILT
125172008-04-14 Ian Lance Taylor <iant@google.com>
12518
12519 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
12520 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
12521 in the name/type/flags to section mapping. Don't call
12522 allocate_output_section.
12523 (Layout::choose_output_section): Change parameter from adjust_name
12524 to is_input_section. Don't permit input sections after sections
12525 are attached to segments. Don't call allocate_output_section.
12526 (Layout::layout_eh_frame): Call update_flags_for_input_section,
12527 not write_enable_output_section.
12528 (Layout::make_output_section): Don't push to
12529 unattached_section_list_ nor call attach_to_segment. Call
12530 attach_section_to_segment if sections are attached.
12531 (Layout::attach_sections_to_segments): New function.
12532 (Layout::attach_section_to_segment): New function.
12533 (Layout::attach_allocated_section_to_segment): Rename from
12534 attach_to_segment. Remove flags parameter.
12535 (Layout::allocate_output_section): Remove function.
12536 (Layout::write_enable_output_section): Remove function.
12537 * layout.h (class Layout): Update for above changes. Add new
12538 field sections_are_attached_.
12539 * output.h (Output_section::update_flags_for_input_section): New
12540 function.
12541 * output.cc (Output_section::add_input_section): Call
12542 update_flags_for_input_section.
12543 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
12544
009a67a2
CC
125452008-04-11 Cary Coutant <ccoutant@google.com>
12546
12547 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
12548 thought unnecessary.
12549 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
12550
759b1a24
ILT
125512008-04-11 Ian Lance Taylor <iant@google.com>
12552
12553 * output.h (class Output_section_data): Remove inline definition
12554 of set_addralign.
12555 * output.cc (Output_section_data::set_addralign): New function.
12556
c2b45e22
CC
125572008-04-11 Cary Coutant <ccoutant@google.com>
12558
12559 Add support for TLS descriptors for i386 and x86_64.
12560 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
12561 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
12562 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
12563 GOT_TYPE_TLS_DESC.
12564 (Target_i386::got_mod_index_entry): Remove unnecessary code.
12565 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
12566 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
12567 relocations.
12568 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
12569 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
12570 Fix problem with initial-exec relocations.
12571 (Target_i386::Relocate::relocate_tls): Likewise.
12572 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
12573 relaxation.
12574 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
12575 support for section-plus-offset dynamic table entries.
12576 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
12577 (Output_data_dynamic::Dynamic_entry): Add support for
12578 section-plus-offset dynamic table entries.
12579 (Output_data_dynamic::Classification): Likewise.
12580 (Output_data_dynamic::classification_): Renamed offset_.
12581 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
12582 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
12583 (Target_x86_64::make_plt_section): New function.
12584 (Target_x86_64::reserve_tlsdesc_entries): New function.
12585 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
12586 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
12587 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
12588 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
12589 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
12590 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
12591 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
12592 add extra PLT entry for TLS descriptors.
12593 (Output_data_plt_x86_64::got_): New field.
12594 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
12595 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
12596 fields.
12597 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
12598 descriptors.
12599 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
12600 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
12601 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
12602 R_386_TLS_DESC_CALL relocations.
12603 (Target_x86_64::Scan::global): Likewise.
12604 (Target_x86_64::do_finalize_sections): Add dynamic table entries
12605 for TLS descriptors.
12606 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
12607 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
12608 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
12609 GD-to-IE relaxation.
12610 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
12611 and TLS_DESCRIPTORS.
12612 * Makefile.in: Rebuild.
12613 * configure: Rebuild.
12614 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
12615 (tls_test_shared2.so): New target.
12616 (tls_shared_gd_to_ie_test_SOURCES): New variable.
12617 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
12618 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
12619 (tls_shared_gd_to_ie_test_LDADD): New variable.
12620 (tls_shared_gnu2_gd_to_ie_test): New target.
12621 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
12622 New targets.
12623 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
12624 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
12625 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
12626 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
12627 (tls_shared_gnu2_test): New target.
12628 (tls_test_gnu2_shared.so): New target.
12629 (tls_shared_gnu2_test_SOURCES): New variable.
12630 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
12631 (tls_shared_gnu2_test_LDFLAGS): New variable.
12632 (tls_shared_gnu2_test_LDADD): New variable.
12633 * testsuite/Makefile.in: Rebuild.
12634 * testsuite/Makefile.
12635
83bfb6b7
ILT
126362008-04-11 Ian Lance Taylor <iant@google.com>
12637
12638 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
12639 justsyms.t.
12640 * testsuite/Makefile.in: Rebuild.
12641
12642 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
12643 long.
12644 * testsuite/script_test_2.cc (main): Adjust test.
12645
706e1f5e
ILT
126462008-04-11 David S. Miller <davem@davemloft.net>
12647 Ian Lance Taylor <iant@google.com>
12648
12649 * options.h (General_options): Add entries for '-Y' and
12650 '-relax'.
12651 * options.cc (General_options:finalize): If -Y was used, add those
12652 entries to the library path instead of the default "/lib" and
12653 "/usr/lib".
12654
7c98e6bb
DM
126552008-04-11 David S. Miller <davem@davemloft.net>
12656
12657 * testsuite/justsyms.t: Start at 0x100.
12658 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
12659 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
12660 long.
12661 * testsuite/script_test_2.cc: Adjust string and section length
12662 checks.
7c98e6bb 12663
99a37bfd
ILT
126642008-04-09 Ian Lance Taylor <iant@google.com>
12665
2cefc357
ILT
12666 PR gold/5996
12667 * script-sections.cc (Sections_element::allocate_to_segment): Add
12668 orphan parameter.
12669 (Output_section_definition::allocate_to_segment): Likewise.
12670 (Orphan_output_section::allocate_to_segment): Likewise.
12671 (Script_sections::attach_sections_using_phdrs_clause): Don't
12672 propagate non-PT_LOAD segments to orphan sections.
12673 * testsuite/Makefile.am (script_test_3.stdout): Generate using
12674 readelf rather than objdump.
12675 * testsuite/script_test_3.sh: Adjust accordingly. Test that
12676 .interp section and PT_INTERP segment are the same size.
12677 * testsuite/Makefile.in: Rebuild.
12678
99a37bfd
ILT
12679 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
12680 aliases for symbols defined in the same object.
12681 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
12682 (weak_alias_test_SOURCES): New variable.
12683 (weak_alias_test_DEPENDENCIES): New variable.
12684 (weak_alias_test_LDFLAGS): New variable.
12685 (weak_alias_test_LDADD): New variable.
12686 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
12687 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
12688 (weak_alias_test_3.o): New target.
12689 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
12690 * testsuite/weak_alias_test_main.cc: New file.
12691 * testsuite/weak_alias_test_1.cc: New file.
12692 * testsuite/weak_alias_test_2.cc: New file.
12693 * testsuite/weak_alias_test_3.cc: New file.
12694
780e49c5
ILT
126952008-04-08 Ian Lance Taylor <iant@google.com>
12696
cdb0b8f5
ILT
12697 * options.h (class General_options): Add --noinhibit-exec option.
12698 * main.cc (main): Check --noinhibit-exec.
12699
0864d551
ILT
12700 * options.h (class General_options): Define --wrap as a special
12701 option. Add wrap_symbols_ field.
12702 (General_options::any_wrap_symbols): New function.
12703 (General_options::is_wrap_symbol): New function.
12704 * options.cc (General_options::parse_wrap): New function.
12705 (General_options::General_options): Initialize wrap_symbols_.
12706 * symtab.cc (Symbol_table::wrap_symbol): New function.
12707 (Symbol_table::add_from_object): Handle --wrap.
12708 * symtab.h (class Symbol_table): Declare wrap_symbol.
12709 * target.h (Target::wrap_char): New function.
12710 (Target::Target_info): Add wrap_char field.
12711 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
12712 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
12713 * testsuite/testfile.cc (Target_test::test_target_info):
12714 Likewise.
12715
789aa6de
ILT
12716 * errors.cc (Errors::undefined_symbol): Mention symbol version if
12717 there is one.
12718
2c38906f
ILT
12719 * layout.h (class Layout): Add added_eh_frame_data_ field.
12720 * layout.cc (Layout::Layout): Initialize new field.
12721 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
12722 output section until we find a section we merged successfully.
12723 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
12724 that the size be non-zero.
12725
780e49c5
ILT
12726 * merge.cc (Object_merge_map::get_output_offset): Remove inline
12727 qualifier.
12728
7fcd0256
ILT
127292008-04-08 Craig Silverstein <csilvers@google.com>
12730
12731 * configure.ac: Export new conditional variable HAVE_ZLIB.
12732 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
12733 on HAVE_ZLIB.
12734 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
12735 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12736
6835af53
ILT
127372008-04-07 Ian Lance Taylor <iant@google.com>
12738
e24f324c
ILT
12739 * version.cc (version_string): Set to "1.5".
12740
a036edd8
ILT
12741 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
12742 Add issued_non_pic_error_ field. Declare check_non_pic.
12743 (Target_x86_64::Scan::check_non_pic): New function.
12744 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
12745 (Target_x86_64::Scan::global): Likewise.
12746
624f8810
ILT
12747 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
12748 addend parameter. Change caller. Handle merge sections.
12749 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
12750 Address to Addend. Don't add in the result of
12751 local_section_offset, pass down the addend and use the returned
12752 value.
12753 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
12754 Update declarations of local_section_offset and symbol_value.
12755 * testsuite/two_file_test_1.cc (t18): New function.
12756 * testsuite/two_file_test_2.cc (f18): New function.
12757 * testsuite/two_file_test_main.cc (main): Call t18.
12758 * testsuite/two_file_test.h (t18, f18): Declare.
12759
6835af53
ILT
12760 * configure.ac: Don't test for objdump, c++filt, or readelf.
12761 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
12762 conditionals.
12763 (TEST_READELF): New variable.
12764 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
12765 (check_PROGRAMS): Add two_file_strip_test.
12766 (two_file_strip_test): New target.
12767 (check_PROGRAMS): Add two_file_same_shared_strip_test.
12768 (two_file_same_shared_strip_test_SOURCES): New variable.
12769 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
12770 (two_file_same_shared_strip_test_LDFLAGS): New variable.
12771 (two_file_same_shared_strip_test_LDADD): New variable.
12772 (two_file_shared_strip.so): New target.
12773 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
12774 (ver_test_5.syms, ver_test_7.syms): Likewise.
12775 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
12776 (strip_test_3.stdout): Use TEST_OBJDUMP.
12777 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12778
86925eef
CC
127792008-04-04 Cary Coutant <ccoutant@google.com>
12780
12781 * symtab.h (Symbol::is_weak_undefined): New function.
12782 (Symbol::is_strong_undefined): New function.
12783 (Symbol::is_absolute): New function.
12784 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
12785 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
12786 absolute symbols.
12787 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
12788 (weak_undef_test): New target.
12789 * testsuite/Makefile.in: Rebuild.
12790 * testsuite/weak_undef_file1.cc: New file.
12791 * testsuite/weak_undef_file2.cc: New file.
12792 * testsuite/weak_undef_test.cc: New file.
12793
126f3ece
ILT
127942008-04-03 Craig Silverstein <csilvers@google.com>
12795
12796 * compressed_output.h (class Output_compressed_section): Use
12797 unsigned buffer.
12798 * compressed_output.cc (zlib_compress): Use unsigned buffers,
12799 add zlib header.
12800 (zlib_compressed_suffix): Removed.
12801 (Output_compressed_section::set_final_data_size): Use unsigned
12802 buffers.
12803 * testsuite/Makefile.am (flagstest_compress_debug_sections):
12804 Fix linker invocation.
12805 (flagstest_o_specialfile_and_compress_debug_sections):
12806 Likewise.
12807 * testsuite/Makefile.in: Regenerated.
12808
deae2a14
DM
128092008-04-02 David S. Miller <davem@davemloft.net>
12810
12811 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
12812 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
12813
70752818
ILT
128142008-04-02 Craig Silverstein <csilvers@google.com>
12815
12816 * TODO: New file.
12817
39d0cb0e
ILT
128182008-04-02 Ian Lance Taylor <iant@google.com>
12819
12820 * fileread.cc (File_read::find_view): Add byteshift and vshifted
12821 parameters. Update for new key type to views_. Change all
12822 callers.
12823 (File_read::read): Adjust for byteshift in returned view.
12824 (File_read::add_view): New function, broken out of
12825 find_and_make_view.
12826 (File_read::make_view): New function, broken out of
12827 find_and_make_view.
12828 (File_read::find_or_make_view): Add offset and aligned
12829 parameters. Rewrite accordingly. Change all callers.
12830 (File_read::get_view): Add offset and aligned parameters. Adjust
12831 for byteshift in return value.
12832 (File_read::get_lasting_view): Likewise.
12833 * fileread.h (class File_read): Update declarations.
12834 (class File_read::View): Add byteshift_ field. Add byteshift to
12835 constructor. Add byteshift method.
12836 * archive.h (Archive::clear_uncached_views): New function.
12837 (Archive::get_view): Add aligned parameter. Change all callers.
12838 * object.h (Object::get_view): Add aligned parameter. Change all
12839 callers.
12840 (Object::get_lasting_view): Likewise.
12841
12842 * fileread.cc (File_read::release): Don't call clear_views if
12843 there are multiple objects.
12844 * fileread.h (File_read::clear_uncached_views): New function.
12845 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
12846 on the archive.
12847
a1207466
CC
128482008-03-31 Cary Coutant <ccoutant@google.com>
12849
12850 Add thin archive support.
12851 * archive.cc (Archive::armagt): New const.
12852 (Archive::setup): Remove task parameter and calls to unlock.
12853 (Archive::unlock_nested_archives): New function.
12854 (Archive::read_header): Add nested_off parameter. Change
12855 all callers.
12856 (Archive::interpret_header): Likewise.
12857 (Archive::include_all_members): Change to handle thin
12858 archives.
12859 (Archive::include_member): Likewise.
12860 * archive.h (Archive::Archive): Add new parameters and
12861 initializers.
12862 (Archive::armagt): New const.
12863 (Archive::setup): Remove task parameter.
12864 (Archive::unlock_nested_archives): New function.
12865 (Archive::read_header): Add nested_off parameter.
12866 (Archive::interpret_header): Likewise.
12867 (Archive::Nested_archive_table): New typedef.
12868 (Archive::is_thin_archive_): New field.
12869 (Archive::nested_archives_): New field.
12870 (Archive::options_): New field.
12871 (Archive::dirpath_): New field.
12872 (Archive::task_): New field.
12873 * readsyms.cc (Read_symbols::do_read_symbols): Add check
12874 for thin archives. Pass additional parameters to
12875 Archive::Archive. Unlock the archive file after calling
12876 Archive::setup.
cd536b21 12877
479f6503
ILT
128782008-03-29 Ian Lance Taylor <iant@google.com>
12879
686c8caf
ILT
12880 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
12881 version symbol to be local.
12882 * testsuite/ver_test_4.sh: New file.
12883 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
12884 (check_DATA): Add ver_test_4.syms.
12885 (ver_test_4.syms): New target.
12886 * testsuite/Makefile.in: Rebuild.
12887
ab794b6b
ILT
12888 * output.cc
12889 (Output_section::Input_section_sort_entry::has_priority): New
12890 function.
12891 (Output_section::Input_section_sort_entry::match_file_name): New
12892 function.
12893 (Output_section::Input_section_sort_entry::match_section_name):
12894 Remove.
12895 (Output_section::Input_section_sort_entry::match_section_name_prefix):
12896 Remove.
12897 (Output_section::Input_section_sort_entry::match_section_file):
12898 Remove.
12899 (Output_section::Input_section_sort_compare::operator()): Rewrite
12900 using new Input_section_sort_entry functions. Sort crtbegin and
12901 crtend first. Sort sections with no priority before sections with
12902 a priority.
12903 * testsuite/initpri1.c (d3): Check j != 4.
12904 (cd5): New constructor/destructor function.
12905 (main): Check j != 2.
12906
479f6503
ILT
12907 * symtab.cc (Symbol_table::add_from_object): If we don't use the
12908 new symbol when resolving, don't call set_is_default.
12909 * testsuite/ver_test_7.cc: New file.
12910 * testsuite/ver_test_7.sh: New file.
12911 * testsuite/Makefile.am (ver_test_7.so): New target.
12912 (ver_test_7.o): New target.
12913 (check_SCRIPTS): Add ver_test_7.sh.
12914 (check_DATA): Add ver_test_7.syms.
12915 (ver_test_7.syms): New target.
12916
2fd32231
ILT
129172008-03-28 Ian Lance Taylor <iant@google.com>
12918
12919 * layout.cc (Layout::layout): If we see an input section with a
12920 name that needs sorting, set the must_sort flag for the output
12921 section.
12922 (Layout::make_output_section): If the name of the output section
12923 indicates that it might require sorting, set the may_sort flag.
12924 * output.h (Output_section::may_sort_attached_input_sections): New
12925 function.
12926 (Output_section::set_may_sort_attached_input_sections): New
12927 function.
12928 (Output_section::must_sort_attached_input_sections): New
12929 function.
12930 (Output_section::set_must_sort_attached_input_sections): New
12931 function.
12932 (class Output_section): Declare Input_section_sort_entry. Define
12933 Input_section_sort_compare. Declare
12934 sort_attached_input_sections. Add new fields:
12935 may_sort_attached_input_sections_,
12936 must_sort_attached_input_sections_,
12937 attached_input_sections_are_sorted_.
12938 * output.cc (Output_section::Output_section): Initialize new
12939 fields.
12940 (Output_section::add_input_section): Add an entry to
12941 input_sections_ if may_sort or must_sort are true.
12942 (Output_section::set_final_data_size): Call
12943 sort_attached_input_sections if necessary.
12944 (Output_section::Input_section_sort_entry): Define new class.
12945 (Output_section::Input_section_sort_compare::operator()): New
12946 function.
12947 (Output_section::sort_attached_input_sections): New function.
12948 * configure.ac: Check whether the compiler supports constructor
12949 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
12950 * testsuite/initpri1.c: New file.
12951 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
12952 CONSTRUCTOR_PRIORITY.
12953 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
12954 (initpri1_LDFLAGS): New variable.
12955 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
12956
18e6b24e
ILT
129572008-03-27 Ian Lance Taylor <iant@google.com>
12958
49bdd526
ILT
12959 * common.cc (Sort_commons::operator): Correct sorting algorithm.
12960 * testsuite/common_test_1.c: New file.
12961 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
12962 (common_test_1_SOURCES): New variable.
12963 (common_test_1_DEPENDENCIES): New variable.
12964 (common_test_1_LDFLAGS): New variable.
12965
18e6b24e
ILT
12966 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
12967 and commons_ correctly when NAME/VERSION does not override
12968 NAME/NULL.
12969 * testsuite/ver_test_6.c: New file.
12970 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
12971 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
12972 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
12973
04bf7072
ILT
129742008-03-26 Ian Lance Taylor <iant@google.com>
12975
5871526f
ILT
12976 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
12977 of an undefined symbol from a version script.
12978 * testsuite/Makefile.am (ver_test_5.so): New target.
12979 (ver_test_5.o): New target.
12980 (check_SCRIPTS): Add ver_test_5.sh.
12981 (check_DATA): Add ver_test_5.syms.
12982 (ver_test_5.syms): New target.
12983 * testsuite/ver_test_5.cc: New file.
12984 * testsuite/ver_test_5.script: New file.
12985 * testsuite/ver_test_5.sh: New file.
12986 * Makefile.in, testsuite/Makefile.in: Rebuild.
12987
04bf7072
ILT
12988 PR gold/5986
12989 Fix problems building gold with gcc 4.3.0.
12990 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
12991 (gold_error_at_location, gold_warning_at_location): Use it.
12992 * configure.ac: Check whether we can compile and use a template
12993 function with a printf attribute.
12994 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
12995 when jumping over bytes.
12996 * object.cc: Instantiate Object::read_section_data.
12997 * debug.h: Include <cstring>
12998 * dwarf_reader.cc: Include <algorithm>
12999 * main.cc: Include <cstring>.
13000 * options.cc: Include <cstring>.
13001 * output.cc: Include <cstring>.
13002 * script.cc: Include <cstring>.
13003 * script.h: Include <string>.
13004 * symtab.cc: Include <cstring> and <algorithm>.
13005 * target-select.cc: Include <cstring>.
13006 * version.cc: Include <string>.
13007 * testsuite/testmain.cc: Include <cstdlib>.
13008 * configure, config.in: Rebuild.
13009
874c5b28
ILT
130102008-03-25 Ian Lance Taylor <iant@google.com>
13011
819d6c3a
ILT
13012 * options.cc: Include "../bfd/bfdver.h".
13013 (options::help): Print bug reporting address.
13014
f4b2c6f5
ILT
13015 * version.cc (print_version): Adjust output for current value of
13016 BFD_VERSION_STRING.
13017
13018 * NEWS: New file.
13019
e96caa79
ILT
13020 * options.cc (options::help): Print list of supported targets.
13021 * target-select.h: Include <vector>.
13022 (class Target_selector): Make machine_, size_, and is_big_endian_
13023 fields const. Add bfd_name_ and instantiated_target_ fields.
13024 (Target_selector::Target_selector): Add bfd_name parameter.
13025 (Target_selector::recognize): Make non-virtual, call
13026 do_recognize.
13027 (Target_selector::recognize_by_name): Make non-virtual, call
13028 do_recognize_by_name.
13029 (Target_selector::supported_names): New function.
13030 (Target_selector::bfd_name): New function.
13031 (Target_selector::do_instantiate_target): New pure virtual
13032 function.
13033 (Target_selector::do_recognize): New virtual function.
13034 (Target_selector::do_recognize_by_name): New virtual function.
13035 (Target_selector::instantiate_target): New private function.
13036 (supported_target_names): Declare.
13037 * target-select.cc (Target_selector::Target_selector): Update for
13038 new parameter and fields.
13039 (select_target_by_name): Check that the name matches before
13040 calling recognize_by_name.
13041 (supported_target_names): New function.
13042 * i386.cc (class Target_selector_i386): Update Target_selector
13043 constructor call. Remove recognize and recognize_by_name. Add
13044 do_instantiate_target.
13045 * x86_64.cc (class Target_selector_x86_64): Likewise.
13046 * testsuite/testfile.cc (class Target_selector_test): Update for
13047 changes to Target_selector.
13048
874c5b28
ILT
13049 * README: Rewrite, with some notes on unsupported features.
13050
0a65a3a7
CC
130512008-03-24 Cary Coutant <ccoutant@google.com>
13052
13053 * i386.cc (Target_i386::Got_type): New enum declaration.
13054 (Target_i386::Scan::local): Updated callers of Output_data_got
13055 member functions.
13056 (Target_i386::Scan::global): Likewise.
13057 (Target_i386::Relocate::relocate): Likewise.
13058 (Target_i386::Relocate::relocate_tls): Likewise.
13059 * object.h (Got_offset_list): New class.
13060 (Sized_relobj::local_has_got_offset): Added got_type parameter.
13061 (Sized_relobj::local_got_offset): Likewise.
13062 (Sized_relobj::set_local_got_offset): Likewise.
13063 (Sized_relobj::local_has_tls_got_offset): Removed.
13064 (Sized_relobj::local_tls_got_offset): Removed.
13065 (Sized_relobj::set_local_tls_got_offset): Removed.
13066 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
13067 * output.cc (Output_data_got::add_global): Added got_type parameter.
13068 (Output_data_got::add_global_with_rel): Likewise.
13069 (Output_data_got::add_global_with_rela): Likewise.
13070 (Output_data_got::add_global_pair_with_rel): New function.
13071 (Output_data_got::add_global_pair_with_rela): New function.
13072 (Output_data_got::add_local): Added got_type parameter.
13073 (Output_data_got::add_local_with_rel): Likewise.
13074 (Output_data_got::add_local_with_rela): Likewise.
13075 (Output_data_got::add_local_pair_with_rel): New function.
13076 (Output_data_got::add_local_pair_with_rela): New function.
13077 (Output_data_got::add_global_tls): Removed.
13078 (Output_data_got::add_global_tls_with_rel): Removed.
13079 (Output_data_got::add_global_tls_with_rela): Removed.
13080 (Output_data_got::add_local_tls): Removed.
13081 (Output_data_got::add_local_tls_with_rel): Removed.
13082 (Output_data_got::add_local_tls_with_rela): Removed.
13083 * output.h (Output_data_got::add_global): Added got_type parameter.
13084 (Output_data_got::add_global_with_rel): Likewise.
13085 (Output_data_got::add_global_with_rela): Likewise.
13086 (Output_data_got::add_global_pair_with_rel): New function.
13087 (Output_data_got::add_global_pair_with_rela): New function.
13088 (Output_data_got::add_local): Added got_type parameter.
13089 (Output_data_got::add_local_with_rel): Likewise.
13090 (Output_data_got::add_local_with_rela): Likewise.
13091 (Output_data_got::add_local_pair_with_rel): New function.
13092 (Output_data_got::add_local_pair_with_rela): New function.
13093 (Output_data_got::add_global_tls): Removed.
13094 (Output_data_got::add_global_tls_with_rel): Removed.
13095 (Output_data_got::add_global_tls_with_rela): Removed.
13096 (Output_data_got::add_local_tls): Removed.
13097 (Output_data_got::add_local_tls_with_rel): Removed.
13098 (Output_data_got::add_local_tls_with_rela): Removed.
13099 * resolve.cc (Symbol::override_base_with_special): Removed
13100 reference to has_got_offset_ field.
13101 * symtab.cc (Symbol::init_fields): Replaced initialization
13102 of got_offset_ with got_offsets_. Removed initialization
13103 of has_got_offset_
53fcba31 13104 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
13105 (Symbol::got_offset): Likewise.
13106 (Symbol::set_got_offset): Likewise.
13107 (Symbol::has_tls_got_offset): Removed.
13108 (Symbol::tls_got_offset): Removed.
13109 (Symbol::set_tls_got_offset): Removed.
13110 (Symbol::got_offset_): Removed.
13111 (Symbol::tls_mod_got_offset_): Removed.
13112 (Symbol::tls_pair_got_offset_): Removed.
13113 (Symbol::got_offsets_): New field.
13114 (Symbol::has_got_offset): Removed.
13115 (Symbol::has_tls_mod_got_offset): Removed.
13116 (Symbol::has_tls_pair_got_offset): Removed.
13117 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
13118 (Target_x86_64::Scan::local): Updated callers of Output_data_got
13119 member functions.
13120 (Target_x86_64::Scan::global): Likewise.
13121 (Target_x86_64::Relocate::relocate): Likewise.
13122 (Target_x86_64::Relocate::relocate_tls): Likewise.
13123
bd52eafb
BE
131242008-03-25 Ben Elliston <bje@au.ibm.com>
13125
13126 * yyscript.y: Fix spelling error in comment.
13127
8b105e34
ILT
131282008-03-24 Ian Lance Taylor <iant@google.com>
13129
8ed814a9
ILT
13130 * options.h (class General_options): Define build_id option.
13131 * layout.h (class Layout): Declare write_build_id, create_note,
13132 create_build_id. Add build_id_note_ member.
13133 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
13134 "libiberty.h", "md5.h", "sha1.h".
13135 (Layout::Layout): Initialize eh_frame_data_,
13136 eh_frame_hdr_section_, and build_id_note_.
13137 (Layout::finalize): Call create_build_id.
13138 (Layout::create_note): New function, broken out of
13139 Layout::create_gold_note.
13140 (Layout::create_gold_note): Call create_note.
13141 (Layout::create_build_id): New function.
13142 (Layout::write_build_id): New function.
13143 (Close_task_runner::run): Call write_build_id.
13144
8b105e34
ILT
13145 * x86_64.cc: Correct license to GPLv3.
13146
086a1841
ILT
131472008-03-23 Ian Lance Taylor <iant@google.com>
13148
13149 * options.cc: Include "demangle.h".
13150 (parse_optional_string): New function.
13151 (parse_long_option): Handle takes_optional_argument.
13152 (parse_short_option): Update dash_z initializer. Handle
13153 takes_optional_argument.
13154 (General_options::General_options): Initialize do_demangle_.
13155 (General_options::finalize): Set do_demangle_. Handle demangling
13156 style.
13157 * options.h (parse_optional_string): Declare.
13158 (struct One_option): Add optional_arg field. Update constructor.
13159 Update call constructor calls. Add takes_optional_argument
13160 function.
13161 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
13162 (DEFINE_optional_string): Define.
13163 (General_options::demangle): Change from DEFINE_bool to
13164 DEFINE_optional_string.
13165 (General_options::no_demangle): New function.
13166 (General_options::do_demangle): New function.
13167 (General_options::set_do_demangle): New function.
13168 (General_options::execstack_status_): Move definition to end of
13169 class definition.
13170 (General_options::static_): Likewise.
13171 (General_options::do_demangle_): New field.
13172 * object.cc (big_endian>::get_symbol_location_info): Call
13173 Options::do_demangle, not Options::demangle.
13174 * symtab.cc (demangle): Likewise.
13175
cbb93e63
ILT
131762008-03-22 Ian Lance Taylor <iant@google.com>
13177
13178 * gold.h: Include <cstddef> and <sys/types.h>
13179 * options.h: Include <cstring>.
13180
ec531623
ILT
131812008-03-21 Ian Lance Taylor <iant@google.com>
13182
13183 * Added source code to GNU binutils.
This page took 0.799438 seconds and 4 git commands to generate.