------------------------------------------------------------------------

I'm sponsoring the following case for myself.   This case qualifies for
Architectural self-review, but I wish to record the following
information.

------------------------------------------------------------------------

The link-editors -z combreloc flag combines individual relocation sections
(like .rela.data and .rela.bss) into one relocation table .SUNW_reloc.
This concatenation of the standard relocation tables allows ld(1) to sort
all data relocations so that the symbol lookup cost, from ld.so.1(1),
is minimized.  The option has existed since Solaris 7 (4044285), and
its use has been enforced for OSnet components via check_rtime.

Linux took the same option, but went one step further and made the
functionality the default behavior for gld as of version 2.13.  Gld
produces .rel.dyn sections, whereas ld produces .SUNW_reloc sections -
however, the section names are never referenced, so their names aren't
particularly meaningful.  Gld also provides the additional -z nocombreloc
option just in case.

ld(1) should make -z combreloc the default behavior when creating a
final object (ie., an executable or shared object).  The -z combreloc
option will still be recognized, but effectively ignored.  A new
-z nocombreloc option will be added to disable the relocation section
concatenation.

------------------------------------------------------------------------

The ld(1) man page will be updated to add:

  Synopsis ld [-64] [-a | -r] [-b] [-Bdirect | nodirect]
      .....
      [-z altexec64] [-z combreloc | nocombreloc ] [-z defs | nodefs]
      .....

  Options
      The following options are supported:
      .....
      -z combreloc | nocombreloc
          By default, the link-editor combines multiple relocation
          sections  when  building  executables or shared objects.
          This  section  combination  differs   from   relocatable
          objects,  in which relocation sections are maintained in
          a one-to-one relationship with the sections to which the
          relocations  must be applied.  The -z nocombreloc option
          disables  this  merging  of  relocation  sections,   and
          preserves  the one-to-one relationship found in the ori-
          ginal relocatable objects.

          The link-editor sorts the  entries  of  data  relocation
          sections by their symbol reference. This sorting reduces
          runtime symbol lookup.  When  multiple  relocation  sec-
          tions are combined, this sorting produces the least pos-
          sible relocation overhead when objects are  loaded  into
          memory,  and  speeds  the  runtime  loading  of  dynamic
          objects.

          Historically, the individual  relocation  sections  were
          carried over to any executable or shared object, and the
          -z combreloc option was required to enable  the  reloca-
          tion  section  merging previously described.  Relocation
          section merging is now the  default.  The  -z  combreloc
          option  is  still  accepted for the benefit of old build
          environments, but the option is unnecessary, and has  no
          effect.

------------------------------------------------------------------------
Release Binding:                 Patch/Micro
ld -znocombreloc option          Committed


-- 

Rod.

Reply via email to