Re: [Linux-ia64] Question about .opd section

From: David Mosberger <>
Date: 2003-02-04 06:19:29
>>>>> On Mon, 3 Feb 2003 08:37:48 -0800, "Wichmann, Mats D" <> said:

  Mats> The gnu toolchain (well, binutils) emits a .opd section
  Mats> for  architectures which use function descriptors -
  Mats> it's not unique to Itanium.

As far as I know, this is an HPism (originally coming from HP-UX
PA-RISC).  "opd" stands for "official procedure descriptor".  the
"official" is in the sense that the address of each descriptor serves
as the canonical "address" of the function it's describing; i.e., this
is what makes function-pointer comparisons work.

  Mats> But I can't find much information about it.  Google has been
  Mats> unhelpful (to me, anyway) on this one. It's described as
  Mats> holding function descriptors, but I'm not clear who uses this
  Mats> information - is this used at runtime?

Nothing at run-time directly references the .opd section, but of
course whenever you call a function through a pointer, you'll end up
loading the function's global-pointer and it's entry point from a
descriptor.  The main program's descriptor are stored in .opd (for
shared objects, the function descriptors are created at runtime, by
the runtime loader).

  Mats> Is this section considered normal/required for
  Mats> Linux/ia64?  I'm asking because it wasn't in the
  Mats> Itanium psABI, and thus didn't make it into the
  Mats> current version of the Itanium LSB spec; our
  Mats> application checker tool is flagging this as an
  Mats> unknown section.

It might be good to document it in the LSB.  There might be tools out
there that assume that .opd contains nothing but function descriptors,
so if someone put something else in there, things might go wrong badly
(which reeminds me: the ptrace-support in libunwind accesses .opd as a
fallback-mechanism to determine the global-pointer of the main
program; so there is at least one library out there that would break
if .opd contained other stuff).

Received on Mon Feb 03 11:38:44 2003

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:11 EST