<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src-test/libexec/rtld-elf/ia64, branch main</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src-test/atom?h=main</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src-test/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/'/>
<updated>2014-07-07T00:27:09Z</updated>
<entry>
<title>Remove ia64.</title>
<updated>2014-07-07T00:27:09Z</updated>
<author>
<name>Marcel Moolenaar</name>
<email>marcel@FreeBSD.org</email>
</author>
<published>2014-07-07T00:27:09Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=e7d939bda22b07be6b68ba38835c9167212fd56e'/>
<id>urn:sha1:e7d939bda22b07be6b68ba38835c9167212fd56e</id>
<content type='text'>
This includes:
o   All directories named *ia64*
o   All files named *ia64*
o   All ia64-specific code guarded by __ia64__
o   All ia64-specific makefile logic
o   Mention of ia64 in comments and documentation

This excludes:
o   Everything under contrib/
o   Everything under crypto/
o   sys/xen/interface
o   sys/sys/elf_common.h

Discussed at: BSDcan
</content>
</entry>
<entry>
<title>Fix r264346 for ia64. We need to allocate memory for the function</title>
<updated>2014-07-02T22:04:12Z</updated>
<author>
<name>Marcel Moolenaar</name>
<email>marcel@FreeBSD.org</email>
</author>
<published>2014-07-02T22:04:12Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=97ef7689149c309c277fb5010b53cbc44d0b601c'/>
<id>urn:sha1:97ef7689149c309c277fb5010b53cbc44d0b601c</id>
<content type='text'>
descriptors in order to relocate RTLD itself. To allocate memory,
we need the pagesizes array initialized, but that happens after
RTLD is relocated. This ordering is important for amd64, but it's
opposite of what ia64 needs. Handle this conflict with the define
called RTLD_INIT_PAGESIZES_EARLY. When defined, obtain the page
sizes before relocating rtld, otherwise do it after.
</content>
</entry>
<entry>
<title>Add GNU hash support for rtld.</title>
<updated>2012-04-30T13:31:10Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2012-04-30T13:31:10Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=f62651920d526d8ef7a8ea66487e5bd1814a7a6f'/>
<id>urn:sha1:f62651920d526d8ef7a8ea66487e5bd1814a7a6f</id>
<content type='text'>
Based on dragonflybsd support for GNU hash by John Marino &lt;draco marino st&gt;
Reviewed by:	kan
Tested by:	bapt
MFC after:	2 weeks
</content>
</entry>
<entry>
<title>Use xmalloc() instead of malloc() in the places where malloc() calls</title>
<updated>2012-03-22T14:20:51Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2012-03-22T14:20:51Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=758ffbfa3bd27cb793750d90c47ed8a0dc537823'/>
<id>urn:sha1:758ffbfa3bd27cb793750d90c47ed8a0dc537823</id>
<content type='text'>
are assumed to not fail.

Make the xcalloc() calling conventions follow the calloc(3) calling
conventions and replace unchecked calls to calloc() with calls to
xcalloc().

Remove redundand declarations from xmalloc.c, which are already
present in rtld.h.

Reviewed by:	kan
Discussed with:	bde
MFC after:	2 weeks
</content>
</entry>
<entry>
<title>Fix several problems with our ELF filters implementation.</title>
<updated>2012-03-20T13:20:49Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2012-03-20T13:20:49Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=082f959ac8281d323f9289c45b769275e172c917'/>
<id>urn:sha1:082f959ac8281d323f9289c45b769275e172c917</id>
<content type='text'>
Do not relocate twice an object which happens to be needed by loaded
binary (or dso) and some filtee opened due to symbol resolution when
relocating need objects.  Record the state of the relocation
processing in Obj_Entry and short-circuit relocate_objects() if
current object already processed.

Do not call constructors for filtees loaded during the early
relocation processing before image is initialized enough to run
user-provided code.  Filtees are loaded using dlopen_object(), which
normally performs relocation and initialization.  If filtee is
lazy-loaded during the relocation of dso needed by the main object,
dlopen_object() runs too earlier, when most runtime services are not
yet ready.

Postpone the constructors call to the time when main binary and
depended libraries constructors are run, passing the new flag
RTLD_LO_EARLY to dlopen_object().  Symbol lookups callers inform
symlook_* functions about early stage of initialization with
SYMLOOK_EARLY.  Pass flags through all functions participating in
object relocation.

Use the opportunity and fix flags argument to find_symdef() in
arch-specific reloc.c to use proper name SYMLOOK_IN_PLT instead of
true, which happen to have the same numeric value.

Reported and tested by:	theraven
Reviewed by:	kan
MFC after:	2 weeks
</content>
</entry>
<entry>
<title>Add support for preinit, init and fini arrays.  Some ABIs, in</title>
<updated>2012-03-11T20:03:09Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2012-03-11T20:03:09Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=83aa9cc00c2d83d05a0efe7a1496d8aab4a153bb'/>
<id>urn:sha1:83aa9cc00c2d83d05a0efe7a1496d8aab4a153bb</id>
<content type='text'>
particular on ARM, do require working init arrays.

Traditional FreeBSD crt1 calls _init and _fini of the binary, instead
of allowing runtime linker to arrange the calls.  This was probably
done to have the same crt code serve both statically and dynamically
linked binaries.  Since ABI mandates that first is called preinit
array functions, then init, and then init array functions, the init
have to be called from rtld now.

To provide binary compatibility to old FreeBSD crt1, which calls _init
itself, rtld only calls intializers and finalizers for main binary if
binary has a note indicating that new crt was used for linking.  Add
parsing of ELF notes to rtld, and cache p_osrel value since we parsed
it anyway.

The patch is inspired by init_array support for DragonflyBSD, written
by John Marino.

Reviewed by:	kan
Tested by:	andrew (arm, previous version), flo (sparc64, previous version)
MFC after:	3 weeks
</content>
</entry>
<entry>
<title>Add support for STT_GNU_IFUNC and R_MACHINE_IRELATIVE GNU extensions to</title>
<updated>2011-12-12T11:03:14Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2011-12-12T11:03:14Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=6be4b697152616e174e381a763ed2128eafca8a0'/>
<id>urn:sha1:6be4b697152616e174e381a763ed2128eafca8a0</id>
<content type='text'>
rtld on 386 and amd64. This adds runtime bits neccessary for the use
of the dispatch functions from the dynamically-linked executables and
shared libraries.

To allow use of external references from the dispatch function, resolution
of the R_MACHINE_IRESOLVE relocations in PLT is postponed until GOT entries
for PLT are prepared, and normal resolution of the GOT entries is finished.
Similar to how it is done by GNU, IRELATIVE relocations are resolved in
advance, instead of normal lazy handling for PLT.

Move the init_pltgot() call before the relocations for the object are
processed.

MFC after:	3 weeks
</content>
</entry>
<entry>
<title>When loading dso without PT_GNU_STACK phdr, only call</title>
<updated>2011-01-25T21:12:31Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2011-01-25T21:12:31Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=cb38d4941c45e3c72c4b5b3fad87d297d950cf53'/>
<id>urn:sha1:cb38d4941c45e3c72c4b5b3fad87d297d950cf53</id>
<content type='text'>
__pthread_map_stacks_exec() on architectures that allow executable
stacks.

Reported and tested by:	marcel (ia64)
</content>
</entry>
<entry>
<title>Implement support for ELF filters in rtld. Both normal and auxillary</title>
<updated>2010-12-25T08:51:20Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2010-12-25T08:51:20Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=8569deaf1cba0d732647f0dae7eb5af2ee5fae1b'/>
<id>urn:sha1:8569deaf1cba0d732647f0dae7eb5af2ee5fae1b</id>
<content type='text'>
filters are implemented.

Filtees are loaded on demand, unless LD_LOADFLTR environment variable
is set or -z loadfltr was specified during the linking. This forces
rtld to upgrade read-locked rtld_bind_lock to write lock when it
encounters an object with filter during symbol lookup.

Consolidate common arguments of the symbol lookup functions in the
SymLook structure.  Track the state of the rtld locks in the
RtldLockState structure. Pass local RtldLockState through the rtld
symbol lookup calls to allow lock upgrades.

Reviewed by:	kan
Tested by:	Mykola Dzham &lt;i levsha me&gt;, nwhitehorn (powerpc)
</content>
</entry>
<entry>
<title>Unbreak ia64.</title>
<updated>2010-10-22T04:43:04Z</updated>
<author>
<name>Marcel Moolenaar</name>
<email>marcel@FreeBSD.org</email>
</author>
<published>2010-10-22T04:43:04Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=30ec71ad048696e11f4ff028061f2668490288c1'/>
<id>urn:sha1:30ec71ad048696e11f4ff028061f2668490288c1</id>
<content type='text'>
With r169630 I disabled symbol versioning because it broke rtld.  With
r211706 rtld got broken for ia64 &amp; powerpc64.  It was fixed for powerpc64
with r212497.  In between, r211749 removed the exports table because the
version script handled the exports.  But wait, symbol versioning was
disabled on ia64.

With exports controlled by the version script and symbol versioning
disabled, all symbols are exported and too many symbols bind to the
definition in rtld. Let's just say that waird things happen.

So, enable symbol versioning on ia64 and apply a work-around for the
SIGSEGV that triggered r169630 to begin with: when rtld relocates
itself, it comes across r_debug_state and for some reason can't find the
definition. This causes a failure, relocation aborts and null pointers
galore. The work-around is to ignore the missing definition when rtld
is relocating itself and keep going.

Maybe with the next binutils this will all go away. Maybe not, in
which case I still need to figure out why r_debug_state cannot be found.

BTW: r_debug_state is in the symbol map -- I don't think any other rtld
symbols that rtld references are in the symbol map...
</content>
</entry>
</feed>
