This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Support MIPS elfoabi target


Fu, Chao-Ying wrote:
> 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.

Ok.

> 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)

You probably want to put a line like "diff -upNR" in your ~/.cvsrc,
unified diffs are a lot nicer to read, and more robust as patches.


Thiemo


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]