Lines Matching defs:stub

1 /* BFD back-end for Intel 386 COFF files (DJGPP variant with a stub).
22 /* This file handles now also stubbed coff images. The stub is a small
26 The COFF image is loaded in memory without the stub attached, so
80 image into memory and then runs it. It is called 'stub'. */
87 /* Temporary location for stub read from input file. */
91 /* That's the function, which creates the stub. There are
92 different cases from where the stub is taken.
95 If it exists and points to a valid stub the stub is taken from
97 the stub is computed from the exe information at the start of that
100 If there was any error, the standard stub (compiled in this file)
104 a stub, like gcc does. */
110 if (coff_data (abfd)->stub == NULL)
112 char *stub;
120 /* If we read a stub from an input file, use that one. */
123 coff_data (abfd)->stub = bfd_alloc (abfd,
125 if (coff_data (abfd)->stub == NULL)
127 memcpy (coff_data (abfd)->stub, go32exe_temp_stub,
137 stub = getenv ("GO32STUB");
139 if (stub == NULL)
140 stub = getenv ("STUB");
141 if (stub == NULL)
143 if (stat (stub, &st) != 0)
146 f = open (stub, O_RDONLY | O_BINARY);
148 f = open (stub, O_RDONLY);
162 /* Compute the size of the stub (it is every thing up
184 /* Now we found a correct stub (hopefully). */
185 coff_data (abfd)->stub = bfd_alloc (abfd, (bfd_size_type) coff_start);
186 if (coff_data (abfd)->stub == NULL)
192 if ((unsigned long) read (f, coff_data (abfd)->stub, coff_start)
195 bfd_release (abfd, coff_data (abfd)->stub);
196 coff_data (abfd)->stub = NULL;
204 stub. */
205 if (coff_data (abfd)->stub == NULL)
207 coff_data (abfd)->stub
209 if (coff_data (abfd)->stub == NULL)
211 memcpy (coff_data (abfd)->stub, go32exe_default_stub,
217 /* If ibfd was a stubbed coff image, copy the stub from that bfd
227 /* Make sure we have a source stub. */
228 BFD_ASSERT (coff_data (ibfd)->stub != NULL);
230 /* Reallocate the output stub if necessary. */
232 coff_data (obfd)->stub = bfd_alloc (obfd, coff_data (ibfd)->stub_size);
233 if (coff_data (obfd)->stub == NULL)
236 /* Now copy the stub. */
237 memcpy (coff_data (obfd)->stub, coff_data (ibfd)->stub,
257 /* Check that there is a GO32 stub and read it to go32exe_temp_stub.
279 /* Read in the stub file header, which is a DOS MZ executable. */
287 /* Determine the size of the stub */
294 /* Save now the stub to be used later. Put the stub data to a temporary
316 must be just a stub with no COFF data attached. */
331 /* Write the stub to the output file, then call coff_write_object_contents. */
343 /* Write the stub. */
347 if (bfd_bwrite (coff_data (abfd)->stub, stubsize, abfd) != stubsize)
372 if (coff_data (abfd)->stub == NULL)