This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
RE: Support MIPS elfoabi target
- From: "Fu, Chao-Ying" <fu at mips dot com>
- To: "Thiemo Seufer" <ths at networkno dot de>
- Cc: <binutils at sourceware dot org>, "Lau, David" <davidlau at mips dot com>
- Date: Thu, 8 May 2008 11:41:58 -0700
- Subject: RE: Support MIPS elfoabi target
Thiemo Seufer wrote:
> > Hi,
> >
> > I found out that MIPS *-elf and *-elfoabi targets use
> different section
> > alignment, due to the check of TARGET_OS in tc-mips.c.
> > Should we use "strncmp (TARGET_OS, "elf", 3)" to match both
> > "elfoabi" and "elf", instead of "strcmp (TARGET_OS, "elf")"?
>
> It looks like other TARGET_OS comparisions ("vxworks", "pe") in
> config/tc-mips.c have the same problem. Could you expand your patch
> to cover those as well?
>
Yes. The TARGET_OS comparison for "pe" uses "strncmp" already. So,
I fixed the "vxworks" comparison to use "strncmp". Thanks!
Regards,
Chao-ying
gas/ChangeLog
2008-05-07 Chao-ying Fu <fu@mips.com>
* config/tc-mips.c (md_begin): Use strncmp to compare TARGET_OS, in
case that some characters append at the end of the name.
(mips_ip): Likewise.
(s_change_sec): Likewise.
(md_section_align): Likewise.
Index: tc-mips.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-mips.c,v
retrieving revision 1.383
diff -r1.383 tc-mips.c
1960,1961c1960,1961
< if (strcmp (TARGET_OS, "elf") != 0
< && strcmp (TARGET_OS, "vxworks") != 0)
---
> if (strncmp (TARGET_OS, "elf", 3) != 0
> && strncmp (TARGET_OS, "vxworks", 7) != 0)
1983c1983
< if (strcmp (TARGET_OS, "elf") != 0)
---
> if (strncmp (TARGET_OS, "elf", 3) != 0)
9555c9555
< if (IS_ELF && strcmp (TARGET_OS, "elf") != 0)
---
> if (IS_ELF && strncmp (TARGET_OS, "elf", 3) != 0)
12178c12178
< if (strcmp (TARGET_OS, "elf") != 0)
---
> if (strncmp (TARGET_OS, "elf", 3) != 0)
12190c12190
> if (strncmp (TARGET_OS, "elf", 3) != 0)
13279c13279
< if (strcmp (TARGET_OS, "elf") == 0)
---
> if (strncmp (TARGET_OS, "elf", 3) == 0)