#include "budbg.h"
#include <sys/stat.h>
+#include "elf/internal.h"
+#include "elf-bfd.h"
+
#ifdef HAVE_GOOD_UTIME_H
#include <utime.h>
#else /* ! HAVE_GOOD_UTIME_H */
static int strip_main PARAMS ((int, char **));
static int copy_main PARAMS ((int, char **));
-#define RETURN_NONFATAL(s) {bfd_nonfatal(s); status = 1; return;}
+#define RETURN_NONFATAL(s) {bfd_nonfatal (s); status = 1; return;}
static asymbol **isympp = NULL; /* Input symbols */
static asymbol **osympp = NULL; /* Output symbols that survive stripping */
if (verbose)
printf (_("copy from %s(%s) to %s(%s)\n"),
- bfd_get_filename(ibfd), bfd_get_target(ibfd),
- bfd_get_filename(obfd), bfd_get_target(obfd));
+ bfd_get_filename (ibfd), bfd_get_target (ibfd),
+ bfd_get_filename (obfd), bfd_get_target (obfd));
if (set_start_set)
start = set_start;
bfd_get_mach (ibfd)));
if (!bfd_set_format (obfd, bfd_get_format (ibfd)))
- RETURN_NONFATAL (bfd_get_filename(ibfd));
+ RETURN_NONFATAL (bfd_get_filename (ibfd));
if (isympp)
free (isympp);
+
if (osympp != isympp)
free (osympp);
- /* bfd mandates that all output sections be created and sizes set before
+ /* BFD mandates that all output sections be created and sizes set before
any output is done. Thus, we traverse all sections multiple times. */
bfd_map_over_sections (ibfd, setup_section, (void *) obfd);
{
non_fatal (_("Can't fill gap after %s: %s"),
bfd_get_section_name (obfd, osections[i]),
- bfd_errmsg (bfd_get_error()));
+ bfd_errmsg (bfd_get_error ()));
status = 1;
break;
}
now = 8192;
else
now = left;
+
if (! bfd_set_section_contents (obfd, osections[i], buf,
off, now))
RETURN_NONFATAL (bfd_get_filename (obfd));
while (!status && this_element != (bfd *) NULL)
{
/* Create an output file for this member. */
- char *output_name = concat (dir, "/", bfd_get_filename(this_element),
+ char *output_name = concat (dir, "/", bfd_get_filename (this_element),
(char *) NULL);
bfd *output_bfd = bfd_openw (output_name, output_target);
bfd *last_element;
return;
osection = bfd_make_section_anyway (obfd, bfd_section_name (ibfd, isection));
+
if (osection == NULL)
{
err = "making";
err = "size";
goto loser;
}
-
+
vma = bfd_section_vma (ibfd, isection);
if (p != NULL && p->change_vma == CHANGE_MODIFY)
vma += p->vma_val;
else if (p->change_lma == CHANGE_SET)
lma = p->lma_val;
else
- abort();
+ abort ();
}
else
lma += change_section_address;
switch (c)
{
case 'b':
- copy_byte = atoi(optarg);
+ copy_byte = atoi (optarg);
if (copy_byte < 0)
fatal (_("byte number must be non-negative"));
break;
case 'i':
- interleave = atoi(optarg);
+ interleave = atoi (optarg);
if (interleave < 1)
fatal (_("interleave must be positive"));
break;