aboutsummaryrefslogtreecommitdiff
path: root/ld/ldexp.c
AgeCommit message (Collapse)AuthorFilesLines
2004-05-11bfd/Jakub Jelinek1-2/+37
* 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-02-23 * ldlang.h (struct lang_output_section_state): Change processedNathan Sidwell1-57/+32
field's type. * ldexp.c (check, invalid): Remove. (fold_name): Move valid_p assignments. Create undefined symbol when needed. Directly exampine section's processd flag. * ldlang.c (lang_output_section_statement_lookup): Adjust processed field init. (lang_size_sections_1): Allow LOADADDR when determining section's VMA. Adjust error message. Fold data statement's expr. (lang_size_sections): Correctly increment lang_statement_iteration. * ld-scripts/provide.exp: New. * ld-scripts/provide-{1,2,3}.{s,t,d}.exp: New. * ldexp.c (fold_tree): Follow indirect symbols.
2004-02-20 * ldgram.y (exp): Add two operand ALIGN.Nathan Sidwell1-0/+4
* ldexp.c (fold_binary): Add ALIGN_K case. * ld.texinfo (ALIGN): Document two operand version. * ld-scripts/align.{s,t,exp}: New.
2004-01-03 * ldexp.c (align_n): Make static.Alan Modra1-2/+5
* ldexp.h (align_n): Delete declaration. * ldlang.h (lang_enter_output_section_statement): Remove block_value param. * ldlang.c (lang_enter_output_section_statement): Likewise. (TO_ADDR, TO_SIZE): Define. (opb): New var. (init_opb): New function. (print_input_section): Call init_opb and use TO_ADDR. (print_data_statement, print_reloc_statement): Likewise. (print_padding_statement): Likewise. (size_input_section): Use TO_SIZE and TO_ADDR, and global opb. (lang_check_section_addresses): Likewise. (lang_size_sections_1): Likewise. (lang_do_assignments_1): Likewise. (lang_set_startof): Likewise. (lang_one_common): Likewise. Combine power_of_two and opb alignment. (lang_process): Call init_opb. (lang_abs_symbol_at_end_of): Use TO_ADDR and global opb. (lang_enter_overlay_section): Adjust lang_enter_output_section_statement call. * ldgram.y: Likewise. * mri.c (mri_draw_tree): Likewise. * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Likewise. * emultempl/mmo.em (mmo_place_orphan): Likewise. * emultempl/pe.em (gld${EMULATION_NAME}_place_orphan): Likewise.
2003-10-11 * ld.texinfo (Builtin Functions) <DEFINED>: Say that only symbolsHans-Peter Nilsson1-2/+10
defined before the statement using DEFINED yield 1. * ldexp.c (fold_name) <case DEFINED>: In lang_first_phase_enum, call lang_track_definedness on symbol. In subsequent phases, use lang_symbol_definition_iteration and lang_statement_iteration to check whether the symbol was defined before the current statement. (exp_fold_tree) <case etree_assign et al>: Call lang_update_definedness before updating symbol type when setting symbol. * ldlang.c (lang_definedness_table): New variable. (lang_definedness_newfunc, lang_track_definedness) (lang_symbol_definition_iteration, lang_update_definedness): New functions. (lang_init): Initialize lang_definedness_table and lang_statement_iteration. (lang_finish): Destroy bfd_hash_table_free. (lang_size_sections): Increment lang_statement_iteration. (lang_do_assignments_1): New function with former lang_do_assignments contents. Change recursive calls to call this function. (lang_do_assignments): Evacuate contents. Increment lang_statement_iteration, then just call lang_do_assignments_1. * ldlang.h (struct lang_definedness_hash_entry) (lang_statement_iteration, lang_track_definedness) (lang_symbol_definition_iteration, lang_update_definedness): Declare.
2003-10-08 * ldexp.c (fold_name) <case DEFINED>: Set section of result toHans-Peter Nilsson1-1/+1
abs_output_section.
2003-06-28Convert to C90Alan Modra1-177/+93
2003-06-25Correct spelling of "relocatable".Alan Modra1-4/+4
2002-11-30s/boolean/bfd_boolean/ s/true/TRUE/ s/false/FALSE/. SimplifyAlan Modra1-32/+36
comparisons of bfd_boolean vars with TRUE/FALSE. Formatting.
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-09-25 * ldexp.c (fold_unary): New. Split out from exp_fold_tree.Alan Modra1-91/+132
(fold_binary): Correct abs - non-abs case. (fold_trinary): New. Split out from exp_fold_tree.
2002-09-02Add EXTERN references to __ctbpm __gp and __ep.Nick Clifton1-11/+13
Define TEMPLATE_NAME. Revert bogus change to ldexp.c
2002-09-02Fix PROVIDENick Clifton1-13/+11
2002-08-13 * emulparams/elf32_dlx.sh (TARGET_PAGE_SIZE): Set to 1.Alan Modra1-4/+15
(MAXPAGESIZE): Set to 1. * ld.h (ALIGN_N): Delete. * ldexp.h (align_n): Declare. * ldexp.c (align_n): New function. (fold_binary): Use align_n instead of ALIGN_N. (exp_fold_tree): Likewise. * ldlang.c (lang_size_sections_1): Likewise. (lang_one_common): Likewise.
2002-06-08 * ldexp.c: Replace CONST with const.Alan Modra1-3/+3
* ldfile.c: Likewise. * ldfile.h: Likewise. * ldlex.l: Likewise. * mri.c: Likewise. * pe-dll.h: Likewise.
2002-05-03 * ld.h: Fix formatting.Kazu Hirata1-2/+2
* ldexp.c: Likewise. * ldfile.c: Likewise. * ldlang.c: Likewise. * ldmain.c: Likewise. * lexsup.c: Likewise. * pe-dll.c: Likewise.
2002-04-30 * ldlang.c (print_assignment): Update print_dot for assignments to ".".Richard Sandiford1-20/+26
* ldexp.c (exp_print_token): Add "infix_p" argument. (exp_print_tree): Update accordingly.
2002-04-03 * ldexp.c (fold_binary) [DATA_SEGMENT_ALIGN]: If common page sizeJakub Jelinek1-1/+2
is smaller than maximum, round dot up to common page boundary.
2002-02-15 Support arbitrary length fill patterns.Alan Modra1-6/+84
* 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-12 * ldlex.l (DATA_SEGMENT_ALIGN, DATA_SEGMENT_END): New tokens.Jakub Jelinek1-1/+49
* 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.
2001-12-04 * ldexp.c (exp_print_token): Correct "table" entry for RSHIFT.Alan Modra1-1/+1
2001-07-19Use stderr if config.map_file is not available. Do not print NULL trees.Nick Clifton1-48/+52
2001-03-13Fixtypos in ChangeLogs, fix copyright dates in filesNick Clifton1-1/+2
2001-02-132001-02-13 H.J. Lu <hjl@gnu.org>H.J. Lu1-1/+5
* ldexp.h (node_type): Add etree_provided. * ldexp.c (exp_fold_tree): Handle etree_provided. Set the node type to etree_provided if defined by PROVIDE. Allow updating for etree_provided. (exp_print_tree): Handle etree_provided. * mpw-elfmips.c (gldelf32ebmip_find_exp_assignment): Handle etree_provided.
2000-10-092000-10-09 Kazu Hirata <kazu@hxi.com>Kazu Hirata1-2/+1
* 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-032000-10-03 Kazu Hirata <kazu@hxi.com>Kazu Hirata1-328/+338
* ldexp.c: Fix formatting.
2000-09-292000-09-29 Kazu Hirata <kazu@hxi.com>Kazu Hirata1-27/+18
* ldcref.c: Fix formatting. * ldctor.c: Likewise. * ldemul.c: Likewise. * ldexp.c: Likewise. * ldfile.c: Likewise. * ldlang.c: Likewise.
2000-02-03Add octets vs bytes functionality to LD.Timothy Wall1-1/+2
1999-07-11 * Many files: Changes to avoid gcc warnings: Add ATTRIBUTE_UNUSEDIan Lance Taylor1-3/+4
as appropriate. Fill in structure initializations.
1999-05-0319990502 sourceware importbinu_ss_19990502Richard Henderson1-0/+985