#include "bfd.h"
#include "bfdlink.h"
#include "libiberty.h"
+#include "ctf-api.h"
#include "safe-ctype.h"
#include "filenames.h"
#include "demangle.h"
#include "ldlex.h"
#include "ldmain.h"
#include "ldfile.h"
-#include "elf-bfd.h"
-#include "coff-bfd.h"
/*
%% literal %
unsigned int linenumber;
bfd_boolean discard_last;
bfd_boolean done;
+ bfd_error_type last_bfd_error = bfd_get_error ();
abfd = args[arg_no].reladdr.abfd;
section = args[arg_no].reladdr.sec;
}
if (!done)
lfinfo (fp, "(%pA+0x%v)", section, offset);
+ bfd_set_error (last_bfd_error);
if (discard_last)
{
/* section name from a section */
asection *sec;
bfd *abfd;
- const char *group = NULL;
- struct coff_comdat_info *ci;
fmt++;
sec = (asection *) args[arg_no].p;
++arg_count;
- abfd = sec->owner;
fprintf (fp, "%s", sec->name);
- if (abfd != NULL
- && bfd_get_flavour (abfd) == bfd_target_elf_flavour
- && elf_next_in_group (sec) != NULL
- && (sec->flags & SEC_GROUP) == 0)
- group = elf_group_name (sec);
- else if (abfd != NULL
- && bfd_get_flavour (abfd) == bfd_target_coff_flavour
- && (ci = bfd_coff_get_comdat_section (sec->owner,
- sec)) != NULL)
- group = ci->name;
- if (group != NULL)
- fprintf (fp, "[%s]", group);
+ abfd = sec->owner;
+ if (abfd != NULL)
+ {
+ const char *group = bfd_group_name (abfd, sec);
+ if (group != NULL)
+ fprintf (fp, "[%s]", group);
+ }
}
else if (*fmt == 'B')
{