<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/libexec/rtld-elf, branch releng/13.5</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=releng%2F13.5</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=releng%2F13.5'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2024-12-13T00:18:33Z</updated>
<entry>
<title>rtld-elf: Fix for mips with LLD 14+</title>
<updated>2024-12-13T00:18:33Z</updated>
<author>
<name>Jessica Clarke</name>
<email>jrtc27@FreeBSD.org</email>
</author>
<published>2024-12-13T00:18:33Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=d7bf409a63501a28357a9a9ec24628e1208d530d'/>
<id>urn:sha1:d7bf409a63501a28357a9a9ec24628e1208d530d</id>
<content type='text'>
As of LLD 14, it no longer falls back to the address of .text if it
can't find the entry point, and instead just uses address 0. Since the
mips port has always used rtld_start as its entry point symbol but has
never set RTLD_ENTRY to match (instead getting the default .rtld_start),
with LLD 14+ it ends up using an entry point of 0, i.e. reinterpreting
various headers and metadata sections as code, and thus quickly dies, in
my case with SIGILL. This has seemingly always been a warning with LLD
even when it defaulted to .text, but that went unnoticed this whole
time, until now. Fix this by specifying the right symbol name.

This is a direct commit to stable/13 as mips no longer exists in main.
</content>
</entry>
<entry>
<title>rtld/arm: fix initial-exec (IE) thread-local storage relocation</title>
<updated>2024-11-22T15:41:10Z</updated>
<author>
<name>R. Christian McDonald</name>
<email>rcm@rcm.sh</email>
</author>
<published>2023-11-03T12:56:58Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=e10cca68cf349d11bc5c6474b792529bffc789cf'/>
<id>urn:sha1:e10cca68cf349d11bc5c6474b792529bffc789cf</id>
<content type='text'>
net/frr[89] revealed an interesting edge-case on arm when dynamically
linking a shared library that declares more than one static TLS variable
with at least one  using the "initial-exec" TLS model. In the case
of frr[89], this library was libfrr.so which essentially does the
following:

	#include &lt;stdio.h&gt;

	#include "lib.h"

	static __thread int *a
		__attribute__((tls_model("initial-exec")));

	void lib_test()
	{
		static __thread int b = -1;

		printf("&amp;a = %p\n", &amp;a);
		printf(" a = %p\n", a);

		printf("\n");

		printf("&amp;b = %p\n", &amp;b);
		printf(" b = %d\n", b);
	}

Allocates a file scoped `static __thread` pointer with
tls_model("initial-exec") and later a block scoped TLS int. Notice in
the above minimal reproducer, `b == -1`. The relocation process does
the wrong thing and ends up pointing both `a` and `b` at the same place
in memory.

The output of the above in the broken state is:

	&amp;a = 0x4009c018
	 a = 0xffffffff

	&amp;b = 0x4009c018
	 b = -1

With the patch applied, the output becomes:

	&amp;a = 0x4009c01c
	 a = 0x0

	&amp;b = 0x4009c018
	 b = -1

Reviewed by:	kib
Approved by:    kp (mentor)
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D42415/

(cherry picked from commit 98fd69f0090da73d9d0451bd769d7752468284c6)
</content>
</entry>
<entry>
<title>Remove "All Rights Reserved" from FreeBSD Foundation copyrights</title>
<updated>2024-09-07T16:30:19Z</updated>
<author>
<name>Ed Maste</name>
<email>emaste@FreeBSD.org</email>
</author>
<published>2024-07-30T16:02:17Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=6b9c7f29b0cdf0da752927ca173f590cdf385c89'/>
<id>urn:sha1:6b9c7f29b0cdf0da752927ca173f590cdf385c89</id>
<content type='text'>
These ones were unambiguous cases where the Foundation was the only
listed copyright holder.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 5c2bc3db201a4fe8d7911cf816bea104d5dc2138)
(cherry picked from commit f06d322e9d925ab56a4aa8210a67637d4d341ab6)
</content>
</entry>
<entry>
<title>rtld: Define MD_OBJ_ENTRY for mips</title>
<updated>2024-07-31T18:59:43Z</updated>
<author>
<name>Jessica Clarke</name>
<email>jrtc27@FreeBSD.org</email>
</author>
<published>2024-07-31T18:59:43Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=b72e57d6c9414005ed991c6cccb1aed24e4718aa'/>
<id>urn:sha1:b72e57d6c9414005ed991c6cccb1aed24e4718aa</id>
<content type='text'>
This is a direct commit to stable/13.

Reported by:	mmel
Fixes:		f9210d37c5c6 ("rtld: Add MD_OBJ_ENTRY to extend Struct_Obj_Entry")
</content>
</entry>
<entry>
<title>rtld: Add MD_OBJ_ENTRY to extend Struct_Obj_Entry</title>
<updated>2024-07-15T12:34:29Z</updated>
<author>
<name>Andrew Turner</name>
<email>andrew@FreeBSD.org</email>
</author>
<published>2024-05-07T15:49:53Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=f9210d37c5c6ef427af619f2bf0ff7157415fa47'/>
<id>urn:sha1:f9210d37c5c6ef427af619f2bf0ff7157415fa47</id>
<content type='text'>
Add a macro the architectures can use to add per-arch fields to
Struct_Obj_Entry.

Reviewed by:	kib
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45116

(cherry picked from commit 06db20ffeca9898e5802d63f3b06caaa37c3a4ed)
</content>
</entry>
<entry>
<title>rtld.1: clarify interaction between -u and -o</title>
<updated>2024-05-07T08:59:07Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2024-04-28T21:45:12Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=f73055ab1e2f46620759da0aba19c8f4a11316bd'/>
<id>urn:sha1:f73055ab1e2f46620759da0aba19c8f4a11316bd</id>
<content type='text'>
(cherry picked from commit 6a7819e43f938992304472054c83f4a6602a9e19)
</content>
</entry>
<entry>
<title>rtld direct exec: make -u behavior match the description</title>
<updated>2024-05-07T08:59:07Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2024-04-28T20:57:54Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=e45b440633f9878baf019d3ef557bd2be103c3f9'/>
<id>urn:sha1:e45b440633f9878baf019d3ef557bd2be103c3f9</id>
<content type='text'>
(cherry picked from commit ef2694f368cee5957ee44b0298da88ff8360d561)
</content>
</entry>
<entry>
<title>rtld: add direct-exec option -o</title>
<updated>2024-05-07T08:59:07Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2024-04-28T03:19:39Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=10484ee13a36e3b0523e8de441c4d528148fd1a3'/>
<id>urn:sha1:10484ee13a36e3b0523e8de441c4d528148fd1a3</id>
<content type='text'>
(cherry picked from commit d1cd0cc32b53c09e72e33116b94a5b0b9781a183)
</content>
</entry>
<entry>
<title>rtld snprintf: do not erronously skip a char at the buffer boundary</title>
<updated>2024-05-03T00:26:26Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2024-04-28T06:37:24Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=d9ec850bde3c8695bebfdfeea72deb1d060cd183'/>
<id>urn:sha1:d9ec850bde3c8695bebfdfeea72deb1d060cd183</id>
<content type='text'>
(cherry picked from commit 56ee5fc43c40479e2651b21862e299bcf73017ae)
</content>
</entry>
<entry>
<title>rtld(1): minor clarification for LD_STATIC_TLS_EXTRA</title>
<updated>2024-04-23T00:32:54Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2024-04-20T13:47:44Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=ed9f44083dbaf9b1bde1d81f7b48308e1dc33138'/>
<id>urn:sha1:ed9f44083dbaf9b1bde1d81f7b48308e1dc33138</id>
<content type='text'>
(cherry picked from commit 8d7473703520f315c1bcd3b3d12498eee10d563e)
</content>
</entry>
</feed>
