<feed xmlns='http://www.w3.org/2005/Atom'>
<title>musl/src/internal, branch v1.0.2</title>
<subtitle>musl - an implementation of the standard library for Linux-based systems</subtitle>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/'/>
<entry>
<title>use hidden visibility rather than protected for syscall internals</title>
<updated>2014-04-16T06:46:05+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2014-04-12T04:16:19+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=f82b05c496b0597d35e437a15105ee796bc3a8d6'/>
<id>f82b05c496b0597d35e437a15105ee796bc3a8d6</id>
<content type='text'>
the use of visibility at all is purely an optimization to avoid the
need for the caller to load the GOT register or similar to prepare for
a call via the PLT. there is no reason for these symbols to be
externally visible, so hidden works just as well as protected, and
using protected visibility is undesirable due to toolchain bugs and
the lack of testing it receives.

in particular, GCC's microblaze target is known to generate symbolic
relocations in the GOT for functions with protected visibility. this
in turn results in a dynamic linker which crashes under any nontrivial
usage that requires making a syscall before symbolic relocations are
processed.

(cherry picked from commit 83c98aac4c43f9571e8f92a1c795afe02c237d4b)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
the use of visibility at all is purely an optimization to avoid the
need for the caller to load the GOT register or similar to prepare for
a call via the PLT. there is no reason for these symbols to be
externally visible, so hidden works just as well as protected, and
using protected visibility is undesirable due to toolchain bugs and
the lack of testing it receives.

in particular, GCC's microblaze target is known to generate symbolic
relocations in the GOT for functions with protected visibility. this
in turn results in a dynamic linker which crashes under any nontrivial
usage that requires making a syscall before symbolic relocations are
processed.

(cherry picked from commit 83c98aac4c43f9571e8f92a1c795afe02c237d4b)
</pre>
</div>
</content>
</entry>
<entry>
<title>include header that declares __syscall_ret where it's defined</title>
<updated>2014-04-16T06:46:04+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2014-03-24T00:42:05+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=f27ca16e9d715d778f48fd27a96bb31d809ecdde'/>
<id>f27ca16e9d715d778f48fd27a96bb31d809ecdde</id>
<content type='text'>
in general, we aim to always include the header that's declaring a
function before defining it so that the compiler can check that
prototypes match.

additionally, the internal syscall.h declares __syscall_ret with a
visibility attribute to improve code generation for shared libc (to
prevent gratuitous GOT-register loads). this declaration should be
visible at the point where __syscall_ret is defined, too, or the
inconsistency could theoretically lead to problems at link-time.

(cherry picked from commit 30c1205acd73c8481ca34f0a41de1d41884d07b5)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
in general, we aim to always include the header that's declaring a
function before defining it so that the compiler can check that
prototypes match.

additionally, the internal syscall.h declares __syscall_ret with a
visibility attribute to improve code generation for shared libc (to
prevent gratuitous GOT-register loads). this declaration should be
visible at the point where __syscall_ret is defined, too, or the
inconsistency could theoretically lead to problems at link-time.

(cherry picked from commit 30c1205acd73c8481ca34f0a41de1d41884d07b5)
</pre>
</div>
</content>
</entry>
<entry>
<title>rename superh port to "sh" for consistency</title>
<updated>2014-02-28T03:03:25+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2014-02-28T03:03:25+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=aacd348637e38795dd7ae3c7c8c908d8c0cd24fd'/>
<id>aacd348637e38795dd7ae3c7c8c908d8c0cd24fd</id>
<content type='text'>
linux, gcc, etc. all use "sh" as the name for the superh arch. there
was already some inconsistency internally in musl: the dynamic linker
was searching for "ld-musl-sh.path" as its path file despite its own
name being "ld-musl-superh.so.1". there was some sentiment in both
directions as to how to resolve the inconsistency, but overall "sh"
was favored.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
linux, gcc, etc. all use "sh" as the name for the superh arch. there
was already some inconsistency internally in musl: the dynamic linker
was searching for "ld-musl-sh.path" as its path file despite its own
name being "ld-musl-superh.so.1". there was some sentiment in both
directions as to how to resolve the inconsistency, but overall "sh"
was favored.
</pre>
</div>
</content>
</entry>
<entry>
<title>superh port</title>
<updated>2014-02-23T22:15:54+00:00</updated>
<author>
<name>Bobby Bingham</name>
<email>koorogi@koorogi.info</email>
</author>
<published>2013-10-05T10:13:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=3a3c813e08d808224c12fd0e9104aeff7c45c9a7'/>
<id>3a3c813e08d808224c12fd0e9104aeff7c45c9a7</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>mostly-cosmetic fixups to x32 port merge</title>
<updated>2014-02-23T10:43:09+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2014-02-23T10:43:09+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=d8b587796f7cfa0c3aa780ad19afe2e30ce84a09'/>
<id>d8b587796f7cfa0c3aa780ad19afe2e30ce84a09</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>import vanilla x86_64 code as x32</title>
<updated>2014-02-23T10:07:18+00:00</updated>
<author>
<name>rofl0r</name>
<email>retnyg@gmx.net</email>
</author>
<published>2014-01-07T21:43:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=323272db175204b951f119dae4bd99ef05e20f13'/>
<id>323272db175204b951f119dae4bd99ef05e20f13</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>internal/syscall.h: add syscall_arg_t macro</title>
<updated>2014-02-22T11:24:35+00:00</updated>
<author>
<name>rofl0r</name>
<email>retnyg@gmx.net</email>
</author>
<published>2014-01-07T15:49:23+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=5cc1d920ba21e9f7672438e86fa11a0db52e23ea'/>
<id>5cc1d920ba21e9f7672438e86fa11a0db52e23ea</id>
<content type='text'>
some 32-on-64 archs require that the actual syscall args be long long.
in that case syscall_arch.h can define syscall_arg_t to whatever it needs
and syscall.h picks it up.
all other archs just use long as usual.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
some 32-on-64 archs require that the actual syscall args be long long.
in that case syscall_arch.h can define syscall_arg_t to whatever it needs
and syscall.h picks it up.
all other archs just use long as usual.
</pre>
</div>
</content>
</entry>
<entry>
<title>internal/syscall.h: use a macro for the syscall args casts</title>
<updated>2014-02-22T08:50:39+00:00</updated>
<author>
<name>rofl0r</name>
<email>retnyg@gmx.net</email>
</author>
<published>2014-01-07T02:31:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=bf84967cae9a5ef5582f9bbf5a097fb083126e33'/>
<id>bf84967cae9a5ef5582f9bbf5a097fb083126e33</id>
<content type='text'>
this allows syscall_arch.h to define the macro __scc if special
casting is needed, as is the case for x32, where the actual syscall
arguments are 64bit, but, in case of pointers, would get sign-extended
and thus become invalid.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
this allows syscall_arch.h to define the macro __scc if special
casting is needed, as is the case for x32, where the actual syscall
arguments are 64bit, but, in case of pointers, would get sign-extended
and thus become invalid.
</pre>
</div>
</content>
</entry>
<entry>
<title>fix ftello result for append streams with unflushed output</title>
<updated>2014-02-07T05:57:50+00:00</updated>
<author>
<name>Rich Felker</name>
<email>dalias@aerifal.cx</email>
</author>
<published>2014-02-07T05:57:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=3af2edee150484940916eba1984f78c3b965dd05'/>
<id>3af2edee150484940916eba1984f78c3b965dd05</id>
<content type='text'>
when there is unflushed output, ftello (and ftell) compute the logical
stream position as the underlying file descriptor's offset plus an
adjustment for the amount of buffered data. however, this can give the
wrong result for append-mode streams where the unflushed writes should
adjust the logical position to be at the end of the file, as if a seek
to end-of-file takes place before the write.

the solution turns out to be a simple trick: when ftello (indirectly)
calls lseek to determine the current file offset, use SEEK_END instead
of SEEK_CUR if the stream is append-mode and there's unwritten
buffered data.

the ISO C rules regarding switching between reading and writing for a
stream opened in an update mode, along with the POSIX rules regarding
switching "active handles", conveniently leave undefined the
hypothetical usage cases where this fix might lead to observably
incorrect offsets.

the bug being fixed was discovered via the test case for glibc issue
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
when there is unflushed output, ftello (and ftell) compute the logical
stream position as the underlying file descriptor's offset plus an
adjustment for the amount of buffered data. however, this can give the
wrong result for append-mode streams where the unflushed writes should
adjust the logical position to be at the end of the file, as if a seek
to end-of-file takes place before the write.

the solution turns out to be a simple trick: when ftello (indirectly)
calls lseek to determine the current file offset, use SEEK_END instead
of SEEK_CUR if the stream is append-mode and there's unwritten
buffered data.

the ISO C rules regarding switching between reading and writing for a
stream opened in an update mode, along with the POSIX rules regarding
switching "active handles", conveniently leave undefined the
hypothetical usage cases where this fix might lead to observably
incorrect offsets.

the bug being fixed was discovered via the test case for glibc issue
</pre>
</div>
</content>
</entry>
<entry>
<title>include cleanups: remove unused headers and add feature test macros</title>
<updated>2013-12-12T05:09:18+00:00</updated>
<author>
<name>Szabolcs Nagy</name>
<email>nsz@port70.net</email>
</author>
<published>2013-12-12T05:09:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.musl-libc.org/cgit/musl/commit/?id=571744447c23f91feb6439948f3a619aca850dfb'/>
<id>571744447c23f91feb6439948f3a619aca850dfb</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
