aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlang.c
AgeCommit message (Collapse)AuthorFilesLines
2001-09-29From John Reiser <jreiser@BitWagon.com>Alan Modra1-0/+2
* ldlang.c (lang_common): Conditionally inhibit Common allocation. * lexsup.c: Add --no-define-common commandline option. * ldgram.y: Add INHIBIT_COMMON_ALLOCATION script command. * ldlex.l: Likewise. * ld.h: Add command_line.inhibit_common_definition. * ldmain.c (main): Initialize. * ld.texinfo: Document.
2001-09-29 * section.c (struct sec): Remove kept_section.Alan Modra1-4/+1
(STD_SECTION): Remove kept_section initialisation. (bfd_make_section_anyway): Here too. * ecoff.c (bfd_debug_section): Remove kept_section initialisation. * cofflink.c (_bfd_coff_link_input_bfd): Don't test kept_section. * elflink.h (elf_link_input_bfd): Set discarded link-once section symbols to zero, and remove all code involved with kept_section and tracking section symbol values. * bfd-in2.h: Regenerate. * configure.in: Bump version number. * configure: Regenerate. * ldlang.c (section_already_linked): Remove assignment to kept_section.
2001-09-19Locale changes from Bruno Haible <haible@clisp.cons.org>.H.J. Lu1-9/+3
2001-08-20 * ldlang.c (insert_pad): Fix typos in last patch.Alan Modra1-2/+2
2001-08-20 * ldlang.c: When traversing lang_statement_union_type lists,Alan Modra1-15/+15
consistently use "header.next" rather than "next". * mpw-eppcmac.c: Likewise. * emultempl/beos.em: Likewise. * emultempl/hppaelf.em: Likewise. * emultempl/pe.em: Likewise. * ldlang.h (union lang_statement_union): Remove "next" field.
2001-08-20 * ldlang.c (insert_pad): Use offsetof macro.Alan Modra1-21/+10
(lang_size_sections): Always neuter padding statements. * emultempl/hppaelf.em (hppaelf_delete_padding_statements): Delete.
2001-08-18 * ldlang.c (insert_pad): Make use of an existing pad statement ifAlan Modra1-105/+95
available. Move code calculating alignment, adjusting section alignment power, and adjusting dot to .. (size_input_section): .. here. Remove unused relax param. (lang_size_sections): Change boolean `relax' param to boolean *. Adjust call to size_input_section. Make use of insert_pad to place pad after the assignment statement. If relaxing, zap padding statements. (reset_memory_regions): Reset output_bfd section sizes too. (relax_again): Move to.. (lang_process): ..here. Adjust call to lang_size_sections, and remove duplicated code. * ldlang.h (lang_size_sections): Change `relax' param to boolean *.
2001-08-14(wild_doit): Rename to lang_add_section.Alan Modra1-17/+17
2001-08-03 * ld.texinfo (Input Section Basics): Clarify ordering of outputAlan Modra1-139/+158
sections. * ldlang.c (callback_t): Add wildcard_list param. (walk_wild_section): Remove "section" param. Rewrite for lang_wild_statement_type change. Remove unique_section_p test. (walk_wild_file): Remove "section" param. (walk_wild): Remove "section" and "file" params. (lang_gc_wild): Likewise. (wild): Likewise. Modify for lang_wild_statement_type change. (wild_sort): Likewise. Add "sec" param. (gc_section_callback): Likewise. (output_section_callback): Likewise. Do unique_section_p test. (map_input_to_output_sections): Modify call to wild. (lang_gc_sections_1): Likewise. (print_wild_statement): Modify for lang_wild_statement_type change. (lang_add_wild): Replace filename, filenames_sorted param with filespec. Replace section_name, sections_sorted, exclude_filename_list with section_list. * ldlang.h (lang_add_wild): Here too. (lang_wild_statement_type): Replace section_name, sections_sorted, and exclude_filename_list with section_list. * ldgram.y (current_file): Delete. (%union): Add wildcard_list. (file_NAME_list): Set type to wildcard_list. Build a linked list rather than calling lang_add_wild for each entry. (input_section_spec_no_keep): Call lang_add_wild here instead. * ld.h (struct wildcard_list): Declare. * mri.c (mri_draw_tree): Modify to suit new lang_add_wild.
2001-07-19If a region is specified assign it to all sections inside the overlay unless ↵Nick Clifton1-1/+12
they have been assigned to the own, non-default, memory region.
2001-06-19 * ldlang.c (lang_check): Emit fatal error if relocatable linkHans-Peter Nilsson1-0/+12
between different object flavours with relocations in input.
2001-06-192001-06-19 H.J. Lu <hjl@gnu.org>H.J. Lu1-5/+0
* ldlang.c (lang_check): Revert the change mode on 2001-06-15.
2001-06-182001-06-18 H.J. Lu <hjl@gnu.org>H.J. Lu1-3/+3
* ldlang.c (init_os): Add the newline to the einfo call. (lang_check): Likewise. (lang_do_version_exports_section): Likewise.
2001-06-15 * ldlang.c (lang_check): Emit fatal error if relocatable linkHans-Peter Nilsson1-0/+5
between different object flavours.
2001-06-15Chnage load_symbols() to a boolean functionNick Clifton1-25/+45
2001-06-08 * ldlang.c (record_bfd_errors): Remove.Alan Modra1-48/+0
* emultempl/aix.em: Fix copyright dates.
2001-05-312001-05-31 H.J. Lu <hjl@gnu.org>H.J. Lu1-8/+0
* ldlang.c (open_input_bfds): Don't change the bfd error handler whilst loading symbols.
2001-05-17Add a flag to asection, linker_has_input, and use it to reliablyAlan Modra1-39/+50
determine whether an input section is the first one assigned to an output section.
2001-05-11 * merge.c (struct sec_merge_hash_entry): Add u.entsize and u.suffixJakub Jelinek1-0/+6
fields, change sec into secinfo. (struct sec_merge_info): Add chain, remove last fields. (struct sec_merge_sec_info): Add next, sec, psecinfo fields. (sec_merge_hash_lookup): If lookup could not use a string only because it has bad alignment, mark the old string for deletion. (sec_merge_add): Add secinfo argument. Don't compute entry's position, instead record the section. (sec_merge_emit): Update for the sec into secinfo change in struct sec_merge_hash_entry. (_bfd_merge_section): Only record the section for merging, defer putting strings into the hash table. (cmplengthentry, last4_eq, last_eq, record_section, merge_strings, _bfd_merge_sections): New functions. (_bfd_merged_section_offset): Update for the sec_merge_hash_entry changes. * libbfd-in.h (_bfd_merge_sections): Add prototype. (_bfd_nolink_bfd_merge_sections): Define. * libbfd.h: Likewise. (bfd_generic_merge_sections): Add prototype. * targets.c (BFD_JUMP_TABLE_LINK): Add _bfd_merge_sections. (struct bfd_target): Likewise. * bfd.c (bfd_merge_sections): Define. * bfd-in2.h: Rebuilt. * elf.c (_bfd_elf_merge_sections): New function. * elf-bfd.h (_bfd_elf_merge_sections): Add prototype. * elfxx-target.h (bfd_elfNN_bfd_merge_sections): Define. * reloc.c (bfd_generic_merge_sections): New function. * vms.c (vms_bfd_merge_sections): New function. * aout-adobe.c (aout_32_bfd_merge_sections): Define. * aout-target.h (MY_bfd_merge_sections): Define. * aout-tic30.c (MY_bfd_merge_sections): Define. * binary.c (binary_bfd_merge_sections): Define. * bout.c (b_out_bfd_merge_sections): Define. * coff-alpha.c (_bfd_ecoff_bfd_merge_sections): Define. * coffcode.c (coff_bfd_merge_sections): Define. * coff-mips.c (_bfd_ecoff_bfd_merge_sections): Define. * i386msdos.c (msdos_bfd_merge_sections): Define. * i386os9k.c (os9k_bfd_merge_sections): Define. * ieee.c (ieee_bfd_merge_sections): Define. * ihex.c (ihex_bfd_merge_sections): Define. * nlm-target.h (nlm_bfd_merge_sections): Define. * oasys.c (oasys_bfd_merge_sections): Define. * ppcboot.c (ppcboot_bfd_merge_sections): Define. * som.c (som_bfd_merge_sections): Define. * srec.c (srec_bfd_merge_sections): Define. * tekhex.c (tekhex_bfd_merge_sections): Define. * versados.c (versados_bfd_merge_sections): Define. * xcoff-target.h (_bfd_xcoff_bfd_merge_sections): Define. * ldlang.c (lang_process): Call bfd_merge_sections.
2001-05-022001-05-02 H.J. Lu <hjl@gnu.org>H.J. Lu1-2/+2
* ldfile.c: Include "libiberty.h". * ldlex.l: Likewise. * ldmisc.c (buystring): Removed. * ldmisc.h: Likewise. * ldfile.c: Replace buystring with xstrdup. * ldlang.c: Likewise. * ldlex.l: Likewise. * ldmain.c: Likewise. * ldmisc.c: Likewise. * lexsup.c: Likewise. * mpw-eppcmac.c: Likewise.
2001-04-28Give emulation a chance to process unrecognized file before fatal error isNick Clifton1-6/+5
reported, not after.
2001-04-13bfd/Jakub Jelinek1-0/+14
* libbfd-in.h (_bfd_merge_section): New. (_bfd_write_merged_section): New. (_bfd_merged_section_offset): New. * libbfd.h: Rebuilt. * linker.c (_bfd_generic_link_output_symbols): Handle discard_sec_merge. * aoutx.h (aout_link_write_symbols): Likewise. * pdp11.c (aout_link_write_symbols): Likewise. * elflink.h (elf_link_add_object_symbols): Call _bfd_merge_section. (elf_bfd_final_link): Adjust global symbols pointing into SEC_MERGE sections. (elf_link_sec_merge_syms): New. (elf_link_input_bfd): Call _bfd_merged_section_offset and _bfd_write_merged_section. Handle discard_sec_merge. * elf-bfd.h (struct elf_link_hash_table): Add merge_info field. (struct bfd_elf_section_data): Likewise. * elf.c (_bfd_elf_make_section_from_shdr): Set SEC_MERGE and SEC_STRINGS section flags and entsize from their ELF counterparts. (_bfd_elf_link_hash_table_init): Initialize merge_info. (elf_fake_sections): Set SHF_MERGE, SHF_STRINGS and sh_entsize from their BFD counterparts. * merge.c: New file. * Makefile.am: Add strtab.lo. * Makefile.in: Rebuilt. include/ * bfdlink.h (bfd_link_discard): Add discard_sec_merge. gas/ * config/obj-elf.c (obj_elf_change_section): Add entsize argument, handle SHF_MERGE and SHF_STRINGS. (obj_elf_parse_section_letters): Set SHF_MERGE and SHF_STRINGS. (obj_elf_section): Allow additional argument specifying entity size. * write.c (adjust_reloc_syms): Keep relocations against local symbols in SEC_MERGE sections. ld/ * ldmain.c (main): Default to discard_sec_merge. * lexsup.c (OPTION_DISCARD_NONE): Define. (ld_options): Add --discard-none. (parse_args): Handle OPTION_DISCARD_NONE. * ldlang.c (wild_doit): SEC_MERGE should be set in the output section only if SEC_MERGE and SEC_STRINGS flags and entsize of all its input sections match.
2001-03-13Fixtypos in ChangeLogs, fix copyright dates in filesNick Clifton1-2/+3
2001-02-27BFD: Catch & report unhandled PE section flags.Nick Clifton1-1/+57
LD: Catch BFD errors whilst loading symbols and do not produce an executable.
2001-01-25(lang_leave_overlay): Don't set lma_region when load_base is specified.Alan Modra1-2/+6
2001-01-23Only set lma_region from the default for the first sectionAlan Modra1-1/+4
of a group of overlay sections.
2001-01-162001-01-16 H.J. Lu <hjl@gnu.org>H.J. Lu1-1/+4
* ldlang.c (lang_check): Merge the private data only if the input file has contents.
2001-01-14Extend "ld --unique" functionality.Alan Modra1-18/+47
2000-12-13Revert the last beautification with "innocent" whitespace,Nick Clifton1-1/+2
it breaks the K&R C preprocessor.
2000-11-30Add support for x86_64-*-linux-gnu* targetNick Clifton1-8/+6
2000-10-12Another try at correcting relocations against discardedAlan Modra1-2/+1
link-once section symbols.
2000-10-092000-10-09 Kazu Hirata <kazu@hxi.com>Kazu Hirata1-4/+3
* ldcref.c: Fix formatting. * ldctor.h: Likewise. * ldemul.c: Likewise. * ldemul.h: Likewise. * ldexp.c: Likewise. * ldexp.h: Likewise. * ldfile.c: Likewise. * ldfile.h: Likewise. * ld.h: Likewise. * ldlang.c: Likewise. * ldlang.h: Likewise. * ldmain.c: Likewise.
2000-10-052000-10-05 Kazu Hirata <kazu@hxi.com>Kazu Hirata1-272/+270
* ldlang.c: Fix formatting.
2000-09-292000-09-29 Kazu Hirata <kazu@hxi.com>Kazu Hirata1-18/+4
* ldcref.c: Fix formatting. * ldctor.c: Likewise. * ldemul.c: Likewise. * ldexp.c: Likewise. * ldfile.c: Likewise. * ldlang.c: Likewise.
2000-09-05A tidy of ld/ldlang.c, and add missing Makefile dependenciesAlan Modra1-165/+181
I should have added with the 2000-07-28 patch.
2000-08-25When choosing the target for a particular endianness, do nothing if the targetNick Clifton1-25/+30
is not supported.
2000-07-11Remove some forward declarations in ldemul.h and ldfile.h, andAlan Modra1-1/+1
re-arrange header include order. Fix shadowing warnings in ldlang.h Fix compile errors in mpw-elfmips.c
2000-06-20tic54x/ibmc54xdsp target for ld.Timothy Wall1-0/+7
2000-05-102000-05-10 H.J. Lu <hjl@gnu.org>H.J. Lu1-1/+3
* ldlang.c (open_input_bfds): Don't load the same file within a group again if the whole archive has been loaded already.
2000-04-25place_orphan optimisationsAlan Modra1-2/+3
2000-02-21This lot mainly cleans up `comparison between signed and unsigned' gccAlan Modra1-22/+22
warnings. One usused var, and a macro parenthesis fix too. Also check input sections are elf when doing gc in elflink.h.
2000-02-16Add LMA memory region functionality.Timothy Wall1-34/+89
2000-02-09These snippets were missed in the previous bytes vs octets patch toTimothy Wall1-2/+6
the linker.
2000-02-04Fix typo in ALIGN_N usage.Timothy Wall1-2/+2
2000-02-03Add octets vs bytes functionality to LD.Timothy Wall1-50/+83
2000-01-21fix typo in comment.Nick Clifton1-0/+1
2000-01-18Apply H.J.'s patch to fix NOLOAD section sizes and dot updatesNick Clifton1-3/+8
2000-01-05 * ld.h (wildcard_spec): Change exclude_name to exclude_name_list.Catherine Moore1-15/+25
(name_list): New. * ld.texinfo (EXCLUDE_FILE): Update documentation. * ldgram.y (wildcard_spec): Support a list of excluded_files. (exclude_name_list): New. ldlang.c (walk_wild_section): Support list of excluded files. (print_wild_statement): Likewise. (lang_add_wild): Likewise. * ldlang.h (lang_wild_statement_type): Likewise. * scripttempl/elf.sc (OTHER_EXCLUDE_FILES): Support.
1999-11-24Fix bug in previous deltaNick Clifton1-1/+1
1999-11-23Do not check sections without a LOAD attribute for overlapNick Clifton1-41/+44