Lines Matching defs:to

1 /* dlltool.c -- tool to generate stuff for PE style DLLs
17 along with this program; if not, write to the Free Software
22 /* This program allows you to build the files necessary to create
23 DLLs to run on a system which understands PE format image files.
32 which the runtime loader needs to tie up references from a
44 The result is going to be <name>.EXE
47 The result is going to be <name>.DLL
60 is <integer> is to be imported from the file <module-name>. If
62 function will be refereed to in the body of the DLL.
81 file to this program is equivalent to a EXPORTS <name>
90 The .exp.s file contains the information necessary to export
92 necessary to use the DLL's routines from a referencing program.
154 # (you don't have to, you could name all the object
162 # (You may have to use -S to tell dlltool where to find the assembler).
201 subsections used to keep the pieces for each dll together: .idata$[234567].
207 DWORD Import Lookup Table; - pointer to .idata$4
210 DWORD Name; - pointer to dll's name
211 PIMAGE_THUNK_DATA FirstThunk; - pointer to .idata$5
216 = array of array of pointers to hint name table.
221 = array of array of pointers to hint name table.
224 Initially, this table is identical to the Import Lookup Table. However,
324 encountered, it is broken up into its component parts and passed to
325 def_import. IMPORT_LIST is initialized to NULL in function main. */
359 /* Types used to implement a linked list of dllnames associated
375 /* Types used to pass data to iterator functions. */
413 /* Default symbols to exclude when exporting all the symbols. */
416 /* TRUE if we should add __imp_<SYMBOL> to import libraries for backward
417 compatibility to old Cygwin releases. */
420 /* TRUE if we have to write PE+ import libraries. */
572 to restore the toc saved by the third instruction in
1037 static dlist_type *a_list; /* Stuff to go in directives. */
1180 /* append_import simply adds the given import definition to the global
1222 declaration, the module name may or may not need ".dll" to be
1223 appended to it, the name of the function may be stored in internal
1228 In defparse.y we have to accept import declarations which follow
1236 passed to def_import() in the "module" parameter, but when it ends
1238 to be reappended.
1386 /* Look for a list of symbols to export in the .drectve section of
1387 ABFD. Pass each one to def_exports. */
1478 /* Look through the symbols in MINISYMS, and add each one to list of
1479 symbols to export. */
1522 /* Add a list of symbols to exclude. */
1556 /* See if STRING is on the list of symbols to exclude. */
1569 /* Add the default list of symbols to exclude. */
1577 /* Choose which symbols to export. */
1582 bfd_byte *from, *fromend, *to;
1591 to = (bfd_byte *) minisyms;
1612 memcpy (to, from, size);
1613 to += size;
1617 return (to - (bfd_byte *) minisyms) / size;
1620 /* Export all symbols in ABFD, except for ones we were told not to
1632 and we don't want to reexport them from here. */
1654 /* Discard the symbols we don't want to export. It's OK to do this
1663 /* Look at the object file to decide which symbols to export. */
1673 /* FIXME: we ought to read in and block out the base relocations. */
1686 fatal (_("Unable to open object file: %s: %s"), filename, bfd_get_errmsg ());
1812 inform (_("Adding exports to output file"));
1864 inform (_("Added exports to output file"));
1868 for the idata sections. It appends the source code to the end of
2037 fatal (_("Unable to open temporary assembler file: %s"), TMP_ASM);
2053 fprintf (f, "\t%sname%s %s Ptr to name of dll\n", ASM_RVA_BEFORE, ASM_RVA_AFTER, ASM_C);
2177 /* Add to the output file a way of getting to the exported names
2218 fatal (_("failed to read the number of entries from base file"));
2347 /* Sections numbered to make the order the same as other PowerPC NT
2376 /* This is what we're trying to make. We generate the imp symbols with
2402 # Rather than a simple "jmp *", the code to get to the dll function
2527 /* On PowerPC, the function name points to a descriptor in
2529 pointer to the code (..function_name), and the second
2530 points to the .toc. */
2582 /* The symbol referring to the code (.text). */
2715 rva to idata$6. */
2826 /* So this pdata section setups up this as a glue linkage to
2828 we need to do:
2831 4, and 0x10 are set to point to the same place:
2834 The actual glue instruction to restore the toc on
2838 3. Lastly, the HandlerData field is set to 0x03, to indicate
2842 /* Alignment must be set to 2**2 or you get extra stuff. */
2893 We use relocs to build this. */
2968 fatal (_("failed to open temporary head file: %s"), TMP_HEAD_S);
2981 fprintf (f, "\t%shname%s\t%sPtr to image import by name list\n",
2993 fprintf (f, "\t%sfthunk%s\t%s pointer to firstthunk\n",
3032 fatal (_("failed to open temporary head file: %s: %s"),
3047 fatal (_("failed to open temporary head file: %s"), TMP_HEAD_S);
3118 fatal (_("failed to open temporary head file: %s: %s"),
3133 fatal (_("failed to open temporary tail file: %s"), TMP_TAIL_S);
3158 /* Normally, we need to see a null descriptor built in idata$3 to
3160 would be to mark this section as a comdat type 2 section, so
3162 comdat, that is) or cause it to be inserted by something else (say
3192 fatal (_("failed to open temporary tail file: %s: %s"),
3227 /* Work out a reasonable size of things to put onto one line. */
3244 /* Don't add PRIVATE entries to import lib. */
3321 /* Append a copy of data (cast to char *) to list. */
3340 /* Add to tail, and move tail. */
3367 /* Print each entry in list to stdout. */
3401 /* Recursive function to free all nodes entry->next->next...
3446 OBJ (where obj is cast to const char *). If found, set global variable
3448 responsibility to set the result variable FALSE before iterating with
3501 Once we know which section to search, evaluate each section for the
3504 of all sections which meet the criteria to a linked list of dll names.
3506 Finally, print them all to stdout. (If --identify-strict, an error is
3589 fatal (_("Unable to determine dll name for `%s' (not an import library?)"),
3594 /* Loop over all members of the archive, applying the supplied function to
3683 -- then add the contents of the section to obj->list. */
3705 /* MS import libs seem to distinguish the .idata$6 section
3720 /* Use a heuristic to determine if data is a dll name.
3721 Possible to defeat this if (a) the library has MANY
3725 also fail to record a valid dll name if the dllname uses
3729 the chosen section -- as opposed to the dll name -- begin
3753 /* Unset ordinals go to the bottom. */
3879 /* Now fill in ordinals where the user wants us to choose. */
3971 fprintf (file, _(" -a --add-indirect Add dll indirects to export file.\n"));
3972 fprintf (file, _(" -D --dllname <name> Name of input dll to put into interface lib.\n"));
3973 fprintf (file, _(" -d --input-def <deffile> Name of .def file to be read in.\n"));
3974 fprintf (file, _(" -z --output-def <deffile> Name of .def file to be created.\n"));
3975 fprintf (file, _(" --export-all-symbols Export all symbols to .def\n"));
3983 fprintf (file, _(" -U --add-underscore Add underscores to all symbols in interface library.\n"));
3984 fprintf (file, _(" --add-stdcall-underscore Add underscores to stdcall symbols in interface library.\n"));
3991 fprintf (file, _(" -f --as-flags <flags> Pass <flags> to the assembler.\n"));
3994 fprintf (file, _(" -t --temp-prefix <prefix> Use <prefix> to construct temp file names.\n"));
3996 fprintf (file, _(" --identify-strict Causes --identify to report error when multiple DLLs.\n"));
4004 fprintf (file, _(" -F --linker-flags <flags> Pass <flags> to the linker.\n"));
4007 fprintf (file, _("Report bugs to %s\n"), REPORT_BUGS_TO);
4150 fatal (_("Unable to open def-file: %s"), optarg);
4203 fatal (_("Unable to open base-file: %s"), optarg);
4273 to avoid exporting DLL entry point and Cygwin32 impure_ptr. */
4353 string running from PREFIX to END_PREFIX. If the concatenated
4398 /* Deduce the name of the program we are want to invoke.
4399 PROG_NAME is the basic name of the program we want to run,
4403 If argv[0] contains the full path, then try to find the program
4507 /* Step one. Run 'ld -r' on the input object files in order to resolve
4508 any internal references and to generate a single .exports section. */
4560 /* XXX - FIME: ought to check/copy other command line options as well. */
4565 /* Step four. Feed the .exp and object files to ld -shared to create the dll. */