Commit Graph

41 Commits

Author SHA1 Message Date
Kazu Hirata 658957dba8 * ldemul.c: Fix formatting.
* ldfile.c: Likewise.
	* pe-dll.c: Likewise.
	* pe-dll.h: Likewise.
2002-05-25 20:39:25 +00:00
Christopher Faylor 70b0be7903 * pe-dll.c (autofilter_liblist): Add more system libs excluded by default.
(autofilter_objlist): Add crtbegin.o, crtend.o.
* emultempl/pe.em (OPTION_EXCLUDE_LIBS): Add new define.
(longopts): Add new option --exclude-libs.
(gld_${EMULATION_NAME}_list_options): Give quick help about it.
(gld_${EMULATION_NAME}_parse_args): Use it.
* pe-dll.h (pe_dll_add_excludes): Add second param to prototype.
* pe-dll.c (exclude_list_struct): Add field type to distinguish symbols from
whole archives.
(pe_dll_add_excludes): Set excludes->type.
(auto_export): Add new variable libname and set to archive basename if abfd.
Use it when filtering default and user-specified libarary excludes.  Let string
"ALL" mean all libs when filtering user-specified libs.
* ld.texinfo: Document --exclude-libs.
2002-05-22 18:03:09 +00:00
Kazu Hirata b7a26f91f4 * ld.h: Fix formatting.
* ldexp.c: Likewise.
	* ldfile.c: Likewise.
	* ldlang.c: Likewise.
	* ldmain.c: Likewise.
	* lexsup.c: Likewise.
	* pe-dll.c: Likewise.
2002-05-03 13:48:55 +00:00
Alan Modra 2c382fb6f5 Support arbitrary length fill patterns.
* 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-15 02:11:05 +00:00
DJ Delorie 59d28a9467 * pe-dll.c (autofilter_objectlist): Add gcrt0.o.
(auto-export): Fix indentation.
2001-10-19 14:25:51 +00:00
DJ Delorie 663dd37808 * pe-dll.c (autofilter_objectlist): Add startup objects
for profiling.
(auto-export): Constify char * p.
Extract file basename and use strcmp rather than ststr
for object lookup.
2001-10-19 00:00:55 +00:00
DJ Delorie 5b784096c9 * pe-dll.c (autofilter_entry_type autofilter_liblist: Add
startup files for mingw32 dlls to list.
2001-10-11 17:16:58 +00:00
Nick Clifton 85c774585e Fix thinko 2001-09-24 21:16:47 +00:00
Nick Clifton 9cc16c3a6b Remove spurious prototype. 2001-09-24 21:13:48 +00:00
Nick Clifton aa3d9aba51 oops - omitted from previous delta 2001-09-24 18:21:24 +00:00
Nick Clifton 72358f6568 Define and use pe_get_data_import_dll_name(). 2001-09-24 15:03:01 +00:00
H.J. Lu 3882b01078 Locale changes from Bruno Haible <haible@clisp.cons.org>. 2001-09-19 05:33:36 +00:00
Alan Modra db09f25b32 * deffilep.y (def_stash_module): Constify "name" param.
* pe-dll.c: Replace CONST with const throughout.
	(quick_symbol): Constify "n1", "n2", "n3" params.
	(make_singleton_name_thunk): Constify "import" param.  Make
	"buffer_len" a size_t.
	(make_import_fixup_entry): Constify "name", "fixup_name",
	"dll_symname" params.
	(pe_get16): Cast args of bfd_seek.  Replace bfd_read with bfd_bread.
	(pe_get32): Likewise.
	(pe_implied_import_dll): Likewise.

	* emultempl/beos.em (sort_by_file_name): Constify "ra", "rb".
	(sort_by_section_name): Likewise.

	* emultempl/pe.em: Move defines for arm_epoc_pe before bfd.h included.
	(make_import_fixup): Cast printf arg, rel->address to long rather
	than int.
	(gld_${EMULATION_NAME}_after_open): Don't compare NULL against int.
2001-09-18 10:10:21 +00:00
Nick Clifton 775cabad23 Fix memory leak 2001-09-14 14:19:05 +00:00
Charles Wilson 0d888aac30 2001-09-12 Paul Sokolovsky <Paul.Sokolovsky@technologist.com>
* emultempl/pe.em(make_import_fixup): change signature to
        take asection as well as arelec; we need this for proper
        error reporting.  Only call pe_create_import_fixup() if
        there is no attempt to add a constant addend to the reloc;
        otherwise, report error condition.
        * pe-dll.c(pe_walk_relocs_of_symbol): change signature,
        since final argument is a pointer to make_import_fixup().
        Change call to cb() to match make_import_fixup() signature.
        (make_import_fixup_mark): make buffer_len unsigned.
        * pe-dll.h: change signature of pe_walk_relocs_of_symbol.
2001-09-12  Charles Wilson  <cwilson@ece.gatech.edu>
        * ld.texinfo: add verbose documentation for auto-import
        direct-addressing workaround, to compliment the terse
        error message.
2001-09-12 15:58:10 +00:00
Andreas Jaeger 948f9114c9 * deffilep.y: Add missing prototypes.
* pe-dll.c: Likewise.
2001-08-21 11:42:57 +00:00
Alan Modra ae7fb08f1a * pe-dll.c (pe_dll_fill_sections): Correct type of "relax" param
passed to lang_size_sections.
	(pe_exe_fill_sections): Likewise.
	* emultempl/pe.em (output_prev_sec_find): Copied from elf32.em.
	(gld_${EMULATION_NAME}_place_orphan): Merge from elf32.em.
2001-08-20 00:22:41 +00:00
Charles Wilson b044cda1de 2001-08-02 Charles Wilson <cwilson@ece.gatech.edu>
* ldmain.c (main): initialize link_info.pei386_auto_import
        * pe-dll.c: new tables for auto-export filtering
        (auto_export): change API, pass abfd for contextual filtering.
        Loop thru tables of excluded symbols instead of comparing
        "by hand".
2001-08-02  Paul Sokolovsky  <paul.sokolovsky@technologist.com>
        * pe-dll.c: new variable pe_dll_enable_extra_debug. New
        static variable current_sec (static struct sec *). Add
        forward declaration for add_bfd_to_link.
        (process_def_file): Don't export undefined symbols. Do not
        export symbols starting with  "_imp__".  Call auto_export()
        with new API.
        (pe_walk_relocs_of_symbol): New function.
        (generate_reloc): add optional extra debugging
        (pe_dll_generate_def_file): eliminate extraneous initial blank
        line in output
        (make_one): enlarge symtab to make room for __nm__ symbols
        (DATA auto-import support).
        (make_singleton_name_thunk): New function.
        (make_import_fixup_mark): New function.
        (make_import_fixup_entry): New function.
        (pe_create_import_fixup): New function.
        (add_bfd_to_link): Specify that 'name' argument is a CONST
        char *.
        * pe-dll.h: declare new variable pe_dll_extra_pe_debug;
        declare new functions pe_walk_relocs_of_symbol and
        pe_create_import_fixup.
        * emultempl/pe.em: add new options --enable-auto-import,
        --disable-auto-import, and --enable-extra-pe-debug.
        (make_import_fixup): New function.
        (pe_find_data_imports): New function.
        (pr_sym): New function.
        (gld_${EMULATION_NAME}_after_open): Add optional extra pe
        debugging. Call pe_find_data_imports.  Mark .idata as DATA, not
        CODE.
2001-08-02  Charles Wilson  <cwilson@ece.gatech.edu>
        * ld.texinfo: add additional documentation for
        --export-all-symbols.  Document --out-implib,
        --enable-auto-image-base, --disable-auto-image-base,
        --dll-search-prefix, --enable-auto-import, and
        --disable-auto-import.
        * ldint.texinfo: Add detailed documentation on auto-import
        implementation.
2001-08-02 23:12:02 +00:00
Nick Clifton a2b64bede3 Fixtypos in ChangeLogs, fix copyright dates in files 2001-03-13 06:14:29 +00:00
DJ Delorie 23a87948dd * pe-dll.c (make_one): Do not generate code thunk for DATA
exports.
(process_def_file): deduce DATA flag for auto-export sumbols.
2000-10-10 03:28:01 +00:00
Kazu Hirata 7bfd51a382 2000-10-09 Kazu Hirata <kazu@hxi.com>
* pe-dll.c: Revert some formatting fixes.
2000-10-09 15:46:45 +00:00
Kazu Hirata 86b1cc60c0 2000-10-09 Kazu Hirata <kazu@hxi.com>
* pe-dll.c: Fix formatting.
2000-10-09 07:01:29 +00:00
Kazu Hirata d643799dab 2000-10-08 Kazu Hirata <kazu@hxi.com>
* pe-dll.c: Fix formatting.
2000-10-09 01:37:11 +00:00
DJ Delorie c2a94a7afd * pe-dll.c (fill_edata): initialize entire block
(make_one): fill in correct section.
2000-10-03 22:07:17 +00:00
DJ Delorie 486e80e2d5 * emultempl/pe.em (gld_*_after_open): detect case where there two
import libraries for same dll; rename one to ensure proper link
order.

* pe-dll.c (process_def_file): compare ordinals to -1, not 0; fix
typo
(generate_edata): fix typo
2000-10-02 14:39:46 +00:00
Kazu Hirata 5cc18311d9 2000-09-29 Kazu Hirata <kazu@hxi.com>
* deffile.h: Fix formatting.
	* ld.h: Likewise.
	* ldctor.h: Likewise.
	* ldemul.h: Likewise.
	* ldexp.h: Likewise.
	* ldfile.h: Likewise.
	* ldlang.h: Likewise.
	* lexsup.c: Likewise.
	* mri.c: Likewise.
	* pe-dll.c: Likewise.
2000-09-29 13:21:41 +00:00
DJ Delorie 45b1f63c8c * pe-dll.c (process_def_file): Uninitialized data wasn't
exported with --export-all-symbols switch.

* pe-dll.c (fill_edata): rearrange the data so that ordinals and
noname work properly.
2000-09-28 20:53:40 +00:00
DJ Delorie 9d68bc829c * pe-dll.c (pe_dll_id_target): check object target name also 2000-07-19 00:04:04 +00:00
DJ Delorie 874c8c99db * pe-dll.c (process_def_file): auto-export data items also
(pe_process_import_defs): also see if _imp_ form needed
2000-07-17 18:40:47 +00:00
DJ Delorie 5b4cf3f497 * pe-dll.c (make_one): fix a typo in the __imp_ name decoration
for dll import libraries
2000-07-13 00:51:40 +00:00
Alan Modra b71e277823 Remove some forward declarations in ldemul.h and ldfile.h, and
re-arrange header include order.
Fix shadowing warnings in ldlang.h
Fix compile errors in mpw-elfmips.c
2000-07-11 03:42:41 +00:00
Nick Clifton f0c87f889d Fix building with --enable-targets=all. 2000-03-01 20:54:37 +00:00
Nick Clifton 344a211f99 Add support for WinCE based toolchains. 2000-02-24 17:53:12 +00:00
Nick Clifton 870df5dcbc Applied Mumit Kha's patch to tweak dll production code. 2000-01-04 23:44:03 +00:00
Nick Clifton a6483292c2 Added year 2000 copyright notice 2000-01-04 23:33:29 +00:00
Nick Clifton 5aaace278d Apply patch from Mumit Khan to fix bugs generating dll names. 2000-01-04 23:30:51 +00:00
DJ Delorie 8a5b676cd2 * pe-dll.c (process_def_file): Move the offset lookup from here to
(fill_exported_offsets): here. New static function.
(fill_edata): Use.
1999-09-29 00:31:40 +00:00
DJ Delorie 7c9e78f8e4 * deffilep.y (tokens): Add upper and lower case versions of DATA,
CONSTANT, NONAME and PRIVATE tokens.
(command): Use DATAU.
(expline): Allow for drectve syntax as well.
(exp_opt_list): Likewise.
(exp_opt): Likewise.
* pe-dll.c (make_one): Only generate the idata entries for data
symbols.
1999-09-28 20:22:55 +00:00
Ian Lance Taylor 1069dd8da7 * pe-dll.h: New file.
* pe-dll.c: Include "pe-dll.h".  Mark unused arguments as needed
	to avoid warnings.
	(edata_sz, reloc_sz): Change from int to size_t.
	(pe_details_type): Change type of imagebase_reloc from int to
	unsigned int.
	(pe_detail_list): Fully initialize last entry.
	(pe_dll_id_target): Change parameter to const.
	(pe_dll_generate_def_file): Likewise.
	(pe_dll_generate_implib): Likewise.
	(pe_implied_import_dll): Likewise.  Change dll_name to const.
	* emultempl/pe.em: Include "pe-dll.h".  Remove declarations now in
	pe-dll.h.
	(init): Fully initialize __dll__ entry.
	(gld_${EMULATION_NAME}_after_open): Remove unused variables
	sequence, elt, and i.
	* deffile.h: Add preprocessor guard.
	* deffilep.y (def_debug): Remove.
	* Makefile.am: Rebuild dependencies.
	(HFILES): Add pe-dll.h.
1999-09-12 15:27:48 +00:00
DJ Delorie c6c37250e9 1999-05-10 DJ Delorie <dj@cygnus.com>
* scripttempl/pe.sc: Specify the output arch, which Ian says is
	the Right Thing to do.
	* emultempl/pe.em: various changes to parameterize the
	target-specific information.
	(gld_i386pe_after_open): Detect and fix MS import libraries
	by renaming the member objects (which are all named the same).
	* pe-dll.c: various changes to parameterize the target-specific
	information.
	(generate_reloc): support relocs more generically to allow for
	expansion.
	(pe_exe_build_sections): new; used to add .relocs to .exes
	(pe_exe_fill_sections): ditto
1999-05-11 21:06:50 +00:00
Richard Henderson 252b5132c7 19990502 sourceware import 1999-05-03 07:29:11 +00:00