aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlex.l
AgeCommit message (Collapse)AuthorFilesLines
2005-01-21 * ldgram.y (AS_NEEDED): New token.Jakub Jelinek1-1/+2
(input_list): Handle AS_NEEDED ( input_list ). * ldlex.l (AS_NEEDED): Add. * ld.texinfo: Document AS_NEEDED (). * NEWS: Mention AS_NEEDED ().
2004-11-19Add ORIGIN and LENGTH linker script operators.Nick Clifton1-48/+48
2004-10-26 * Makefile.in (earmsymbian.c): Depend on armbpabi.sc, not elf.sc.Mark Mitchell1-0/+1
* ldexp.h (segment_type): New type. (segments): New variable. * ldexp.c (segments): New variable. (exp_print_token): Handle SEGMENT_START. (fold_binary): Likewise. * ldgram.y (SEGMENT_START): Declare it as a token. (exp): Handle SEGMENT_START. * ldlang.h (lang_address_statement_type): Add segment field. (lang_section_start): Change prototype. * ldlang.c (map_input_to_output_sections): Do not process section assignments if a corresponding SEGMENT_START has already been seen. (lang_section_start): Add segment parameter. * ldlex.l (SEGMENT_START): Add it. * lexsup.c (seg_segment_start): New function. (parse_args): Use it for -Tbss, -Tdata, and -Ttext. * ld.texinfo (SEGMENT_START): Document it. * emulparams/armsymbian.sh (EMBEDDED): Set it. * scripttempl/armbpabi.sc: Use SEGMENT_START to control segment base addresses. Do not map relocations. * NEWS: Mention SEGMENT_START.
2004-10-04ld/H.J. Lu1-1/+3
2004-10-04 H.J. Lu <hongjiu.lu@intel.com> * NEWS: Mention SORT_BY_NAME, SORT_BY_ALIGNMENT and --sort-section name|alignment. * ld.texinfo: Document SORT_BY_NAME, SORT_BY_ALIGNMENT and --sort-section name|alignment. * ld.h (sort_type): New enum. (wildcard_spec): Change the type of `sorted' to sort_type. * ldgram.y (SORT): Removed. (SORT_BY_NAME): Added. (SORT_BY_ALIGNMENT): Added. (wildcard_spec): Updated `sorted'. Handle SORT_BY_NAME and SORT_BY_ALIGNMENT. (input_section_spec_no_keep): Updated `sorted'. (statement): Replace SORT with SORT_BY_NAME. * ldlang.c (compare_section): New function to compare 2 sections with different sorting schemes. (wild_sort): Updated. Use compare_section. (update_wild_statements): New function. (lang_process): Call update_wild_statements before map_input_to_output_sections. * ldlex.l (SORT_BY_NAME): New. (SORT_BY_ALIGNMENT): New. (SORT): Return SORT_BY_NAME. * ldmain.c (sort_section): New. Defined. (main): Initialize it to none. * lexsup.c (option_values): Add OPTION_SORT_SECTION. (ld_options): Add an entry for OPTION_SORT_SECTION. (parse_args): Handle OPTION_SORT_SECTION. * mri.c (mri_draw_tree): Updated `sorted'. ld/testsuite/ 2004-10-04 H.J. Lu <hongjiu.lu@intel.com> * ld-scripts/sort.exp: New file for section sorting tests. * ld-scripts/sort_b_a.d: Likewise * ld-scripts/sort_b_a.s: Likewise * ld-scripts/sort_b_a.t: Likewise * ld-scripts/sort_b_a_a-1.d: Likewise * ld-scripts/sort_b_a_a-2.d: Likewise * ld-scripts/sort_b_a_a-3.d: Likewise * ld-scripts/sort_b_a_a.t: Likewise * ld-scripts/sort_b_a_n-1.d: Likewise * ld-scripts/sort_b_a_n-2.d: Likewise * ld-scripts/sort_b_a_n-3.d: Likewise * ld-scripts/sort_b_a_n.t: Likewise * ld-scripts/sort_b_n.d: Likewise * ld-scripts/sort_b_n.s: Likewise * ld-scripts/sort_b_n.t: Likewise * ld-scripts/sort_b_n_a-1.d: Likewise * ld-scripts/sort_b_n_a-2.d: Likewise * ld-scripts/sort_b_n_a-3.d: Likewise * ld-scripts/sort_b_n_a.t: Likewise * ld-scripts/sort_b_n_n-1.d: Likewise * ld-scripts/sort_b_n_n-2.d: Likewise * ld-scripts/sort_b_n_n-3.d: Likewise * ld-scripts/sort_b_n_n.t: Likewise * ld-scripts/sort_n_a-a.s: Likewise * ld-scripts/sort_n_a-b.s: Likewise * ld-scripts/sort_no-1.d: Likewise * ld-scripts/sort_no-2.d: Likewise * ld-scripts/sort_no.t: Likewise
2004-05-19 * ldgram.y (sect_constraint): New.Jakub Jelinek1-0/+2
(ONLY_IF_RO, ONLY_IF_RW): New tokens. (section): Add sect_constraint. Pass additional argument to lang_enter_output_section_statement. * mri.c (mri_draw_tree): Pass additional argument to lang_enter_output_section_statement. * emultempl/pe.em (place_orphan): Likewise. (output_prev_sec_find): Disregard output section statements with constraint == -1. * emultempl/mmo.em (output_prev_sec_find): Likewise. (mmo_place_orphan): Pass additional argument to lang_enter_output_section_statement. * emultempl/elf32.em (output_prev_sec_find): Disregard output section statements with constraint == -1. (place_orphan): Pass additional argument to lang_enter_output_section_statement. * ldlang.c (lang_enter_overlay_section): Likewise. (lang_output_section_find_1): New. (lang_output_section_find): Use it. (lang_output_section_statement_lookup_1): New. (lang_output_section_statement_lookup): Use it. (check_section_callback, check_input_sections): New. (map_input_to_output_sections): Check if all input sections are readonly if ONLY_IF_RO or ONLY_IF_RW was seen. (strip_excluded_output_sections): Disregard output section statements with constraint == -1. (lang_record_phdrs): Likewise. (lang_enter_output_section_statement): Add constraint argument. Use lang_output_section_statement_lookup_1. * ldlang.h (lang_output_section_statement_type): Add constraint and all_input_readonly fields. (lang_enter_output_section_statement): Adjust prototype. * ldlex.l (ONLY_IF_RO, ONLY_IF_RW): New tokens. * scripttempl/elf.sc (.eh_frame, .gcc_except_table): Move into text segment if all input sections are readonly.
2004-05-11bfd/Jakub Jelinek1-0/+1
* elflink.c (elf_bfd_final_link): Don't output STT_SECTION symbol into .dynsym if elf_section_data (sec)->dynindx <= 0. Adjust counting of last_local. (_bfd_elf_link_renumber_dynsyms): Don't assign dynindx to sections other than SHT_PROGBITS/SHT_NOBITS and neither for .got/.got.plt/.plt created by the linker nor !SHF_ALLOC. * elf32-i386.c (elf_i386_finish_dynamic_sections): Point DT_PLTGOT to the start of the .got.plt section instead of the .got output section. Set sh_entsize for .got section in addition to .got.plt. (elf_i386_relocate_section): Don't assume _GLOBAL_OFFSET_TABLE_ is at sgot->output_section->vma. * elf64-x86-64.c (elf64_x86_64_finish_dynamic_sections): Point DT_PLTGOT to the start of the .got.plt section instead of the .got output section. (elf64_x86_64_relocate_section): Don't assume _GLOBAL_OFFSET_TABLE_ is at sgot->output_section->vma. Set sh_entsize for .got section in addition to .got.plt. * elf.c (_bfd_elf_print_private_bfd_data): Handle PT_GNU_RELRO. (bfd_section_from_phdr): Likewise. (map_sections_to_segments): Likewise. (assign_file_positions_for_segments): Likewise. (get_program_header_size): Likewise. * elflink.c (bfd_elf_size_dynamic_sections): Set elf_tdata (output_bfd)->relro from info->relro. * elf-bfd.h (struct elf_obj_tdata): Add relro field. include/ * bfdlink.h (struct bfd_link_info): Add relro, relro_start and relro_end fields. * elf/common.h (PT_GNU_EH_FRAME, PT_GNU_STACK): Add comments. (PT_GNU_RELRO): Define. binutils/ * readelf.c (get_segment_type): Handle PT_GNU_RELRO. ld/ * genscripts.sh: Generate -z combreloc -z now -z relro scripts for binaries, -shared and -pie. * emulparams/elf_i386.sh (SEPARATE_GOTPLT): Set. * emulparams/elf_x86_64.sh (SEPARATE_GOTPLT): Set. * emulparams/elf32ppc.sh (OTHER_READWRITE_SECTIONS): Rename to... (OTHER_RELRO_SECTIONS): ... this. * ldlex.l (DATA_SEGMENT_RELRO_END): Add. * emultempl/elf32.em (gld${EMULATION_NAME}_handle_option): Handle -z relro and -z norelro. (gld${EMULATION_NAME}_list_options): Add it to usage. (gld${EMULATION_NAME}_get_script): Return -z combreloc -z now -z relro scripts when appropriate. * scripttempl/elf.sc: Unset SEPARATE_GOTPLT if RELRO_NOW is set. Create separate .got.plt section if SEPARATE_GOTPLT. Move sections which are only written during relocation handling to the beginning of RW segment. If NO_SMALL_DATA, move .got before .data. Add DATA_SEGMENT_RELRO_END directive. Include OTHER_RELRO_SECTIONS. * ldgram.y (DATA_SEGMENT_RELRO_END): Add. * ldexp.c (exp_print_token): Handle DATA_SEGMENT_RELRO_END. (fold_unary): Likewise. (fold_binary): Handle -z relro. * ldexp.h (struct exp_data_seg): Add exp_dataseg_relro_seen and exp_dataseg_relro_adjust phases. Add relro_end field. * ldmain.c (main): Initialize link_info.relro to FALSE. * ldlang.c (lang_size_sections): Handle -z relro. ld/testsuite/ * ld-i386/tlspic.rd: Adjust for section reordering changes and removal of unneeded STT_SECTION symbols from .dynsym. * ld-i386/tlspic.dd: Likewise. * ld-i386/tlspic.sd: Likewise. * ld-i386/tlsbin.rd: Likewise. * ld-i386/tlsbinpic.s: Likewise. * ld-i386/tlsbin.dd: Likewise. * ld-i386/tlsbin.sd: Likewise. * ld-i386/tlsnopic.rd: Likewise. * ld-i386/tlsnopic1.s: Likewise. * ld-i386/combreloc.d: Likewise. * ld-i386/tlsnopic.dd: Likewise. * ld-i386/tlsnopic.sd: Likewise. * ld-x86-64/tlspic.rd: Likewise. * ld-x86-64/tlspic.dd: Likewise. * ld-x86-64/tlsbin.dd: Likewise. * ld-x86-64/tlspic.sd: Likewise. * ld-x86-64/tlsbin.sd: Likewise. * ld-x86-64/tlspic.td: Likewise. * ld-x86-64/tlsbin.td: Likewise. * ld-x86-64/tlsbin.rd: Likewise. * ld-s390/tlspic1.s: Likewise. * ld-s390/tlsbinpic.s: Likewise. * ld-s390/tlspic.rd: Likewise. * ld-s390/tlsbin.rd: Likewise. * ld-s390/tlspic.dd: Likewise. * ld-s390/tlsbin.dd: Likewise. * ld-s390/tlsbin.sd: Likewise. * ld-s390/tlsbin.td: Likewise. * ld-s390/tlspic.sd: Likewise. * ld-s390/tlspic.td: Likewise. * ld-s390/tlspic1_64.s: Likewise. * ld-s390/tlsbinpic_64.s: Likewise. * ld-s390/tlspic_64.rd: Likewise. * ld-s390/tlsbin_64.rd: Likewise. * ld-s390/tlspic_64.dd: Likewise. * ld-s390/tlsbin_64.dd: Likewise. * ld-s390/tlspic_64.sd: Likewise. * ld-s390/tlspic_64.td: Likewise. * ld-s390/tlsbin_64.td: Likewise. * ld-s390/tlsbin_64.sd: Likewise. * ld-powerpc/tlsexe32.r: Likewise. * ld-powerpc/tlsso32.r: Likewise. * ld-powerpc/tlsso32.d: Likewise. * ld-powerpc/tlsso32.g: Likewise. * ld-powerpc/tlsso32.t: Likewise. * ld-powerpc/tlsexe.r: Likewise. * ld-powerpc/tlsso.r: Likewise. * ld-powerpc/tlsso.g: Likewise. * ld-powerpc/tlsexetoc.r: Likewise. * ld-powerpc/tlstocso.r: Likewise. * ld-powerpc/tlstocso.g: Likewise. * ld-ia64/tlspic.rd: Likewise. * ld-ia64/tlspic.dd: Likewise. * ld-ia64/tlspic.sd: Likewise. * ld-ia64/tlspic.td: Likewise. * ld-ia64/tlsbin.rd: Likewise. * ld-ia64/tlsbin.sd: Likewise. * ld-ia64/tlsbin.td: Likewise. * ld-elfvsb/elfvsb.exp: XFAIL non-PIC load offset tests on s390x. * ld-shared/shared.exp: Likewise.
2004-03-30 Remove long-obsolete MPW support.Stan Shebs1-5/+0
* mpw-config.in, mpw-make.sed, mac-ld.r: Remove files. * Makefile.am (mpw): Remove file-presynthesizing actions. * Makefile.in: Likewise. * ldfile.c (slash): Remove MPW case. * ldlex.l [MPW]: Remove unused definition.
2003-10-24bfd/H.J. Lu1-1/+1
2003-10-24 H.J. Lu <hongjiu.lu@intel.com> * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Look up hash table for real symbols. include/ 2003-10-24 H.J. Lu <hongjiu.lu@intel.com> * bfdlink.h (bfd_elf_version_expr): Add "symbol" and remove "wildcard". ld/ 2003-10-24 H.J. Lu <hongjiu.lu@intel.com> * ldlang.c (lang_vers_match): Check "symbol" instead of "wildcard" and "pattern". Fix a typo. (lang_finalize_version_expr_head): Likewise. (lang_register_vers_node): Likewise. (realsymbol): New function. (lang_new_vers_pattern): Set "symbol" and remove "wildcard". * ldlex.l (V_IDENTIFIER): Allow '\\'.
2003-07-27 * ld.texinfo: Typo fixes. Document SUBALIGN.Alan Modra1-0/+1
* ldgram.y (opt_subalign): Add. * ldlex.l (SUBALIGN): Recognize. * ldlang.c (overlay_subalign): New var. (lang_enter_overlay): Add subalign param. (lang_enter_overlay_section): Pass overlay_subalign to lang_enter_output_section_statement. * ldlang.h (lang_enter_overlay): Update.
2003-06-28Convert to C90Alan Modra1-74/+61
2003-05-05 * ldlex.l: Accept C style comments in version scripts.Alan Modra1-1/+1
2003-04-152003-04-15 H.J. Lu <hjl@gnu.org>H.J. Lu1-1/+1
From Debian by Jack Howarth <howarth@nitro.med.uc.edu>: * ldlex.l: Use YY_CURRENT_BUFFER instead of yy_current_buffer.
2002-10-30 * emultempl/aix.em: Use include <> for generated headers.Daniel Jacobowitz1-1/+1
* emultempl/beos.em: Likewise. * emultempl/elf32.em: Likewise. * emultempl/pe.em: Likewise. * ldctor.c: Likewise. * ldexp.c: Likewise. * ldfile.c: Likewise. * ldlang.c: Likewise. * ldlex.c: Likewise. * ldlex.l: Likewise. * ldmain.c: Likewise. * ldmisc.c: Likewise. * ldwrite.c: Likewise. * lexsup.c: Likewise. * mri.c: Likewise. * pe-dll.c: Likewise.
2002-07-01 * ldlang.h (entry_sym): Make it a struct bfd_sym_chain.Alan Modra1-0/+1
* ldlang.c (entry_sym): Likewise. (ldlang_undef_chain_list_type): Likewise. (lang_finish): Adjust references to entry_symbol. (lang_add_entry): Likewise. (lang_gc_sections): Use link_info.gc_sym_list. (lang_process): Set link_info.gc_sym_list. * ldlex.l: Include bfdlink.h. * ldmain.c (main): Init link_info.gc_sym_list. * emultempl/aix.em: Adjust references to entry_symbol. * emultempl/armcoff.em: Likewise. * emultempl/armelf.em: Likewise. * emultempl/pe.em: Likewise. * emultempl/ppc64elf.em (ppc_after_open): New function. (LDEMUL_AFTER_OPEN): Define. * emulparams/elf64ppc.sh: KEEP .opd sections.
2002-06-08 * ldexp.c: Replace CONST with const.Alan Modra1-2/+2
* ldfile.c: Likewise. * ldfile.h: Likewise. * ldlex.l: Likewise. * mri.c: Likewise. * pe-dll.h: Likewise.
2002-05-25 * ldlex.l: Use #include "" instead of <> for local header files.Alan Modra1-1/+1
2002-02-15 Support arbitrary length fill patterns.Alan Modra1-7/+24
* ldexp.h (etree_value_type): Add "str" field. (union etree_union): Add "str" to "value" struct. (exp_bigintop): Declare. (exp_get_fill): Declare. * ldexp.c: Include "safe-ctype.h". (exp_intop): Set value.str to NULL. (exp_bigintop): New function. (new_rel): Pass in "str", and set new.str from it. (new_rel_from_section): Set new.str to NULL. (fold_name): Adjust calls to new_rel. (exp_fold_tree): Likewise. (exp_get_fill): New function. * ldgram.y (struct big_int bigint, fill_type *fill): New. (INT): Returns a "bigint". Adjust all code handling INTs. (fill_opt): Returns a "fill". (fill_exp): Split out of fill_opt, use for FILL. * ldlang.h (struct _fill_type): New. (fill_type): Move typedef to ldexp.h. (lang_output_section_statement_type): "fill" is now a pointer. (lang_fill_statement_type): Likewise. (lang_padding_statement_type): Likewise. (lang_add_fill): Now takes a "fill_type *" param. (lang_leave_output_section_statement): Likewise. (lang_do_assignments): Likewise. (lang_size_sections): Likewise. (lang_leave_overlay_section): Likewise. (lang_leave_overlay): Likewise. * ldlang.c: Include ldgram.h after ldexp.h. (lang_output_section_statement_lookup): Adjust for fill_type change. (print_fill_statement): Likewise. (print_padding_statement): Likewise. (insert_pad): Now takes a "fill_type *" arg. (size_input_section): Likewise. (lang_size_sections_1): Likewise. (lang_size_sections): Likewise. (lang_do_assignments): Likewise. (lang_add_fill): Likewise. (lang_leave_output_section_statement): Likewise. (lang_leave_overlay_section): Likewise. (lang_leave_overlay): Likewise. Adjust all callers of the above function. * ldlex.l: Include ldgram.h after ldexp.h. Allow hex numbers starting with "0X" as well as "0x". Return bigint.str for hex numbers starting with "0x" or "0X", zero bigint.str otherwise. Always use base 16 for numbers starting with "$". * ldmain.c: Include ldgram.h after ldexp.h. * ldwrite.c (build_link_order): Use bfd_data_link_order in place of bfd_fill_link_order. * pe-dll.c: Adjust lang_do_assignments calls. * emultempl/elf32.em: Likewise. * emultempl/hppaelf.em: Likewise. * emultempl/ppc64elf.em: Likewise. * emultempl/beos.em: Include ldgram.h after ldexp.h, adjust lang_add_assignment call. * emultempl/pe.em: Likewise.
2002-02-14 * ld.texinfo (VERSION scripts): Symbol names are globbing patterns.Alan Modra1-1/+1
* ldgram.y (lang_new_vers_regex): Rename to lang_new_vers_pattern; the pattern in question is not a regexp. * ldlang.c: Likewise. * ldlang.h: Likewise. * ldlex.l (V_IDENTIFIER): Allow '[', ']', '-', '!', and '^' also.
2002-02-12 * ldlex.l (DATA_SEGMENT_ALIGN, DATA_SEGMENT_END): New tokens.Jakub Jelinek1-0/+2
* ldgram.y (DATA_SEGMENT_ALIGN, DATA_SEGMENT_END): New tokens. (exp): Add DATA_SEGMENT_ALIGN (exp, exp) and DATA_SEGMENT_END (exp). * ldexp.c (exp_data_seg): New variable. (exp_print_token): Handle DATA_SEGMENT_ALIGN and DATA_SEGMENT_END. (fold_binary): Handle DATA_SEGMENT_ALIGN. (exp_fold_tree): Handle DATA_SEGMENT_END. Pass allocation_done when recursing instead of hardcoding lang_allocating_phase_enum. * ldexp.h (exp_data_seg): New. * ldlang.c (lang_size_sections_1): Renamed from lang_size_sections. (lang_size_sections): New. * ld.texinfo (DATA_SEGMENT_ALIGN, DATA_SEGMENT_END): Document. * scripttempl/elf.sc: Use DATA_SEGMENT_ALIGN and DATA_SEGMENT_END if COMMONPAGESIZE is defined. * emulparams/elf_i386.sh (COMMONPAGESIZE): Set to 4K. * emulparams/elf32_sparc.sh (COMMONPAGESIZE): Set to 8K. * emulparams/elf64_sparc.sh (COMMONPAGESIZE): Set to 8K. * emulparams/elf64alpha.sh (COMMONPAGESIZE): Set to 8K. * emulparams/elf64_ia64.sh (COMMONPAGESIZE): Set to 16K for shared libraries only.
2002-01-25 * ldlex.l (yy_input): Correct error check.Andreas Jaeger1-1/+1
2002-01-21 * ldlex.l: Use fread instead of read.Andreas Jaeger1-3/+3
2001-10-20 * ldgram.y (mri_script_command): Surround processing of INCLUDEAlan Modra1-7/+6
with ldlex_script, ldlex_popstate. (ifile_p1): Likewise. * ldlex.l (EOF): Don't BEGIN(SCRIPT). Restore lineno from the correct slot. (lex_push_file): Save current lineno to lineno_stack. Set lineno to 1. Don't BEGIN(SCRIPT). (lex_redirect): Similarly. * ldmain.c (main): Set yydebug non-zero if YYDEBUG.
2001-09-29From John Reiser <jreiser@BitWagon.com>Alan Modra1-0/+1
* 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-19Locale changes from Bruno Haible <haible@clisp.cons.org>.H.J. Lu1-3/+3
2001-05-022001-05-02 H.J. Lu <hjl@gnu.org>H.J. Lu1-8/+9
* 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-03-13Fixtypos in ChangeLogs, fix copyright dates in filesNick Clifton1-1/+1
2000-11-05* ldlex.l (yy_create_string_buffer): Init all structure fields.Alan Modra1-0/+5
* Makefile.am (DISTCLEANFILES): Add stringify.sed. Move 2000-11-02 Makefile.in changes to this file.
2000-06-052000-06-05 Michael Matz <matz@ifh.de>H.J. Lu1-1/+1
* ldgram.y (vers_defns): Handle 'extern "C++" { ... }' in version scripts. * ldlex.l (V_IDENTIFIER): Accept `::' in symbols.
1999-05-0319990502 sourceware importbinu_ss_19990502Richard Henderson1-0/+662