public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Elf OS ABI Number
@ 2003-06-11 14:00 Kris Warkentin
  2003-06-11 14:23 ` Andrew Cagney
  2003-06-11 16:44 ` Richard Earnshaw
  0 siblings, 2 replies; 7+ messages in thread
From: Kris Warkentin @ 2003-06-11 14:00 UTC (permalink / raw)
  To: Gdb@Sources.Redhat.Com

Does anyone know how to get one of these?  I was rooting around on Caldera's
website but didn't see anything.  I've realized that we need to have a
practical way to identify QNX binaries and this looks like the way to go.

cheers,

Kris


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

* Re: Elf OS ABI Number
  2003-06-11 14:00 Elf OS ABI Number Kris Warkentin
@ 2003-06-11 14:23 ` Andrew Cagney
  2003-06-11 16:44 ` Richard Earnshaw
  1 sibling, 0 replies; 7+ messages in thread
From: Andrew Cagney @ 2003-06-11 14:23 UTC (permalink / raw)
  To: Kris Warkentin; +Cc: Gdb@Sources.Redhat.Com

> Does anyone know how to get one of these?  I was rooting around on Caldera's
> website but didn't see anything.  I've realized that we need to have a
> practical way to identify QNX binaries and this looks like the way to go.
> 
> cheers,

Check the binutils doco and/or mailing list archives.  The question 
comes up often.

Andrew


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

* Re: Elf OS ABI Number
  2003-06-11 14:00 Elf OS ABI Number Kris Warkentin
  2003-06-11 14:23 ` Andrew Cagney
@ 2003-06-11 16:44 ` Richard Earnshaw
  2003-06-11 17:20   ` Kris Warkentin
  1 sibling, 1 reply; 7+ messages in thread
From: Richard Earnshaw @ 2003-06-11 16:44 UTC (permalink / raw)
  To: Kris Warkentin; +Cc: Gdb@Sources.Redhat.Com, Richard.Earnshaw

> Does anyone know how to get one of these?  I was rooting around on Caldera's
> website but didn't see anything.  I've realized that we need to have a
> practical way to identify QNX binaries and this looks like the way to go.
> 

A fairly common question, to which most times the answer is that you don't 
need one.

You should only be using the OS ABI field if you are changing the meaning 
of the ELF specifics for a processor (new relocs, for example) which a 
linker not trained to recognise these would be unable to handle.  It 
shouldn't be used to represent things that are encoded in the instructions 
inside sections (eg library calls specific to your OS, etc).

The ELF specs seem to find it very hard to express this, but if you read 
it carefully, that is what they do say.

R.

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

* Re: Elf OS ABI Number
  2003-06-11 16:44 ` Richard Earnshaw
@ 2003-06-11 17:20   ` Kris Warkentin
  2003-06-12 14:27     ` Richard Earnshaw
  0 siblings, 1 reply; 7+ messages in thread
From: Kris Warkentin @ 2003-06-11 17:20 UTC (permalink / raw)
  To: Richard.Earnshaw; +Cc: Gdb@Sources.Redhat.Com, Richard.Earnshaw

> > Does anyone know how to get one of these?  I was rooting around on
Caldera's
> > website but didn't see anything.  I've realized that we need to have a
> > practical way to identify QNX binaries and this looks like the way to
go.
> >
>
> A fairly common question, to which most times the answer is that you don't
> need one.
>
> You should only be using the OS ABI field if you are changing the meaning
> of the ELF specifics for a processor (new relocs, for example) which a
> linker not trained to recognise these would be unable to handle.  It
> shouldn't be used to represent things that are encoded in the instructions
> inside sections (eg library calls specific to your OS, etc).

Actually, we do have a few things that are different - QNX specific
relocations, different MIPS ABI, etc.  It seems like having the ABI number
can do no harm but can certainly be useful.  The problem with things like
.note sections for identifying binaries is that a stripped binary can no
longer be identified.

cheers,

Kris


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

* Re: Elf OS ABI Number
  2003-06-11 17:20   ` Kris Warkentin
@ 2003-06-12 14:27     ` Richard Earnshaw
  2003-06-12 14:46       ` Kris Warkentin
  0 siblings, 1 reply; 7+ messages in thread
From: Richard Earnshaw @ 2003-06-12 14:27 UTC (permalink / raw)
  To: Kris Warkentin; +Cc: Richard.Earnshaw, Gdb@Sources.Redhat.Com

> > > Does anyone know how to get one of these?  I was rooting around on
> Caldera's
> > > website but didn't see anything.  I've realized that we need to have a
> > > practical way to identify QNX binaries and this looks like the way to
> go.
> > >
> >
> > A fairly common question, to which most times the answer is that you don't
> > need one.
> >
> > You should only be using the OS ABI field if you are changing the meaning
> > of the ELF specifics for a processor (new relocs, for example) which a
> > linker not trained to recognise these would be unable to handle.  It
> > shouldn't be used to represent things that are encoded in the instructions
> > inside sections (eg library calls specific to your OS, etc).
> 
> Actually, we do have a few things that are different - QNX specific
> relocations, different MIPS ABI, etc.  It seems like having the ABI number
> can do no harm but can certainly be useful. 

As I said before, new relocations is a valid reason for an OS_ABI field 
change.  However, an ABI change (calling standard) is not -- it doesn't 
change the meaning of the ELF container, which is what the field is about. 
 The harm is that a linker is supposed to reject an OS_ABI field setting 
it doesn't understand.

Is there a good reason why you've invented your own relocs?  If the 
processor vendor (who generally own the reloc space allocation for their 
processor) where to allocate a reloc that conflicts with your usage at a 
later date you might have a major problem on your hands.

> The problem with things like
> .note sections for identifying binaries is that a stripped binary can no
> longer be identified.

No, .note sections are not symbols, so are not removed by strip.  The only 
way to remove a .note section is to use objcopy and tell it not to copy 
that section.

R.

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

* Re: Elf OS ABI Number
  2003-06-12 14:27     ` Richard Earnshaw
@ 2003-06-12 14:46       ` Kris Warkentin
  2003-06-12 14:50         ` Kris Warkentin
  0 siblings, 1 reply; 7+ messages in thread
From: Kris Warkentin @ 2003-06-12 14:46 UTC (permalink / raw)
  To: Richard.Earnshaw; +Cc: Richard.Earnshaw, Gdb@Sources.Redhat.Com

> > Actually, we do have a few things that are different - QNX specific
> > relocations, different MIPS ABI, etc.  It seems like having the ABI
number
> > can do no harm but can certainly be useful.
>
> As I said before, new relocations is a valid reason for an OS_ABI field
> change.  However, an ABI change (calling standard) is not -- it doesn't
> change the meaning of the ELF container, which is what the field is about.
>  The harm is that a linker is supposed to reject an OS_ABI field setting
> it doesn't understand.

Yes, I just learned that yesterday.  I'm beginning to lean back towards the
.note section.  I'm beginning to win hearts and minds on this end as well.

> Is there a good reason why you've invented your own relocs?  If the
> processor vendor (who generally own the reloc space allocation for their
> processor) where to allocate a reloc that conflicts with your usage at a
> later date you might have a major problem on your hands.

We do some weird stuff for execute in place and various kernel stuff.  I
don't understand the details particularily well but we have to use our own
linker on certain startup code and such.  Probably doesn't affect much else.

> > The problem with things like
> > .note sections for identifying binaries is that a stripped binary can no
> > longer be identified.
>
> No, .note sections are not symbols, so are not removed by strip.  The only
> way to remove a .note section is to use objcopy and tell it not to copy
> that section.

Well, I should have been more clear on that.  When we put binaries into an
image, they are REALLY stripped - no sections at all.  They are also
pre-relocated so that they can be run directly off of flash or other memory
type media.  Ultimately, you can't really debug these anyway (bfd won't even
recognize them properly) so it doesn't really matter that much.  If you have
a version with debug info that gdb can load, you can debug them properly
anyway though so it's only a minor quibble.

cheers,

Kris


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

* Re: Elf OS ABI Number
  2003-06-12 14:46       ` Kris Warkentin
@ 2003-06-12 14:50         ` Kris Warkentin
  0 siblings, 0 replies; 7+ messages in thread
From: Kris Warkentin @ 2003-06-12 14:50 UTC (permalink / raw)
  To: Kris Warkentin, Richard.Earnshaw; +Cc: Richard.Earnshaw, Gdb@Sources.Redhat.Com

> > Is there a good reason why you've invented your own relocs?  If the
> > processor vendor (who generally own the reloc space allocation for their
> > processor) where to allocate a reloc that conflicts with your usage at a
> > later date you might have a major problem on your hands.
>
> We do some weird stuff for execute in place and various kernel stuff.  I
> don't understand the details particularily well but we have to use our own
> linker on certain startup code and such.  Probably doesn't affect much
else.

I forgot to mention, the one place where we might legitimately need an OSABI
number is in MIPS.  We have our own ABI that doesn't force us to compile
everything PIC.  There was a whitepaper posted to binutils and gcc once upon
a time but no one was interested in it.

cheers,

Kris


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

end of thread, other threads:[~2003-06-12 14:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-11 14:00 Elf OS ABI Number Kris Warkentin
2003-06-11 14:23 ` Andrew Cagney
2003-06-11 16:44 ` Richard Earnshaw
2003-06-11 17:20   ` Kris Warkentin
2003-06-12 14:27     ` Richard Earnshaw
2003-06-12 14:46       ` Kris Warkentin
2003-06-12 14:50         ` Kris Warkentin

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