<feed xmlns='http://www.w3.org/2005/Atom'>
<title>glibc.git/elf/dl-printf.c, branch master</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/'/>
<entry>
<title>elf: Fix tunable handing with clang</title>
<updated>2025-10-21T12:26:04+00:00</updated>
<author>
<name>Adhemerval Zanella</name>
<email>adhemerval.zanella@linaro.org</email>
</author>
<published>2025-10-17T19:13:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=2ebfb31b35c89f8ba1da1ed8b90fba26566017a9'/>
<id>2ebfb31b35c89f8ba1da1ed8b90fba26566017a9</id>
<content type='text'>
Recent clang version optimizes some loops contructions to strlen [1],
which might generate function calls when self-relocation is not
already done (on tunable parsing).  Use an out-of-line function
with __attribute_optimization_barrier__ to avoid this.

[1] https://github.com/llvm/llvm-project/pull/132572/commits/facd7dfc80d655fe49baf4bf27e144a4c890a149

Reviewed-by: Sam James &lt;sam@gentoo.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Recent clang version optimizes some loops contructions to strlen [1],
which might generate function calls when self-relocation is not
already done (on tunable parsing).  Use an out-of-line function
with __attribute_optimization_barrier__ to avoid this.

[1] https://github.com/llvm/llvm-project/pull/132572/commits/facd7dfc80d655fe49baf4bf27e144a4c890a149

Reviewed-by: Sam James &lt;sam@gentoo.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Update copyright dates with scripts/update-copyrights</title>
<updated>2025-01-01T19:22:09+00:00</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2025-01-01T18:14:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=2642002380aafb71a1d3b569b6d7ebeab3284816'/>
<id>2642002380aafb71a1d3b569b6d7ebeab3284816</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Update copyright dates with scripts/update-copyrights</title>
<updated>2024-01-01T18:53:40+00:00</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2024-01-01T18:12:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=dff8da6b3e89b986bb7f6b1ec18cf65d5972e307'/>
<id>dff8da6b3e89b986bb7f6b1ec18cf65d5972e307</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>elf: Fix _dl_debug_vdprintf to work before self-relocation</title>
<updated>2023-11-21T19:15:42+00:00</updated>
<author>
<name>Adhemerval Zanella</name>
<email>adhemerval.zanella@linaro.org</email>
</author>
<published>2023-11-06T20:25:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=434eca873f14f618d6c2279b54fb809fb56f2c50'/>
<id>434eca873f14f618d6c2279b54fb809fb56f2c50</id>
<content type='text'>
The strlen might trigger and invalid GOT entry if it used before
the process is self-relocated (for instance on dl-tunables if any
error occurs).

For i386, _dl_writev with PIE requires to use the old 'int $0x80'
syscall mode because the calling the TLS register (gs) is not yet
initialized.

Checked on x86_64-linux-gnu.
Reviewed-by: Siddhesh Poyarekar &lt;siddhesh@sourceware.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The strlen might trigger and invalid GOT entry if it used before
the process is self-relocated (for instance on dl-tunables if any
error occurs).

For i386, _dl_writev with PIE requires to use the old 'int $0x80'
syscall mode because the calling the TLS register (gs) is not yet
initialized.

Checked on x86_64-linux-gnu.
Reviewed-by: Siddhesh Poyarekar &lt;siddhesh@sourceware.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>elf: fix handling of negative numbers in dl-printf</title>
<updated>2023-05-25T16:50:59+00:00</updated>
<author>
<name>Roy Eldar</name>
<email>royeldar0@gmail.com</email>
</author>
<published>2023-05-25T14:41:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=dae801527386f94e9d2fabf23c37863d1b599153'/>
<id>dae801527386f94e9d2fabf23c37863d1b599153</id>
<content type='text'>
_dl_debug_vdprintf is a bare-bones printf implementation; currently
printing a signed integer (using "%d" format specifier) behaves
incorrectly when the number is negative, as it just prints the
corresponding unsigned integer, preceeded by a minus sign.

For example, _dl_printf("%d", -1) would print '-4294967295'.

Signed-off-by: Roy Eldar &lt;royeldar0@gmail.com&gt;
Reviewed-by: Florian Weimer &lt;fweimer@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
_dl_debug_vdprintf is a bare-bones printf implementation; currently
printing a signed integer (using "%d" format specifier) behaves
incorrectly when the number is negative, as it just prints the
corresponding unsigned integer, preceeded by a minus sign.

For example, _dl_printf("%d", -1) would print '-4294967295'.

Signed-off-by: Roy Eldar &lt;royeldar0@gmail.com&gt;
Reviewed-by: Florian Weimer &lt;fweimer@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Update copyright dates with scripts/update-copyrights</title>
<updated>2023-01-06T21:14:39+00:00</updated>
<author>
<name>Joseph Myers</name>
<email>joseph@codesourcery.com</email>
</author>
<published>2023-01-06T21:08:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=6d7e8eda9b85b08f207a6dc6f187e94e4817270f'/>
<id>6d7e8eda9b85b08f207a6dc6f187e94e4817270f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>elf: Remove allocate use on _dl_debug_printf</title>
<updated>2022-11-02T14:30:24+00:00</updated>
<author>
<name>Adhemerval Zanella</name>
<email>adhemerval.zanella@linaro.org</email>
</author>
<published>2022-10-31T18:46:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=40c112ed0d7d0577d2f84851c1f7b8157b3bd2f5'/>
<id>40c112ed0d7d0577d2f84851c1f7b8157b3bd2f5</id>
<content type='text'>
The maximum number of directives is already limited by the maximum
value of iovec, and current padding usage on _dl_map_object_from_fd
specifies a value of 16 (2 times sizeof (void *)) in hexa, which is
less than the INT_STRLEN_BOUND(void *) (20 for LP64).

This works if pointers are larger than 8 bytes, for instance 16.
In this case the maximum padding would be 32 and the IFMTSIZE would
be 40.

The resulting code does use a slightly larger static stack, the
output of -fstack-usage (for x86_64):

 * master:
   dl-printf.c:35:1:_dl_debug_vdprintf     1344    dynamic

 * patch:
   dl-printf.c:36:1:_dl_debug_vdprintf     2416    static

However, there is an improvement in code generation:

 * master
   text    data     bss     dec     hex filename
   3309       0       0    3309     ced elf/dl-printf.os

 * patch
   text    data     bss     dec     hex filename
   3151       0       0    3151     c4f elf/dl-printf.os

Checked on x86_64-linux-gnu.

Reviewed-by: Szabolcs Nagy &lt;szabolcs.nagy@arm.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The maximum number of directives is already limited by the maximum
value of iovec, and current padding usage on _dl_map_object_from_fd
specifies a value of 16 (2 times sizeof (void *)) in hexa, which is
less than the INT_STRLEN_BOUND(void *) (20 for LP64).

This works if pointers are larger than 8 bytes, for instance 16.
In this case the maximum padding would be 32 and the IFMTSIZE would
be 40.

The resulting code does use a slightly larger static stack, the
output of -fstack-usage (for x86_64):

 * master:
   dl-printf.c:35:1:_dl_debug_vdprintf     1344    dynamic

 * patch:
   dl-printf.c:36:1:_dl_debug_vdprintf     2416    static

However, there is an improvement in code generation:

 * master
   text    data     bss     dec     hex filename
   3309       0       0    3309     ced elf/dl-printf.os

 * patch
   text    data     bss     dec     hex filename
   3151       0       0    3151     c4f elf/dl-printf.os

Checked on x86_64-linux-gnu.

Reviewed-by: Szabolcs Nagy &lt;szabolcs.nagy@arm.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>elf: Fix alloca size in _dl_debug_vdprintf</title>
<updated>2022-10-28T10:16:09+00:00</updated>
<author>
<name>Szabolcs Nagy</name>
<email>szabolcs.nagy@arm.com</email>
</author>
<published>2022-10-11T13:22:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=eef17d4d9fcd38c5cbb9bc9515ba72d1773b67a2'/>
<id>eef17d4d9fcd38c5cbb9bc9515ba72d1773b67a2</id>
<content type='text'>
The alloca size did not consider the optional width parameter for
padding which could cause buffer underflow. The width is currently used
e.g. by _dl_map_object_from_fd which passes 2 * sizeof(void *) which
can be larger than the alloca buffer size on targets where
sizeof(void *) &gt;= 2 * sizeof(unsigned long).

Even if large width is not used on existing targets it is better to fix
the formatting code to avoid surprises.

Reviewed-by: Florian Weimer &lt;fweimer@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The alloca size did not consider the optional width parameter for
padding which could cause buffer underflow. The width is currently used
e.g. by _dl_map_object_from_fd which passes 2 * sizeof(void *) which
can be larger than the alloca buffer size on targets where
sizeof(void *) &gt;= 2 * sizeof(unsigned long).

Even if large width is not used on existing targets it is better to fix
the formatting code to avoid surprises.

Reviewed-by: Florian Weimer &lt;fweimer@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Use '%z' instead of '%Z' on printf functions</title>
<updated>2022-09-22T11:48:04+00:00</updated>
<author>
<name>Adhemerval Zanella Netto</name>
<email>adhemerval.zanella@linaro.org</email>
</author>
<published>2022-09-01T13:02:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=de477abcaaabb1f9815cb63876637a47a95e7ac1'/>
<id>de477abcaaabb1f9815cb63876637a47a95e7ac1</id>
<content type='text'>
The Z modifier is a nonstandard synonymn for z (that predates z
itself) and compiler might issue an warning for in invalid
conversion specifier.

Reviewed-by: Florian Weimer &lt;fweimer@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The Z modifier is a nonstandard synonymn for z (that predates z
itself) and compiler might issue an warning for in invalid
conversion specifier.

Reviewed-by: Florian Weimer &lt;fweimer@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>elf: Split dl-printf.c from dl-misc.c</title>
<updated>2022-01-14T19:17:05+00:00</updated>
<author>
<name>Florian Weimer</name>
<email>fweimer@redhat.com</email>
</author>
<published>2022-01-14T19:16:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/glibc.git/commit/?id=b693d75f0c611bce9b0ad984bad306121d42c535'/>
<id>b693d75f0c611bce9b0ad984bad306121d42c535</id>
<content type='text'>
This allows to use different compiler flags for the diagnostics
code.

Reviewed-by: H.J. Lu &lt;hjl.tools@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This allows to use different compiler flags for the diagnostics
code.

Reviewed-by: H.J. Lu &lt;hjl.tools@gmail.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
