public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* really confused by mips target formats
@ 2006-02-28 11:33 Eric Fisher
  2006-02-28 17:14 ` Maciej W. Rozycki
  2006-02-28 18:24 ` Thiemo Seufer
  0 siblings, 2 replies; 5+ messages in thread
From: Eric Fisher @ 2006-02-28 11:33 UTC (permalink / raw)
  To: binutils

Hi,
I really need your help. I'm confused by mips target formats. Here is
the function from tc-mips.c.

/* The default target format to use.  */

const char *
mips_target_format ()
{
  switch (OUTPUT_FLAVOR)
    {
    case bfd_target_aout_flavour:
      return target_big_endian ? "a.out-mips-big" : "a.out-mips-little";
    case bfd_target_ecoff_flavour:
      return target_big_endian ? "ecoff-bigmips" : ECOFF_LITTLE_FORMAT;
    case bfd_target_coff_flavour:
      return "pe-mips";
    case bfd_target_elf_flavour:
#ifdef TE_TMIPS
      /* This is traditional mips.  */
      return (target_big_endian
	      ? (HAVE_64BIT_OBJECTS
		 ? "elf64-tradbigmips"
		 : (HAVE_NEWABI
		    ? "elf32-ntradbigmips" : "elf32-tradbigmips"))
	      : (HAVE_64BIT_OBJECTS
		 ? "elf64-tradlittlemips"
		 : (HAVE_NEWABI
		    ? "elf32-ntradlittlemips" : "elf32-tradlittlemips")));
#else
      return (target_big_endian
	      ? (HAVE_64BIT_OBJECTS
		 ? "elf64-bigmips"
		 : (HAVE_NEWABI
		    ? "elf32-nbigmips" : "elf32-bigmips"))
	      : (HAVE_64BIT_OBJECTS
		 ? "elf64-littlemips"
		 : (HAVE_NEWABI
		    ? "elf32-nlittlemips" : "elf32-littlemips")));
#endif
    default:
      abort ();
      return NULL;
    }
}

Let's just talk about elf flavour. What are the traditional mips,
non-traditional mips and newabi? Why do both traditional mips and
non-traditional mips contain newabi?

Why does the object file assembled by mips-linux-as have elf32-tradbigmips
format? While one by mips-elf-as has elf32-bigmips?

Thanks.
Eric.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: really confused by mips target formats
  2006-02-28 11:33 really confused by mips target formats Eric Fisher
@ 2006-02-28 17:14 ` Maciej W. Rozycki
  2006-02-28 18:24 ` Thiemo Seufer
  1 sibling, 0 replies; 5+ messages in thread
From: Maciej W. Rozycki @ 2006-02-28 17:14 UTC (permalink / raw)
  To: Eric Fisher; +Cc: binutils

On Tue, 28 Feb 2006, Eric Fisher wrote:

> Let's just talk about elf flavour. What are the traditional mips,
> non-traditional mips and newabi? Why do both traditional mips and
> non-traditional mips contain newabi?

 The existence of the traditional and non-traditional targets results from 
a few subtle differences in how files are generated depending on whether 
they are to be as defined by the generic ELF specification or the SGI 
variation in areas that are not really processor specific.  Most notably 
the definition of what constitutes a local symbol which may affect the 
order of symbols in symbol tables.

 The old ABI (o32) vs new ABIs (n32, n64) difference is independent from 
the above and results from different register sizes, calling conventions, 
etc.

> Why does the object file assembled by mips-linux-as have elf32-tradbigmips
> format? While one by mips-elf-as has elf32-bigmips?

 It depends on the default emulation as configured when it was built.  
Unfortunately it does not seem to be possible to select another BFD target 
for gas.  Possible workarounds include running `ld -r' or `objcopy' on the 
object file, but as most likely completely untested these might not work 
due to bugs either.

  Maciej

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: really confused by mips target formats
  2006-02-28 11:33 really confused by mips target formats Eric Fisher
  2006-02-28 17:14 ` Maciej W. Rozycki
@ 2006-02-28 18:24 ` Thiemo Seufer
  2006-03-01  1:20   ` Eric Fisher
  1 sibling, 1 reply; 5+ messages in thread
From: Thiemo Seufer @ 2006-02-28 18:24 UTC (permalink / raw)
  To: Eric Fisher; +Cc: binutils

On Tue, Feb 28, 2006 at 11:03:33AM +0800, Eric Fisher wrote:
[snip]
> Let's just talk about elf flavour. What are the traditional mips,
> non-traditional mips and newabi? Why do both traditional mips and
> non-traditional mips contain newabi?

Traditional mips is the flavour used before SGI went ahead and screwed
it up. :-)

> Why does the object file assembled by mips-linux-as have elf32-tradbigmips
> format? While one by mips-elf-as has elf32-bigmips?

At one point, the SGI-ish flavour was used for both. For a linux
userland with its dynamic libraries the traditional format seemed to
be more sensible (and more in line with other ELF implementations).
For mips-elf embedded systems, the backward compatibility argument
had more weight, they continued to use SGI-ish objects.


Thiemo

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: really confused by mips target formats
  2006-02-28 18:24 ` Thiemo Seufer
@ 2006-03-01  1:20   ` Eric Fisher
  2006-03-01 12:50     ` Maciej W. Rozycki
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Fisher @ 2006-03-01  1:20 UTC (permalink / raw)
  To: binutils

I know o32, n32 and n64. But the thing puzzled me is that both
traditional and non-traditional have old and new abi. Then we got four
targets: trad+old, trad+new, nontrad+old, nontrad+new. ah-oh :<

2006/2/28, Thiemo Seufer <ths@networkno.de>:
> On Tue, Feb 28, 2006 at 11:03:33AM +0800, Eric Fisher wrote:
> [snip]
> > Let's just talk about elf flavour. What are the traditional mips,
> > non-traditional mips and newabi? Why do both traditional mips and
> > non-traditional mips contain newabi?
>
> Traditional mips is the flavour used before SGI went ahead and screwed
> it up. :-)
>
> > Why does the object file assembled by mips-linux-as have elf32-tradbigmips
> > format? While one by mips-elf-as has elf32-bigmips?
>
> At one point, the SGI-ish flavour was used for both. For a linux
> userland with its dynamic libraries the traditional format seemed to
> be more sensible (and more in line with other ELF implementations).
> For mips-elf embedded systems, the backward compatibility argument
> had more weight, they continued to use SGI-ish objects.
>
>
> Thiemo
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: really confused by mips target formats
  2006-03-01  1:20   ` Eric Fisher
@ 2006-03-01 12:50     ` Maciej W. Rozycki
  0 siblings, 0 replies; 5+ messages in thread
From: Maciej W. Rozycki @ 2006-03-01 12:50 UTC (permalink / raw)
  To: Eric Fisher; +Cc: binutils

On Wed, 1 Mar 2006, Eric Fisher wrote:

> I know o32, n32 and n64. But the thing puzzled me is that both
> traditional and non-traditional have old and new abi. Then we got four
> targets: trad+old, trad+new, nontrad+old, nontrad+new. ah-oh :<

 Six, actually.  And add another half a dozen for the other endianness. 
;-)

  Maciej

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-03-01 12:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-28 11:33 really confused by mips target formats Eric Fisher
2006-02-28 17:14 ` Maciej W. Rozycki
2006-02-28 18:24 ` Thiemo Seufer
2006-03-01  1:20   ` Eric Fisher
2006-03-01 12:50     ` Maciej W. Rozycki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).