Friday Apr 22, 2016

How To Strip An ELF Object Without Fully Understanding It

The simple ELF rules that let programs like strip renumber sections and fix up the sh_link and sh_info section header fields, without understanding the content of the sections involved.[Read More]

Wednesday Jan 06, 2016

(Not) Managing More Than One Of The Same Object In A Process

The ways in which more than one ELF object with the same SONAME can end up in a process, what the linkers do to try and prevent it, why that's not completely possible, and why this situation is something to avoid rather than try and manage.[Read More]

Monday Nov 26, 2012

Parent Objects

A description of Solaris Parent Objects, which were introduced in Solaris 11 Update 1. Parent objects allow plugin objects to be built, with the ld -z defs option, linking against the parent, so that external symbols from the parent can be seen at link time, producing a completely linked object that won't fail to find the external symbols it needs at runtime. This is often referred to as "symbol closure". A side bonus is that the file utility can identify the parent for plugin objects.[Read More]

Ancillary Objects: Separate Debug ELF Files For Solaris

Ancillary Objects, an ELF feature introduced with Solaris 11 Update 1, allow the debug sections for an object to be written to a separate file that need not be present for the object to be used at runtime.[Read More]

Friday Nov 11, 2011

elffile: ELF Specific File Identification Utility

The standard file utility is inconvenient when applied to archives of ELF objects. Introducing elffile, a Solaris utility that provides the same sort of information as file, without requiring the contents of the archive to be unpacked.[Read More]

The Stub Proto: Not Just For Stub Objects Anymore

Once we had the stub proto in place for building Solaris, we found additional unanticipated uses for it.[Read More]

Using Stub Objects

How to use stub objects to simplify builds, increase build parallelism without complicated makefiles or ordering, and improve object interfaces. Stub objects changed the game for us in terms of build reliability, and the overall build rules are simpler too.[Read More]

Much Ado About Nothing: Stub Objects

Solaris 11 delivered a new type of object, known as a stub. A stub object is an object, built entirely from mapfiles, that supplies the same linking interface as the real object, while containing no code or data. This post describes the long process from idea to practical reality used every day to build the Solaris OS.[Read More]

Nagging As A Strategy For Better Linking: -z guidance

Like most long lived tools, the linkers have some unfortunate defaults. In addition, there are newer abilities that people don't always use. How do you push the world to use that stuff, without breaking existing applications?[Read More]

64-bit Archives Needed

How Solaris ELF archives were extended so that ELF archives can exceed the 32-bit 2GB file size limit, with a discussion of how other Unix like systems have tackled the same problem.[Read More]

Solaris 11

Solaris 11: A few new ELF and linking features: 64-bit archives, ld guidance, stub objects, elffile. [Read More]

Friday Oct 15, 2010

How To Name A Solaris Shared Object

The rules that govern how Solaris shared objects are named, with a deep dive on how SONAMEs and compilation symlinks conspire to let you link with the latest version of a library, while old programs continue to run with the old versions of the same library.[Read More]

Thursday Jan 07, 2010

A New Mapfile Syntax for Solaris

An overview of the new version 2 Solaris Mapfile Language. Version 2 mapfiles are human readable, and provide a basis for the addition of future link-editor features in ways that the original language can't support. [Read More]

Wednesday Jan 06, 2010

The Problem(s) With Solaris SVR4 Link-Editor Mapfiles

I was a Sun user and ISV for many years before joining the Solaris group, and I wrote more than my share of low level C code, and used all the various compilers, linkers, and debuggers. And yet, I never fully understood the cryptic and odd Solaris link-editor mapfile language that was inherited with Sysv Unix from AT&T. When I joined Sun, I got the job of designing its replacement, and had to sit down and fully map it out. I realized that if I didn't write it down, I'd forget it all again, as it's just that cryptic. The best way to use this is to decode your existing mapfiles and then rewrite them in the the version 2 mapfile language. [Read More]

Tuesday Oct 21, 2008

GNU Hash ELF Sections

Solaris doesn't use the GNU hash, but I wanted to understand it in enough detail to be able to implement it, and while I found bits and pieces of what I needed on the web, there was no single detailed description. I ended up contacting the authors to clarify and explain some bits. They were generous with their time, and helped me out. In return, here is a detailed description of the GNU hash, with enough background to understand it. [Read More]

The Cost Of ELF Symbol Hashing

Standard ELF uses hash sections that are essentially unchanged since they were defined at AT&T in the 1980's. GNU have created their own replacements for these, in the interest of speeding up the hash process. Here, I consider the costs involved in ELF hashing, and highlight the difference in approach between Solaris, which uses direct bindings to drive down these costs (as well as other benefits), and the GNU hash which seeks to drive out all the unnecessary computational overhead of classic ELF symbol lookup.[Read More]

Wednesday Mar 19, 2008

ld Is Now A Cross Link-Editor

The Solaris link-editor (ld) has the ability to link objects for a target machine different than the one doing the link. As an example, you can link sparc objects while running on an x86 based system. [Read More]

Friday Nov 02, 2007

Avoiding LD_LIBRARY_PATH: The Options

The LD_LIBRARY_PATH environment is a necessary evil that is used far more often than it should be. With the addition of the elfedit utility, I revisit this old topic, describing the many ways in which LD_LIBRARY_PATH can bite, provide some strategies for reducing its use, and some guidelines on how to manage its use if you must use it. [Read More]

Introducing elfedit: A Tool For Modifying Existing ELF Objects

elfedit is a new Solaris utility that allows for arbitrary in place editing of ELF objects. It's a boon for debugging, and testing, and early experimentation, and it finally provides a way for people who are not comfortable editing ELF objects in emacs to alter the runpath of an object. It's an expert tool, so it can also break objects, which is in itself useful in a development environment. [Read More]

Tuesday Jun 12, 2007

Changing ELF Runpaths (Code Included)

One of the goals that led to the development of the elfedit utility was to enable modifying the runpath of an existing object without having to relink it. The changes to Solaris ELF objects required to support that are described here, and a simple program to do that named rpath is provided. Today we have elfedit, so there's no reason to use rpath, but it still serves as documentation. [Read More]

Friday Feb 09, 2007

Which Solaris Files Are Stripped?

In the previous posting about the new .SUNW_ldynsym sections, I claimed that Solaris objects have been shipped in unstripped form for many years. I learned later that this is only partially true, and that things were greatly improved with Solaris 10. This article gives the details.[Read More]

Wednesday Feb 07, 2007

What Is .SUNW_ldynsym?

Solaris ELF files have a new ELF symbol table. The section type is SHT_SUNW_LDYNSYM, and the section is named .SUNW_ldynsym. In the 20+ years in which the ELF standard has been in use, we have only needed two symbol tables (.symtab, and .dynsym) to support linking, so the addition of a third symbol table is a notable event for ELF cognoscenti. Even if you aren't one of those, you may encounter these sections, and wonder what they are for.[Read More]

Saturday Sep 23, 2006

Inside ELF Symbol Tables

ELF symbol tables, and the rules and conventions that govern their layout. [Read More]

Friday Sep 22, 2006

What Are "Tentative" Symbols?

An exploration of the mess that is Unix "tentative" symbols, also known as "common" symbols, and a tip on how to prevent them from happening in your code.[Read More]

Wednesday Jun 14, 2006

Settling An Old Score (Linker Division)

I used SunOS and later Solaris for many years before joining Sun. Joining the Solaris group allowed me to fix a classic misfeature of the link-editor, and cause output files to be unlinked before being created, rather than writing the new content in place. [Read More]

Happy Birthday To OpenSolaris

OpenSolaris, 1 year in.[Read More]

Wednesday Apr 19, 2006

Testing Critical System Components Without Turning Your System Into A Brick

In the past, a programming mistake in the runtime linker could immediately brick your system (render it unusable), and recovery was slow and tedious (boot the CD, put back the old runtime linker, reboot). Solaris Zones provide the option to employ a dirty and unsupported, but very useful trick for testing new development linker components without the risk of bricking the box. [Read More]
About

I work in the core Solaris OS group on the Solaris linkers. These blogs discuss various aspects of linking and the ELF object file format.

Search

Categories
Archives
« June 2016
SunMonTueWedThuFriSat
   
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
  
       
Today
Feeds