summaryrefslogtreecommitdiff
path: root/bfd/elf.c
Commit message (Collapse)AuthorAgeFilesLines
* PR 16056Alan Modra2013-10-171-2/+3
| | | | | * elf.c (copy_elf_program_header): Only consider SEC_ALLOC sections when finding lowest_section.
* * elf-bfd.h (enum elf_reloc_type_class): Add reloc_class_ifunc.Alan Modra2013-03-271-1/+3
| | | | | | | | | | | | | | | | | | | | | | | (struct elf_backend_data <elf_backed_reloc_type_class>): Add bfd_link_info* and asection* params. (_bfd_elf_reloc_type_class): Likewise. * elf.c (_bfd_elf_reloc_type_class): Likewise. * elflink.c (elf_link_sort_cmp2): Sort first on reloc class. (elf_link_sort_relocs): Update elf_backed_reloc_type_class call. * elf32-ppc.c (ppc_elf_reloc_type_class): Return reloc_class_ifunc for any reliplt reloc. Don't return reloc_class_plt for R_PPC_REL24 and R_PPC_ADDR24. * elf64-ppc.c (allocate_got): Formatting. (ppc64_elf_reloc_type_class): Return reloc_class_ifunc for any reliplt reloc. * elf-m10300.c, * elf32-arm.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-cris.c, * elf32-hppa.c, * elf32-i386.c, * elf32-lm32.c, * elf32-m32r.c, * elf32-m68k.c, * elf32-metag.c, * elf32-nios2.c, * elf32-s390.c, * elf32-sh.c, * elf32-sparc.c, * elf32-tilepro.c, * elf32-vax.c, * elf32-xtensa.c, * elf64-aarch64.c, * elf64-alpha.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-s390.c, * elf64-sparc.c, * elf64-x86-64.c, * elfnn-ia64.c, * elfxx-tilegx.c, * elfxx-tilegx.h: Add extra params to the various reloc_type_class functions.
* * elf-bfd.h (struct elf_backend_data <merge_symbol>): Update proto.Alan Modra2013-03-251-1/+1
| | | | | | | | (_bfd_elf_init_reloc_shdr): Delete. * elf.c (_bfd_elf_init_reloc_shdr): Make static. * elf64-x86-64.c (elf_x86_64_merge_symbol): Trim parameters to just what is needed. * elflink.c (_bfd_elf_merge_symbol): Update bed->merge_symbol call.
* * elf-bfd.h (elfcore_write_s390_tdb): Add prototype.Nick Clifton2013-03-081-4/+28
| | | | | | | | | * elf.c (elfcore_write_s390_tdb): New function. (elfcore_write_register_note): Call it. (elfcore_grok_s390_tdb): New function. (elfcore_grok_note): Call it. * readelf.c (get_note_type): Add NT_S390_TDB.
* bfd/Alan Modra2013-02-211-8/+14
| | | | | | | | | | | | | | | | | | | | | | | * elf-bfd.h (struct elf_build_id): Extracted from.. (struct elf_build_id_info): ..here. Delete. (struct output_elf_obj_tdata): New, extracted from.. (struct elf_obj_tdata): ..here. Reorganize for better packing. Add "o" field. (elf_program_header_size): Reference tdata->o. (elf_seg_map, elf_next_file_pos, elf_eh_frame_hdr, elf_linker, elf_stack_flags, elf_shstrtab, elf_strtab_sec, elf_shstrtab_sec, elf_section_syms, elf_num_section_syms, elf_flags_init): Likewise. * elf.c (bfd_elf_allocate_object): Allocate output_elf_obj_tdata when opening bfd in any mode that might write. (_bfd_elf_write_object_contents): Use build_id field in output_elf_obj_tdata. (_bfd_elf_close_and_cleanup): Tweak elf_shstrtab test. (elfobj_grok_gnu_build_id): Adjust for elf_tdata changes. gdb/ * elfread.c (build_id_bfd_get): Adjust for elf_tdata changes. ld/ * emultempl/elf32.em (write_build_id, setup_build_id): Adjust for elf_tdata changes.
* * elf-bfd.h (struct core_elf_obj_tdata): New.Alan Modra2013-02-211-42/+45
| | | | | | | | | | | | | | | (struct elf_obj_tdata): Delete core_signal, core_pid, core_lwpid, core_program, and core_command. Add "core". * elf.c (bfd_elf_mkcorefile): Allocate "core" struct. Update all refs to tdata core fields. * elf32-am33lin.c, * elf32-arm.c, * elf32-cris.c, * elf32-frv.c, * elf32-hppa.c, * elf32-i386.c, * elf32-m68k.c, * elf32-mips.c, * elf32-nios2.c, * elf32-ppc.c, * elf32-s390.c, * elf32-score.c, * elf32-score7.c, * elf32-sh.c, * elf32-sparc.c, * elf32-tilegx.c, * elf32-tilepro.c, * elf32-xtensa.c, * elf64-aarch64.c, * elf64-hppa.c, * elf64-mips.c, * elf64-ppc.c, * elf64-tilegx.c, * elf64-x86-64.c, * elfcore.h, * elfn32-mips.c: Update all refs to tdata core fields.
* bfd/Alan Modra2013-02-211-84/+78
| | | | | | | | | | | | | | | | | | | * elf-bfd.h (struct elf_obj_tdata): Rename segment_map to seg_map. Delete num_locals and num_globals. (elf_num_locals, elf_num_globals): Don't define. (elf_seg_map, elf_next_file_pos, elf_eh_frame_hdr, elf_linker, elf_stack_flags, elf_strtab_sec, elf_shstrtab_sec): Define. * bfd.c, * elf-eh-frame.c, * elf-nacl.c, * elf-vxworks.c, * elf.c, * elf32-arm.c, * elf32-lm32.c, * elf32-ppc.c, * elf32-rx.c, * elf32-spu.c, * elf64-hppa.c, * elfcode.h, * elflink.c, * elfnn-ia64.c, * elfxx-mips.c: Use newly defined elf_obj_tdata accessor macros. * elf.c (elf_map_symbols): Add pnum_locals param. Return number of locals syms via new param. (swap_out_syms): Adjust to suit elf_map_symbols change. ld/ * emultempl/elf-generic.em: Use newly defined elf_obj_tdata accessor macros.
* include/Alan Modra2013-02-181-9/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bfdlink.h (struct bfd_link_info): Delete emit_note_gnu_build_id. bfd/ * configure.in: Bump version to 2.23.52. * elf-bfd.h (struct elf_build_id_info): New. (struct elf_obj_tdata): Delete after_write_object_contents, after_write_object_contents_info and build_id_size. Make build_id a pointer to struct elf_build_id_info. * elf.c (_bfd_elf_write_object_contents): Style. Update after_write_ibject_contents invocation. (elfobj_grok_gnu_build_id): Update for new build_id struct. Don't allow zero size notes. * configure: Regenerate. gdb/ * elfread.c (struct build_id): Delete. Use struct elf_build_id throughout file instead. (build_id_bfd_get): Update to use new elf_tdata build_id field. Don't xmalloc return value. (build_id_verify): Similarly. Don't xfree. (build_id_to_debug_filename): Update. (find_separate_debug_file_by_buildid): Update, don't xfree. ld/ * emultempl/elf32.em (emit_note_gnu_build_id): New static var. Replace all info->emit_note_gnu_build_id refs. (id_note_section_size): Rename from gld${EMULATION_NAME}_id_note_section_size. (struct build_id_info): Delete. (write_build_id): Rename from gld${EMULATION_NAME}_write_build_id_section. Update elf_tdata usage. Style, formatting. (setup_build_id): New function. (gld${EMULATION_NAME}_after_open): Use setup_build_id.
* PR binutils/15106Alan Modra2013-02-081-23/+31
| | | | | | * elf-bfd.h (struct elf_obj_tdata): Add elf_find_function_cache. * elf.c (elf_find_function): Revert last change. Use new tdata field rather than static vars for cache.
* PR binutils/15106Alan Modra2013-02-071-0/+3
| | | | * elf.c (elf_find_function): Don't cache if symbols change.
* 2013-02-04 Sergio Durigan Junior <sergiodj@redhat.com>Sergio Durigan Junior2013-02-041-0/+29
| | | | | | | | | | | | | | | | | | Pedro Alves <palves@redhat.com> * Makefile.in (SOURCE_HFILES): Add `elf-linux-psinfo.h'. * elf-bfd.h (elf_internal_linux_prpsinfo): New structure declaration. (elfcore_write_linux_prpsinfo32, elfcore_write_linux_prpsinfo64) (elfcore_write_ppc32_linux_prpsinfo32): New declarations. * elf-linux-psinfo.h: New file. * elf.c: Include elf-linux-psinfo.h. (elfcore_write_linux_prpsinfo32, elfcore_write_linux_prpsinfo64): New functions. * elf32-ppc.c: Include `elf-linux-psinfo.h'. (elf_external_ppc_linux_prpsinfo32): New structure declaration. (PPC_LINUX_PRPSINFO32_SWAP_FIELDS): New macro. (elfcore_write_ppc_linux_prpsinfo32): New function.
* include/elf/Yufeng Zhang2013-01-081-1/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2013-01-08 Yufeng Zhang <yufeng.zhang@arm.com> * common.h (NT_ARM_TLS, NT_ARM_HW_BREAK, NT_ARM_HW_WATCH): New macro definitions. bfd/ 2013-01-08 Yufeng Zhang <yufeng.zhang@arm.com> * elf-bfd.h (elfcore_write_aarch_tls): Add prototype. (elfcore_write_aarch_hw_break): Likewise. (elfcore_write_aarch_hw_watch): Likewise. * elf.c (elfcore_grok_aarch_tls): New function. (elfcore_grok_aarch_hw_break): Likewise. (elfcore_grok_aarch_hw_watch): Likewise. (elfcore_grok_note): Call the new functions to handle the corresponding notes. (elfcore_write_aarch_tls): New function. (elfcore_write_aarch_hw_break): Likewise. (elfcore_write_aarch_hw_watch): Likewise. (elfcore_write_register_note): Call the new functions to handle the corresponding pseudo sections. binutils/ 2013-01-08 Yufeng Zhang <yufeng.zhang@arm.com> * readelf.c (get_note_type): Handle NT_ARM_TLS, NT_ARM_HW_BREAK and NT_ARM_HW_WATCH.
* * elf.c (swap_out_syms): Set shndx to SHN_ABS when not one ofAlan Modra2012-12-181-0/+1
| | | | the special MAP_* values.
* gdbTom Tromey2012-12-141-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * NEWS: Mention "info proc" and core files. * corelow.c (core_info_proc): New function. (init_core_ops): Set to_info_proc. * gdbarch.c, gdbarch.h: Rebuild. * gdbarch.sh (core_info_proc): New method. * infcmd.c (info_proc_cmd_1): Invoke target_info_proc first. * linux-tdep.c (linux_core_info_proc_mappings) (linux_core_info_proc): New functions. (linux_find_memory_region_ftype): New typedef. (linux_find_memory_regions_full): New function, from linux_find_memory_regions. (struct linux_find_memory_regions_data): New. (linux_find_memory_regions_thunk): New function. (linux_find_memory_regions): Rewrite. (struct linux_make_mappings_data): New. (linux_make_mappings_callback) (linux_make_mappings_corefile_notes): New functions. (linux_make_corefile_notes): Call linux_make_mappings_corefile_notes. (linux_init_abi): Call set_gdbarch_core_info_proc. * target.c (target_info_proc): Return 'int'. * target.h (target_info_proc): Update. gdb/doc * gdb.texinfo (SVR4 Process Information): Mention core files. gdb/testsuite * gdb.base/info-proc.exp: Add core file tests. bfd * elf.c (elfcore_grok_note) <NT_FILE>: New case.
* PR ld/14926Alan Modra2012-12-071-0/+1
| | | | | * elf.c (_bfd_elf_map_sections_to_segments): Include elf header size when determining phdr_in_segment.
* Set output maxpagesize when rewriting program headerH.J. Lu2012-11-211-0/+20
| | | | | | | | | | | | | | | | bfd/ PR binutils/14493 * elf.c (copy_elf_program_header): When rewriting program header, set the output maxpagesize to the maximum alignment of input PT_LOAD segments. 2012-11-21 H.J. Lu <hongjiu.lu@intel.com> PR binutils/14493 * ld-elf/maxpage5.d: New file. * ld-elf/maxpage5.s: Likewise. * ld-elf/maxpage5.t: Likewise.
* Allocate elf_segment_map with bfd_zallocH.J. Lu2012-11-131-1/+1
| | | | | * elf.c (rewrite_elf_program_header): Allocate elf_segment_map with bfd_zalloc, instead of bfd_alloc.
* Remove trailing redundant `;'H.J. Lu2012-11-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bfd/ * aout-tic30.c (MY_final_link_callback): Remove trailing redundant `;'. * coff-h8500.c (extra_case): Likewise. (bfd_coff_reloc16_get_value): Likewise. * dwarf2.c (_bfd_dwarf2_cleanup_debug_info): Likewise. * elf.c (_bfd_elf_slurp_version_tables): Likewise. * elf32-frv.c (elf32_frv_relocate_section): Likewise. * elf32-v850.c (v850_elf_perform_relocation): Likewise. * opncls.c (bfd_calc_gnu_debuglink_crc32): Likewise. * plugin.c (add_symbols): Likewise. * reloc.c (bfd_check_overflow): Likewise. * vms-lib.c (_bfd_vms_lib_archive_p): Likewise. binutils/ * coffgrok.c (coff_grok): Remove trailing redundant `;'. * resrc.c (open_input_stream): Likewise. gas/ * config/atof-ieee.c (gen_to_words): Remove trailing redundant `;'. * config/atof-vax.c (flonum_gen2vax): Likewise. * config/tc-d10v.c (write_2_short): Likewise. * config/tc-i386-intel.c (i386_intel_simplify): Likewise. * config/tc-s390.c (tc_s390_force_relocation): Likewise. * config/tc-v850.c (md_parse_option): Likewise. * config/tc-xtensa.c (find_address_of_next_align_frag): Likewise. * dwarf2dbg.c (out_header): Likewise. * symbols.c (dollar_label_name): Likewise. (fb_label_name): Likewise. ld/ * testplug.c (record_add_file): Remove trailing redundant `;'. opcodes/ * aarch64-opc.h (gen_mask): Remove trailing redundant `;'. * ia64-gen.c (fetch_insn_class): Likewise.
* gdbTom Tromey2012-11-081-0/+4
| | | | | | | | | | | | | | | * linux-tdep.c (linux_make_siginfo_note): New function. (linux_make_corefile_notes): Use it. * corelow.c (get_core_siginfo): New function. (core_xfer_partial) <TARGET_OBJECT_SIGNAL_INFO>: New case. gdb/testsuite * gdb.base/siginfo-obj.exp: Create core file. Test siginfo from core files, if possible. * gdb.base/siginfo-thread.c: New file * gdb.base/siginfo-thread.exp: New file bfd * elf.c (elfcore_grok_note) <NT_SIGINFO>: New case; make pseudosection.
* bfd/Nathan Sidwell2012-10-231-2/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bfd-in.h (bfd_elf_stack_segment_size): Declare. * bfd-in2.h: Rebuilt. * elfxx-target.h (elf_backend_stack_align): New. (elfNN_bed): Add it. * elf-bfd.h (struct elf_backend_data): Add stack_align field. * elf.c (bfd_elf_map_sections_to_segments): Pay attention to stack_align and stacksize for PT_GNU_STACK segment. (assign_file_positions_for_non_load_sections): Set p_memsz for PT_GNU_STACK segment. (copy_elf_program_header): Copy PT_GNU_STACK size. * elflink.c (bfd_elf_stack_segment_size): New function, taken from uclinux backends. (bfd_elf_size_dynamic_sections): Determine PT_GNU_STACK requirements after calling backend. Pay attention to stacksize. * elf32-bfin.c (elf32_bfinfdpic_always_size_sections): Call bfd_elf_stack_segment_size. (elf32_bfinfdpic_modify_program_headers): Delete. (elf32_bfingfdpic_copy_private_bfd_data): Don't copy PT_GNU_STACK here. (elf_backend_stack_align): Override. (elf_backend_modify_program_headers): Don't override. * elf32-frv.c (frvfdpic_always_size_sections): Call bfd_elf_stack_segment_size. (elf32_frvfdpic_modify_program_headers): Delete. (elf32_frvfdpic_copy_private_bfd_data): Don't copy PT_GNU_STACK here. (elf_backend_stack_align): Override. (elf_backend_modify_program_headers): Don't override. * elf32-lm32.c (lm32_elf_always_size_sections): Leave PT_GNU_STACK creation to underlying elf support. Check __stacksize here for backwards compatibility, and set it if needed. (lm32_elf_modify_segment_map): Delete. (lm32_elf_modify_program_headers): Delete. (elf_backend_stack_align): Override. (elf_backend_modify_segment_map): Don't override. (elf_backend_modify_program_headers): Don't override. * elf32-sh.c (sh_elf_always_size_sections): Call bfd_elf_stack_segment_size. (sh_elf_modify_program_headers): Delete. (sh_elf_copy_private_data): Don't copy PT_GNU_STACK here. (elf_backend_stack_align): Override. (elf_backend_modify_program_headers): Don't override. * elf32-tic6x.c (elf32_tic6x_always_size_sections): Call bfd_elf_stack_segment_size. (elf32_tic6x_modify_program_headers): Delete. (elf32_tic6x_copy_private_data): Delete. (elf_backend_stack_align): Override. (bfd_elf32_bfd_copy_private_bfd_data): Don't override. (elf_backend_modify_program_headers): Don't override. include/ * bfdlink.h (struct bfd_link_info): Add stacksize option. ld/ * ld.texinfo (stack-size): New option. * emultempl/elf32.em: Add stack-size option. ld/testsuite/ * ld-elf/binutils.exp: Add -z stack-size=0. * ld-elf/elf.exp: Add stack-exec and stack-size tests. * ld-elf/orphan-region.d: Add stack-size option. Remove xfail. * ld-elf/stack-exec.rd: New. * ld-elf/stack-size.rd: New. * ld-elf/stack.s: New. * ld-scripts/empty-aligned.d: Add stack-size option. * ld-sh/fdpic-stack-set.d: New. * ld-tic6x/shlib-1.rd: Remove __stacksize symbol. * ld-tic6x/shlib-1b.rd: Likewise. * ld-tic6x/shlib-1r.rd: Likewise. * ld-tic6x/shlib-1rb.rd: Likewise. * ld-tic6x/shlib-app-1.rd: Likewise. * ld-tic6x/shlib-app-1b.rd: Likewise. * ld-tic6x/shlib-app-1r.rd: Likewise. * ld-tic6x/shlib-app-1rb.rd: Likewise. * ld-tic6x/shlib-noindex.rd: Likewise. * ld-tic6x/static-app-1.rd: Likewise. * ld-tic6x/static-app-1b.rd: Likewise. * ld-tic6x/static-app-1r.rd: Likewise. * ld-tic6x/static-app-1rb.rd: Likewise.
* * elf.c (special_sections_d): Add comment.Doug Evans2012-10-151-0/+3
|
* PR binutils/14662Alan Modra2012-10-071-37/+17
| | | | | * elf.c (_bfd_elf_make_section_from_shdr): Treat .gdb_index as SEC_DEBUGGING.
* Ignore section symbols without a BFD sectionH.J. Lu2012-09-041-3/+11
| | | | | | | | | | | | | bfd/ PR binutils/14493 * elf.c (ignore_section_sym): Also ignore section symbols without a BFD section. binutils/ PR binutils/14493 * readelf.c (get_symbol_index_type): Check bad section index.
* PR binutils/14444Alan Modra2012-08-101-5/+5
| | | | | | | * elf.c (IS_VALID_GROUP_SECTION_HEADER) Add minsize param. (setup_group): Adjust uses. (bfd_section_from_shdr): Allow SHT_GROUP sections with just a flag word.
* 2012-07-24 Teresa Johnson <tejohnson@google.com>Cary Coutant2012-07-241-2/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bfd/ * bfd.c (bfd_find_nearest_line_discriminator): New macro. * coff-rs6000.c: Init _bfd_find_nearest_line_discriminator. * coff64-rs6000.c: Likewise. * dwarf2.c (struct line_info): Add discriminator field. (add_line_info): Fill in new discriminator field. (decode_line_info): Record discriminator information instead of ignoring it. (lookup_address_in_line_info_table): Return discriminator field if requested. (comp_unit_find_nearest_line): Add discriminator argument. (find_line): Likewise. (_bfd_dwarf2_find_nearest_line): Likewise. (_bfd_dwarf2_find_line): Likewise. * elf-bfd.h (_bfd_elf_find_nearest_line_discriminator): New. (_bfd_elf_find_line_discriminator): Likewise. (_bfd_generic_find_nearest_line_discriminator): Likewise. Defined. * elf.c (_bfd_elf_find_nearest_line): Change to a wrapper that invokes _bfd_elf_find_nearest_line_discriminator with correct arguments. (_bfd_elf_find_nearest_line_discriminator): New. (_bfd_elf_find_line): Change to a wrapper that invokes _bfd_elf_find_line_discriminator with correct arguments. (_bfd_elf_find_line_discriminator): New. * coffgen.c (coff_find_nearest_line_with_names): Handle new discriminator argument. * elf32-arm.c (elf32_arm_find_nearest_line): Likewise. * elf64-alpha.c (elf64_alpha_find_nearest_line): Likewise. * elfxx-mips.c (_bfd_mips_elf_find_nearest_line): Likewise. * mach-o.c (bfd_mach_o_find_nearest_line): Likewise. * libbfd-in.h (_bfd_dwarf2_find_nearest_line): Add discriminator argument. (_bfd_dwarf2_find_line): Likewise. (_bfd_generic_find_nearest_line_discriminator): New. * libbfd.c (_bfd_generic_find_nearest_line_discriminator): New. * bfd-in2.h: Regenerated. * libbfd.h: Likewise. * targets.c (BFD_JUMP_TABLE_SYMBOLS): Initialize _bfd_find_nearest_line_discriminator with _bfd_generic_find_nearest_line_discriminator. (bfd_target): Add _bfd_find_nearest_line_discriminator. binutils/ * addr2line.c (find_address_in_section): Invoke bfd_find_nearest_line_discriminator to get the discriminator. (find_offset_in_section): Likewise. (translate_addresses): Print discriminator if it is non-zero. * objdump.c (show_line): Invoke bfd_find_nearest_line_discriminator to get the discriminator, and keep track of prev_discriminator. Print discriminator if it is non-zero. (disassemble_data): Initialize prev_discriminator. (dump_reloc_set): Invoke bfd_find_nearest_line_discriminator to get the discriminator, and keep track of last_discriminator. Print discriminator if it is non-zero.
* Check number of sections overflowH.J. Lu2012-07-041-0/+7
| | | | | | * elf.c (assign_section_numbers): Check if number of sections >= SHN_LORESERVE. * elfcode.h (elf_object_p): Likewise.
* Don't compress empty debug sectionH.J. Lu2012-07-031-1/+1
| | | | | | | | | | | | | | | 2012-07-03 H.J. Lu <hongjiu.lu@intel.com> PR binutils/14319 * elf.c (_bfd_elf_make_section_from_shdr): Don't compress empty debug section. 2012-07-03 H.J. Lu <hongjiu.lu@intel.com> PR binutils/14319 * binutils-all/compress.exp: Test compress empty debug sections. * binutils-all/dw2-empty.S: New file.
* PR ld/14207Alan Modra2012-07-031-10/+8
| | | | | | | | | | * elf.c (assign_file_positions_for_load_sections): Remove assertions that only PT_LOAD headers include file header and section headers. (assign_file_positions_for_non_load_sections): Similarly don't assert PT_GNU_RELRO header does not include file and section headers. Compare first section vma rather than PT_LOAD p_vaddr against relro_start when looking for PT_LOAD covering PT_GNU_RELRO. Replace abort with assertion.
* * elf.c (_bfd_elf_make_section_from_shdr): Fix typo in errorAndreas Schwab2012-07-011-2/+2
| | | | message.
* bfd/Roland McGrath2012-06-221-0/+49
| | | | | | | | | | | | | * elf.c (assign_file_positions_for_non_load_sections): Define __ehdr_start symbol if it's referenced and there's a PT_LOAD segment that covers both the file and program headers. ld/ * NEWS: Mention __ehdr_start. ld/testsuite/ * ld-elf/ehdr_start.s: New file. * ld-elf/ehdr_start.d: New file.
* Abort if PT_GNU_RELRO segment doesn't fit in PT_LOAD segmentH.J. Lu2012-06-121-0/+5
| | | | | | | | | | | | | | | | bfd/ PR bfd/14207 * elf.c (assign_file_positions_for_non_load_sections): Abort if PT_GNU_RELRO segment doesn't fit in PT_LOAD segment. ld/testsuite/ PR ld/14207 * ld-x86-64/x86-64.exp: Run pr14207. * ld-x86-64/pr14207.d: New file. * ld-x86-64/pr14207.s: Likewise.
* PR ld/14207Alan Modra2012-06-121-7/+14
| | | | | | * elf.c (_bfd_elf_map_sections_to_segments): Disregard bss type sections at end of PT_LOAD segment when searching for segment that contains end of relro extent.
* Reindent assign_file_positions_for_non_load_sectionsH.J. Lu2012-06-111-8/+9
| | | | * elf.c (assign_file_positions_for_non_load_sections): Reindent.
* Reindent _bfd_elf_map_sections_to_segmentsH.J. Lu2012-06-111-1/+1
| | | | * elf.c (_bfd_elf_map_sections_to_segments): Reindent.
* bfd/Jan Kratochvil2012-06-041-1/+1
| | | | | | | | | | | | | | | | | | * bfd-in.h (bfd_elf_bfd_from_remote_memory): Make LEN argument of target_read_memory as bfd_size_type. * bfd-in2.h: Regenerate. * elf-bfd.h (elf_backend_bfd_from_remote_memory): Make LEN argument of target_read_memory as bfd_size_type. (_bfd_elf32_bfd_from_remote_memory): Likewise. (_bfd_elf64_bfd_from_remote_memory): Likewise. * elf.c (bfd_elf_bfd_from_remote_memory): Likewise. * elfcode.h (NAME(_bfd_elf,bfd_from_remote_memory)): Likewise. gdb/ * symfile-mem.c: 3 new gdb_static_assert for target_read_memory_bfd parameters. (target_read_memory_bfd): New function. (symbol_file_add_from_memory): Use it.
* PR binutils/13897Alan Modra2012-06-031-56/+79
| | | | | | | | | | | | * elf.c (elf_find_function): Cache last function sym info. (_bfd_elf_maybe_function_sym): Return function size, pass in section of interest. * elf-bfd.h (struct elf_backend_data <maybe_function_sym>): Likewise. (_bfd_elf_maybe_function_sym): Likewise. * elf64-ppc.c (ppc64_elf_maybe_function_sym): Likewise. (opd_entry_value): Add in_code_sec param. Revert caching code. Return -1 if in_code_sec and function found in wrong section. Update all calls.
* bfd/Jan Kratochvil2012-06-011-1/+1
| | | | | | | | | | | | | | | | * bfd-in.h (bfd_elf_bfd_from_remote_memory): Make LEN argument of target_read_memory as size_t. * bfd-in2.h: Regenerate. * elf-bfd.h (elf_backend_bfd_from_remote_memory): Make LEN argument of target_read_memory as size_t. (_bfd_elf32_bfd_from_remote_memory): Likewise. (_bfd_elf64_bfd_from_remote_memory): Likewise. * elf.c (bfd_elf_bfd_from_remote_memory): Likewise. * elfcode.h (NAME(_bfd_elf,bfd_from_remote_memory)): Likewise. gdb/ * target.c (target_read_memory): Make LEN argument as size_t. * target.h (target_read_memory): Likewise.
* * elf.c (ignore_section_sym): Correct comment. Don't returnAlan Modra2012-05-171-15/+15
| | | | | | true for absolute section. (elf_map_symbols): Move stray comment. Adjust for above change. Don't discard global section symbols.
* PR ld/13962Alan Modra2012-05-161-1/+19
| | | | | | | PR ld/7023 * elf.c (bfd_section_from_shdr): Fail when .dynsym sh_info is out of range. As a special case, fix sh_info for zero sh_size. Do the same for .symtab.
* 2012-05-08 Ben Cheng <bccheng@google.com>Doug Kwan2012-05-081-2/+8
| | | | | * bfd/elf.c: Preserve the original p_align and p_flags if they are valid.
* PR ld/13991Alan Modra2012-04-241-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bfd/ * bfd/elf-bfd.h (_bfd_elf_link_just_syms): Define as _bfd_generic_link_just_syms. * bfd/elflink.c (_bfd_elf_link_just_syms): Delete. * bfd/linker.c (_bfd_generic_link_just_syms): Set sec_info_type. * bfd/bfd-in.h (discarded_section): Renamed from elf_discarded_section. * bfd/section.c (SEC_INFO_TYPE_NONE, SEC_INFO_TYPE_STABS, SEC_INFO_TYPE_MERGE, SEC_INFO_TYPE_EH_FRAME, SEC_INFO_TYPE_JUST_SYMS): Renamed from corresponding ELF_INFO_TYPE. * bfd/elf-eh-frame.c, * bfd/elf-m10200.c, * bfd/elf-m10300.c, * bfd/elf.c, * bfd/elf32-arm.c, * bfd/elf32-avr.c, * bfd/elf32-bfin.c, * bfd/elf32-cr16.c, * bfd/elf32-cr16c.c, * bfd/elf32-cris.c, * bfd/elf32-crx.c, * bfd/elf32-d10v.c, * bfd/elf32-epiphany.c, * bfd/elf32-fr30.c, * bfd/elf32-frv.c, * bfd/elf32-h8300.c, * bfd/elf32-hppa.c, * bfd/elf32-i370.c, * bfd/elf32-i386.c, * bfd/elf32-i860.c, * bfd/elf32-ip2k.c, * bfd/elf32-iq2000.c, * bfd/elf32-lm32.c, * bfd/elf32-m32c.c, * bfd/elf32-m32r.c, * bfd/elf32-m68hc1x.c, * bfd/elf32-m68k.c, * bfd/elf32-mcore.c, * bfd/elf32-mep.c, * bfd/elf32-moxie.c, * bfd/elf32-msp430.c, * bfd/elf32-mt.c, * bfd/elf32-openrisc.c, * bfd/elf32-ppc.c, * bfd/elf32-rl78.c, * bfd/elf32-rx.c, * bfd/elf32-s390.c, * bfd/elf32-score.c, * bfd/elf32-score7.c, * bfd/elf32-sh.c, * bfd/elf32-spu.c, * bfd/elf32-tic6x.c, * bfd/elf32-tilepro.c, * bfd/elf32-v850.c, * bfd/elf32-vax.c, * bfd/elf32-xc16x.c, * bfd/elf32-xstormy16.c, * bfd/elf32-xtensa.c, * bfd/elf64-alpha.c, * bfd/elf64-hppa.c, * bfd/elf64-ia64-vms.c, * bfd/elf64-mmix.c, * bfd/elf64-ppc.c, * bfd/elf64-s390.c, * bfd/elf64-sh64.c, * bfd/elf64-x86-64.c, * bfd/elflink.c, * bfd/elfnn-ia64.c, * bfd/elfxx-mips.c, * bfd/elfxx-sparc.c, * bfd/elfxx-tilegx.c, * bfd/reloc.c: Update all references. * bfd/bfd-in2.h: Regenerate. ld/ * ld/ldlang.c (size_input_section): Use sec_info_type rather than usrdata->flags.just_syms. * ld/ldwrite.c (build_link_order): Likewise. * ld/emultempl/hppaelf.em (build_section_lists): Likewise. * ld/emultempl/ppc64elf.em (build_toc_list): Likewise. * ld/emultempl/armelf.em (build_section_lists): Likewise. (after_allocation): Update for renamed sec_info_type value. * ld/emultempl/tic6xdsbt.em: Likewise.
* bfd/Roland McGrath2012-04-091-5/+9
| | | | | | | | | * elf.c (_bfd_elf_map_sections_to_segments): Set INFO->user_phdrs. * elf-nacl.c (nacl_modify_segment_map): Do nothing if INFO->user_phdrs. (nacl_modify_program_headers): Likewise. include/ * bfdlink.h (struct bfd_link_info): Add new member user_phdrs.
* * elf.c (assign_file_positions_for_non_load_sections): Don't warnAlan Modra2012-03-231-6/+7
| | | | on empty alloc sections.
* * elf.c (elf_find_function): Don't use internal_elf_sym.Alan Modra2012-02-071-34/+25
| | | | | | | | (_bfd_elf_maybe_function_sym): Likewise. Replace elf_symbol_type parameter with asymbol. * elf64-ppc.c (ppc64_elf_maybe_function_sym): Likewise. * elf-bfd.h (_bfd_elf_maybe_function_sym): Update prototype. (struct elf_backend_data <maybe_function_sym>): Likewise.
* * elf-bfd.h: Formatting.Alan Modra2012-01-231-8/+27
| | | | | | | | | | | (struct elf_backend_data): Add "maybe_function_sym". (_bfd_elf_maybe_function_sym): Declare. * elfxx-target.h (elf_backend_maybe_function_sym): Define. (elfNN_bed): Init new field. * elf.c (elf_find_function): Use maybe_function_sym. (_bfd_elf_maybe_function_sym): New function. * elf64-ppc.c (elf_backend_maybe_function_sym): Define. (ppc64_elf_maybe_function_sym): New function.
* * elf.c (elfcore_write_prpsinfo): Provide unconditionally.Ulrich Weigand2012-01-201-10/+14
| | | | | | | Return NULL if core file generation is unsupported. (elfcore_write_prstatus): Likewise. * elf32-arm.c (elf32_arm_nabi_write_core_note): New function. (elf_backend_write_core_note): Define.
* 2011-12-13 Shinichiro Hamaji <shinichiro.hamaji@gmail.com>Tristan Gingold2011-12-131-3/+4
| | | | | | | | | | | | | | | | | | | | * dwarf2.c (bfd_dwarf2_cleanup_debug_info): Accept stash as an argument like other functions to support formats other than ELF. * elf-bfd.h (bfd_dwarf2_cleanup_debug_info): Move to bfd-in.h. * elf.c (_bfd_elf_close_and_cleanup): Pass dwarf2_find_line_info in tdata as a parameter. * libbfd-in.h (bfd_dwarf2_cleanup_debug_info): Move from elf-bfd.h. * libbfd.h (bfd_dwarf2_cleanup_debug_info): Regenerate. * mach-o-target.c (bfd_mach_o_close_and_cleanup): Remove the fallback macro. (bfd_mach_o_find_nearest_line): Likewise. * mach-o.c (bfd_mach_o_find_nearest_line): Add the definition which calls _bfd_dwarf2_find_nearest_line. (bfd_mach_o_close_and_cleanup): Likewise. * mach-o.h (mach_o_data_struct): Add dwarf2_find_line_info. (bfd_mach_o_find_nearest_line): Add declaration. (bfd_mach_o_close_and_cleanup): Add declaration.
* include/elf/ChangeLog:Ulrich Weigand2011-12-061-0/+56
| | | | | | | | | | | | | | | | * common.h (NT_S390_LAST_BREAK): Define. (NT_S390_SYSTEM_CALL): Likewise. bfd/ChangeLog: * elf-bfd.h (elfcore_write_s390_last_break): Add prototype. (elfcore_write_s390_system_call): Likewise. * elf.c (elfcore_write_s390_last_break): New function. (elfcore_write_s390_system_call): Likewise. (elfcore_write_register_note): Call them. (elfcore_grok_s390_last_break): New function. (elfcore_grok_s390_system_call): Likewise. (elfcore_grok_note): Call them.
* 2011-09-30 Tristan Gingold <gingold@adacore.com>Tristan Gingold2011-09-301-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dwarf2.c (struct dwarf2_debug): Add field debug_sections. (read_section): Add sec argument. Adjust the code to get section names from it. (read_indirect_string): Adjust call to read_section. (read_abbrevs): Ditto. (decode_line_info): Ditto. (read_debug_ranges): Ditto. (DWARF2_DEBUG_INFO, DWARF2_COMPRESSED_DEBUG_INFO): Remove. (find_debug_info): Add debug_sections parameter. Use it instead the above macros. (place_sections): Get section names from stash. (find_line): Add debug_sections argument. Initialize debug_sections field of stash from it. Adjust calls to find_debug_info. (_bfd_dwarf2_find_nearest_line): Add debug_sections argument. Adjust call to find_line. (_bfd_dwarf2_find_line): Adjust call to find_line. * libcoff-in.h (struct dwarf_debug_section): New declaration. (coff_find_nearest_line_with_names): Likewise. * libcoff.h: Regenerate. * libbfd-in.h (struct dwarf_debug_section): Move declaration. (dwarf_debug_sections): Likewise. (_bfd_dwarf2_find_nearest_line): Add debug_sections argument. * libbfd.h: Regenerate. * elf.c (_bfd_elf_find_nearest_line): Adjust call to _bfd_dwarf2_find_nearest_line. * elfxx-mips.c (_bfd_mips_elf_find_nearest_line): Ditto. * elf64-alpha.c (elf64_alpha_find_nearest_line): Ditto. * elf32-arm.c (elf32_arm_find_nearest_line): Ditto. * coffgen.c (coff_find_nearest_line_with_names): New function. (coff_find_nearest_line): Calls coff_find_nearest_line_with_names. * coff-rs6000.c (xcoff_debug_sections): New constant. (xcoff_find_nearest_line): New function. (rs6000coff_vec): Use xcoff_find_nearest_line. (pmac_xcoff_vec): Ditto.
* ELFOSABI_GNUThomas Schwinge2011-07-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bfd/ * elf.c (_bfd_elf_set_osabi): Use ELFOSABI_GNU name instead of ELFOSABI_LINUX alias. * elf32-hppa.c: Likewise. * elf32-i370.c: Likewise. * elf64-hppa.c: Likewise. binutils/ * elfedit.c (osabis): Use ELFOSABI_GNU name instead of ELFOSABI_LINUX alias and ELFOSABI_HURD. Add GNU alias. * readelf.c (get_osabi_name, get_symbol_binding, get_symbol_type): Likewise. * doc/binutils.texi <elfedit>: Update accordingly. elfcpp/ * elfcpp.h (ELFOSABI): Add ELFOSABI_GNU with value of ELFOSABI_LINUX, keep ELFOSABI_LINUX as an alias. Remove ELFOSABI_HURD. gas/ * config/obj-elf.c (obj_elf_type): Use ELFOSABI_GNU name instead of ELFOSABI_LINUX alias. * config/tc-ia64.c: Likewise. include/elf/ * common.h (ELFOSABI_GNU): Define, replaces... (ELFOSABI_LINUX): ... this, kept as an alias. (ELFOSABI_HURD): Remove. ld/testsuite/ * ld-ifunc/ifunc.exp: Update for changed output. * ld-unique/unique.exp: Likewise.