This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: PATCH to ld fixes the MIPS ECOFF --embedded-relocs BFD check bug
- To: binutils at sourceware dot cygnus dot com
- Subject: Re: PATCH to ld fixes the MIPS ECOFF --embedded-relocs BFD check bug
- From: msokolov at ivan dot Harhan dot ORG (Michael Sokolov)
- Date: Wed, 7 Jun 00 20:10:42 CDT
Ian Lance Taylor <ian@zembu.com> wrote:
> Just check for bfd_target_ecoff_flavour here. Don't make assumptions
> about the target name.
Alan Modra <alan@linuxcare.com.au> wrote:
> if (bfd_get_flavour (abfd) == bfd_target_ecoff_flavour)
Alan, you reversed the sense of the condition! :-)
The revised patch is below.
--
Michael Sokolov Harhan Engineering Laboratory
Public Service Agent International Free Computing Task Force
International Engineering and Science Task Force
615 N GOOD LATIMER EXPY STE #4
DALLAS TX 75204-5852 USA
Phone: +1-214-824-7693 (Harhan Eng Lab office)
E-mail: msokolov@ivan.Harhan.ORG (ARPA TCP/SMTP) (UUCP coming soon)
2000-06-07 Michael Sokolov <msokolov@ivan.Harhan.ORG>
* emultempl/mipsecoff.em (gld{EMULATION_NAME}_after_open): Require all
input objects to be ECOFF.
(check_sections): einfo takes %B, not %P, to print a BFD name.
Index: emultempl/mipsecoff.em
===================================================================
RCS file: /cvs/src/src/ld/emultempl/mipsecoff.em,v
retrieving revision 1.4
diff -c -3 -p -r1.4 mipsecoff.em
*** mipsecoff.em 2000/02/29 05:53:53 1.4
--- mipsecoff.em 2000/06/08 01:06:32
*************** gld${EMULATION_NAME}_after_open ()
*** 69,74 ****
--- 69,79 ----
{
asection *datasec;
+ /* As first-order business, make sure that each input BFD is ECOFF. It
+ better be, as we are directly calling an ECOFF backend function. */
+ if (bfd_get_flavour (abfd) != bfd_target_ecoff_flavour)
+ einfo ("%F%B: all input objects must be ECOFF for --embedded-relocs\n");
+
datasec = bfd_get_section_by_name (abfd, ".sdata");
/* Note that we assume that the reloc_count field has already
*************** check_sections (abfd, sec, sdatasec)
*** 113,119 ****
if ((bfd_get_section_flags (abfd, sec) & SEC_CODE) == 0
&& sec != (asection *) sdatasec
&& sec->reloc_count != 0)
! einfo ("%P%X: section %s has relocs; can not use --embedded-relocs\n",
abfd, bfd_get_section_name (abfd, sec));
}
--- 118,124 ----
if ((bfd_get_section_flags (abfd, sec) & SEC_CODE) == 0
&& sec != (asection *) sdatasec
&& sec->reloc_count != 0)
! einfo ("%B%X: section %s has relocs; can not use --embedded-relocs\n",
abfd, bfd_get_section_name (abfd, sec));
}