<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/libexec/rtld-elf/xmalloc.c, branch releng/14.4</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=releng%2F14.4</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=releng%2F14.4'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2023-08-21T14:16:42Z</updated>
<entry>
<title>rtld: switch from malloc_aligned() to __crt_aligned_alloc()</title>
<updated>2023-08-21T14:16:42Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2023-07-30T01:51:52Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=feaae6ba1ace0091384ac371423976cd15e59e5a'/>
<id>urn:sha1:feaae6ba1ace0091384ac371423976cd15e59e5a</id>
<content type='text'>
Use regular free(), since it works now.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D41150
</content>
</entry>
<entry>
<title>Remove $FreeBSD$: two-line .h pattern</title>
<updated>2023-08-16T17:54:16Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-16T17:54:16Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=b3e7694832e81d7a904a10f525f8797b753bf0d3'/>
<id>urn:sha1:b3e7694832e81d7a904a10f525f8797b753bf0d3</id>
<content type='text'>
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
</content>
</entry>
<entry>
<title>spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD</title>
<updated>2023-05-12T16:44:03Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-05-10T15:40:58Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=4d846d260e2b9a3d4d0a701462568268cbfe7a5b'/>
<id>urn:sha1:4d846d260e2b9a3d4d0a701462568268cbfe7a5b</id>
<content type='text'>
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with:		pfg
MFC After:		3 days
Sponsored by:		Netflix
</content>
</entry>
<entry>
<title>Make p_vaddr % p_align == p_offset % p_align for (some) TLS segments.</title>
<updated>2020-04-04T22:37:50Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2020-04-04T22:37:50Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=2f06c66ad524dea51c175ca24f59f4448ccd7254'/>
<id>urn:sha1:2f06c66ad524dea51c175ca24f59f4448ccd7254</id>
<content type='text'>
See https://sourceware.org/bugzilla/show_bug.cgi?id=24606 for the test case.
See https://reviews.llvm.org/D64930 for the background and more discussion.

Also this fixes another bug in malloc_aligned() where total size of
the allocated memory might be not enough to fit the aligned requested
block after the initial pointer is incremented by the pointer size.

Reviewed by:	bdragon
Tested by:	antoine (exp-run PR 244866), bdragon, emaste
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D21163
</content>
</entry>
<entry>
<title>Reduce size of rtld by 22% by pulling in less code from libc</title>
<updated>2019-06-30T11:49:58Z</updated>
<author>
<name>Alex Richardson</name>
<email>arichardson@FreeBSD.org</email>
</author>
<published>2019-06-30T11:49:58Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=b54a59f3ba244b76a34488090653df687527e53c'/>
<id>urn:sha1:b54a59f3ba244b76a34488090653df687527e53c</id>
<content type='text'>
Currently RTLD is linked against libc_nossp_pic which means that any libc
symbol used in rtld can pull in a lot of depedencies. This was causing
symbol such as __libc_interposing and all the pthread stubs to be included
in RTLD even though they are not required. It turns out most of these
dependencies can easily be avoided by providing overrides inside of rtld.

This change is motivated by CHERI, where we have an experimental ABI that
requires additional relocation processing to allow the use of function
pointers inside of rtld. Instead of adding this self-relocation code to
RTLD I attempted to remove most function pointers from RTLD and discovered
that most of them came from the libc dependencies instead of being actually
used inside rtld.

A nice side-effect of this change is that rtld is now 22% smaller on amd64.

   text	   data	    bss	    dec	    hex	filename
0x21eb6	  0xce0	  0xe60	 145910	  239f6	/home/alr48/ld-elf-x86.before.so.1
0x1a6ed	  0x728	  0xdd8	 113645	  1bbed	/home/alr48/ld-elf-x86.after.so.1

The number of R_X86_64_RELATIVE relocations that need to be processed on
startup has also gone down from 368 to 187 (almost 50% less).

Reviewed By:	kib
Differential Revision: https://reviews.freebsd.org/D20663
</content>
</entry>
<entry>
<title>Adjust posix symbols from rtld-elf/malloc.c with the __crt_ prefix.</title>
<updated>2019-01-29T22:40:42Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2019-01-29T22:40:42Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=1a3b2ebf9595f4203df1b54d8a1343b908a1ea9d'/>
<id>urn:sha1:1a3b2ebf9595f4203df1b54d8a1343b908a1ea9d</id>
<content type='text'>
This allows to reuse the allocator in other environments that get
malloc(3) and related functions from libc or interposer.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D18988
</content>
</entry>
<entry>
<title>libexec: adoption of SPDX licensing ID tags.</title>
<updated>2017-11-27T15:25:02Z</updated>
<author>
<name>Pedro F. Giffuni</name>
<email>pfg@FreeBSD.org</email>
</author>
<published>2017-11-27T15:25:02Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=e6209940dee96d8deed5ee7c2b2663512dd55db9'/>
<id>urn:sha1:e6209940dee96d8deed5ee7c2b2663512dd55db9</id>
<content type='text'>
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

No functional change intended.
</content>
</entry>
<entry>
<title>Increase alignment to size of pointer if the alignment is too small.</title>
<updated>2014-02-22T11:06:48Z</updated>
<author>
<name>David Xu</name>
<email>davidxu@FreeBSD.org</email>
</author>
<published>2014-02-22T11:06:48Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=eab68f795a5cfe398a635980176572357983e53e'/>
<id>urn:sha1:eab68f795a5cfe398a635980176572357983e53e</id>
<content type='text'>
Some modules do not align data at least to size of pointer, they uses a
smaller alignment, but our pointer should be aligned to its native
boundary, otherwise on some platforms, hardware alignment checking
will cause bus error.
</content>
</entry>
<entry>
<title>malloc_aligned() may not leave enough space for pointer to allocated memory,</title>
<updated>2014-02-21T03:36:16Z</updated>
<author>
<name>David Xu</name>
<email>davidxu@FreeBSD.org</email>
</author>
<published>2014-02-21T03:36:16Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=209782e06fd16c7330d789ff13502d5767a3a88f'/>
<id>urn:sha1:209782e06fd16c7330d789ff13502d5767a3a88f</id>
<content type='text'>
saving the pointer will overwrite bytes belongs to another memory block
unexpectly, to fix the problem, use (allocated address + sizeof(void *)) as
initial value, and slip to next aligned address, so maximum extra bytes is
sizeof(void *) + align - 1.

Tested by: Andre Albsmeier &lt; mail at ma17 dot ata dot myota dot orgndre &gt;
</content>
</entry>
<entry>
<title>Build an allocator for the aligned memory on top of the rtld-private</title>
<updated>2013-12-06T21:30:31Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2013-12-06T21:30:31Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=dfe296c43a26175f98ded41168e5c106edd52599'/>
<id>urn:sha1:dfe296c43a26175f98ded41168e5c106edd52599</id>
<content type='text'>
malloc.

Reviewed by:	kan
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
</content>
</entry>
</feed>
