<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/libexec/rtld-elf/map_object.c, branch releng/8.1</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=releng%2F8.1</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=releng%2F8.1'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2009-12-14T12:19:21Z</updated>
<entry>
<title>Merge r197808 from head to stable/8:</title>
<updated>2009-12-14T12:19:21Z</updated>
<author>
<name>Robert Watson</name>
<email>rwatson@FreeBSD.org</email>
</author>
<published>2009-12-14T12:19:21Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=8b2c0bec3b9c6ac9617c4b20e6756385f148e095'/>
<id>urn:sha1:8b2c0bec3b9c6ac9617c4b20e6756385f148e095</id>
<content type='text'>
  In rtld's map_object(), use pread(..., 0) rather than read() to read the
  ELF header from the front of the file.  As all other I/O on the binary
  is done using mmap(), this avoids the need for seek privileges on the
  file descriptor during run-time linking.

  Sponsored by: Google
</content>
</entry>
<entry>
<title>Only perform .bss mapping and cleaning operations when segment file size</title>
<updated>2009-07-17T19:32:04Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2009-07-17T19:32:04Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=69ca61ba5e482dda9410c227ca300218bf56c95a'/>
<id>urn:sha1:69ca61ba5e482dda9410c227ca300218bf56c95a</id>
<content type='text'>
is not equal to its memory size.

This eliminates unneeded clearing of the text segment that often
happens due to text end not being page-aligned.

For instance,
$ readelf -l /lib/libedit.so.6
Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x000000 0x00000000 0x00000000 0x139e1 0x139e1 R E 0x1000
  LOAD           0x014000 0x00014000 0x00014000 0x00f04 0x00f14 RW  0x1000
  DYNAMIC        0x014cc4 0x00014cc4 0x00014cc4 0x000d0 0x000d0 RW  0x4
$ procstat -v $$ (for /bin/sh)
68585 0x28097000 0x280aa000 r-x    6    0  21  14 CN vn /lib/libedit.so.6
68585 0x280aa000 0x280ab000 r-x    1    0   1   0 CN vn /lib/libedit.so.6 &lt;==
68585 0x280ab000 0x280ac000 rwx    1    0   1   0 CN vn /lib/libedit.so.6
Note the splitted map entry marked by '&lt;=='.

Reviewed by:	kan
Approved by:	re (kensmith)
MFC after:	1 month
</content>
</entry>
<entry>
<title>Currently, when mapping an object, rtld reserves the whole address space</title>
<updated>2009-04-10T10:14:04Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2009-04-10T10:14:04Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=a3c8e04ef731511cdb39c2f8f2c2079da1b30624'/>
<id>urn:sha1:a3c8e04ef731511cdb39c2f8f2c2079da1b30624</id>
<content type='text'>
for the mapping by the object' file with the protection and mode of
the first loadable segment over the whole region. Then, it maps other
segments at the appropriate addresses inside the region.

On amd64, due to default alignment of the segments being 1Gb, the
subsequent segment mappings leave the holes in the region, that usually
contain mapping of the object' file past eof. Such mappings prevent
wiring of the address space, because the pages cannot be faulted in.

Change the way the mapping of the ELF objects is constructed, by first
mapping PROT_NONE anonymous memory over the whole range, and then
mapping the segments of the object over it. Take advantage of this new
order and allocate .bss by changing the protection of the range instead
of remapping.

Note that we cannot simply keep the holes between segments, because
other mappings may be made there. Among other issues, when the dso is
unloaded, rtld unmaps the whole region, deleting unrelated mappings.

The kernel ELF image activator does put the holes between segments, but
this is not critical for now because kernel loads only executable image
and interpreter, both cannot be unloaded. This will be fixed later, if
needed.

Reported and tested by:	Hans Ottevanger &lt;fbsdhackers beasties demon nl&gt;
Suggested and reviewed by:	kan, alc
</content>
</entry>
<entry>
<title>Update comment to the reality, rtld supports any number of loadable segments.</title>
<updated>2009-04-10T09:52:42Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2009-04-10T09:52:42Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=11e0093f28feefb0f060c480439de0ade62b5305'/>
<id>urn:sha1:11e0093f28feefb0f060c480439de0ade62b5305</id>
<content type='text'>
Fix spacing.

Reviewed by:	kan
</content>
</entry>
<entry>
<title>Implement the dynamic string token substitution in the rpath and</title>
<updated>2009-03-18T13:40:37Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2009-03-18T13:40:37Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=28551690e093233d3c124b7d2642389934aaafe3'/>
<id>urn:sha1:28551690e093233d3c124b7d2642389934aaafe3</id>
<content type='text'>
soneeded pathes. The $ORIGIN, $OSNAME, $OSREL and $PLATFORM tokens
are supported. Enabling the substitution requires DF_ORIGIN flag in
DT_FLAGS or DF_1_ORIGIN if DF_FLAGS_1, that may be set with -z origin
gnu ld flag. Translation is unconditionally disabled for setuid/setgid
processes.

The $ORIGIN translation relies on the AT_EXECPATH auxinfo supplied
by kernel.

Requested by:	maho
Tested by:	maho, pho
Reviewed by:	kan
</content>
</entry>
<entry>
<title>Implement dl_iterate_phdr function.</title>
<updated>2007-04-03T18:31:20Z</updated>
<author>
<name>Alexander Kabaev</name>
<email>kan@FreeBSD.org</email>
</author>
<published>2007-04-03T18:31:20Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=49f90ad2822286dfdf9e8d63df93bfeb22ed72c2'/>
<id>urn:sha1:49f90ad2822286dfdf9e8d63df93bfeb22ed72c2</id>
<content type='text'>
Convert boolean flags in internal Obj_Entry structure into bitfields.
Properly check for loaded segment alignment in map_object.
</content>
</entry>
<entry>
<title>Implement ELF symbol versioning using GNU semantics. This code aims</title>
<updated>2005-12-18T19:43:33Z</updated>
<author>
<name>Alexander Kabaev</name>
<email>kan@FreeBSD.org</email>
</author>
<published>2005-12-18T19:43:33Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=0eb88f20298d056bf09b52ec2d84d3662b8fd152'/>
<id>urn:sha1:0eb88f20298d056bf09b52ec2d84d3662b8fd152</id>
<content type='text'>
to be compatible with symbol versioning support as implemented by
GNU libc and documented by http://people.redhat.com/~drepper/symbol-versioning
and LSB 3.0.

Implement dlvsym() function to allow lookups for a specific version of
a given symbol.
</content>
</entry>
<entry>
<title>Attempt to free any static TLS space used by a shared library when it</title>
<updated>2005-02-27T12:55:40Z</updated>
<author>
<name>Doug Rabson</name>
<email>dfr@FreeBSD.org</email>
</author>
<published>2005-02-27T12:55:40Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=ddab7ee80aeeaf519a0e0bb5bf2944f5ebbaa44f'/>
<id>urn:sha1:ddab7ee80aeeaf519a0e0bb5bf2944f5ebbaa44f</id>
<content type='text'>
is unloaded. This allows applications which load and unload libraries
like libGL.so.1 several times to work properly.

MFC after: 2 days
</content>
</entry>
<entry>
<title>Add support for Thread Local Storage.</title>
<updated>2004-08-03T08:51:00Z</updated>
<author>
<name>Doug Rabson</name>
<email>dfr@FreeBSD.org</email>
</author>
<published>2004-08-03T08:51:00Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=017246d02f18aa1b754027fe6c058a76659e66b7'/>
<id>urn:sha1:017246d02f18aa1b754027fe6c058a76659e66b7</id>
<content type='text'>
</content>
</entry>
<entry>
<title>- Add support for DT_FLAGS.</title>
<updated>2003-06-18T03:34:29Z</updated>
<author>
<name>Matthew N. Dodd</name>
<email>mdodd@FreeBSD.org</email>
</author>
<published>2003-06-18T03:34:29Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=da9f24547061aaed0e667eeafd3e29e48fc21224'/>
<id>urn:sha1:da9f24547061aaed0e667eeafd3e29e48fc21224</id>
<content type='text'>
- Define various things from the most recent ELF spec.
</content>
</entry>
</feed>
