<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<id>tag:old.nabble.com,2006:forum-12198</id>
	<title>Nabble - Sourceware - glibc</title>
	<updated>2009-12-17T02:18:03Z</updated>
	<link rel="self" type="application/atom+xml" href="http://old.nabble.com/Sourceware---glibc-f12198.xml" />
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Sourceware---glibc-f12198.html" />
	<subtitle type="html">&lt;a href=&quot;http://sourceware.org/glibc/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;glibc&lt;/a&gt;&amp;nbsp;stands for GNU libc program.
&lt;br&gt;Any Unix-like operating system needs a C library: the library which defines the &amp;quot;system calls'' and other basic facilities such as open, malloc, printf, exit, etc.
&lt;br&gt;The GNU C library is used as the C library in the GNU system and most systems with the Linux kernel.</subtitle>
	
<entry>
	<id>tag:old.nabble.com,2006:post-26828336</id>
	<title>Re: Is DT_TEXTREL supposed to be supported on s390 31-bit or not?</title>
	<published>2009-12-17T02:18:03Z</published>
	<updated>2009-12-17T02:18:03Z</updated>
	<author>
		<name>Martin Schwidefsky</name>
	</author>
	<content type="html">Hi Jakub,
&lt;br&gt;&lt;br&gt;On Wed, 16 Dec 2009 18:10:23 +0100
&lt;br&gt;Jakub Jelinek &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26828336&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jakub@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Wed, Dec 16, 2009 at 05:43:54PM +0100, Martin Schwidefsky wrote:
&lt;br&gt;&amp;gt; &amp;gt; On Wed, 16 Dec 2009 16:56:35 +0100
&lt;br&gt;&amp;gt; &amp;gt; Jakub Jelinek &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26828336&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jakub@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; While DT_TEXTREL libraries are clearly unsupported on many architectures and
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; on some even ld fails to link them, s390 31-bit (unlike 64-bit) DT_TEXTREL
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; libraries used to work. &amp;nbsp;But apparently only when targetting old CPUs, with
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; say -march=z900 or newer relocations like R_390_PC32DBL are created and
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; ld.so (nor prelink) handles them.
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; So my question is, do we just want to say that DT_TEXTREL on s390 31-bit is
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; not supported at all, or do we want to handle the relocations that can
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; appear in -fno-pic 31-bit libraries?
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; DT_TEXTREL on 64-bit is not supported because of weak global symbols and
&lt;br&gt;&amp;gt; &amp;gt; the limitation of the LARL instruction to a 4GB range. 
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; DT_TEXTREL on 31-bit used to work fine though and I can't see a reason
&lt;br&gt;&amp;gt; &amp;gt; why it should not work on newer CPUs. With -march=z900 the compiler
&lt;br&gt;&amp;gt; &amp;gt; will use LARL to get the address of global symbols, but the library will
&lt;br&gt;&amp;gt; &amp;gt; be loaded below 4GB. That should work.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; If so, can you please figure out what relocations might be needed
&lt;br&gt;&amp;gt; by -m31 -march=z900 (or later) code and add support for those relocs into
&lt;br&gt;&amp;gt; sysdeps/s390/s390-32/dl-machine.h ? &amp;nbsp;R_390_PC32DBL is the only one I've
&lt;br&gt;&amp;gt; noticed during prelink checking, but that doesn't mean it isn't the only
&lt;br&gt;&amp;gt; one.
&lt;/div&gt;&lt;br&gt;Ok, I've reproduced the problem. The load of a non-pic library compiled
&lt;br&gt;with -march=z9-109 gives the following error:
&lt;br&gt;&lt;br&gt;error while loading shared libraries: &amp;lt;lib&amp;gt;: unexpected reloc type 0x13
&lt;br&gt;&lt;br&gt;Reloc type 0x13 is indeed R_390_PC32DBL. The 32-bit variant
&lt;br&gt;of dl-machine.h does not handle this relocation which is used to access
&lt;br&gt;global variables for -m31 -march=z9-109. The following patches fixes
&lt;br&gt;the problem for me:
&lt;br&gt;&lt;br&gt;2009-12-17 &amp;nbsp;Martin Schwidefsky &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26828336&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;schwidefsky@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; * sysdeps/s390/s390-32/dl-machine.h (elf_machine_rela): Handle
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; R_390_PC32DBL. Remove unneeded R_390_PLT16DBL.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; * sysdeps/s390/s390-32/dl-machine.h (elf_machine_rela): Remove
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; unneeded R_390_PLT16DBL and R_390_PLT32DBL.
&lt;br&gt;&lt;br&gt;--
&lt;br&gt;diff -urpN glibc/sysdeps/s390/s390-32/dl-machine.h glibc-s390/sysdeps/s390/s390-32/dl-machine.h
&lt;br&gt;--- glibc/sysdeps/s390/s390-32/dl-machine.h	2009-12-17 10:48:49.000000000 +0100
&lt;br&gt;+++ glibc-s390/sysdeps/s390/s390-32/dl-machine.h	2009-12-17 10:47:30.000000000 +0100
&lt;br&gt;@@ -389,10 +389,13 @@ elf_machine_rela (struct link_map *map, 
&lt;br&gt;&amp;nbsp;	 &amp;nbsp;*reloc_addr = value + reloc-&amp;gt;r_addend - (Elf32_Addr) reloc_addr;
&lt;br&gt;&amp;nbsp;	 &amp;nbsp;break;
&lt;br&gt;&amp;nbsp;	case R_390_PC16DBL:
&lt;br&gt;-	case R_390_PLT16DBL:
&lt;br&gt;&amp;nbsp;	 &amp;nbsp;*(unsigned short *) reloc_addr = (unsigned short)
&lt;br&gt;&amp;nbsp;	 &amp;nbsp; &amp;nbsp;((short) (value + reloc-&amp;gt;r_addend - (Elf32_Addr) reloc_addr) &amp;gt;&amp;gt; 1);
&lt;br&gt;&amp;nbsp;	 &amp;nbsp;break;
&lt;br&gt;+	case R_390_PC32DBL:
&lt;br&gt;+	 &amp;nbsp;*(unsigned int *) reloc_addr = (unsigned int)
&lt;br&gt;+	 &amp;nbsp; &amp;nbsp;((int) (value + reloc-&amp;gt;r_addend - (Elf32_Addr) reloc_addr) &amp;gt;&amp;gt; 1);
&lt;br&gt;+	 &amp;nbsp;break;
&lt;br&gt;&amp;nbsp;	case R_390_PC16:
&lt;br&gt;&amp;nbsp;	 &amp;nbsp;*(unsigned short *) reloc_addr =
&lt;br&gt;&amp;nbsp;	 &amp;nbsp; &amp;nbsp;value + reloc-&amp;gt;r_addend - (Elf32_Addr) reloc_addr;
&lt;br&gt;diff -urpN glibc/sysdeps/s390/s390-64/dl-machine.h glibc-s390/sysdeps/s390/s390-64/dl-machine.h
&lt;br&gt;--- glibc/sysdeps/s390/s390-64/dl-machine.h	2009-12-17 10:48:49.000000000 +0100
&lt;br&gt;+++ glibc-s390/sysdeps/s390/s390-64/dl-machine.h	2009-12-17 10:47:20.000000000 +0100
&lt;br&gt;@@ -371,7 +371,6 @@ elf_machine_rela (struct link_map *map, 
&lt;br&gt;&amp;nbsp;	 &amp;nbsp;*reloc_addr = value +reloc-&amp;gt;r_addend - (Elf64_Addr) reloc_addr;
&lt;br&gt;&amp;nbsp;	 &amp;nbsp;break;
&lt;br&gt;&amp;nbsp;	case R_390_PC32DBL:
&lt;br&gt;-	case R_390_PLT32DBL:
&lt;br&gt;&amp;nbsp;	 &amp;nbsp;*(unsigned int *) reloc_addr = (unsigned int)
&lt;br&gt;&amp;nbsp;	 &amp;nbsp; &amp;nbsp;((int) (value + reloc-&amp;gt;r_addend - (Elf64_Addr) reloc_addr) &amp;gt;&amp;gt; 1);
&lt;br&gt;&amp;nbsp;	 &amp;nbsp;break;
&lt;br&gt;@@ -380,7 +379,6 @@ elf_machine_rela (struct link_map *map, 
&lt;br&gt;&amp;nbsp;	 &amp;nbsp; &amp;nbsp;value + reloc-&amp;gt;r_addend - (Elf64_Addr) reloc_addr;
&lt;br&gt;&amp;nbsp;	 &amp;nbsp;break;
&lt;br&gt;&amp;nbsp;	case R_390_PC16DBL:
&lt;br&gt;-	case R_390_PLT16DBL:
&lt;br&gt;&amp;nbsp;	 &amp;nbsp;*(unsigned short *) reloc_addr = (unsigned short)
&lt;br&gt;&amp;nbsp;	 &amp;nbsp; &amp;nbsp;((short) (value + reloc-&amp;gt;r_addend - (Elf64_Addr) reloc_addr) &amp;gt;&amp;gt; 1);
&lt;br&gt;&amp;nbsp;	 &amp;nbsp;break;
&lt;br&gt;-- 
&lt;br&gt;blue skies,
&lt;br&gt;&amp;nbsp; &amp;nbsp;Martin.
&lt;br&gt;&lt;br&gt;&amp;quot;Reality continues to ruin my life.&amp;quot; - Calvin.
&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Sourceware---libc-alpha-f12199.html&quot; embed=&quot;fixTarget[12199]&quot; target=&quot;_top&quot; &gt;Sourceware - libc-alpha&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Is-DT_TEXTREL-supposed-to-be-supported-on-s390-31-bit-or-not--tp26813651p26828336.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26825241</id>
	<title>[Bug libc/11099] INT_FIELD_MAYBE_NULL changed behaviour on x86_64</title>
	<published>2009-12-17T01:20:55Z</published>
	<updated>2009-12-17T01:20:55Z</updated>
	<author>
		<name>Bugzilla from sourceware-bugzilla@sourceware.org</name>
	</author>
	<content type="html">&lt;br&gt;------- Additional Comments From schwab at linux-m68k dot org &amp;nbsp;2009-12-17 09:20 -------
&lt;br&gt;The CVS-&amp;gt;git conversion is broken, use the CVS log.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [BZ #9706]
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; * nss/nss_files/files-parse.c (strtou32): New function.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (INT_FIELD): Use strotu32 instead of strtoul to unify behavior
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; across 32-bit and 64-bit platforms.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (INT_FIELD_MAYBE_NULL): Likewise.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://sourceware.org/bugzilla/show_bug.cgi?id=11099&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://sourceware.org/bugzilla/show_bug.cgi?id=11099&lt;/a&gt;&lt;br&gt;&lt;br&gt;------- You are receiving this mail because: -------
&lt;br&gt;You are on the CC list for the bug, or are watching someone who is.
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Sourceware---glibc-bugs-f12205.html&quot; embed=&quot;fixTarget[12205]&quot; target=&quot;_top&quot; &gt;Sourceware - glibc-bugs&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-Bug-libc-11099--New%3A-INT_FIELD_MAYBE_NULL-changed-behaviour-on-x86_64-tp26816245p26825241.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26819381</id>
	<title>[Bug libc/11100] New: sysdeps/unix/sysv/linux/ptrace.c PTRACE_SETOPTIONS inappropriate pointer check</title>
	<published>2009-12-16T14:11:17Z</published>
	<updated>2009-12-16T14:11:17Z</updated>
	<author>
		<name>Bugzilla from sourceware-bugzilla@sourceware.org</name>
	</author>
	<content type="html">In sysdeps/unix/sysv/linux/ptrace.c, on line 102, if __BOUNDED__POINTERS__ is 
&lt;br&gt;true, checks are done that pointers point at appropriate locations. Such a 
&lt;br&gt;check is done on the &amp;quot;data&amp;quot; argument to ptrace() if the &amp;quot;request&amp;quot; argument is 
&lt;br&gt;PTRACE_SETOPTIONS. However, according to ptrace(2) (and, indeed, according to 
&lt;br&gt;the gdb sources and the kernel sources), the PTRACE_SETOPTIONS request accepts 
&lt;br&gt;a bitmask of PTRACE_O_* values as its &amp;quot;data&amp;quot; argument, *not* a pointer.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Summary: sysdeps/unix/sysv/linux/ptrace.c PTRACE_SETOPTIONS
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; inappropriate pointer check
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Product: glibc
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Version: unspecified
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Status: NEW
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Severity: minor
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Priority: P2
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Component: libc
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AssignedTo: drepper at redhat dot com
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ReportedBy: chris2k01 at hotmail dot com
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CC: glibc-bugs at sources dot redhat dot com
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://sourceware.org/bugzilla/show_bug.cgi?id=11100&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://sourceware.org/bugzilla/show_bug.cgi?id=11100&lt;/a&gt;&lt;br&gt;&lt;br&gt;------- You are receiving this mail because: -------
&lt;br&gt;You are on the CC list for the bug, or are watching someone who is.
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Sourceware---glibc-bugs-f12205.html&quot; embed=&quot;fixTarget[12205]&quot; target=&quot;_top&quot; &gt;Sourceware - glibc-bugs&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-Bug-libc-11100--New%3A-sysdeps-unix-sysv-linux-ptrace.c-PTRACE_SETOPTIONS-inappropriate-pointer-check-tp26819381p26819381.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26816435</id>
	<title>Re: [MIPS,M68K] Update bits/poll.h</title>
	<published>2009-12-16T10:53:56Z</published>
	<updated>2009-12-16T10:53:56Z</updated>
	<author>
		<name>Andreas Schwab-2</name>
	</author>
	<content type="html">&amp;quot;Joseph S. Myers&amp;quot; &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26816435&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;joseph@...&lt;/a&gt;&amp;gt; writes:
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;nbsp;2009-12-16 &amp;nbsp;Joseph Myers &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26816435&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;joseph@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt; +	[BZ #11093]
&lt;br&gt;&amp;gt; +	* sysdeps/unix/sysv/linux/m68k/bits/poll.h: Define POLLRDNORM,
&lt;br&gt;&amp;gt; +	POLLRDBAND, POLLWRNORM, and POLLWRBAND also for POSIX 2008.
&lt;br&gt;&amp;gt; +
&lt;br&gt;&lt;br&gt;Ok.
&lt;br&gt;&lt;br&gt;Andreas.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Andreas Schwab, &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26816435&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;schwab@...&lt;/a&gt;
&lt;br&gt;GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 &amp;nbsp;01D3 44D5 214B 8276 4ED5
&lt;br&gt;&amp;quot;And now for something completely different.&amp;quot;
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Sourceware---libc-ports-f12204.html&quot; embed=&quot;fixTarget[12204]&quot; target=&quot;_top&quot; &gt;Sourceware - libc-ports&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-MIPS%2CM68K--Update-bits-poll.h-tp26815445p26816435.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26816245</id>
	<title>[Bug libc/11099] New: INT_FIELD_MAYBE_NULL changed behaviour on x86_64</title>
	<published>2009-12-16T10:41:19Z</published>
	<updated>2009-12-16T10:41:19Z</updated>
	<author>
		<name>Bugzilla from sourceware-bugzilla@sourceware.org</name>
	</author>
	<content type="html">We had password aging bugs on Mandriva and I found that when a field of
&lt;br&gt;/etc/shadow contains -1, it gets 32 bits value of -1 on x86_64 even if the field
&lt;br&gt;is long in the struct.
&lt;br&gt;&lt;br&gt;According to the doc it should indeed be empty to disable instead of containing
&lt;br&gt;-1, but well the field is signed and nothing prevents from having a negative value
&lt;br&gt;&lt;br&gt;It used to work and the behavior change broke tests like spw-&amp;gt;sp_* != -1 in pam
&lt;br&gt;modules
&lt;br&gt;&lt;br&gt;The change was introduced by
&lt;br&gt;&lt;a href=&quot;http://repo.or.cz/w/glibc.git/commitdiff/1e545d0185072ac0d4646223d509c3692cbe550a&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://repo.or.cz/w/glibc.git/commitdiff/1e545d0185072ac0d4646223d509c3692cbe550a&lt;/a&gt;&amp;nbsp;with
&lt;br&gt;a commit message unrelated to this part of the commit
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Summary: INT_FIELD_MAYBE_NULL changed behaviour on x86_64
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Product: glibc
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Version: 2.11
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Status: NEW
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Severity: normal
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Priority: P2
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Component: libc
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AssignedTo: drepper at redhat dot com
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ReportedBy: pterjan at mandriva dot com
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CC: glibc-bugs at sources dot redhat dot com
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://sourceware.org/bugzilla/show_bug.cgi?id=11099&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://sourceware.org/bugzilla/show_bug.cgi?id=11099&lt;/a&gt;&lt;br&gt;&lt;br&gt;------- You are receiving this mail because: -------
&lt;br&gt;You are on the CC list for the bug, or are watching someone who is.
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Sourceware---glibc-bugs-f12205.html&quot; embed=&quot;fixTarget[12205]&quot; target=&quot;_top&quot; &gt;Sourceware - glibc-bugs&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-Bug-libc-11099--New%3A-INT_FIELD_MAYBE_NULL-changed-behaviour-on-x86_64-tp26816245p26816245.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26815671</id>
	<title>Re: Breaking ARM's mcount implementations into a separate file</title>
	<published>2009-12-16T10:04:41Z</published>
	<updated>2009-12-16T10:04:41Z</updated>
	<author>
		<name>Joseph S. Myers</name>
	</author>
	<content type="html">On Tue, 15 Dec 2009, Thomas Schwinge wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;gt; You'll need to send the patch in a form appropriate for committing, tested 
&lt;br&gt;&amp;gt; &amp;gt; as both ARM and Thumb-2.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Thusly done with the following patch.
&lt;br&gt;&lt;br&gt;Thank you, I have committed this patch.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Joseph S. Myers
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26815671&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;joseph@...&lt;/a&gt;
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Sourceware---libc-ports-f12204.html&quot; embed=&quot;fixTarget[12204]&quot; target=&quot;_top&quot; &gt;Sourceware - libc-ports&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Breaking-ARM%27s-mcount-implementations-into-a-separate-file-tp26787384p26815671.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26815445</id>
	<title>[MIPS,M68K] Update bits/poll.h</title>
	<published>2009-12-16T09:50:02Z</published>
	<updated>2009-12-16T09:50:02Z</updated>
	<author>
		<name>Joseph S. Myers</name>
	</author>
	<content type="html">This patch updates ports bits/poll.h headers in line with a recent libc 
&lt;br&gt;change. &amp;nbsp;I've committed the MIPS patch; OK to commit the M68K one?
&lt;br&gt;&lt;br&gt;diff --git a/ChangeLog.m68k b/ChangeLog.m68k
&lt;br&gt;index 8411570..978cd1a 100644
&lt;br&gt;--- a/ChangeLog.m68k
&lt;br&gt;+++ b/ChangeLog.m68k
&lt;br&gt;@@ -1,5 +1,11 @@
&lt;br&gt;&amp;nbsp;2009-12-16 &amp;nbsp;Joseph Myers &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26815445&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;joseph@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+	[BZ #11093]
&lt;br&gt;+	* sysdeps/unix/sysv/linux/m68k/bits/poll.h: Define POLLRDNORM,
&lt;br&gt;+	POLLRDBAND, POLLWRNORM, and POLLWRBAND also for POSIX 2008.
&lt;br&gt;+
&lt;br&gt;+2009-12-16 &amp;nbsp;Joseph Myers &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26815445&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;joseph@...&lt;/a&gt;&amp;gt;
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;	* sysdeps/unix/sysv/linux/m68k/bits/fcntl.h: Redefine O_SYNC and
&lt;br&gt;&amp;nbsp;	O_DSYNC to match 2.6.33+ kernels.
&lt;br&gt;&amp;nbsp;
&lt;br&gt;diff --git a/ChangeLog.mips b/ChangeLog.mips
&lt;br&gt;index 0f8f7c8..68ba90d 100644
&lt;br&gt;--- a/ChangeLog.mips
&lt;br&gt;+++ b/ChangeLog.mips
&lt;br&gt;@@ -1,5 +1,11 @@
&lt;br&gt;&amp;nbsp;2009-12-16 &amp;nbsp;Joseph Myers &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26815445&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;joseph@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+	[BZ #11093]
&lt;br&gt;+	* sysdeps/unix/sysv/linux/mips/bits/poll.h: Define POLLRDNORM,
&lt;br&gt;+	POLLRDBAND, POLLWRNORM, and POLLWRBAND also for POSIX 2008.
&lt;br&gt;+
&lt;br&gt;+2009-12-16 &amp;nbsp;Joseph Myers &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26815445&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;joseph@...&lt;/a&gt;&amp;gt;
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;	* sysdeps/mips/dl-lookup.c: Update from generic version.
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;2009-12-15 &amp;nbsp;Joseph Myers &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26815445&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;joseph@...&lt;/a&gt;&amp;gt;
&lt;br&gt;diff --git a/sysdeps/unix/sysv/linux/m68k/bits/poll.h b/sysdeps/unix/sysv/linux/m68k/bits/poll.h
&lt;br&gt;index bc28579..84219ba 100644
&lt;br&gt;--- a/sysdeps/unix/sysv/linux/m68k/bits/poll.h
&lt;br&gt;+++ b/sysdeps/unix/sysv/linux/m68k/bits/poll.h
&lt;br&gt;@@ -1,4 +1,4 @@
&lt;br&gt;-/* Copyright (C) 1997, 2001, 2008 Free Software Foundation, Inc.
&lt;br&gt;+/* Copyright (C) 1997, 2001, 2008, 2009 Free Software Foundation, Inc.
&lt;br&gt;&amp;nbsp; &amp;nbsp; This file is part of the GNU C Library.
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp; &amp;nbsp; The GNU C Library is free software; you can redistribute it and/or
&lt;br&gt;@@ -27,7 +27,7 @@
&lt;br&gt;&amp;nbsp;#define POLLPRI		0x002		/* There is urgent data to read. &amp;nbsp;*/
&lt;br&gt;&amp;nbsp;#define POLLOUT		0x004		/* Writing now will not block. &amp;nbsp;*/
&lt;br&gt;&amp;nbsp;
&lt;br&gt;-#ifdef __USE_XOPEN
&lt;br&gt;+#if defined __USE_XOPEN || defined __USE_XOPEN2K8
&lt;br&gt;&amp;nbsp;/* These values are defined in XPG4.2. &amp;nbsp;*/
&lt;br&gt;&amp;nbsp;# define POLLRDNORM	0x040		/* Normal data may be read. &amp;nbsp;*/
&lt;br&gt;&amp;nbsp;# define POLLRDBAND	0x080		/* Priority data may be read. &amp;nbsp;*/
&lt;br&gt;diff --git a/sysdeps/unix/sysv/linux/mips/bits/poll.h b/sysdeps/unix/sysv/linux/mips/bits/poll.h
&lt;br&gt;index eee4ea2..8231239 100644
&lt;br&gt;--- a/sysdeps/unix/sysv/linux/mips/bits/poll.h
&lt;br&gt;+++ b/sysdeps/unix/sysv/linux/mips/bits/poll.h
&lt;br&gt;@@ -1,4 +1,4 @@
&lt;br&gt;-/* Copyright (C) 1997, 2001, 2006 Free Software Foundation, Inc.
&lt;br&gt;+/* Copyright (C) 1997, 2001, 2006, 2009 Free Software Foundation, Inc.
&lt;br&gt;&amp;nbsp; &amp;nbsp; This file is part of the GNU C Library.
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp; &amp;nbsp; The GNU C Library is free software; you can redistribute it and/or
&lt;br&gt;@@ -27,7 +27,7 @@
&lt;br&gt;&amp;nbsp;#define POLLPRI		0x002		/* There is urgent data to read. &amp;nbsp;*/
&lt;br&gt;&amp;nbsp;#define POLLOUT		0x004		/* Writing now will not block. &amp;nbsp;*/
&lt;br&gt;&amp;nbsp;
&lt;br&gt;-#ifdef __USE_XOPEN
&lt;br&gt;+#if defined __USE_XOPEN || defined __USE_XOPEN2K8
&lt;br&gt;&amp;nbsp;/* These values are defined in XPG4.2. &amp;nbsp;*/
&lt;br&gt;&amp;nbsp;# define POLLRDNORM	0x040		/* Normal data may be read. &amp;nbsp;*/
&lt;br&gt;&amp;nbsp;# define POLLRDBAND	0x080		/* Priority data may be read. &amp;nbsp;*/
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Joseph S. Myers
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26815445&amp;i=5&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;joseph@...&lt;/a&gt;
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Sourceware---libc-ports-f12204.html&quot; embed=&quot;fixTarget[12204]&quot; target=&quot;_top&quot; &gt;Sourceware - libc-ports&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-MIPS%2CM68K--Update-bits-poll.h-tp26815445p26815445.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26815374</id>
	<title>Another MIPS dl-lookup.c update</title>
	<published>2009-12-16T09:44:54Z</published>
	<updated>2009-12-16T09:44:54Z</updated>
	<author>
		<name>Joseph S. Myers</name>
	</author>
	<content type="html">Another change has gone into the libc dl-lookup.c, so I've applied the 
&lt;br&gt;patch also to the MIPS version.
&lt;br&gt;&lt;br&gt;diff --git a/ChangeLog.mips b/ChangeLog.mips
&lt;br&gt;index 9dfe2a5..0f8f7c8 100644
&lt;br&gt;--- a/ChangeLog.mips
&lt;br&gt;+++ b/ChangeLog.mips
&lt;br&gt;@@ -1,3 +1,7 @@
&lt;br&gt;+2009-12-16 &amp;nbsp;Joseph Myers &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26815374&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;joseph@...&lt;/a&gt;&amp;gt;
&lt;br&gt;+
&lt;br&gt;+	* sysdeps/mips/dl-lookup.c: Update from generic version.
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;2009-12-15 &amp;nbsp;Joseph Myers &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26815374&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;joseph@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;	* sysdeps/unix/sysv/linux/mips/bits/fcntl.h: Redefine O_SYNC and
&lt;br&gt;diff --git a/sysdeps/mips/dl-lookup.c b/sysdeps/mips/dl-lookup.c
&lt;br&gt;index c7deb4d..a9fff59 100644
&lt;br&gt;--- a/sysdeps/mips/dl-lookup.c
&lt;br&gt;+++ b/sysdeps/mips/dl-lookup.c
&lt;br&gt;@@ -794,7 +794,7 @@ _dl_lookup_symbol_x (const char *undef_name, struct link_map *undef_map,
&lt;br&gt;&amp;nbsp; &amp;nbsp;if (__builtin_expect (protected != 0, 0))
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;{
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/* It is very tricky. &amp;nbsp;We need to figure out what value to
&lt;br&gt;- &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return for the protected symbol. &amp;nbsp;*/
&lt;br&gt;+	 return for the protected symbol. &amp;nbsp;*/
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (type_class == ELF_RTYPE_CLASS_PLT)
&lt;br&gt;&amp;nbsp;	{
&lt;br&gt;&amp;nbsp;	 &amp;nbsp;if (current_value.s != NULL &amp;&amp; current_value.m != undef_map)
&lt;br&gt;@@ -839,7 +839,8 @@ _dl_lookup_symbol_x (const char *undef_name, struct link_map *undef_map,
&lt;br&gt;&amp;nbsp;				 &amp;nbsp;version, type_class, flags, skip_map);
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp; &amp;nbsp;/* The object is used. &amp;nbsp;*/
&lt;br&gt;- &amp;nbsp;current_value.m-&amp;gt;l_used = 1;
&lt;br&gt;+ &amp;nbsp;if (__builtin_expect (current_value.m-&amp;gt;l_used == 0, 0))
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;current_value.m-&amp;gt;l_used = 1;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp; &amp;nbsp;if (__builtin_expect (GLRO(dl_debug_mask)
&lt;br&gt;&amp;nbsp;			&amp; (DL_DEBUG_BINDINGS|DL_DEBUG_PRELINK), 0))
&lt;br&gt;@@ -861,7 +862,7 @@ _dl_setup_hash (struct link_map *map)
&lt;br&gt;&amp;nbsp; &amp;nbsp;Elf_Symndx nchain;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp; &amp;nbsp;if (__builtin_expect (map-&amp;gt;l_info[DT_ADDRTAGIDX (DT_GNU_HASH) + DT_NUM
&lt;br&gt;- &amp;nbsp;				 &amp;nbsp; &amp;nbsp;+ DT_THISPROCNUM + DT_VERSIONTAGNUM
&lt;br&gt;+				 &amp;nbsp; &amp;nbsp;+ DT_THISPROCNUM + DT_VERSIONTAGNUM
&lt;br&gt;&amp;nbsp;				 &amp;nbsp; &amp;nbsp;+ DT_EXTRANUM + DT_VALNUM] != NULL, 1))
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;{
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Elf32_Word *hash32
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Joseph S. Myers
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26815374&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;joseph@...&lt;/a&gt;
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Sourceware---libc-ports-f12204.html&quot; embed=&quot;fixTarget[12204]&quot; target=&quot;_top&quot; &gt;Sourceware - libc-ports&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Another-MIPS-dl-lookup.c-update-tp26815374p26815374.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26814771</id>
	<title>Re: Is DT_TEXTREL supposed to be supported on s390 31-bit or not?</title>
	<published>2009-12-16T09:10:23Z</published>
	<updated>2009-12-16T09:10:23Z</updated>
	<author>
		<name>Jakub Jelinek</name>
	</author>
	<content type="html">On Wed, Dec 16, 2009 at 05:43:54PM +0100, Martin Schwidefsky wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Wed, 16 Dec 2009 16:56:35 +0100
&lt;br&gt;&amp;gt; Jakub Jelinek &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26814771&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jakub@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; While DT_TEXTREL libraries are clearly unsupported on many architectures and
&lt;br&gt;&amp;gt; &amp;gt; on some even ld fails to link them, s390 31-bit (unlike 64-bit) DT_TEXTREL
&lt;br&gt;&amp;gt; &amp;gt; libraries used to work. &amp;nbsp;But apparently only when targetting old CPUs, with
&lt;br&gt;&amp;gt; &amp;gt; say -march=z900 or newer relocations like R_390_PC32DBL are created and
&lt;br&gt;&amp;gt; &amp;gt; ld.so (nor prelink) handles them.
&lt;br&gt;&amp;gt; &amp;gt; So my question is, do we just want to say that DT_TEXTREL on s390 31-bit is
&lt;br&gt;&amp;gt; &amp;gt; not supported at all, or do we want to handle the relocations that can
&lt;br&gt;&amp;gt; &amp;gt; appear in -fno-pic 31-bit libraries?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; DT_TEXTREL on 64-bit is not supported because of weak global symbols and
&lt;br&gt;&amp;gt; the limitation of the LARL instruction to a 4GB range. 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; DT_TEXTREL on 31-bit used to work fine though and I can't see a reason
&lt;br&gt;&amp;gt; why it should not work on newer CPUs. With -march=z900 the compiler
&lt;br&gt;&amp;gt; will use LARL to get the address of global symbols, but the library will
&lt;br&gt;&amp;gt; be loaded below 4GB. That should work.
&lt;/div&gt;&lt;br&gt;If so, can you please figure out what relocations might be needed
&lt;br&gt;by -m31 -march=z900 (or later) code and add support for those relocs into
&lt;br&gt;sysdeps/s390/s390-32/dl-machine.h ? &amp;nbsp;R_390_PC32DBL is the only one I've
&lt;br&gt;noticed during prelink checking, but that doesn't mean it isn't the only
&lt;br&gt;one.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Jakub
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Sourceware---libc-alpha-f12199.html&quot; embed=&quot;fixTarget[12199]&quot; target=&quot;_top&quot; &gt;Sourceware - libc-alpha&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Is-DT_TEXTREL-supposed-to-be-supported-on-s390-31-bit-or-not--tp26813651p26814771.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26814634</id>
	<title>Re: SH, S390: (not) calling __gmon_start__ from pt-initfini.c</title>
	<published>2009-12-16T08:46:19Z</published>
	<updated>2009-12-16T08:46:19Z</updated>
	<author>
		<name>Ulrich Drepper</name>
	</author>
	<content type="html">On 12/16/2009 08:34 AM, Martin Schwidefsky wrote:
&lt;br&gt;&amp;gt; Ok, from looking at the code it seems that the call to __gmon_start__
&lt;br&gt;&amp;gt; from libpthread is redundant. Andreas checked and tested the change,
&lt;br&gt;&amp;gt; that is good enough for me. Ok from my side.
&lt;br&gt;&lt;br&gt;Somebody will have to submit a new patch. &amp;nbsp;I'm not trying to second 
&lt;br&gt;guess from the various messages what has to be done.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Sourceware---libc-alpha-f12199.html&quot; embed=&quot;fixTarget[12199]&quot; target=&quot;_top&quot; &gt;Sourceware - libc-alpha&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/SH%2C-S390%3A-%28not%29-calling-__gmon_start__-from-pt-initfini.c-tp26544183p26814634.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26814622</id>
	<title>Re: Is DT_TEXTREL supposed to be supported on s390 31-bit or not?</title>
	<published>2009-12-16T08:43:54Z</published>
	<updated>2009-12-16T08:43:54Z</updated>
	<author>
		<name>Martin Schwidefsky</name>
	</author>
	<content type="html">Hi Jakub,
&lt;br&gt;&lt;br&gt;On Wed, 16 Dec 2009 16:56:35 +0100
&lt;br&gt;Jakub Jelinek &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26814622&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jakub@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; While DT_TEXTREL libraries are clearly unsupported on many architectures and
&lt;br&gt;&amp;gt; on some even ld fails to link them, s390 31-bit (unlike 64-bit) DT_TEXTREL
&lt;br&gt;&amp;gt; libraries used to work. &amp;nbsp;But apparently only when targetting old CPUs, with
&lt;br&gt;&amp;gt; say -march=z900 or newer relocations like R_390_PC32DBL are created and
&lt;br&gt;&amp;gt; ld.so (nor prelink) handles them.
&lt;br&gt;&amp;gt; So my question is, do we just want to say that DT_TEXTREL on s390 31-bit is
&lt;br&gt;&amp;gt; not supported at all, or do we want to handle the relocations that can
&lt;br&gt;&amp;gt; appear in -fno-pic 31-bit libraries?
&lt;br&gt;&lt;br&gt;DT_TEXTREL on 64-bit is not supported because of weak global symbols and
&lt;br&gt;the limitation of the LARL instruction to a 4GB range. 
&lt;br&gt;&lt;br&gt;DT_TEXTREL on 31-bit used to work fine though and I can't see a reason
&lt;br&gt;why it should not work on newer CPUs. With -march=z900 the compiler
&lt;br&gt;will use LARL to get the address of global symbols, but the library will
&lt;br&gt;be loaded below 4GB. That should work.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;blue skies,
&lt;br&gt;&amp;nbsp; &amp;nbsp;Martin.
&lt;br&gt;&lt;br&gt;&amp;quot;Reality continues to ruin my life.&amp;quot; - Calvin.
&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Sourceware---libc-alpha-f12199.html&quot; embed=&quot;fixTarget[12199]&quot; target=&quot;_top&quot; &gt;Sourceware - libc-alpha&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Is-DT_TEXTREL-supposed-to-be-supported-on-s390-31-bit-or-not--tp26813651p26814622.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26814135</id>
	<title>Re: SH, S390: (not) calling __gmon_start__ from pt-initfini.c</title>
	<published>2009-12-16T08:34:31Z</published>
	<updated>2009-12-16T08:34:31Z</updated>
	<author>
		<name>Martin Schwidefsky</name>
	</author>
	<content type="html">On Wed, 09 Dec 2009 15:26:43 +0100
&lt;br&gt;Andreas Krebbel &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26814135&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;krebbel@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; Hi Thomas,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; the S/390 part looks ok to me but I think the &amp;quot;.L22&amp;quot; label should go away as well.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I've run the libc testsuite on s390 and s390x with your patch without seeing 
&lt;br&gt;&amp;gt; regressions.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; However I cannot approve your patch. Let's wait for comments from Martin.
&lt;br&gt;&lt;br&gt;Ok, from looking at the code it seems that the call to __gmon_start__
&lt;br&gt;from libpthread is redundant. Andreas checked and tested the change,
&lt;br&gt;that is good enough for me. Ok from my side.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;blue skies,
&lt;br&gt;&amp;nbsp; &amp;nbsp;Martin.
&lt;br&gt;&lt;br&gt;&amp;quot;Reality continues to ruin my life.&amp;quot; - Calvin.
&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Sourceware---libc-alpha-f12199.html&quot; embed=&quot;fixTarget[12199]&quot; target=&quot;_top&quot; &gt;Sourceware - libc-alpha&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/SH%2C-S390%3A-%28not%29-calling-__gmon_start__-from-pt-initfini.c-tp26544183p26814135.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26813651</id>
	<title>Is DT_TEXTREL supposed to be supported on s390 31-bit or not?</title>
	<published>2009-12-16T07:56:35Z</published>
	<updated>2009-12-16T07:56:35Z</updated>
	<author>
		<name>Jakub Jelinek</name>
	</author>
	<content type="html">Hi!
&lt;br&gt;&lt;br&gt;While DT_TEXTREL libraries are clearly unsupported on many architectures and
&lt;br&gt;on some even ld fails to link them, s390 31-bit (unlike 64-bit) DT_TEXTREL
&lt;br&gt;libraries used to work. &amp;nbsp;But apparently only when targetting old CPUs, with
&lt;br&gt;say -march=z900 or newer relocations like R_390_PC32DBL are created and
&lt;br&gt;ld.so (nor prelink) handles them.
&lt;br&gt;So my question is, do we just want to say that DT_TEXTREL on s390 31-bit is
&lt;br&gt;not supported at all, or do we want to handle the relocations that can
&lt;br&gt;appear in -fno-pic 31-bit libraries?
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Jakub
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Sourceware---libc-alpha-f12199.html&quot; embed=&quot;fixTarget[12199]&quot; target=&quot;_top&quot; &gt;Sourceware - libc-alpha&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Is-DT_TEXTREL-supposed-to-be-supported-on-s390-31-bit-or-not--tp26813651p26813651.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26803999</id>
	<title>Re: [ARM,MIPS,M68K] O_SYNC fcntl.h updates</title>
	<published>2009-12-15T15:47:58Z</published>
	<updated>2009-12-15T15:47:58Z</updated>
	<author>
		<name>Andreas Schwab-2</name>
	</author>
	<content type="html">&amp;quot;Joseph S. Myers&amp;quot; &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26803999&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;joseph@...&lt;/a&gt;&amp;gt; writes:
&lt;br&gt;&lt;br&gt;&amp;gt; +2009-12-15 &amp;nbsp;Joseph Myers &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26803999&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;joseph@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; +
&lt;br&gt;&amp;gt; +	* sysdeps/unix/sysv/linux/m68k/bits/fcntl.h: Redefine O_SYNC and
&lt;br&gt;&amp;gt; +	O_DSYNC to match 2.6.33+ kernels.
&lt;br&gt;&amp;gt; +
&lt;br&gt;&lt;br&gt;Ok.
&lt;br&gt;&lt;br&gt;Andreas.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Andreas Schwab, &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26803999&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;schwab@...&lt;/a&gt;
&lt;br&gt;GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 &amp;nbsp;01D3 44D5 214B 8276 4ED5
&lt;br&gt;&amp;quot;And now for something completely different.&amp;quot;
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Sourceware---libc-ports-f12204.html&quot; embed=&quot;fixTarget[12204]&quot; target=&quot;_top&quot; &gt;Sourceware - libc-ports&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-ARM%2CMIPS%2CM68K--O_SYNC-fcntl.h-updates-tp26799245p26803999.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26802496</id>
	<title>Re: Breaking ARM's mcount implementations into a separate file</title>
	<published>2009-12-15T13:54:43Z</published>
	<updated>2009-12-15T13:54:43Z</updated>
	<author>
		<name>Thomas Schwinge-8</name>
	</author>
	<content type="html">Hello!
&lt;br&gt;&lt;br&gt;On 2009-12-15 13:55, Joseph S. Myers wrote:
&lt;div class='shrinkable-quote'&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Tue, 15 Dec 2009, Thomas Schwinge wrote:
&lt;br&gt;&amp;gt;&amp;gt; On 2009-12-15 02:05, Joseph S. Myers wrote:
&lt;br&gt;&amp;gt;&amp;gt; &amp;gt; I'm not sure of the significance of having separate ARM/Thumb versions, 
&lt;br&gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; Well, if I understand this correctly, it was you, together with Paul
&lt;br&gt;&amp;gt;&amp;gt; Brook, who have added this code on 2009-02-05.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; You need to look more carefully at the history before I merged Thumb-2 
&lt;br&gt;&amp;gt; support from EGLIBC to FSF ports. &amp;nbsp;The new mcount entry point dates back 
&lt;br&gt;&amp;gt; at least to &amp;lt;&lt;a href=&quot;http://www.eglibc.org/archives/patches/msg00449.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.eglibc.org/archives/patches/msg00449.html&lt;/a&gt;&amp;gt; and 
&lt;br&gt;&amp;gt; other discussions around that time, while Thumb-2 mcount comes from 
&lt;br&gt;&amp;gt; &amp;lt;&lt;a href=&quot;http://www.eglibc.org/archives/patches/msg00143.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.eglibc.org/archives/patches/msg00143.html&lt;/a&gt;&amp;gt;. &amp;nbsp;I.e., on 
&lt;br&gt;&amp;gt; 2009-02-05 I merged existing code without knowing the significance of 
&lt;br&gt;&amp;gt; every bit of it.
&lt;/div&gt;&lt;/div&gt;Thanks for the clarification. &amp;nbsp;I had simply been looking at ChangeLog.arm
&lt;br&gt;which contains this:
&lt;br&gt;&lt;br&gt;2009-02-05 &amp;nbsp;Paul Brook &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26802496&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;paul@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Joseph Myers &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26802496&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;joseph@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [...]
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; * sysdeps/arm/machine-gmon.h (MCOUNT): Add Thumb-2 implementation.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [...]
&lt;br&gt;&lt;br&gt;..., so I supposed that you had been directly involved with that.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;gt; You'll need to send the patch in a form appropriate for committing, tested 
&lt;br&gt;&amp;gt; as both ARM and Thumb-2.
&lt;br&gt;&lt;br&gt;Thusly done with the following patch.
&lt;br&gt;&lt;br&gt;I folded the two _mcount definitions into one -- but that one now
&lt;br&gt;consists of nearly an equal amount of CPP conditionals compared to
&lt;br&gt;assembly instructions, so if you'd rather have a bit of assembly source
&lt;br&gt;code duplication, but better readability (?), then please tell and I'll
&lt;br&gt;modify accordingly.
&lt;br&gt;&lt;br&gt;&lt;br&gt;2009-12-15 &amp;nbsp;Thomas Schwinge &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26802496&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;thomas@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; * sysdeps/arm/eabi/Makefile [gmon] (sysdep_routines): Add arm-mcount.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; * sysdeps/arm/eabi/machine-gmon.h (mcount_internal): Define to
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; `__mcount_internal'.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (MCOUNT (__gnu_mcount_nc), OLD_MCOUNT (_mcount), mcount): Move to...
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; * sysdeps/arm/eabi/arm-mcount.S: ... this new file as __gnu_mcount_nc,
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; _mcount, and mcount, respectively.
&lt;br&gt;&lt;br&gt;diff --git a/glibc-ports-mainline/sysdeps/arm/eabi/Makefile b/glibc-ports-mainline/sysdeps/arm/eabi/Makefile
&lt;br&gt;index 36ddb8e..73185cb 100644
&lt;br&gt;--- a/glibc-ports-mainline/sysdeps/arm/eabi/Makefile
&lt;br&gt;+++ b/glibc-ports-mainline/sysdeps/arm/eabi/Makefile
&lt;br&gt;@@ -15,6 +15,10 @@ static-only-routines += $(aeabi_constants)
&lt;br&gt;&amp;nbsp;gen-as-const-headers += rtld-global-offsets.sym
&lt;br&gt;&amp;nbsp;endif
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+ifeq ($(subdir),gmon)
&lt;br&gt;+sysdep_routines += arm-mcount
&lt;br&gt;+endif
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;ifeq ($(subdir),debug)
&lt;br&gt;&amp;nbsp;CFLAGS-backtrace.c += -funwind-tables
&lt;br&gt;&amp;nbsp;CFLAGS-tst-backtrace2.c += -funwind-tables
&lt;br&gt;diff --git a/glibc-ports-mainline/sysdeps/arm/eabi/arm-mcount.S b/glibc-ports-mainline/sysdeps/arm/eabi/arm-mcount.S
&lt;br&gt;new file mode 100644
&lt;br&gt;index 0000000..2aa50b7
&lt;br&gt;--- /dev/null
&lt;br&gt;+++ b/glibc-ports-mainline/sysdeps/arm/eabi/arm-mcount.S
&lt;br&gt;@@ -0,0 +1,83 @@
&lt;br&gt;+/* Implementation of profiling support. &amp;nbsp;ARM EABI version.
&lt;br&gt;+ &amp;nbsp; Copyright (C) 2008, 2009 Free Software Foundation, Inc.
&lt;br&gt;+ &amp;nbsp; This file is part of the GNU C Library.
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; The GNU C Library is free software; you can redistribute it and/or
&lt;br&gt;+ &amp;nbsp; modify it under the terms of the GNU Lesser General Public
&lt;br&gt;+ &amp;nbsp; License as published by the Free Software Foundation; either
&lt;br&gt;+ &amp;nbsp; version 2.1 of the License, or (at your option) any later version.
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; The GNU C Library is distributed in the hope that it will be useful,
&lt;br&gt;+ &amp;nbsp; but WITHOUT ANY WARRANTY; without even the implied warranty of
&lt;br&gt;+ &amp;nbsp; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. &amp;nbsp;See the GNU
&lt;br&gt;+ &amp;nbsp; Lesser General Public License for more details.
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; You should have received a copy of the GNU Lesser General Public
&lt;br&gt;+ &amp;nbsp; License along with the GNU C Library; if not, write to the Free
&lt;br&gt;+ &amp;nbsp; Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
&lt;br&gt;+ &amp;nbsp; 02111-1307 USA. &amp;nbsp;*/
&lt;br&gt;+
&lt;br&gt;+/* Don't call mcount when calling mcount... &amp;nbsp;*/
&lt;br&gt;+#undef PROF
&lt;br&gt;+
&lt;br&gt;+#include &amp;lt;sysdep.h&amp;gt;
&lt;br&gt;+
&lt;br&gt;+
&lt;br&gt;+#ifdef __thumb2__
&lt;br&gt;+	.thumb
&lt;br&gt;+	.syntax unified
&lt;br&gt;+#endif
&lt;br&gt;+
&lt;br&gt;+
&lt;br&gt;+/* Use an assembly stub with a special ABI. &amp;nbsp;The calling lr has been
&lt;br&gt;+ &amp;nbsp; pushed to the stack (which will be misaligned). &amp;nbsp;We should preserve
&lt;br&gt;+ &amp;nbsp; all registers except ip and pop a word off the stack.
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; NOTE: This assumes mcount_internal does not clobber any non-core
&lt;br&gt;+ &amp;nbsp; (coprocessor) registers. &amp;nbsp;Currently this is true, but may require
&lt;br&gt;+ &amp;nbsp; additional attention in the future.
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; The calling sequence looks something like:
&lt;br&gt;+func:
&lt;br&gt;+ &amp;nbsp; push {lr}
&lt;br&gt;+ &amp;nbsp; bl __gnu_mount_nc
&lt;br&gt;+ &amp;nbsp; &amp;lt;function body&amp;gt;
&lt;br&gt;+*/
&lt;br&gt;+
&lt;br&gt;+ENTRY(__gnu_mcount_nc)
&lt;br&gt;+	push {r0, r1, r2, r3, lr}
&lt;br&gt;+	bic r1, lr, #1
&lt;br&gt;+	ldr r0, [sp, #20]
&lt;br&gt;+	bl __mcount_internal
&lt;br&gt;+	pop {r0, r1, r2, r3, ip, lr}
&lt;br&gt;+	bx ip
&lt;br&gt;+END(__gnu_mcount_nc)
&lt;br&gt;+
&lt;br&gt;+
&lt;br&gt;+/* Provide old mcount for backwards compatibility. &amp;nbsp;This requires
&lt;br&gt;+ &amp;nbsp; code be compiled with APCS frame pointers. &amp;nbsp;*/
&lt;br&gt;+
&lt;br&gt;+ENTRY(_mcount)
&lt;br&gt;+	stmdb sp!, {r0, r1, r2, r3, fp, lr}
&lt;br&gt;+#ifdef __thumb2__
&lt;br&gt;+	movs r0, fp
&lt;br&gt;+	ittt ne
&lt;br&gt;+	ldrne r0, [r0, #-4]
&lt;br&gt;+#else
&lt;br&gt;+	movs fp, fp
&lt;br&gt;+	ldrne r0, [fp, #-4]
&lt;br&gt;+#endif
&lt;br&gt;+	movnes r1, lr
&lt;br&gt;+	blne __mcount_internal
&lt;br&gt;+#ifdef __thumb2__
&lt;br&gt;+	ldmia sp!, {r0, r1, r2, r3, fp, pc}
&lt;br&gt;+#else
&lt;br&gt;+	ldmia sp!, {r0, r1, r2, r3, fp, lr}
&lt;br&gt;+	bx lr
&lt;br&gt;+#endif
&lt;br&gt;+END(_mcount)
&lt;br&gt;+
&lt;br&gt;+/* The canonical name for the function is `_mcount' in both C and asm,
&lt;br&gt;+ &amp;nbsp; but some old asm code might assume it's `mcount'. &amp;nbsp;*/
&lt;br&gt;+#undef mcount
&lt;br&gt;+weak_alias (_mcount, mcount)
&lt;br&gt;diff --git a/glibc-ports-mainline/sysdeps/arm/eabi/machine-gmon.h b/glibc-ports-mainline/sysdeps/arm/eabi/machine-gmon.h
&lt;br&gt;index 189a9a3..aca23c9 100644
&lt;br&gt;--- a/glibc-ports-mainline/sysdeps/arm/eabi/machine-gmon.h
&lt;br&gt;+++ b/glibc-ports-mainline/sysdeps/arm/eabi/machine-gmon.h
&lt;br&gt;@@ -1,5 +1,5 @@
&lt;br&gt;&amp;nbsp;/* Machine-dependent definitions for profiling support. &amp;nbsp;ARM EABI version.
&lt;br&gt;- &amp;nbsp; Copyright (C) 2008 Free Software Foundation, Inc.
&lt;br&gt;+ &amp;nbsp; Copyright (C) 2008, 2009 Free Software Foundation, Inc.
&lt;br&gt;&amp;nbsp; &amp;nbsp; This file is part of the GNU C Library.
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp; &amp;nbsp; The GNU C Library is free software; you can redistribute it and/or
&lt;br&gt;@@ -17,83 +17,18 @@
&lt;br&gt;&amp;nbsp; &amp;nbsp; Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
&lt;br&gt;&amp;nbsp; &amp;nbsp; 02111-1307 USA. &amp;nbsp;*/
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+#include &amp;lt;sysdep.h&amp;gt;
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;/* GCC for the ARM cannot compile __builtin_return_address(N) for N != 0, 
&lt;br&gt;&amp;nbsp; &amp;nbsp; so we must use an assembly stub. &amp;nbsp;*/
&lt;br&gt;&amp;nbsp;
&lt;br&gt;-#include &amp;lt;sysdep.h&amp;gt;
&lt;br&gt;-static void mcount_internal (u_long frompc, u_long selfpc) __attribute_used__;
&lt;br&gt;+/* We must not pollute the global namespace. &amp;nbsp;*/
&lt;br&gt;+#define mcount_internal __mcount_internal
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+extern void mcount_internal (u_long frompc, u_long selfpc) internal_function;
&lt;br&gt;&amp;nbsp;#define _MCOUNT_DECL(frompc, selfpc) \
&lt;br&gt;-static void mcount_internal (u_long frompc, u_long selfpc)
&lt;br&gt;-
&lt;br&gt;-/* Use an assembly stub with a special ABI. &amp;nbsp;The calling lr has been
&lt;br&gt;- &amp;nbsp; pushed to the stack (which will be misaligned). &amp;nbsp;We should preserve
&lt;br&gt;- &amp;nbsp; all registers except ip and pop a word off the stack.
&lt;br&gt;-
&lt;br&gt;- &amp;nbsp; NOTE: This assumes mcount_internal does not clobber any non-core
&lt;br&gt;- &amp;nbsp; (coprocessor) registers. &amp;nbsp;Currently this is true, but may require
&lt;br&gt;- &amp;nbsp; additional attention in the future.
&lt;br&gt;-
&lt;br&gt;- &amp;nbsp; The calling sequence looks something like:
&lt;br&gt;-func:
&lt;br&gt;- &amp;nbsp; push {lr}
&lt;br&gt;- &amp;nbsp; bl __gnu_mount_nc
&lt;br&gt;- &amp;nbsp; &amp;lt;function body&amp;gt;
&lt;br&gt;- */
&lt;br&gt;-
&lt;br&gt;-
&lt;br&gt;-#define MCOUNT								\
&lt;br&gt;-void __attribute__((__naked__)) __gnu_mcount_nc(void)			\
&lt;br&gt;-{									\
&lt;br&gt;- &amp;nbsp; &amp;nbsp;asm (&amp;quot;push {r0, r1, r2, r3, lr}\n\t&amp;quot;				\
&lt;br&gt;-	 &amp;quot;bic r1, lr, #1\n\t&amp;quot;						\
&lt;br&gt;-	 &amp;quot;ldr r0, [sp, #20]\n\t&amp;quot;					\
&lt;br&gt;-	 &amp;quot;bl mcount_internal\n\t&amp;quot;					\
&lt;br&gt;-	 &amp;quot;pop {r0, r1, r2, r3, ip, lr}\n\t&amp;quot;				\
&lt;br&gt;-	 &amp;quot;bx ip&amp;quot;);							\
&lt;br&gt;-}									\
&lt;br&gt;-OLD_MCOUNT
&lt;br&gt;-
&lt;br&gt;-/* Provide old mcount for backwards compatibility. &amp;nbsp;This requires
&lt;br&gt;- &amp;nbsp; code be compiled with APCS frame pointers. &amp;nbsp;*/
&lt;br&gt;-
&lt;br&gt;-#ifndef NO_UNDERSCORES
&lt;br&gt;-/* The asm symbols for C functions are `_function'.
&lt;br&gt;- &amp;nbsp; The canonical name for the counter function is `mcount', no _. &amp;nbsp;*/
&lt;br&gt;-void _mcount (void) asm (&amp;quot;mcount&amp;quot;);
&lt;br&gt;-#else
&lt;br&gt;-/* The canonical name for the function is `_mcount' in both C and asm,
&lt;br&gt;- &amp;nbsp; but some old asm code might assume it's `mcount'. &amp;nbsp;*/
&lt;br&gt;-void _mcount (void);
&lt;br&gt;-weak_alias (_mcount, mcount)
&lt;br&gt;-#endif
&lt;br&gt;-
&lt;br&gt;-#ifdef __thumb2__
&lt;br&gt;-
&lt;br&gt;-#define OLD_MCOUNT							\
&lt;br&gt;-void __attribute__((__naked__)) _mcount (void)				\
&lt;br&gt;-{									\
&lt;br&gt;- &amp;nbsp;__asm__(&amp;quot;push		{r0, r1, r2, r3, fp, lr};&amp;quot;			\
&lt;br&gt;-	 &amp;nbsp;&amp;quot;movs		r0, fp;&amp;quot;					\
&lt;br&gt;-	 &amp;nbsp;&amp;quot;ittt		ne;&amp;quot;						\
&lt;br&gt;-	 &amp;nbsp;&amp;quot;ldrne	r0, [r0, #-4];&amp;quot;					\
&lt;br&gt;-	 &amp;nbsp;&amp;quot;movsne	r1, lr;&amp;quot;					\
&lt;br&gt;-	 &amp;nbsp;&amp;quot;blne		mcount_internal;&amp;quot;				\
&lt;br&gt;-	 &amp;nbsp;&amp;quot;pop		{r0, r1, r2, r3, fp, pc}&amp;quot;);			\
&lt;br&gt;-}
&lt;br&gt;-
&lt;br&gt;-#else
&lt;br&gt;+ &amp;nbsp;void internal_function mcount_internal (u_long frompc, u_long selfpc)
&lt;br&gt;&amp;nbsp;
&lt;br&gt;-#define OLD_MCOUNT							\
&lt;br&gt;-void __attribute__((__naked__)) _mcount (void)				\
&lt;br&gt;-{									\
&lt;br&gt;- &amp;nbsp;__asm__(&amp;quot;stmdb	sp!, {r0, r1, r2, r3, fp, lr};&amp;quot;			\
&lt;br&gt;-	 &amp;nbsp;&amp;quot;movs		fp, fp;&amp;quot;					\
&lt;br&gt;-	 &amp;nbsp;&amp;quot;ldrne	r0, [fp, #-4];&amp;quot;					\
&lt;br&gt;-	 &amp;nbsp;&amp;quot;movnes	r1, lr;&amp;quot;					\
&lt;br&gt;-	 &amp;nbsp;&amp;quot;blne		mcount_internal;&amp;quot;				\
&lt;br&gt;-	 &amp;nbsp;&amp;quot;ldmia	sp!, {r0, r1, r2, r3, fp, lr};&amp;quot;			\
&lt;br&gt;-	 &amp;nbsp;&amp;quot;bx		lr&amp;quot;);						\
&lt;br&gt;-}
&lt;br&gt;&amp;nbsp;
&lt;br&gt;-#endif
&lt;br&gt;+/* Define MCOUNT as empty since we have the implementation in another file. &amp;nbsp;*/
&lt;br&gt;+#define MCOUNT
&lt;br&gt;&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;&amp;nbsp;Thomas
&lt;br&gt;&lt;br /&gt; &lt;div class=&quot;small&quot;&gt;&lt;br/&gt;&lt;img src=&quot;http://old.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;attachment0&lt;/strong&gt; (202 bytes) &lt;a href=&quot;http://old.nabble.com/attachment/26802496/0/attachment0&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;/div&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Sourceware---libc-ports-f12204.html&quot; embed=&quot;fixTarget[12204]&quot; target=&quot;_top&quot; &gt;Sourceware - libc-ports&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Breaking-ARM%27s-mcount-implementations-into-a-separate-file-tp26787384p26802496.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26801775</id>
	<title>[Bug libc/11093] &lt;poll.h&gt; does not define POLL[RD|WR]* macros with _POSIX_C_SOURCE=&quot;200809L&quot;</title>
	<published>2009-12-15T13:05:41Z</published>
	<updated>2009-12-15T13:05:41Z</updated>
	<author>
		<name>Bugzilla from sourceware-bugzilla@sourceware.org</name>
	</author>
	<content type="html">&lt;br&gt;------- Additional Comments From drepper at redhat dot com &amp;nbsp;2009-12-15 21:05 -------
&lt;br&gt;Fixed in git.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;What &amp;nbsp; &amp;nbsp;|Removed &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |Added
&lt;br&gt;----------------------------------------------------------------------------
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Status|NEW &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |RESOLVED
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Resolution| &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|FIXED
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://sourceware.org/bugzilla/show_bug.cgi?id=11093&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://sourceware.org/bugzilla/show_bug.cgi?id=11093&lt;/a&gt;&lt;br&gt;&lt;br&gt;------- You are receiving this mail because: -------
&lt;br&gt;You are on the CC list for the bug, or are watching someone who is.
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Sourceware---glibc-bugs-f12205.html&quot; embed=&quot;fixTarget[12205]&quot; target=&quot;_top&quot; &gt;Sourceware - glibc-bugs&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-Bug-libc-11093--New%3A-%3Cpoll.h%3E-does-not-define-POLL-RD%7CWR-*-macros-with-_POSIX_C_SOURCE%3D%22200809L%22-tp26801449p26801775.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26801449</id>
	<title>[Bug libc/11093] New: &lt;poll.h&gt; does not define POLL[RD|WR]* macros with _POSIX_C_SOURCE=&quot;200809L&quot;</title>
	<published>2009-12-15T12:42:36Z</published>
	<updated>2009-12-15T12:42:36Z</updated>
	<author>
		<name>Bugzilla from sourceware-bugzilla@sourceware.org</name>
	</author>
	<content type="html">As of POSIX.1-2008, the &amp;lt;poll.h&amp;gt; header was moved completely to the base
&lt;br&gt;specification [1]. Therefore, a definition of _POSIX_C_SOURCE to 200809L alone
&lt;br&gt;should be enough to get all definitions in &amp;lt;poll.h&amp;gt; specified by POSIX.1-2008.
&lt;br&gt;Currently, however, the POLLRDNORM, POLLRDBAND, POLLWRNORM and POLLWRBAND depend
&lt;br&gt;on _XOPEN_SOURCE.
&lt;br&gt;&lt;br&gt;Test program:
&lt;br&gt;&lt;br&gt;#define _POSIX_C_SOURCE 200809L
&lt;br&gt;&lt;br&gt;#include &amp;lt;poll.h&amp;gt;
&lt;br&gt;&lt;br&gt;int main (void)
&lt;br&gt;{
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; struct pollfd fds[] = {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .fd &amp;nbsp; &amp;nbsp; = 0,
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .events = POLLIN | POLLRDNORM | POLLRDBAND
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; },
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .fd &amp;nbsp; &amp;nbsp; = 1,
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .events = POLLOUT | POLLWRNORM | POLLWRBAND
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; };
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (void)fds;
&lt;br&gt;}
&lt;br&gt;&lt;br&gt;[1] &lt;a href=&quot;http://www.opengroup.org/onlinepubs/9699919799/basedefs/poll.h.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.opengroup.org/onlinepubs/9699919799/basedefs/poll.h.html&lt;/a&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Summary: &amp;lt;poll.h&amp;gt; does not define POLL[RD|WR]* macros with
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; _POSIX_C_SOURCE=&amp;quot;200809L&amp;quot;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Product: glibc
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Version: 2.9
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Status: NEW
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Severity: normal
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Priority: P2
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Component: libc
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AssignedTo: drepper at redhat dot com
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ReportedBy: andrey dot vihrov at gmail dot com
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CC: glibc-bugs at sources dot redhat dot com
&lt;br&gt;&amp;nbsp;GCC build triplet: x86_64-pc-linux-gnu
&lt;br&gt;&amp;nbsp; GCC host triplet: x86_64-pc-linux-gnu
&lt;br&gt;GCC target triplet: x86_64-pc-linux-gnu
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://sourceware.org/bugzilla/show_bug.cgi?id=11093&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://sourceware.org/bugzilla/show_bug.cgi?id=11093&lt;/a&gt;&lt;br&gt;&lt;br&gt;------- You are receiving this mail because: -------
&lt;br&gt;You are on the CC list for the bug, or are watching someone who is.
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Sourceware---glibc-bugs-f12205.html&quot; embed=&quot;fixTarget[12205]&quot; target=&quot;_top&quot; &gt;Sourceware - glibc-bugs&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-Bug-libc-11093--New%3A-%3Cpoll.h%3E-does-not-define-POLL-RD%7CWR-*-macros-with-_POSIX_C_SOURCE%3D%22200809L%22-tp26801449p26801449.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26799245</id>
	<title>[ARM,MIPS,M68K] O_SYNC fcntl.h updates</title>
	<published>2009-12-15T10:16:32Z</published>
	<updated>2009-12-15T10:16:32Z</updated>
	<author>
		<name>Joseph S. Myers</name>
	</author>
	<content type="html">This patch updates O_SYNC in bits/fcntl.h headers in line with recent libc 
&lt;br&gt;and kernel changes. &amp;nbsp;(The previously used value had only O_DSYNC semantics 
&lt;br&gt;and keeps those for binary compatibility, so is kept as the value of 
&lt;br&gt;O_DSYNC, but O_SYNC gets a new value which has full O_SYNC semantics in 
&lt;br&gt;new kernels.)
&lt;br&gt;&lt;br&gt;I've committed the ARM and MIPS changes; OK to commit the M68K ones? &amp;nbsp;
&lt;br&gt;Other ports maintainers will also need to update their ports; HPPA will 
&lt;br&gt;need special care in view of the &amp;quot;Note that parisc really screwed up their 
&lt;br&gt;headers&amp;quot; in the commit message for the relevant kernel patch.
&lt;br&gt;&lt;br&gt;diff --git a/ChangeLog.arm b/ChangeLog.arm
&lt;br&gt;index c20b095..03bfd34 100644
&lt;br&gt;--- a/ChangeLog.arm
&lt;br&gt;+++ b/ChangeLog.arm
&lt;br&gt;@@ -1,3 +1,8 @@
&lt;br&gt;+2009-12-15 &amp;nbsp;Joseph Myers &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26799245&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;joseph@...&lt;/a&gt;&amp;gt;
&lt;br&gt;+
&lt;br&gt;+	* sysdeps/unix/sysv/linux/arm/bits/fcntl.h: Redefine O_SYNC and
&lt;br&gt;+	O_DSYNC to match 2.6.33+ kernels.
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;2009-11-19 &amp;nbsp;Joseph Myers &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26799245&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;joseph@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;	* sysdeps/unix/sysv/linux/arm/bits/fcntl.h: Introduce new symbol
&lt;br&gt;diff --git a/ChangeLog.m68k b/ChangeLog.m68k
&lt;br&gt;index 42d6a91..b1eb009 100644
&lt;br&gt;--- a/ChangeLog.m68k
&lt;br&gt;+++ b/ChangeLog.m68k
&lt;br&gt;@@ -1,3 +1,8 @@
&lt;br&gt;+2009-12-15 &amp;nbsp;Joseph Myers &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26799245&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;joseph@...&lt;/a&gt;&amp;gt;
&lt;br&gt;+
&lt;br&gt;+	* sysdeps/unix/sysv/linux/m68k/bits/fcntl.h: Redefine O_SYNC and
&lt;br&gt;+	O_DSYNC to match 2.6.33+ kernels.
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;2009-11-23 &amp;nbsp;Andreas Schwab &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26799245&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;schwab@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;	* sysdeps/unix/sysv/linux/m68k/bits/stat.h: Use struct timespec
&lt;br&gt;diff --git a/ChangeLog.mips b/ChangeLog.mips
&lt;br&gt;index b3125f4..9dfe2a5 100644
&lt;br&gt;--- a/ChangeLog.mips
&lt;br&gt;+++ b/ChangeLog.mips
&lt;br&gt;@@ -1,3 +1,8 @@
&lt;br&gt;+2009-12-15 &amp;nbsp;Joseph Myers &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26799245&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;joseph@...&lt;/a&gt;&amp;gt;
&lt;br&gt;+
&lt;br&gt;+	* sysdeps/unix/sysv/linux/mips/bits/fcntl.h: Redefine O_SYNC and
&lt;br&gt;+	O_DSYNC to match 2.6.33+ kernels.
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;2009-12-09 &amp;nbsp;Joseph Myers &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26799245&amp;i=5&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;joseph@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;	* sysdeps/unix/sysv/linux/mips/bits/socket.h: Define mmsghdr and
&lt;br&gt;diff --git a/sysdeps/unix/sysv/linux/arm/bits/fcntl.h b/sysdeps/unix/sysv/linux/arm/bits/fcntl.h
&lt;br&gt;index d597c10..4971473 100644
&lt;br&gt;--- a/sysdeps/unix/sysv/linux/arm/bits/fcntl.h
&lt;br&gt;+++ b/sysdeps/unix/sysv/linux/arm/bits/fcntl.h
&lt;br&gt;@@ -41,7 +41,7 @@
&lt;br&gt;&amp;nbsp;#define O_APPEND	 &amp;nbsp;02000
&lt;br&gt;&amp;nbsp;#define O_NONBLOCK	 &amp;nbsp;04000
&lt;br&gt;&amp;nbsp;#define O_NDELAY	O_NONBLOCK
&lt;br&gt;-#define O_SYNC		 010000
&lt;br&gt;+#define O_SYNC	 &amp;nbsp; &amp;nbsp; &amp;nbsp; 04010000
&lt;br&gt;&amp;nbsp;#define O_FSYNC		 O_SYNC
&lt;br&gt;&amp;nbsp;#define O_ASYNC		 020000
&lt;br&gt;&amp;nbsp;
&lt;br&gt;@@ -57,7 +57,7 @@
&lt;br&gt;&amp;nbsp; &amp;nbsp; We define the symbols here but let them do the same as O_SYNC since
&lt;br&gt;&amp;nbsp; &amp;nbsp; this is a superset.	*/
&lt;br&gt;&amp;nbsp;#if defined __USE_POSIX199309 || defined __USE_UNIX98
&lt;br&gt;-# define O_DSYNC	O_SYNC	/* Synchronize data. &amp;nbsp;*/
&lt;br&gt;+# define O_DSYNC	010000	/* Synchronize data. &amp;nbsp;*/
&lt;br&gt;&amp;nbsp;# define O_RSYNC	O_SYNC	/* Synchronize read operations.	 */
&lt;br&gt;&amp;nbsp;#endif
&lt;br&gt;&amp;nbsp;
&lt;br&gt;diff --git a/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h b/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h
&lt;br&gt;index 8ed8eb6..1f98cf5 100644
&lt;br&gt;--- a/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h
&lt;br&gt;+++ b/sysdeps/unix/sysv/linux/m68k/bits/fcntl.h
&lt;br&gt;@@ -40,7 +40,7 @@
&lt;br&gt;&amp;nbsp;#define O_APPEND	 &amp;nbsp;02000
&lt;br&gt;&amp;nbsp;#define O_NONBLOCK	 &amp;nbsp;04000
&lt;br&gt;&amp;nbsp;#define O_NDELAY	O_NONBLOCK
&lt;br&gt;-#define O_SYNC		 010000
&lt;br&gt;+#define O_SYNC	 &amp;nbsp; &amp;nbsp; &amp;nbsp; 04010000
&lt;br&gt;&amp;nbsp;#define O_FSYNC		 O_SYNC
&lt;br&gt;&amp;nbsp;#define O_ASYNC		 020000
&lt;br&gt;&amp;nbsp;
&lt;br&gt;@@ -56,7 +56,7 @@
&lt;br&gt;&amp;nbsp; &amp;nbsp; We define the symbols here but let them do the same as O_SYNC since
&lt;br&gt;&amp;nbsp; &amp;nbsp; this is a superset.	*/
&lt;br&gt;&amp;nbsp;#if defined __USE_POSIX199309 || defined __USE_UNIX98
&lt;br&gt;-# define O_DSYNC	O_SYNC	/* Synchronize data. &amp;nbsp;*/
&lt;br&gt;+# define O_DSYNC	010000	/* Synchronize data. &amp;nbsp;*/
&lt;br&gt;&amp;nbsp;# define O_RSYNC	O_SYNC	/* Synchronize read operations.	 */
&lt;br&gt;&amp;nbsp;#endif
&lt;br&gt;&amp;nbsp;
&lt;br&gt;diff --git a/sysdeps/unix/sysv/linux/mips/bits/fcntl.h b/sysdeps/unix/sysv/linux/mips/bits/fcntl.h
&lt;br&gt;index 5496912..24fb974 100644
&lt;br&gt;--- a/sysdeps/unix/sysv/linux/mips/bits/fcntl.h
&lt;br&gt;+++ b/sysdeps/unix/sysv/linux/mips/bits/fcntl.h
&lt;br&gt;@@ -36,7 +36,7 @@
&lt;br&gt;&amp;nbsp;#define O_WRONLY	 &amp;nbsp; &amp;nbsp; 01
&lt;br&gt;&amp;nbsp;#define O_RDWR		 &amp;nbsp; &amp;nbsp; 02
&lt;br&gt;&amp;nbsp;#define O_APPEND	 0x0008
&lt;br&gt;-#define O_SYNC		 0x0010
&lt;br&gt;+#define O_SYNC		 0x4010
&lt;br&gt;&amp;nbsp;#define O_NONBLOCK	 0x0080
&lt;br&gt;&amp;nbsp;#define O_NDELAY	O_NONBLOCK
&lt;br&gt;&amp;nbsp;#define O_CREAT		 0x0100	/* not fcntl */
&lt;br&gt;@@ -58,7 +58,7 @@
&lt;br&gt;&amp;nbsp; &amp;nbsp; We define the symbols here but let them do the same as O_SYNC since
&lt;br&gt;&amp;nbsp; &amp;nbsp; this is a superset.	*/
&lt;br&gt;&amp;nbsp;#if defined __USE_POSIX199309 || defined __USE_UNIX98
&lt;br&gt;-# define O_DSYNC	O_SYNC	/* Synchronize data. &amp;nbsp;*/
&lt;br&gt;+# define O_DSYNC	0x0010	/* Synchronize data. &amp;nbsp;*/
&lt;br&gt;&amp;nbsp;# define O_RSYNC	O_SYNC	/* Synchronize read operations.	 */
&lt;br&gt;&amp;nbsp;#endif
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Joseph S. Myers
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26799245&amp;i=6&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;joseph@...&lt;/a&gt;
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Sourceware---libc-ports-f12204.html&quot; embed=&quot;fixTarget[12204]&quot; target=&quot;_top&quot; &gt;Sourceware - libc-ports&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-ARM%2CMIPS%2CM68K--O_SYNC-fcntl.h-updates-tp26799245p26799245.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26801518</id>
	<title>[PATCH] Additional setcontext(), etc. POSIX conformance tests</title>
	<published>2009-12-15T09:57:32Z</published>
	<updated>2009-12-15T09:57:32Z</updated>
	<author>
		<name>Maciej W. Rozycki-4</name>
	</author>
	<content type="html">Hello,
&lt;br&gt;&lt;br&gt;&amp;nbsp;While developing the implementation of the setcontext(), etc. API for the 
&lt;br&gt;MIPS platform earlier this year, I used these additional tests to verify 
&lt;br&gt;POSIX conformance (cf. 
&lt;br&gt;&lt;a href=&quot;http://www.opengroup.org/onlinepubs/009695399/functions/setcontext.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.opengroup.org/onlinepubs/009695399/functions/setcontext.html&lt;/a&gt;). &amp;nbsp;
&lt;br&gt;Their purpose is as follows:
&lt;br&gt;&lt;br&gt;- tst-makecontext3.c -- verify that for ABIs that use a mixed 
&lt;br&gt;&amp;nbsp; register/stack argument passing convention arguments are placed in their 
&lt;br&gt;&amp;nbsp; designated registers and stack slots correctly -- the existing tests 
&lt;br&gt;&amp;nbsp; would not hit the argument register limit for some ABIs, such as MIPS 
&lt;br&gt;&amp;nbsp; n64 and n32 ABIs that define eight argument registers,
&lt;br&gt;&lt;br&gt;- tst-sigcontext.c -- verify that a user context obtained from a signal 
&lt;br&gt;&amp;nbsp; handler can be used with setcontext(), etc.
&lt;br&gt;&lt;br&gt;&amp;nbsp;I've thought it might be worth sharing these tests with the community so 
&lt;br&gt;that developers can readily verify the respective implementations for 
&lt;br&gt;platforms they are interested in and do not have to reinvent the wheel.
&lt;br&gt;&lt;br&gt;2009-12-15 &amp;nbsp;Maciej W. Rozycki &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26801518&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;macro@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; * stdlib/tst-makecontext3.c: New test.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; * stdlib/tst-sigcontext.c: Likewise.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; * stdlib/Makefile (tests): Add them.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; * stdlib/tst-setcontext.c (check_called): Fix a typo.
&lt;br&gt;&lt;br&gt;&amp;nbsp;Please apply.
&lt;br&gt;&lt;br&gt;&amp;nbsp; Maciej
&lt;br&gt;&lt;br&gt;glibc-2.11.90-20091215-tst-ucontext-3.patch
&lt;br&gt;diff --git a/stdlib/Makefile b/stdlib/Makefile
&lt;br&gt;index d361dd8..882302f 100644
&lt;br&gt;--- a/stdlib/Makefile
&lt;br&gt;+++ b/stdlib/Makefile
&lt;br&gt;@@ -70,7 +70,8 @@ tests		:= tst-strtol tst-strtod testmb testrand testsort testdiv &amp;nbsp; \
&lt;br&gt;&amp;nbsp;		 &amp;nbsp; test-a64l tst-qsort tst-system testmb2 bug-strtod2	 &amp;nbsp; &amp;nbsp;\
&lt;br&gt;&amp;nbsp;		 &amp;nbsp; tst-atof1 tst-atof2 tst-strtod2 tst-strtod3 tst-rand48-2 \
&lt;br&gt;&amp;nbsp;		 &amp;nbsp; tst-makecontext tst-strtod4 tst-strtod5 tst-qsort2	 &amp;nbsp; &amp;nbsp;\
&lt;br&gt;-		 &amp;nbsp; tst-makecontext2 tst-strtod6 tst-unsetenv1
&lt;br&gt;+		 &amp;nbsp; tst-makecontext2 tst-strtod6 tst-unsetenv1		 &amp;nbsp; &amp;nbsp;\
&lt;br&gt;+		 &amp;nbsp; tst-makecontext3 tst-sigcontext
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;include ../Makeconfig
&lt;br&gt;&amp;nbsp;
&lt;br&gt;diff --git a/stdlib/tst-makecontext3.c b/stdlib/tst-makecontext3.c
&lt;br&gt;new file mode 100644
&lt;br&gt;index 0000000..f127c6a
&lt;br&gt;--- /dev/null
&lt;br&gt;+++ b/stdlib/tst-makecontext3.c
&lt;br&gt;@@ -0,0 +1,217 @@
&lt;br&gt;+/* Copyright (C) 2001,2002,2004,2006,2009 Free Software Foundation, Inc.
&lt;br&gt;+ &amp;nbsp; This file is part of the GNU C Library.
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; The GNU C Library is free software; you can redistribute it and/or
&lt;br&gt;+ &amp;nbsp; modify it under the terms of the GNU Lesser General Public
&lt;br&gt;+ &amp;nbsp; License as published by the Free Software Foundation; either
&lt;br&gt;+ &amp;nbsp; version 2.1 of the License, or (at your option) any later version.
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; The GNU C Library is distributed in the hope that it will be useful,
&lt;br&gt;+ &amp;nbsp; but WITHOUT ANY WARRANTY; without even the implied warranty of
&lt;br&gt;+ &amp;nbsp; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. &amp;nbsp;See the GNU
&lt;br&gt;+ &amp;nbsp; Lesser General Public License for more details.
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; You should have received a copy of the GNU Lesser General Public
&lt;br&gt;+ &amp;nbsp; License along with the GNU C Library; if not, write to the Free
&lt;br&gt;+ &amp;nbsp; Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
&lt;br&gt;+ &amp;nbsp; 02110-1301, USA. &amp;nbsp;*/
&lt;br&gt;+
&lt;br&gt;+#include &amp;lt;errno.h&amp;gt;
&lt;br&gt;+#include &amp;lt;stdio.h&amp;gt;
&lt;br&gt;+#include &amp;lt;stdlib.h&amp;gt;
&lt;br&gt;+#include &amp;lt;string.h&amp;gt;
&lt;br&gt;+#include &amp;lt;ucontext.h&amp;gt;
&lt;br&gt;+#include &amp;lt;unistd.h&amp;gt;
&lt;br&gt;+
&lt;br&gt;+static ucontext_t ctx[3];
&lt;br&gt;+
&lt;br&gt;+static int was_in_f1;
&lt;br&gt;+static int was_in_f2;
&lt;br&gt;+
&lt;br&gt;+static char st2[32768];
&lt;br&gt;+
&lt;br&gt;+static volatile int flag;
&lt;br&gt;+
&lt;br&gt;+static void
&lt;br&gt;+f1 (int a00, int a01, int a02, int a03, int a04, int a05, int a06, int a07,
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;int a08, int a09, int a10, int a11, int a12, int a13, int a14, int a15,
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;int a16, int a17, int a18, int a19, int a20, int a21, int a22, int a23,
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;int a24, int a25, int a26, int a27, int a28, int a29, int a30, int a31,
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;int a32)
&lt;br&gt;+{
&lt;br&gt;+ &amp;nbsp;printf (&amp;quot;start f1(a00=%08x,a01=%08x,a02=%08x,a03=%08x,\n&amp;quot;
&lt;br&gt;+	 &amp;nbsp;&amp;quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; a04=%08x,a05=%08x,a06=%08x,a07=%08x,\n&amp;quot;
&lt;br&gt;+	 &amp;nbsp;&amp;quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; a08=%08x,a09=%08x,a10=%08x,a11=%08x,\n&amp;quot;
&lt;br&gt;+	 &amp;nbsp;&amp;quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; a12=%08x,a13=%08x,a14=%08x,a15=%08x,\n&amp;quot;
&lt;br&gt;+	 &amp;nbsp;&amp;quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; a16=%08x,a17=%08x,a18=%08x,a19=%08x,\n&amp;quot;
&lt;br&gt;+	 &amp;nbsp;&amp;quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; a20=%08x,a21=%08x,a22=%08x,a23=%08x,\n&amp;quot;
&lt;br&gt;+	 &amp;nbsp;&amp;quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; a24=%08x,a25=%08x,a26=%08x,a27=%08x,\n&amp;quot;
&lt;br&gt;+	 &amp;nbsp;&amp;quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; a28=%08x,a29=%08x,a30=%08x,a31=%08x,\n&amp;quot;
&lt;br&gt;+	 &amp;nbsp;&amp;quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; a32=%08x) [%d]\n&amp;quot;,
&lt;br&gt;+	 &amp;nbsp;a00, a01, a02, a03, a04, a05, a06, a07,
&lt;br&gt;+	 &amp;nbsp;a08, a09, a10, a11, a12, a13, a14, a15,
&lt;br&gt;+	 &amp;nbsp;a16, a17, a18, a19, a20, a21, a22, a23,
&lt;br&gt;+	 &amp;nbsp;a24, a25, a26, a27, a28, a29, a30, a31,
&lt;br&gt;+	 &amp;nbsp;a32, flag);
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;if (a00 != (0x00000001 &amp;lt;&amp;lt; flag) || a01 != (0x00000004 &amp;lt;&amp;lt; flag)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;|| a02 != (0x00000012 &amp;lt;&amp;lt; flag) || a03 != (0x00000048 &amp;lt;&amp;lt; flag)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;|| a04 != (0x00000123 &amp;lt;&amp;lt; flag) || a05 != (0x0000048d &amp;lt;&amp;lt; flag)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;|| a06 != (0x00001234 &amp;lt;&amp;lt; flag) || a07 != (0x000048d1 &amp;lt;&amp;lt; flag)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;|| a08 != (0x00012345 &amp;lt;&amp;lt; flag) || a09 != (0x00048d15 &amp;lt;&amp;lt; flag)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;|| a10 != (0x00123456 &amp;lt;&amp;lt; flag) || a11 != (0x0048d159 &amp;lt;&amp;lt; flag)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;|| a12 != (0x01234567 &amp;lt;&amp;lt; flag) || a13 != (0x048d159e &amp;lt;&amp;lt; flag)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;|| a14 != (0x12345678 &amp;lt;&amp;lt; flag) || a15 != (0x48d159e2 &amp;lt;&amp;lt; flag)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;|| a16 != (0x23456789 &amp;lt;&amp;lt; flag) || a17 != (0x8d159e26 &amp;lt;&amp;lt; flag)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;|| a18 != (0x3456789a &amp;lt;&amp;lt; flag) || a19 != (0xd159e26a &amp;lt;&amp;lt; flag)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;|| a20 != (0x456789ab &amp;lt;&amp;lt; flag) || a21 != (0x159e26af &amp;lt;&amp;lt; flag)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;|| a22 != (0x56789abc &amp;lt;&amp;lt; flag) || a23 != (0x59e26af3 &amp;lt;&amp;lt; flag)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;|| a24 != (0x6789abcd &amp;lt;&amp;lt; flag) || a25 != (0x9e26af37 &amp;lt;&amp;lt; flag)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;|| a26 != (0x789abcde &amp;lt;&amp;lt; flag) || a27 != (0xe26af37b &amp;lt;&amp;lt; flag)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;|| a28 != (0x89abcdef &amp;lt;&amp;lt; flag) || a29 != (0x26af37bc &amp;lt;&amp;lt; flag)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;|| a30 != (0x9abcdef0 &amp;lt;&amp;lt; flag) || a31 != (0x6af37bc3 &amp;lt;&amp;lt; flag)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;|| a32 != (0xabcdef0f &amp;lt;&amp;lt; flag))
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;{
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;puts (&amp;quot;arg mismatch&amp;quot;);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;exit (-1);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;if (flag &amp;&amp; swapcontext (&amp;ctx[1], &amp;ctx[2]) != 0)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;{
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;printf (&amp;quot;%s: swapcontext: %m\n&amp;quot;, __FUNCTION__);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;exit (1);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+ &amp;nbsp;printf (&amp;quot;finish f1 [%d]\n&amp;quot;, flag);
&lt;br&gt;+ &amp;nbsp;flag++;
&lt;br&gt;+ &amp;nbsp;was_in_f1++;
&lt;br&gt;+}
&lt;br&gt;+
&lt;br&gt;+static void
&lt;br&gt;+f2 (void)
&lt;br&gt;+{
&lt;br&gt;+ &amp;nbsp;puts (&amp;quot;start f2&amp;quot;);
&lt;br&gt;+ &amp;nbsp;if (swapcontext (&amp;ctx[2], &amp;ctx[1]) != 0)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;{
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;printf (&amp;quot;%s: swapcontext: %m\n&amp;quot;, __FUNCTION__);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;exit (1);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+ &amp;nbsp;puts (&amp;quot;finish f2&amp;quot;);
&lt;br&gt;+ &amp;nbsp;was_in_f2 = 1;
&lt;br&gt;+}
&lt;br&gt;+
&lt;br&gt;+volatile int global;
&lt;br&gt;+
&lt;br&gt;+
&lt;br&gt;+static int back_in_main;
&lt;br&gt;+
&lt;br&gt;+
&lt;br&gt;+static void
&lt;br&gt;+check_called (void)
&lt;br&gt;+{
&lt;br&gt;+ &amp;nbsp;if (back_in_main == 0)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;{
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;puts (&amp;quot;program did not reach main again&amp;quot;);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;_exit (1);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+}
&lt;br&gt;+
&lt;br&gt;+
&lt;br&gt;+int
&lt;br&gt;+main (void)
&lt;br&gt;+{
&lt;br&gt;+ &amp;nbsp;atexit (check_called);
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;char st1[32768];
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;puts (&amp;quot;making contexts&amp;quot;);
&lt;br&gt;+ &amp;nbsp;if (getcontext (&amp;ctx[0]) != 0)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;{
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;if (errno == ENOSYS)
&lt;br&gt;+	{
&lt;br&gt;+	 &amp;nbsp;back_in_main = 1;
&lt;br&gt;+	 &amp;nbsp;exit (0);
&lt;br&gt;+	}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;printf (&amp;quot;%s: getcontext: %m\n&amp;quot;, __FUNCTION__);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;exit (1);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;ctx[1] = ctx[0];
&lt;br&gt;+ &amp;nbsp;ctx[1].uc_stack.ss_sp = st1;
&lt;br&gt;+ &amp;nbsp;ctx[1].uc_stack.ss_size = sizeof st1;
&lt;br&gt;+ &amp;nbsp;ctx[1].uc_link = &amp;ctx[0];
&lt;br&gt;+ &amp;nbsp;{
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;ucontext_t tempctx = ctx[1];
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;makecontext (&amp;ctx[1], (void (*) (void)) f1, 33,
&lt;br&gt;+		 0x00000001 &amp;lt;&amp;lt; flag, 0x00000004 &amp;lt;&amp;lt; flag,
&lt;br&gt;+		 0x00000012 &amp;lt;&amp;lt; flag, 0x00000048 &amp;lt;&amp;lt; flag,
&lt;br&gt;+		 0x00000123 &amp;lt;&amp;lt; flag, 0x0000048d &amp;lt;&amp;lt; flag,
&lt;br&gt;+		 0x00001234 &amp;lt;&amp;lt; flag, 0x000048d1 &amp;lt;&amp;lt; flag,
&lt;br&gt;+		 0x00012345 &amp;lt;&amp;lt; flag, 0x00048d15 &amp;lt;&amp;lt; flag,
&lt;br&gt;+		 0x00123456 &amp;lt;&amp;lt; flag, 0x0048d159 &amp;lt;&amp;lt; flag,
&lt;br&gt;+		 0x01234567 &amp;lt;&amp;lt; flag, 0x048d159e &amp;lt;&amp;lt; flag,
&lt;br&gt;+		 0x12345678 &amp;lt;&amp;lt; flag, 0x48d159e2 &amp;lt;&amp;lt; flag,
&lt;br&gt;+		 0x23456789 &amp;lt;&amp;lt; flag, 0x8d159e26 &amp;lt;&amp;lt; flag,
&lt;br&gt;+		 0x3456789a &amp;lt;&amp;lt; flag, 0xd159e26a &amp;lt;&amp;lt; flag,
&lt;br&gt;+		 0x456789ab &amp;lt;&amp;lt; flag, 0x159e26af &amp;lt;&amp;lt; flag,
&lt;br&gt;+		 0x56789abc &amp;lt;&amp;lt; flag, 0x59e26af3 &amp;lt;&amp;lt; flag,
&lt;br&gt;+		 0x6789abcd &amp;lt;&amp;lt; flag, 0x9e26af37 &amp;lt;&amp;lt; flag,
&lt;br&gt;+		 0x789abcde &amp;lt;&amp;lt; flag, 0xe26af37b &amp;lt;&amp;lt; flag,
&lt;br&gt;+		 0x89abcdef &amp;lt;&amp;lt; flag, 0x26af37bc &amp;lt;&amp;lt; flag,
&lt;br&gt;+		 0x9abcdef0 &amp;lt;&amp;lt; flag, 0x6af37bc3 &amp;lt;&amp;lt; flag,
&lt;br&gt;+		 0xabcdef0f &amp;lt;&amp;lt; flag);
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;/* Without this check, a stub makecontext can make us spin forever. &amp;nbsp;*/
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;if (memcmp (&amp;tempctx, &amp;ctx[1], sizeof ctx[1]) == 0)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;{
&lt;br&gt;+	puts (&amp;quot;makecontext was a no-op, presuming not implemented&amp;quot;);
&lt;br&gt;+	return 0;
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+ &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;/* Play some tricks with this context. &amp;nbsp;*/
&lt;br&gt;+ &amp;nbsp;if (++global == 1)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;if (setcontext (&amp;ctx[1]) != 0)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;{
&lt;br&gt;+	printf (&amp;quot;%s: setcontext: %m\n&amp;quot;, __FUNCTION__);
&lt;br&gt;+	exit (1);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+ &amp;nbsp;if (global != 2)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;{
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;printf (&amp;quot;%s: 'global' not incremented twice\n&amp;quot;, __FUNCTION__);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;exit (1);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;if (getcontext (&amp;ctx[2]) != 0)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;{
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;printf (&amp;quot;%s: second getcontext: %m\n&amp;quot;, __FUNCTION__);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;exit (1);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+ &amp;nbsp;ctx[2].uc_stack.ss_sp = st2;
&lt;br&gt;+ &amp;nbsp;ctx[2].uc_stack.ss_size = sizeof st2;
&lt;br&gt;+ &amp;nbsp;ctx[2].uc_link = &amp;ctx[1];
&lt;br&gt;+ &amp;nbsp;makecontext (&amp;ctx[2], f2, 0);
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;puts (&amp;quot;swapping contexts&amp;quot;);
&lt;br&gt;+ &amp;nbsp;if (swapcontext (&amp;ctx[0], &amp;ctx[2]) != 0)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;{
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;printf (&amp;quot;%s: swapcontext: %m\n&amp;quot;, __FUNCTION__);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;exit (1);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+ &amp;nbsp;puts (&amp;quot;back at main program&amp;quot;);
&lt;br&gt;+ &amp;nbsp;back_in_main = 1;
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;if (was_in_f1 &amp;lt; 2)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;{
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;puts (&amp;quot;didn't reach f1 twice&amp;quot;);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;exit (1);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+ &amp;nbsp;if (was_in_f2 == 0)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;{
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;puts (&amp;quot;didn't reach f2&amp;quot;);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;exit (1);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;puts (&amp;quot;test succeeded&amp;quot;);
&lt;br&gt;+ &amp;nbsp;return 0;
&lt;br&gt;+}
&lt;br&gt;diff --git a/stdlib/tst-setcontext.c b/stdlib/tst-setcontext.c
&lt;br&gt;index 51296f7..9a6d79b 100644
&lt;br&gt;--- a/stdlib/tst-setcontext.c
&lt;br&gt;+++ b/stdlib/tst-setcontext.c
&lt;br&gt;@@ -133,7 +133,7 @@ check_called (void)
&lt;br&gt;&amp;nbsp;{
&lt;br&gt;&amp;nbsp; &amp;nbsp;if (back_in_main == 0)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;{
&lt;br&gt;- &amp;nbsp; &amp;nbsp; &amp;nbsp;puts (&amp;quot;program did no reach main again&amp;quot;);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;puts (&amp;quot;program did not reach main again&amp;quot;);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;_exit (1);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;nbsp;}
&lt;br&gt;diff --git a/stdlib/tst-sigcontext.c b/stdlib/tst-sigcontext.c
&lt;br&gt;new file mode 100644
&lt;br&gt;index 0000000..45b1a06
&lt;br&gt;--- /dev/null
&lt;br&gt;+++ b/stdlib/tst-sigcontext.c
&lt;br&gt;@@ -0,0 +1,312 @@
&lt;br&gt;+/* Copyright (C) 2009 Free Software Foundation, Inc.
&lt;br&gt;+ &amp;nbsp; This file is part of the GNU C Library.
&lt;br&gt;+ &amp;nbsp; Contributed by Maciej W. Rozycki &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26801518&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;macro@...&lt;/a&gt;&amp;gt;.
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; The GNU C Library is free software; you can redistribute it and/or
&lt;br&gt;+ &amp;nbsp; modify it under the terms of the GNU Lesser General Public
&lt;br&gt;+ &amp;nbsp; License as published by the Free Software Foundation; either
&lt;br&gt;+ &amp;nbsp; version 2.1 of the License, or (at your option) any later version.
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; The GNU C Library is distributed in the hope that it will be useful,
&lt;br&gt;+ &amp;nbsp; but WITHOUT ANY WARRANTY; without even the implied warranty of
&lt;br&gt;+ &amp;nbsp; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. &amp;nbsp;See the GNU
&lt;br&gt;+ &amp;nbsp; Lesser General Public License for more details.
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; You should have received a copy of the GNU Lesser General Public
&lt;br&gt;+ &amp;nbsp; License along with the GNU C Library; if not, write to the Free
&lt;br&gt;+ &amp;nbsp; Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
&lt;br&gt;+ &amp;nbsp; 02110-1301, USA. &amp;nbsp;*/
&lt;br&gt;+
&lt;br&gt;+#include &amp;lt;errno.h&amp;gt;
&lt;br&gt;+#include &amp;lt;signal.h&amp;gt;
&lt;br&gt;+#include &amp;lt;stdio.h&amp;gt;
&lt;br&gt;+#include &amp;lt;stdlib.h&amp;gt;
&lt;br&gt;+#include &amp;lt;string.h&amp;gt;
&lt;br&gt;+#include &amp;lt;time.h&amp;gt;
&lt;br&gt;+#include &amp;lt;ucontext.h&amp;gt;
&lt;br&gt;+#include &amp;lt;unistd.h&amp;gt;
&lt;br&gt;+
&lt;br&gt;+static volatile ucontext_t ctx[3];
&lt;br&gt;+static volatile int flags[3];
&lt;br&gt;+static volatile int oflag;
&lt;br&gt;+static volatile int flag;
&lt;br&gt;+
&lt;br&gt;+static volatile int sig_errno_set;
&lt;br&gt;+static volatile int sig_errno;
&lt;br&gt;+static volatile int sig_ready;
&lt;br&gt;+
&lt;br&gt;+static int was_in_f1;
&lt;br&gt;+static int was_in_f2;
&lt;br&gt;+
&lt;br&gt;+static char st2[32768];
&lt;br&gt;+
&lt;br&gt;+static long long int max;
&lt;br&gt;+static volatile long long int count;
&lt;br&gt;+
&lt;br&gt;+/* These have to be run with the caller's frame. &amp;nbsp;*/
&lt;br&gt;+static inline int sig_getcontext (int) __attribute__ ((always_inline));
&lt;br&gt;+static inline int sig_swapcontext (int, int) __attribute__ ((always_inline));
&lt;br&gt;+
&lt;br&gt;+static void
&lt;br&gt;+sig_gethandler (int signo, siginfo_t *info, void *context)
&lt;br&gt;+{
&lt;br&gt;+ &amp;nbsp;ucontext_t *ucp = context;
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;if (! sig_ready)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;{
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;alarm (1);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;return;
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;ctx[flag] = *ucp;
&lt;br&gt;+ &amp;nbsp;flags[flag] = 1;
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;sig_errno_set = 1;
&lt;br&gt;+ &amp;nbsp;sig_errno = 0;
&lt;br&gt;+}
&lt;br&gt;+
&lt;br&gt;+static void
&lt;br&gt;+sig_swaphandler (int signo, siginfo_t *info, void *context)
&lt;br&gt;+{
&lt;br&gt;+ &amp;nbsp;ucontext_t *oucp = context;
&lt;br&gt;+ &amp;nbsp;ucontext_t *ucp = (ucontext_t *) (ctx + flag);
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;if (! sig_ready)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;{
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;alarm (1);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;return;
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;ctx[oflag] = *oucp;
&lt;br&gt;+ &amp;nbsp;flags[oflag] = 1;
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;sig_errno_set = 1;
&lt;br&gt;+ &amp;nbsp;sig_errno = setcontext (ucp);
&lt;br&gt;+}
&lt;br&gt;+
&lt;br&gt;+static int
&lt;br&gt;+sig_getcontext (int uci)
&lt;br&gt;+{
&lt;br&gt;+ &amp;nbsp;struct sigaction sa;
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;sigemptyset (&amp;sa.sa_mask);
&lt;br&gt;+ &amp;nbsp;sa.sa_flags = SA_SIGINFO;
&lt;br&gt;+ &amp;nbsp;sa.sa_sigaction = sig_gethandler;
&lt;br&gt;+ &amp;nbsp;if (sigaction (SIGALRM, &amp;sa, NULL) &amp;lt; 0)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;{
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;printf (&amp;quot;%s: sigaction ALRM failed: %m\n&amp;quot;, __FUNCTION__);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;exit (1);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;flag = uci;
&lt;br&gt;+ &amp;nbsp;sig_errno_set = 0;
&lt;br&gt;+ &amp;nbsp;sig_ready = 0;
&lt;br&gt;+ &amp;nbsp;alarm (1);
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;/* Need to get the signal in this frame. &amp;nbsp;*/
&lt;br&gt;+ &amp;nbsp;sig_ready = 1;
&lt;br&gt;+ &amp;nbsp;for (count = max; count &amp;gt; 0; count--)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;if (sig_errno_set)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;break;
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;if (! sig_errno_set)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;{
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;printf (&amp;quot;%s: ALRM signal not received\n&amp;quot;, __FUNCTION__);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;exit (1);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;return 0;
&lt;br&gt;+}
&lt;br&gt;+
&lt;br&gt;+static int
&lt;br&gt;+sig_swapcontext (int ouci, int uci)
&lt;br&gt;+{
&lt;br&gt;+ &amp;nbsp;struct sigaction sa;
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;sigemptyset (&amp;sa.sa_mask);
&lt;br&gt;+ &amp;nbsp;sa.sa_flags = SA_SIGINFO;
&lt;br&gt;+ &amp;nbsp;sa.sa_sigaction = sig_swaphandler;
&lt;br&gt;+ &amp;nbsp;if (sigaction (SIGALRM, &amp;sa, NULL) &amp;lt; 0)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;{
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;printf (&amp;quot;%s: sigaction ALRM failed: %m\n&amp;quot;, __FUNCTION__);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;exit (1);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;flag = uci;
&lt;br&gt;+ &amp;nbsp;oflag = ouci;
&lt;br&gt;+ &amp;nbsp;sig_errno_set = 0;
&lt;br&gt;+ &amp;nbsp;sig_ready = 0;
&lt;br&gt;+ &amp;nbsp;alarm (1);
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;/* Need to get the signal in this frame. &amp;nbsp;*/
&lt;br&gt;+ &amp;nbsp;sig_ready = 1;
&lt;br&gt;+ &amp;nbsp;for (count = max; count &amp;gt; 0; count--)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;if (sig_errno_set)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;break;
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;if (! sig_errno_set)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;{
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;printf (&amp;quot;%s: ALRM signal not received\n&amp;quot;, __FUNCTION__);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;exit (1);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;return sig_errno;
&lt;br&gt;+}
&lt;br&gt;+
&lt;br&gt;+
&lt;br&gt;+static void
&lt;br&gt;+f1 (int a0, int a1, int a2, int a3)
&lt;br&gt;+{
&lt;br&gt;+ &amp;nbsp;int status;
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;printf (&amp;quot;start f1(a0=%x,a1=%x,a2=%x,a3=%x)\n&amp;quot;, a0, a1, a2, a3);
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;if (a0 != 1 || a1 != 2 || a2 != 3 || a3 != -4)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;{
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;puts (&amp;quot;arg mismatch&amp;quot;);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;exit (-1);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;status = sig_swapcontext (1, 2);
&lt;br&gt;+ &amp;nbsp;if (status != 0)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;{
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;printf (&amp;quot;%s: swapping contexts failed: %s\n&amp;quot;,
&lt;br&gt;+	 &amp;nbsp; &amp;nbsp; &amp;nbsp;__FUNCTION__, strerror (status));
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;exit (1);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+ &amp;nbsp;puts (&amp;quot;finish f1&amp;quot;);
&lt;br&gt;+ &amp;nbsp;was_in_f1 = 1;
&lt;br&gt;+}
&lt;br&gt;+
&lt;br&gt;+static void
&lt;br&gt;+f2 (void)
&lt;br&gt;+{
&lt;br&gt;+ &amp;nbsp;int status;
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;puts (&amp;quot;start f2&amp;quot;);
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;status = sig_swapcontext (2, 1);
&lt;br&gt;+ &amp;nbsp;if (status != 0)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;{
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;printf (&amp;quot;%s: swapping contexts failed: %s\n&amp;quot;,
&lt;br&gt;+	 &amp;nbsp; &amp;nbsp; &amp;nbsp;__FUNCTION__, strerror (status));
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;exit (1);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+ &amp;nbsp;puts (&amp;quot;finish f2&amp;quot;);
&lt;br&gt;+ &amp;nbsp;was_in_f2 = 1;
&lt;br&gt;+}
&lt;br&gt;+
&lt;br&gt;+
&lt;br&gt;+static int back_in_main;
&lt;br&gt;+
&lt;br&gt;+static void
&lt;br&gt;+check_called (void)
&lt;br&gt;+{
&lt;br&gt;+ &amp;nbsp;if (back_in_main == 0)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;{
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;printf (&amp;quot;%s: program did not reach main again&amp;quot;, __FUNCTION__);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;_exit (1);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+}
&lt;br&gt;+
&lt;br&gt;+
&lt;br&gt;+volatile int global;
&lt;br&gt;+
&lt;br&gt;+int
&lt;br&gt;+main (void)
&lt;br&gt;+{
&lt;br&gt;+ &amp;nbsp;char st1[32768];
&lt;br&gt;+ &amp;nbsp;time_t t0, t1;
&lt;br&gt;+ &amp;nbsp;int status;
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;atexit (check_called);
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;puts (&amp;quot;calibrating delay loop&amp;quot;);
&lt;br&gt;+ &amp;nbsp;for (max = 0x10000; max &amp;lt; LLONG_MAX / 2; max *= 2)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;{
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;t0 = time (NULL);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;for (count = max; count &amp;gt; 0; count--);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;t1 = time (NULL);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;if (difftime (t1, t0) &amp;gt; 10.0)
&lt;br&gt;+	break;
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;puts (&amp;quot;making contexts&amp;quot;);
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;sig_getcontext (1);
&lt;br&gt;+ &amp;nbsp;if (! flags[1])
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;{
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;printf (&amp;quot;%s: context not retrieved\n&amp;quot;, __FUNCTION__);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;exit (1);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;/* Play some tricks with this context. &amp;nbsp;*/
&lt;br&gt;+ &amp;nbsp;if (++global == 1)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;if (setcontext ((ucontext_t *) &amp;ctx[1]) != 0)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;{
&lt;br&gt;+	if (errno == ENOSYS)
&lt;br&gt;+	 &amp;nbsp;{
&lt;br&gt;+	 &amp;nbsp; &amp;nbsp;back_in_main = 1;
&lt;br&gt;+	 &amp;nbsp; &amp;nbsp;exit (0);
&lt;br&gt;+	 &amp;nbsp;}
&lt;br&gt;+	printf (&amp;quot;%s: setcontext: %m\n&amp;quot;, __FUNCTION__);
&lt;br&gt;+	exit (1);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+ &amp;nbsp;if (global != 2)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;{
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;printf (&amp;quot;%s: 'global' not incremented twice\n&amp;quot;, __FUNCTION__);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;exit (1);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;ctx[1].uc_stack.ss_sp = st1;
&lt;br&gt;+ &amp;nbsp;ctx[1].uc_stack.ss_size = sizeof st1;
&lt;br&gt;+ &amp;nbsp;ctx[1].uc_link = (ucontext_t *) &amp;ctx[0];
&lt;br&gt;+ &amp;nbsp;{
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;ucontext_t tempctx = ctx[1];
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;makecontext ((ucontext_t *) &amp;ctx[1], (void (*) (void)) f1, 4, 1, 2, 3, -4);
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;/* Without this check, a stub makecontext can make us spin forever. &amp;nbsp;*/
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;if (memcmp (&amp;tempctx, (void *) &amp;ctx[1], sizeof ctx[1]) == 0)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;{
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;puts (&amp;quot;makecontext was a no-op, presuming not implemented&amp;quot;);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return 0;
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+ &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;sig_getcontext (2);
&lt;br&gt;+ &amp;nbsp;if (! flags[2])
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;{
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;printf (&amp;quot;%s: second context not retrieved\n&amp;quot;, __FUNCTION__);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;exit (1);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;ctx[2].uc_stack.ss_sp = st2;
&lt;br&gt;+ &amp;nbsp;ctx[2].uc_stack.ss_size = sizeof st2;
&lt;br&gt;+ &amp;nbsp;ctx[2].uc_link = (ucontext_t *) &amp;ctx[1];
&lt;br&gt;+ &amp;nbsp;makecontext ((ucontext_t *) &amp;ctx[2], f2, 0);
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;puts (&amp;quot;swapping contexts&amp;quot;);
&lt;br&gt;+ &amp;nbsp;status = sig_swapcontext (0, 2);
&lt;br&gt;+ &amp;nbsp;if (status != 0)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;{
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;printf (&amp;quot;%s: swapping contexts failed: %s\n&amp;quot;,
&lt;br&gt;+	 &amp;nbsp; &amp;nbsp; &amp;nbsp;__FUNCTION__, strerror (status));
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;exit (1);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+ &amp;nbsp;puts (&amp;quot;back at main program&amp;quot;);
&lt;br&gt;+ &amp;nbsp;back_in_main = 1;
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;if (was_in_f1 == 0)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;{
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;puts (&amp;quot;didn't reach f1&amp;quot;);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;exit (1);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+ &amp;nbsp;if (was_in_f2 == 0)
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;{
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;puts (&amp;quot;didn't reach f2&amp;quot;);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp;exit (1);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp;}
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp;puts (&amp;quot;test succeeded&amp;quot;);
&lt;br&gt;+ &amp;nbsp;return 0;
&lt;br&gt;+}
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Sourceware---libc-alpha-f12199.html&quot; embed=&quot;fixTarget[12199]&quot; target=&quot;_top&quot; &gt;Sourceware - libc-alpha&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-PATCH--Additional-setcontext%28%29%2C-etc.-POSIX-conformance-tests-tp26801518p26801518.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26795741</id>
	<title>Re: [ARM] {OABI, EABI} x {LinuxThreads, NPTL} (was: Breaking ARM's  mcount implementations into a separate file)</title>
	<published>2009-12-15T06:35:55Z</published>
	<updated>2009-12-15T06:35:55Z</updated>
	<author>
		<name>Daniel Jacobowitz-2</name>
	</author>
	<content type="html">On Tue, Dec 15, 2009 at 10:41:51AM +0100, Thomas Schwinge wrote:
&lt;br&gt;&amp;gt; Hello!
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; While we're at that -- another question: what's the general policy on
&lt;br&gt;&amp;gt; keeping ARM's OABI and LinuxThreads code up to date that is still present
&lt;br&gt;&amp;gt; in the repository? &amp;nbsp;Obviously it needs time to maintain / enhace these
&lt;br&gt;&amp;gt; code paths when doing changes to EABI / NPTL code -- but are these
&lt;br&gt;&amp;gt; changes at all used by anyone, or is it in fact wasted time? &amp;nbsp;Let alone
&lt;br&gt;&amp;gt; the difficulty with testing such changes. &amp;nbsp;Should maybe even the OABI and
&lt;br&gt;&amp;gt; LinuxThread code blocks / files be removed from the repository?
&lt;br&gt;&lt;br&gt;We've left it there in case anyone wants to use it - but still don't
&lt;br&gt;bother updating it. &amp;nbsp;I expect a few people still use the OABI NPTL
&lt;br&gt;port, and no one uses new glibc sources with OABI LinuxThreads.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Daniel Jacobowitz
&lt;br&gt;CodeSourcery
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Sourceware---libc-ports-f12204.html&quot; embed=&quot;fixTarget[12204]&quot; target=&quot;_top&quot; &gt;Sourceware - libc-ports&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Breaking-ARM%27s-mcount-implementations-into-a-separate-file-tp26787384p26795741.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26795177</id>
	<title>Re: Breaking ARM's mcount implementations into a separate file</title>
	<published>2009-12-15T05:55:16Z</published>
	<updated>2009-12-15T05:55:16Z</updated>
	<author>
		<name>Joseph S. Myers</name>
	</author>
	<content type="html">On Tue, 15 Dec 2009, Thomas Schwinge wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hello!
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; On 2009-12-15 02:05, Joseph S. Myers wrote:
&lt;br&gt;&amp;gt; &amp;gt; On Tue, 15 Dec 2009, Thomas Schwinge wrote:
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; I inspected the pre / post libraries (symbols, disassembly), and did test
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; runs to confirm that profiling still works in the ``normal'' and -mthumb
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; cases.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; I'm not sure of the significance of having separate ARM/Thumb versions, 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Well, if I understand this correctly, it was you, together with Paul
&lt;br&gt;&amp;gt; Brook, who have added this code on 2009-02-05.
&lt;/div&gt;&lt;br&gt;You need to look more carefully at the history before I merged Thumb-2 
&lt;br&gt;support from EGLIBC to FSF ports. &amp;nbsp;The new mcount entry point dates back 
&lt;br&gt;at least to &amp;lt;&lt;a href=&quot;http://www.eglibc.org/archives/patches/msg00449.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.eglibc.org/archives/patches/msg00449.html&lt;/a&gt;&amp;gt; and 
&lt;br&gt;other discussions around that time, while Thumb-2 mcount comes from 
&lt;br&gt;&amp;lt;&lt;a href=&quot;http://www.eglibc.org/archives/patches/msg00143.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.eglibc.org/archives/patches/msg00143.html&lt;/a&gt;&amp;gt;. &amp;nbsp;I.e., on 
&lt;br&gt;2009-02-05 I merged existing code without knowing the significance of 
&lt;br&gt;every bit of it.
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;gt; #if defined(__thumb2__)
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .thumb
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .syntax unified
&lt;br&gt;&amp;gt; &amp;gt; #endif
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; This is correct. &amp;nbsp;I transformed the code without thinking about that. &amp;nbsp;Do
&lt;br&gt;&amp;gt; I need to resend the patch, or can the one who is comitting it easily add
&lt;br&gt;&amp;gt; the two assembler directives to the [__thumb2__] code?
&lt;br&gt;&lt;br&gt;You'll need to send the patch in a form appropriate for committing, tested 
&lt;br&gt;as both ARM and Thumb-2.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Joseph S. Myers
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26795177&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;joseph@...&lt;/a&gt;
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Sourceware---libc-ports-f12204.html&quot; embed=&quot;fixTarget[12204]&quot; target=&quot;_top&quot; &gt;Sourceware - libc-ports&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Breaking-ARM%27s-mcount-implementations-into-a-separate-file-tp26787384p26795177.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26792100</id>
	<title>[ARM] {OABI, EABI} x {LinuxThreads, NPTL} (was: Breaking ARM's mcount implementations into a separate file)</title>
	<published>2009-12-15T01:41:51Z</published>
	<updated>2009-12-15T01:41:51Z</updated>
	<author>
		<name>Thomas Schwinge-8</name>
	</author>
	<content type="html">Hello!
&lt;br&gt;&lt;br&gt;While we're at that -- another question: what's the general policy on
&lt;br&gt;keeping ARM's OABI and LinuxThreads code up to date that is still present
&lt;br&gt;in the repository? &amp;nbsp;Obviously it needs time to maintain / enhace these
&lt;br&gt;code paths when doing changes to EABI / NPTL code -- but are these
&lt;br&gt;changes at all used by anyone, or is it in fact wasted time? &amp;nbsp;Let alone
&lt;br&gt;the difficulty with testing such changes. &amp;nbsp;Should maybe even the OABI and
&lt;br&gt;LinuxThread code blocks / files be removed from the repository?
&lt;br&gt;&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;&amp;nbsp;Thomas
&lt;br&gt;&lt;br /&gt; &lt;div class=&quot;small&quot;&gt;&lt;br/&gt;&lt;img src=&quot;http://old.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;attachment0&lt;/strong&gt; (202 bytes) &lt;a href=&quot;http://old.nabble.com/attachment/26792100/0/attachment0&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;/div&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Sourceware---libc-ports-f12204.html&quot; embed=&quot;fixTarget[12204]&quot; target=&quot;_top&quot; &gt;Sourceware - libc-ports&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Breaking-ARM%27s-mcount-implementations-into-a-separate-file-tp26787384p26792100.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26791606</id>
	<title>Re: Breaking ARM's mcount implementations into a separate file</title>
	<published>2009-12-15T00:54:41Z</published>
	<updated>2009-12-15T00:54:41Z</updated>
	<author>
		<name>Thomas Schwinge-8</name>
	</author>
	<content type="html">Hello!
&lt;br&gt;&lt;br&gt;On 2009-12-15 02:05, Joseph S. Myers wrote:
&lt;br&gt;&amp;gt; On Tue, 15 Dec 2009, Thomas Schwinge wrote:
&lt;br&gt;&amp;gt;&amp;gt; I inspected the pre / post libraries (symbols, disassembly), and did test
&lt;br&gt;&amp;gt;&amp;gt; runs to confirm that profiling still works in the ``normal'' and -mthumb
&lt;br&gt;&amp;gt;&amp;gt; cases.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I'm not sure of the significance of having separate ARM/Thumb versions, 
&lt;br&gt;&lt;br&gt;Well, if I understand this correctly, it was you, together with Paul
&lt;br&gt;Brook, who have added this code on 2009-02-05.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; but it does not make much sense to me to have different __thumb2__ 
&lt;br&gt;&amp;gt; versions that still get compiled in ARM mode when glibc is built as 
&lt;br&gt;&amp;gt; Thumb-2. &amp;nbsp;Remember that .S files get built in ARM mode unless they contain 
&lt;br&gt;&amp;gt; assembler directives to use Thumb, but __thumb2__ is defined if the 
&lt;br&gt;&amp;gt; compiler would generate Thumb-2. &amp;nbsp;If you want particular .S sources built 
&lt;br&gt;&amp;gt; as Thumb-2 code, you need something like sysdeps/arm/elf/start.S:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; #if defined(__thumb2__)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .thumb
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .syntax unified
&lt;br&gt;&amp;gt; #endif
&lt;/div&gt;&lt;/div&gt;This is correct. &amp;nbsp;I transformed the code without thinking about that. &amp;nbsp;Do
&lt;br&gt;I need to resend the patch, or can the one who is comitting it easily add
&lt;br&gt;the two assembler directives to the [__thumb2__] code?
&lt;br&gt;&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;&amp;nbsp;Thomas
&lt;br&gt;&lt;br /&gt; &lt;div class=&quot;small&quot;&gt;&lt;br/&gt;&lt;img src=&quot;http://old.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;attachment0&lt;/strong&gt; (202 bytes) &lt;a href=&quot;http://old.nabble.com/attachment/26791606/0/attachment0&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;/div&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Sourceware---libc-ports-f12204.html&quot; embed=&quot;fixTarget[12204]&quot; target=&quot;_top&quot; &gt;Sourceware - libc-ports&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Breaking-ARM%27s-mcount-implementations-into-a-separate-file-tp26787384p26791606.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26788272</id>
	<title>Re: Breaking ARM's mcount implementations into a separate file</title>
	<published>2009-12-14T18:05:23Z</published>
	<updated>2009-12-14T18:05:23Z</updated>
	<author>
		<name>Joseph S. Myers</name>
	</author>
	<content type="html">On Tue, 15 Dec 2009, Thomas Schwinge wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; I inspected the pre / post libraries (symbols, disassembly), and did test
&lt;br&gt;&amp;gt; runs to confirm that profiling still works in the ``normal'' and -mthumb
&lt;br&gt;&amp;gt; cases.
&lt;br&gt;&lt;br&gt;I'm not sure of the significance of having separate ARM/Thumb versions, 
&lt;br&gt;but it does not make much sense to me to have different __thumb2__ 
&lt;br&gt;versions that still get compiled in ARM mode when glibc is built as 
&lt;br&gt;Thumb-2. &amp;nbsp;Remember that .S files get built in ARM mode unless they contain 
&lt;br&gt;assembler directives to use Thumb, but __thumb2__ is defined if the 
&lt;br&gt;compiler would generate Thumb-2. &amp;nbsp;If you want particular .S sources built 
&lt;br&gt;as Thumb-2 code, you need something like sysdeps/arm/elf/start.S:
&lt;br&gt;&lt;br&gt;#if defined(__thumb2__)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .thumb
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .syntax unified
&lt;br&gt;#endif
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Joseph S. Myers
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26788272&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;joseph@...&lt;/a&gt;
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Sourceware---libc-ports-f12204.html&quot; embed=&quot;fixTarget[12204]&quot; target=&quot;_top&quot; &gt;Sourceware - libc-ports&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Breaking-ARM%27s-mcount-implementations-into-a-separate-file-tp26787384p26788272.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26787384</id>
	<title>Breaking ARM's mcount implementations into a separate file</title>
	<published>2009-12-14T16:08:24Z</published>
	<updated>2009-12-14T16:08:24Z</updated>
	<author>
		<name>Thomas Schwinge-8</name>
	</author>
	<content type="html">Hello!
&lt;br&gt;&lt;br&gt;ARM currently implements the mcount functions as inline assembly in
&lt;br&gt;__attribute__ (__naked__) functions. &amp;nbsp;This interferes with my ongoing
&lt;br&gt;work to add CFI statements to ARM's assembly code, as I can't be sure
&lt;br&gt;whether .cfi_startproc has already been issued (-g with recent GCC) or
&lt;br&gt;not (and I'd have to do it manually in the inline assembly code then, but
&lt;br&gt;only in this latter case). &amp;nbsp;Also, this patch simplifies the code by
&lt;br&gt;undoing the wrapping of macro definitions containing C functions
&lt;br&gt;containing (only) inline assembly code, and aligns to what the mainline
&lt;br&gt;code is using.
&lt;br&gt;&lt;br&gt;&lt;br&gt;2009-12-15 &amp;nbsp;Thomas Schwinge &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26787384&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;thomas@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; * sysdeps/arm/eabi/Makefile [gmon] (sysdep_routines): Add arm-mcount.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; * sysdeps/arm/eabi/machine-gmon.h (mcount_internal): Define to
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; `__mcount_internal'.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (MCOUNT (__gnu_mcount_nc), OLD_MCOUNT (_mcount), mcount): Move to...
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; * sysdeps/arm/eabi/arm-mcount.S: ... this new file as __gnu_mcount_nc,
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; _mcount, and mcount, respectively.
&lt;br&gt;&lt;br&gt;diff --git a/glibc-ports-mainline/sysdeps/arm/eabi/Makefile b/glibc-ports-mainline/sysdeps/arm/eabi/Makefile
&lt;br&gt;index 36ddb8e..73185cb 100644
&lt;br&gt;--- a/glibc-ports-mainline/sysdeps/arm/eabi/Makefile
&lt;br&gt;+++ b/glibc-ports-mainline/sysdeps/arm/eabi/Makefile
&lt;br&gt;@@ -15,6 +15,10 @@ static-only-routines += $(aeabi_constants)
&lt;br&gt;&amp;nbsp;gen-as-const-headers += rtld-global-offsets.sym
&lt;br&gt;&amp;nbsp;endif
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+ifeq ($(subdir),gmon)
&lt;br&gt;+sysdep_routines += arm-mcount
&lt;br&gt;+endif
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;ifeq ($(subdir),debug)
&lt;br&gt;&amp;nbsp;CFLAGS-backtrace.c += -funwind-tables
&lt;br&gt;&amp;nbsp;CFLAGS-tst-backtrace2.c += -funwind-tables
&lt;br&gt;diff --git a/glibc-ports-mainline/sysdeps/arm/eabi/arm-mcount.S b/glibc-ports-mainline/sysdeps/arm/eabi/arm-mcount.S
&lt;br&gt;new file mode 100644
&lt;br&gt;index 0000000..82ef02b
&lt;br&gt;--- /dev/null
&lt;br&gt;+++ b/glibc-ports-mainline/sysdeps/arm/eabi/arm-mcount.S
&lt;br&gt;@@ -0,0 +1,78 @@
&lt;br&gt;+/* Implementation of profiling support. &amp;nbsp;ARM EABI version.
&lt;br&gt;+ &amp;nbsp; Copyright (C) 2008, 2009 Free Software Foundation, Inc.
&lt;br&gt;+ &amp;nbsp; This file is part of the GNU C Library.
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; The GNU C Library is free software; you can redistribute it and/or
&lt;br&gt;+ &amp;nbsp; modify it under the terms of the GNU Lesser General Public
&lt;br&gt;+ &amp;nbsp; License as published by the Free Software Foundation; either
&lt;br&gt;+ &amp;nbsp; version 2.1 of the License, or (at your option) any later version.
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; The GNU C Library is distributed in the hope that it will be useful,
&lt;br&gt;+ &amp;nbsp; but WITHOUT ANY WARRANTY; without even the implied warranty of
&lt;br&gt;+ &amp;nbsp; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. &amp;nbsp;See the GNU
&lt;br&gt;+ &amp;nbsp; Lesser General Public License for more details.
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; You should have received a copy of the GNU Lesser General Public
&lt;br&gt;+ &amp;nbsp; License along with the GNU C Library; if not, write to the Free
&lt;br&gt;+ &amp;nbsp; Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
&lt;br&gt;+ &amp;nbsp; 02111-1307 USA. &amp;nbsp;*/
&lt;br&gt;+
&lt;br&gt;+#include &amp;lt;sysdep.h&amp;gt;
&lt;br&gt;+
&lt;br&gt;+#undef CALL_MCOUNT
&lt;br&gt;+#define CALL_MCOUNT /* Don't call mcount when calling mcount... &amp;nbsp;*/
&lt;br&gt;+	
&lt;br&gt;+/* Use an assembly stub with a special ABI. &amp;nbsp;The calling lr has been
&lt;br&gt;+ &amp;nbsp; pushed to the stack (which will be misaligned). &amp;nbsp;We should preserve
&lt;br&gt;+ &amp;nbsp; all registers except ip and pop a word off the stack.
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; NOTE: This assumes mcount_internal does not clobber any non-core
&lt;br&gt;+ &amp;nbsp; (coprocessor) registers. &amp;nbsp;Currently this is true, but may require
&lt;br&gt;+ &amp;nbsp; additional attention in the future.
&lt;br&gt;+
&lt;br&gt;+ &amp;nbsp; The calling sequence looks something like:
&lt;br&gt;+func:
&lt;br&gt;+ &amp;nbsp; push {lr}
&lt;br&gt;+ &amp;nbsp; bl __gnu_mount_nc
&lt;br&gt;+ &amp;nbsp; &amp;lt;function body&amp;gt;
&lt;br&gt;+*/
&lt;br&gt;+
&lt;br&gt;+ENTRY(__gnu_mcount_nc)
&lt;br&gt;+	push {r0, r1, r2, r3, lr}
&lt;br&gt;+	bic r1, lr, #1
&lt;br&gt;+	ldr r0, [sp, #20]
&lt;br&gt;+	bl __mcount_internal
&lt;br&gt;+	pop {r0, r1, r2, r3, ip, lr}
&lt;br&gt;+	bx ip
&lt;br&gt;+END(__gnu_mcount_nc)
&lt;br&gt;+
&lt;br&gt;+
&lt;br&gt;+/* Provide old mcount for backwards compatibility. &amp;nbsp;This requires
&lt;br&gt;+ &amp;nbsp; code be compiled with APCS frame pointers. &amp;nbsp;*/
&lt;br&gt;+
&lt;br&gt;+#ifdef __thumb2__
&lt;br&gt;+ENTRY(_mcount)
&lt;br&gt;+	push {r0, r1, r2, r3, fp, lr}
&lt;br&gt;+	movs r0, fp
&lt;br&gt;+	ittt ne
&lt;br&gt;+	ldrne r0, [r0, #-4]
&lt;br&gt;+	movsne r1, lr
&lt;br&gt;+	blne __mcount_internal
&lt;br&gt;+	pop {r0, r1, r2, r3, fp, pc}
&lt;br&gt;+END(_mcount)
&lt;br&gt;+#else
&lt;br&gt;+ENTRY(_mcount)
&lt;br&gt;+	stmdb sp!, {r0, r1, r2, r3, fp, lr}
&lt;br&gt;+	movs fp, fp
&lt;br&gt;+	ldrne r0, [fp, #-4]
&lt;br&gt;+	movnes r1, lr
&lt;br&gt;+	blne __mcount_internal
&lt;br&gt;+	ldmia sp!, {r0, r1, r2, r3, fp, lr}
&lt;br&gt;+	bx lr
&lt;br&gt;+END(_mcount)
&lt;br&gt;+#endif
&lt;br&gt;+
&lt;br&gt;+/* The canonical name for the function is `_mcount' in both C and asm,
&lt;br&gt;+ &amp;nbsp; but some old asm code might assume it's `mcount'. &amp;nbsp;*/
&lt;br&gt;+#undef mcount
&lt;br&gt;+weak_alias (_mcount, mcount)
&lt;br&gt;diff --git a/glibc-ports-mainline/sysdeps/arm/eabi/machine-gmon.h b/glibc-ports-mainline/sysdeps/arm/eabi/machine-gmon.h
&lt;br&gt;index 189a9a3..aca23c9 100644
&lt;br&gt;--- a/glibc-ports-mainline/sysdeps/arm/eabi/machine-gmon.h
&lt;br&gt;+++ b/glibc-ports-mainline/sysdeps/arm/eabi/machine-gmon.h
&lt;br&gt;@@ -1,5 +1,5 @@
&lt;br&gt;&amp;nbsp;/* Machine-dependent definitions for profiling support. &amp;nbsp;ARM EABI version.
&lt;br&gt;- &amp;nbsp; Copyright (C) 2008 Free Software Foundation, Inc.
&lt;br&gt;+ &amp;nbsp; Copyright (C) 2008, 2009 Free Software Foundation, Inc.
&lt;br&gt;&amp;nbsp; &amp;nbsp; This file is part of the GNU C Library.
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp; &amp;nbsp; The GNU C Library is free software; you can redistribute it and/or
&lt;br&gt;@@ -17,83 +17,18 @@
&lt;br&gt;&amp;nbsp; &amp;nbsp; Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
&lt;br&gt;&amp;nbsp; &amp;nbsp; 02111-1307 USA. &amp;nbsp;*/
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+#include &amp;lt;sysdep.h&amp;gt;
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;/* GCC for the ARM cannot compile __builtin_return_address(N) for N != 0, 
&lt;br&gt;&amp;nbsp; &amp;nbsp; so we must use an assembly stub. &amp;nbsp;*/
&lt;br&gt;&amp;nbsp;
&lt;br&gt;-#include &amp;lt;sysdep.h&amp;gt;
&lt;br&gt;-static void mcount_internal (u_long frompc, u_long selfpc) __attribute_used__;
&lt;br&gt;+/* We must not pollute the global namespace. &amp;nbsp;*/
&lt;br&gt;+#define mcount_internal __mcount_internal
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+extern void mcount_internal (u_long frompc, u_long selfpc) internal_function;
&lt;br&gt;&amp;nbsp;#define _MCOUNT_DECL(frompc, selfpc) \
&lt;br&gt;-static void mcount_internal (u_long frompc, u_long selfpc)
&lt;br&gt;-
&lt;br&gt;-/* Use an assembly stub with a special ABI. &amp;nbsp;The calling lr has been
&lt;br&gt;- &amp;nbsp; pushed to the stack (which will be misaligned). &amp;nbsp;We should preserve
&lt;br&gt;- &amp;nbsp; all registers except ip and pop a word off the stack.
&lt;br&gt;-
&lt;br&gt;- &amp;nbsp; NOTE: This assumes mcount_internal does not clobber any non-core
&lt;br&gt;- &amp;nbsp; (coprocessor) registers. &amp;nbsp;Currently this is true, but may require
&lt;br&gt;- &amp;nbsp; additional attention in the future.
&lt;br&gt;-
&lt;br&gt;- &amp;nbsp; The calling sequence looks something like:
&lt;br&gt;-func:
&lt;br&gt;- &amp;nbsp; push {lr}
&lt;br&gt;- &amp;nbsp; bl __gnu_mount_nc
&lt;br&gt;- &amp;nbsp; &amp;lt;function body&amp;gt;
&lt;br&gt;- */
&lt;br&gt;-
&lt;br&gt;-
&lt;br&gt;-#define MCOUNT								\
&lt;br&gt;-void __attribute__((__naked__)) __gnu_mcount_nc(void)			\
&lt;br&gt;-{									\
&lt;br&gt;- &amp;nbsp; &amp;nbsp;asm (&amp;quot;push {r0, r1, r2, r3, lr}\n\t&amp;quot;				\
&lt;br&gt;-	 &amp;quot;bic r1, lr, #1\n\t&amp;quot;						\
&lt;br&gt;-	 &amp;quot;ldr r0, [sp, #20]\n\t&amp;quot;					\
&lt;br&gt;-	 &amp;quot;bl mcount_internal\n\t&amp;quot;					\
&lt;br&gt;-	 &amp;quot;pop {r0, r1, r2, r3, ip, lr}\n\t&amp;quot;				\
&lt;br&gt;-	 &amp;quot;bx ip&amp;quot;);							\
&lt;br&gt;-}									\
&lt;br&gt;-OLD_MCOUNT
&lt;br&gt;-
&lt;br&gt;-/* Provide old mcount for backwards compatibility. &amp;nbsp;This requires
&lt;br&gt;- &amp;nbsp; code be compiled with APCS frame pointers. &amp;nbsp;*/
&lt;br&gt;-
&lt;br&gt;-#ifndef NO_UNDERSCORES
&lt;br&gt;-/* The asm symbols for C functions are `_function'.
&lt;br&gt;- &amp;nbsp; The canonical name for the counter function is `mcount', no _. &amp;nbsp;*/
&lt;br&gt;-void _mcount (void) asm (&amp;quot;mcount&amp;quot;);
&lt;br&gt;-#else
&lt;br&gt;-/* The canonical name for the function is `_mcount' in both C and asm,
&lt;br&gt;- &amp;nbsp; but some old asm code might assume it's `mcount'. &amp;nbsp;*/
&lt;br&gt;-void _mcount (void);
&lt;br&gt;-weak_alias (_mcount, mcount)
&lt;br&gt;-#endif
&lt;br&gt;-
&lt;br&gt;-#ifdef __thumb2__
&lt;br&gt;-
&lt;br&gt;-#define OLD_MCOUNT							\
&lt;br&gt;-void __attribute__((__naked__)) _mcount (void)				\
&lt;br&gt;-{									\
&lt;br&gt;- &amp;nbsp;__asm__(&amp;quot;push		{r0, r1, r2, r3, fp, lr};&amp;quot;			\
&lt;br&gt;-	 &amp;nbsp;&amp;quot;movs		r0, fp;&amp;quot;					\
&lt;br&gt;-	 &amp;nbsp;&amp;quot;ittt		ne;&amp;quot;						\
&lt;br&gt;-	 &amp;nbsp;&amp;quot;ldrne	r0, [r0, #-4];&amp;quot;					\
&lt;br&gt;-	 &amp;nbsp;&amp;quot;movsne	r1, lr;&amp;quot;					\
&lt;br&gt;-	 &amp;nbsp;&amp;quot;blne		mcount_internal;&amp;quot;				\
&lt;br&gt;-	 &amp;nbsp;&amp;quot;pop		{r0, r1, r2, r3, fp, pc}&amp;quot;);			\
&lt;br&gt;-}
&lt;br&gt;-
&lt;br&gt;-#else
&lt;br&gt;+ &amp;nbsp;void internal_function mcount_internal (u_long frompc, u_long selfpc)
&lt;br&gt;&amp;nbsp;
&lt;br&gt;-#define OLD_MCOUNT							\
&lt;br&gt;-void __attribute__((__naked__)) _mcount (void)				\
&lt;br&gt;-{									\
&lt;br&gt;- &amp;nbsp;__asm__(&amp;quot;stmdb	sp!, {r0, r1, r2, r3, fp, lr};&amp;quot;			\
&lt;br&gt;-	 &amp;nbsp;&amp;quot;movs		fp, fp;&amp;quot;					\
&lt;br&gt;-	 &amp;nbsp;&amp;quot;ldrne	r0, [fp, #-4];&amp;quot;					\
&lt;br&gt;-	 &amp;nbsp;&amp;quot;movnes	r1, lr;&amp;quot;					\
&lt;br&gt;-	 &amp;nbsp;&amp;quot;blne		mcount_internal;&amp;quot;				\
&lt;br&gt;-	 &amp;nbsp;&amp;quot;ldmia	sp!, {r0, r1, r2, r3, fp, lr};&amp;quot;			\
&lt;br&gt;-	 &amp;nbsp;&amp;quot;bx		lr&amp;quot;);						\
&lt;br&gt;-}
&lt;br&gt;&amp;nbsp;
&lt;br&gt;-#endif
&lt;br&gt;+/* Define MCOUNT as empty since we have the implementation in another file. &amp;nbsp;*/
&lt;br&gt;+#define MCOUNT
&lt;br&gt;&lt;br&gt;&lt;br&gt;I inspected the pre / post libraries (symbols, disassembly), and did test
&lt;br&gt;runs to confirm that profiling still works in the ``normal'' and -mthumb
&lt;br&gt;cases.
&lt;br&gt;&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;&amp;nbsp;Thomas
&lt;br&gt;&lt;br /&gt; &lt;div class=&quot;small&quot;&gt;&lt;br/&gt;&lt;img src=&quot;http://old.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;attachment0&lt;/strong&gt; (202 bytes) &lt;a href=&quot;http://old.nabble.com/attachment/26787384/0/attachment0&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;/div&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Sourceware---libc-ports-f12204.html&quot; embed=&quot;fixTarget[12204]&quot; target=&quot;_top&quot; &gt;Sourceware - libc-ports&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Breaking-ARM%27s-mcount-implementations-into-a-separate-file-tp26787384p26787384.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26781858</id>
	<title>The Linux binutils 2.20.51.0.4 is released</title>
	<published>2009-12-14T09:37:24Z</published>
	<updated>2009-12-14T09:37:24Z</updated>
	<author>
		<name>H.J. Lu-10</name>
	</author>
	<content type="html">This is the beta release of binutils 2.20.51.0.4 for Linux, which is
&lt;br&gt;based on binutils 2009 1214 in CVS on sourceware.org plus various
&lt;br&gt;changes. It is purely for Linux.
&lt;br&gt;&lt;br&gt;All relevant patches in patches have been applied to the source tree.
&lt;br&gt;You can take a look at patches/README to see what have been applied and
&lt;br&gt;in what order they have been applied.
&lt;br&gt;&lt;br&gt;Starting from the 2.20.51.0.4 release, no diffs against the previous
&lt;br&gt;release will be provided.
&lt;br&gt;&lt;br&gt;You can enable both gold and bfd ld with --enable-gold=both. Gold will
&lt;br&gt;be installed as ld.gold and bfd ld will be installed as ld.bfd. &amp;nbsp;By
&lt;br&gt;default, ld.bfd will be installed as ld. &amp;nbsp;You can use the configure
&lt;br&gt;option, --enable-linker=[bfd,gold] to choose the default linker, ld.
&lt;br&gt;IA-32 binary and X64_64 binary tar balls are configured with
&lt;br&gt;--enable-gold=both --enable-plugins --enable-threads.
&lt;br&gt;&lt;br&gt;Starting from the 2.18.50.0.4 release, the x86 assembler no longer
&lt;br&gt;accepts
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fnstsw %eax
&lt;br&gt;&lt;br&gt;fnstsw stores 16bit into %ax and the upper 16bit of %eax is unchanged.
&lt;br&gt;Please use
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fnstsw %ax
&lt;br&gt;&lt;br&gt;Starting from the 2.17.50.0.4 release, the default output section LMA
&lt;br&gt;(load memory address) has changed for allocatable sections from being
&lt;br&gt;equal to VMA (virtual memory address), to keeping the difference between
&lt;br&gt;LMA and VMA the same as the previous output section in the same region.
&lt;br&gt;&lt;br&gt;For
&lt;br&gt;&lt;br&gt;.data.init_task : { *(.data.init_task) }
&lt;br&gt;&lt;br&gt;LMA of .data.init_task section is equal to its VMA with the old linker.
&lt;br&gt;With the new linker, it depends on the previous output section. You
&lt;br&gt;can use
&lt;br&gt;&lt;br&gt;.data.init_task : AT (ADDR(.data.init_task)) { *(.data.init_task) }
&lt;br&gt;&lt;br&gt;to ensure that LMA of .data.init_task section is always equal to its
&lt;br&gt;VMA. The linker script in the older 2.6 x86-64 kernel depends on the
&lt;br&gt;old behavior. &amp;nbsp;You can add AT (ADDR(section)) to force LMA of
&lt;br&gt;.data.init_task section equal to its VMA. It will work with both old
&lt;br&gt;and new linkers. The x86-64 kernel linker script in kernel 2.6.13 and
&lt;br&gt;above is OK.
&lt;br&gt;&lt;br&gt;The new x86_64 assembler no longer accepts
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; monitor %eax,%ecx,%edx
&lt;br&gt;&lt;br&gt;You should use
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; monitor %rax,%ecx,%edx
&lt;br&gt;&lt;br&gt;or
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; monitor
&lt;br&gt;&lt;br&gt;which works with both old and new x86_64 assemblers. They should
&lt;br&gt;generate the same opcode.
&lt;br&gt;&lt;br&gt;The new i386/x86_64 assemblers no longer accept instructions for moving
&lt;br&gt;between a segment register and a 32bit memory location, i.e.,
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; movl (%eax),%ds
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; movl %ds,(%eax)
&lt;br&gt;&lt;br&gt;To generate instructions for moving between a segment register and a
&lt;br&gt;16bit memory location without the 16bit operand size prefix, 0x66,
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mov (%eax),%ds
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mov %ds,(%eax)
&lt;br&gt;&lt;br&gt;should be used. It will work with both new and old assemblers. The
&lt;br&gt;assembler starting from 2.16.90.0.1 will also support
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; movw (%eax),%ds
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; movw %ds,(%eax)
&lt;br&gt;&lt;br&gt;without the 0x66 prefix. Patches for 2.4 and 2.6 Linux kernels are
&lt;br&gt;available at
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://www.kernel.org/pub/linux/devel/binutils/linux-2.4-seg-4.patch&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.kernel.org/pub/linux/devel/binutils/linux-2.4-seg-4.patch&lt;/a&gt;&lt;br&gt;&lt;a href=&quot;http://www.kernel.org/pub/linux/devel/binutils/linux-2.6-seg-5.patch&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.kernel.org/pub/linux/devel/binutils/linux-2.6-seg-5.patch&lt;/a&gt;&lt;br&gt;&lt;br&gt;The ia64 assembler is now defaulted to tune for Itanium 2 processors.
&lt;br&gt;To build a kernel for Itanium 1 processors, you will need to add
&lt;br&gt;&lt;br&gt;ifeq ($(CONFIG_ITANIUM),y)
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CFLAGS += -Wa,-mtune=itanium1
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AFLAGS += -Wa,-mtune=itanium1
&lt;br&gt;endif
&lt;br&gt;&lt;br&gt;to arch/ia64/Makefile in your kernel source tree.
&lt;br&gt;&lt;br&gt;Please report any bugs related to binutils 2.20.51.0.3 to
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26781858&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;hjl.tools@...&lt;/a&gt;
&lt;br&gt;&lt;br&gt;and
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://www.sourceware.org/bugzilla/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.sourceware.org/bugzilla/&lt;/a&gt;&lt;br&gt;&lt;br&gt;Changes from binutils 2.20.51.0.3:
&lt;br&gt;&lt;br&gt;1. Update from binutils 2009 1214.
&lt;br&gt;2. Update x86 assembler to check lockable instructions for lock prefix.
&lt;br&gt;3. Update x86 disassembler to display all prefixes.
&lt;br&gt;4. Support AMD XOP new instructions.
&lt;br&gt;5. Fix an x86 assembler regression on Intel syntax. &amp;nbsp;PR 11037.
&lt;br&gt;6. Improve ia64 linker relaxation. &amp;nbsp;PR 10955.
&lt;br&gt;7. Add --no-relax linker option.
&lt;br&gt;8. Update readelf to dump .debug_pubtype sections.
&lt;br&gt;9. Improve gold:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; a. Support linking against STT_GNU_IFUNC symbols defined in
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;shared libraries.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; b. Support linking with STB_GNU_UNIQUE symbols.
&lt;br&gt;10. Improve arm support.
&lt;br&gt;11. Improve m68k support.
&lt;br&gt;12. Improve mips support.
&lt;br&gt;13. Improve ppc support.
&lt;br&gt;&lt;br&gt;Changes from binutils 2.20.51.0.2:
&lt;br&gt;&lt;br&gt;1. Update from binutils 2009 1109.
&lt;br&gt;2. Fix &amp;quot;ld -s -static&amp;quot; with STT_GNU_IFUNC symbols. &amp;nbsp;PR 10911.
&lt;br&gt;3. Fix file permission on PIE with objcopy. PR 10802.
&lt;br&gt;4. Fix x86 Intel syntax assembler with relocation. &amp;nbsp;PR 10856.
&lt;br&gt;5. Fix x86 Intel syntax assembler with far jump. &amp;nbsp;PR 10740.
&lt;br&gt;6. Add AMD LWP support.
&lt;br&gt;7. Renamed linker option --add-needed to --copy-dt-needed-entries.
&lt;br&gt;8. Support enabling both ld and gold with --enable-gold=both and
&lt;br&gt;--enable-linker=[bfd,gold].
&lt;br&gt;9. Improve gold.
&lt;br&gt;10. Improve arm support.
&lt;br&gt;11. Improve cris support.
&lt;br&gt;12. Improve hppa support.
&lt;br&gt;13. Improve m68k support.
&lt;br&gt;14. Improve RX support.
&lt;br&gt;15. Improve spu support.
&lt;br&gt;16. Improve vax support.
&lt;br&gt;17. Improve MacOS support.
&lt;br&gt;18. Improve Windows support.
&lt;br&gt;&lt;br&gt;Changes from binutils 2.20.51.0.1:
&lt;br&gt;&lt;br&gt;1. Update from binutils 2009 1009.
&lt;br&gt;2. Add .cfi_sections to assembler.
&lt;br&gt;3. Fix a linker bug with local dynamic symbols. PR 10630.
&lt;br&gt;4. Add DWARF-3/DWARF-4 support.
&lt;br&gt;5. Fix the x86 assembler PIC bug. PR 10677.
&lt;br&gt;6. Fix the x86-64 displacement assembler bug. &amp;nbsp;PR 10636.
&lt;br&gt;7. Fix the x86 assembler bug with Intel memory syntax. &amp;nbsp;PR 10637.
&lt;br&gt;8. Fix the x86 PIC assembler bug with Intel syntax. PR 10704.
&lt;br&gt;9. Add RX support.
&lt;br&gt;10. Improve gold.
&lt;br&gt;11. Improve arm support.
&lt;br&gt;12. Improve bfin support.
&lt;br&gt;13. Improve cr16 support.
&lt;br&gt;14. Improve m68k support.
&lt;br&gt;15. Improve mips support.
&lt;br&gt;16. Improve ppc support.
&lt;br&gt;&lt;br&gt;Changes from binutils 2.19.51.0.14:
&lt;br&gt;&lt;br&gt;1. Update from binutils 2009 0905.
&lt;br&gt;2. Add Intel L1OM support.
&lt;br&gt;3. Add MicroBlaze support.
&lt;br&gt;4. Fix assembler for DWARF info without .file/.loc directives. &amp;nbsp;PR 10531.
&lt;br&gt;5. Improve -pie with TLS relocations on ia32 and x86-64. &amp;nbsp;PRs 6443/10434.
&lt;br&gt;6. Fix linker page size support. &amp;nbsp;PR 10569.
&lt;br&gt;7. Fix wildcard in linker version script. &amp;nbsp;PR 10518.
&lt;br&gt;8. Fix strip with STB_GNU_UNIQUE. PR 10492.
&lt;br&gt;9. Fix strip on unwriteable files. &amp;nbsp;PR 10364.
&lt;br&gt;10. Fix crash with &amp;quot;ld --build-id /usr/lib/libc.a&amp;quot;. &amp;nbsp;PR 10555.
&lt;br&gt;11. Fix linker for Linux kernel build. &amp;nbsp;PR 10429.
&lt;br&gt;12. Support string merge on .comment section.
&lt;br&gt;13. Improve build with C++ compiler.
&lt;br&gt;14. Improve gold.
&lt;br&gt;15. Improve arm support.
&lt;br&gt;16. Improve bfin support.
&lt;br&gt;11. Improve m32c support.
&lt;br&gt;17. Improve m68k support.
&lt;br&gt;18. Improve mep support.
&lt;br&gt;19. Improve mips support.
&lt;br&gt;20. Improve ppc support.
&lt;br&gt;21. Improve spu support.
&lt;br&gt;22. Improve xtensa support.
&lt;br&gt;&lt;br&gt;Changes from binutils 2.19.51.0.13:
&lt;br&gt;&lt;br&gt;1. Update from binutils 2009 0722.
&lt;br&gt;2. Fix linker for STT_GNU_IFUNC symbols in static executables. &amp;nbsp;PR 10433.
&lt;br&gt;3. Fix linker bug for Linux kernel build. &amp;nbsp;PR 10429.
&lt;br&gt;&lt;br&gt;Changes from binutils 2.19.51.0.12:
&lt;br&gt;&lt;br&gt;1. Update from binutils 2009 0721.
&lt;br&gt;2. Fix linker for undefined STT_GNU_IFUNC symbols. &amp;nbsp;PR 10426.
&lt;br&gt;3. Fix x86 assembler for nops in 64bit. &amp;nbsp;PR 10420.
&lt;br&gt;4. Add a new option, --insn-width, to objdump.
&lt;br&gt;5. Improve arm support.
&lt;br&gt;6. Improve mips support.
&lt;br&gt;7. Improve gold support.
&lt;br&gt;&lt;br&gt;Changes from binutils 2.19.51.0.11:
&lt;br&gt;&lt;br&gt;1. Update from binutils 2009 0716.
&lt;br&gt;2. Fix x86 assembler for jumping to local STT_GNU_IFUNC symbols.
&lt;br&gt;3. Fix x86 linker for relocatable link with local STT_GNU_IFUNC symbols.
&lt;br&gt;4. Implement ppc STT_GNU_IFUNC support.
&lt;br&gt;5. Support x86 FMA4.
&lt;br&gt;6. Fix linker regression with Linux kernel build.
&lt;br&gt;7. Support unordered references in DWARF reader.
&lt;br&gt;8. Improve PE/COFF support.
&lt;br&gt;8. Improve arm support.
&lt;br&gt;9. Improve m10300 support.
&lt;br&gt;10. Improve ppc support.
&lt;br&gt;11. Improve spu support.
&lt;br&gt;12. Improve gold support.
&lt;br&gt;&lt;br&gt;Changes from binutils 2.19.51.0.10:
&lt;br&gt;&lt;br&gt;1. Update from binutils 2009 0627.
&lt;br&gt;2. Fix strip on static executable with STT_GNU_IFUNC symbol. &amp;nbsp;PR 10337.
&lt;br&gt;3. Add STB_GNU_UNIQUE support.
&lt;br&gt;4. Fix objcopy on empty file. &amp;nbsp;PR 10321.
&lt;br&gt;5. Fix debug section for PE-COFF.
&lt;br&gt;6. Suport build with gcc 4.5.0.
&lt;br&gt;7. Improve arm support.
&lt;br&gt;8. Improve ppc support.
&lt;br&gt;9. Improve m10300 support.
&lt;br&gt;10. Improve mep support.
&lt;br&gt;11. Improve MacOS support.
&lt;br&gt;12. Improve gold support.
&lt;br&gt;&lt;br&gt;Changes from binutils 2.19.51.0.9:
&lt;br&gt;&lt;br&gt;1. Update from binutils 2009 0618.
&lt;br&gt;2. Update STT_GNU_IFUNC symbol support. &amp;nbsp;PR 10269/10270.
&lt;br&gt;3. Fix an assembler CFI bug. &amp;nbsp;PR 10255.
&lt;br&gt;4. Improve objdump. &amp;nbsp;PR 10263/10288
&lt;br&gt;5. Improve readelf.
&lt;br&gt;6. Improve arm support.
&lt;br&gt;7. Improve moxie support.
&lt;br&gt;8. Improve spu support.
&lt;br&gt;9. Improve vax support.
&lt;br&gt;10. Improve COFF/PE support.
&lt;br&gt;11. Improve MacOS support.
&lt;br&gt;&lt;br&gt;Changes from binutils 2.19.51.0.8:
&lt;br&gt;&lt;br&gt;1. Update from binutils 2009 0606.
&lt;br&gt;2. Update STT_GNU_IFUNC symbol support.
&lt;br&gt;&lt;br&gt;Changes from binutils 2.19.51.0.7:
&lt;br&gt;&lt;br&gt;1. Update from binutils 2009 0603.
&lt;br&gt;2. Fix STT_GNU_IFUNC symbol with pointer equality.
&lt;br&gt;&lt;br&gt;Changes from binutils 2.19.51.0.6:
&lt;br&gt;&lt;br&gt;1. Update from binutils 2009 0601.
&lt;br&gt;2. Update STT_GNU_IFUNC support. PR 10205.
&lt;br&gt;3. Fix x86 asssembler Intel syntax regression with '$'. PR 10198.
&lt;br&gt;&lt;br&gt;Changes from binutils 2.19.51.0.5:
&lt;br&gt;&lt;br&gt;1. Update from binutils 2009 0529.
&lt;br&gt;2. Rewrite STT_GNU_IFUNC, R_386_IRELATIVE and R_X86_64_IRELATIVE linker
&lt;br&gt;support for STT_GNU_IFUNC symbols in shared library, dynamic executable
&lt;br&gt;and static executable.
&lt;br&gt;3. Add plugin support.
&lt;br&gt;4. Improve spu support.
&lt;br&gt;&lt;br&gt;Changes from binutils 2.19.51.0.4:
&lt;br&gt;&lt;br&gt;1. Update from binutils 2009 0525.
&lt;br&gt;2. Add STT_GNU_IFUNC, R_386_IRELATIVE and R_X86_64_IRELATIVE support to
&lt;br&gt;assembler and linker.
&lt;br&gt;3. Add LD_AS_NEEDED support to linker.
&lt;br&gt;4. Remove AMD SSE5 support.
&lt;br&gt;5. A new Intel syntax parser in x86 assembler.
&lt;br&gt;6. Add DWARF discriminator support.
&lt;br&gt;7. Add --64 support for x86 PE/COFF assembler.
&lt;br&gt;8. Support common symbol with alignment for PE/COFF.
&lt;br&gt;9. Improve gold support.
&lt;br&gt;10. Improve arm support.
&lt;br&gt;11. Improve mep support.
&lt;br&gt;12. Improve mips support.
&lt;br&gt;13. Improve ppc support.
&lt;br&gt;14. Improve spu support.
&lt;br&gt;&lt;br&gt;Changes from binutils 2.19.51.0.3:
&lt;br&gt;&lt;br&gt;1. Update from binutils 2009 0418.
&lt;br&gt;2. Remove EFI targets and use PEI targets for EFI. Add --file-alignment,
&lt;br&gt;--heap, --image-base, --section-alignment, --stack and --subsystem command
&lt;br&gt;line options for objcopy. &amp;nbsp;PR 10074.
&lt;br&gt;3. Update linker to warn alternate ELF machine code.
&lt;br&gt;4. Fix x86 linker TLS transition. &amp;nbsp;PR 9938.
&lt;br&gt;5. Improve DWARF dumper to check relocations against STT_SECTION
&lt;br&gt;symbol.
&lt;br&gt;6. Guard DWARF dumper on bad DWARF input.
&lt;br&gt;7. Add EM_ETPU and EM_SLE9X. &amp;nbsp;Reserve 3 ELF machine types for Intel.
&lt;br&gt;8. Adding a linker missing entry symbol warning for -pie. PR 9970.
&lt;br&gt;9. Make the -e option for linker to imply -u. &amp;nbsp;PR 6766.
&lt;br&gt;10. Properly handle paging for PEI targets.
&lt;br&gt;11. Fix assembler listing with input from stdin.
&lt;br&gt;12. Update objcopy/string to generate symbol table if there is any
&lt;br&gt;relocation in output. &amp;nbsp;PR 9945.
&lt;br&gt;13. Require texinfo 4.7 for build. &amp;nbsp;PR 10039.
&lt;br&gt;14. Add moxie support.
&lt;br&gt;15. Improve gold support.
&lt;br&gt;16. Improve AIX support.
&lt;br&gt;17. Improve arm support.
&lt;br&gt;18. Improve cris support.
&lt;br&gt;19. Improve crx support.
&lt;br&gt;20. Improve mips support.
&lt;br&gt;21. Improve ppc support.
&lt;br&gt;22. Improve s390 support.
&lt;br&gt;23. Improve spu support.
&lt;br&gt;24. Improve vax support.
&lt;br&gt;&lt;br&gt;Changes from binutils 2.19.51.0.2:
&lt;br&gt;&lt;br&gt;1. Update from binutils 2009 0310.
&lt;br&gt;2. Fix strip on common symbols in relocatable file. &amp;nbsp;PR 9933.
&lt;br&gt;3. Fix --enable-targets=all build.
&lt;br&gt;4. Fix ia64 build with -Wformat-security. &amp;nbsp;PR 9874.
&lt;br&gt;5. Add REGION_ALIAS support in linker script.
&lt;br&gt;6. Add think archive support to readelf.
&lt;br&gt;7. Improve DWARF support in objdump.
&lt;br&gt;8. Improve alpha support.
&lt;br&gt;9. Improve arm support.
&lt;br&gt;10. Improve hppa support.
&lt;br&gt;11. Improve m68k support.
&lt;br&gt;12. Improve mips support.
&lt;br&gt;13. Improve ppc support.
&lt;br&gt;14. Improve xtensa support.
&lt;br&gt;15. Add score 7 support.
&lt;br&gt;&lt;br&gt;Changes from binutils 2.19.51.0.1:
&lt;br&gt;&lt;br&gt;1. Update from binutils 2009 0204.
&lt;br&gt;2. Support AVX Programming Reference (January, 2009)
&lt;br&gt;3. Improve .s suffix support in x86 disassembler.
&lt;br&gt;4. Add --prefix/--prefix-strip for objdump -S. &amp;nbsp;PR 9784.
&lt;br&gt;5. Change &amp;quot;ld --as-needed&amp;quot; to resolve undefined references in DSO.
&lt;br&gt;6. Add -Ttext-segment to ld to set address of text segment.
&lt;br&gt;7. Fix &amp;quot;ld -r --gc-sections --entry&amp;quot; crash with COMDAT group. &amp;nbsp;PR 9727.
&lt;br&gt;8. Improve linker compatibility for g++ 3.4 `.gnu.linkonce.r.*.
&lt;br&gt;9. Add VMS/ia64 support.
&lt;br&gt;10. Improve arm support.
&lt;br&gt;11. Improve cris support.
&lt;br&gt;12. Improve m68k support.
&lt;br&gt;13. Improve mips support.
&lt;br&gt;14. Improve spu support.
&lt;br&gt;&lt;br&gt;Changes from binutils 2.19.50.0.1:
&lt;br&gt;&lt;br&gt;1. Update from binutils 2009 0106.
&lt;br&gt;2. Support AVX Programming Reference (December, 2008)
&lt;br&gt;2. Encode AVX insns with 2byte VEX prefix if possible.
&lt;br&gt;4. Add .s suffix support to swap register operands to x86 assembler.
&lt;br&gt;5. Properly select NOP insns for code alignment in x86 assembler.
&lt;br&gt;6. Fix 2 symbol visibility linker bugs. &amp;nbsp;PRs 9676/9679.
&lt;br&gt;7. Fix an ia64 linker relaxation bug. &amp;nbsp;PR 7036.
&lt;br&gt;8. Fix a symbol versioning bug. PR 7047.
&lt;br&gt;9. Fix unitialized data in linker. &amp;nbsp;PR 7028.
&lt;br&gt;10. Avoid a linker crash on bad input. &amp;nbsp;PR 7023.
&lt;br&gt;11. Fix a linker memory leak. &amp;nbsp;PR 7012.
&lt;br&gt;12. Fix strip/objcopy crash on PT_GNU_RELRO. &amp;nbsp;PR 7011.
&lt;br&gt;13. Improve MacOS support.
&lt;br&gt;14. Fix a COFF linker bug. &amp;nbsp;PR 6945.
&lt;br&gt;15. Add LM32 support.
&lt;br&gt;16. Fix various arm bugs.
&lt;br&gt;17. Fix various avr bugs.
&lt;br&gt;18. Fix various CR16 &amp;nbsp;bugs.
&lt;br&gt;19. Fix various cris bugs.
&lt;br&gt;20. Fix various m32c bugs.
&lt;br&gt;21. Fix various m68k bugs.
&lt;br&gt;22. Fix various mips bugs.
&lt;br&gt;23. Fix various ppc bugs.
&lt;br&gt;24. Fix various s390 bugs.
&lt;br&gt;25. Fix various sparc bugs.
&lt;br&gt;26. Fix various spu bugs.
&lt;br&gt;27. Fix various xtensa bugs.
&lt;br&gt;&lt;br&gt;The file list:
&lt;br&gt;&lt;br&gt;1. binutils-2.20.51.0.3.tar.bz2. Source code.
&lt;br&gt;2. binutils-2.20.51.0.3.i686.tar.bz2. IA-32 binary tar ball for RedHat
&lt;br&gt;&amp;nbsp; &amp;nbsp;EL 4.
&lt;br&gt;3. binutils-2.20.51.0.3.ia64.tar.bz2. IA-64 binary tar ball for RedHat
&lt;br&gt;&amp;nbsp; &amp;nbsp;EL 4.
&lt;br&gt;4. binutils-2.20.51.0.3.x86_64.tar.bz2. X64_64 binary tar ball for RedHat
&lt;br&gt;&amp;nbsp; &amp;nbsp;EL 4.
&lt;br&gt;&lt;br&gt;The primary sites for the beta Linux binutils are:
&lt;br&gt;&lt;br&gt;1. &lt;a href=&quot;http://www.kernel.org/pub/linux/devel/binutils/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.kernel.org/pub/linux/devel/binutils/&lt;/a&gt;&lt;br&gt;&lt;br&gt;Thanks.
&lt;br&gt;&lt;br&gt;&lt;br&gt;H.J. Lu
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26781858&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;hjl.tools@...&lt;/a&gt;
&lt;br&gt;12/14/2009
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Sourceware---libc-alpha-f12199.html&quot; embed=&quot;fixTarget[12199]&quot; target=&quot;_top&quot; &gt;Sourceware - libc-alpha&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/The-Linux-binutils-2.20.51.0.4-is-released-tp26781858p26781858.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26774656</id>
	<title>[Bug libc/11087] New: mallinfo miscounting hblks because of missing mutex</title>
	<published>2009-12-14T00:56:34Z</published>
	<updated>2009-12-14T00:56:34Z</updated>
	<author>
		<name>Bugzilla from sourceware-bugzilla@sourceware.org</name>
	</author>
	<content type="html">I have an issue with non-atomic increment/
&lt;br&gt;decrement
&lt;br&gt;of hblks, (i.e. n_mmaps) in a multi-threaded mission critical process
&lt;br&gt;that monitors
&lt;br&gt;heap usage as part of supervision. This value can drift astray of the
&lt;br&gt;true count and
&lt;br&gt;rarerly triggers an assertion in the total heap calculatio. There is a
&lt;br&gt;similar disabled
&lt;br&gt;assert in glibc:
&lt;br&gt;&lt;br&gt;#ifdef NO_THREADS
&lt;br&gt;&amp;nbsp; assert(total &amp;lt;= (unsigned long)(mp_.max_total_mem));
&lt;br&gt;&amp;nbsp; assert(mp_.n_mmaps &amp;gt;= 0);
&lt;br&gt;#endif
&lt;br&gt;&lt;br&gt;Seem to be a problem of wanting to pay the cost of mutex contention
&lt;br&gt;instead of
&lt;br&gt;the (application specific) cost of providing wrong values. In the
&lt;br&gt;context of a malloc call
&lt;br&gt;that asks for 2 Mb, I have not figured out that part yet, but I can't
&lt;br&gt;imagine that keeping
&lt;br&gt;a correct total count in a multi-threaded is beyond state of the art
&lt;br&gt;(but am sure it may
&lt;br&gt;be beyond desire of hackers or motivation of maintainers). There is a
&lt;br&gt;disabled
&lt;br&gt;THREAD_STATS switch but that doesn't seem to handle this case. The
&lt;br&gt;problem might be
&lt;br&gt;resolved, but at home I can still reproduce it with latest glibc:
&lt;br&gt;&lt;br&gt;with Text_Io;
&lt;br&gt;with Unchecked_Deallocation;
&lt;br&gt;procedure T is
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;type Mallinfo_Field is (Arena, Ordblks, Smblks, Hblks, Hblkhd,
&lt;br&gt;Usmblks, Fsmblks, Uordblks, Fordblks, Keepcost);
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;type Mallinfo_Stats is array (Mallinfo_Field) of Integer;
&lt;br&gt;&amp;nbsp; &amp;nbsp;-- on 32 bit.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;function mallinfo return Mallinfo_Stats;
&lt;br&gt;&amp;nbsp; &amp;nbsp;pragma Interface (C, mallinfo);
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;type Large is array (1..2**22) of Character; -- 4M
&lt;br&gt;&amp;nbsp; &amp;nbsp;type Large_Ptr is access Large;
&lt;br&gt;&amp;nbsp; &amp;nbsp;procedure Free is new Unchecked_Deallocation (Large, Large_Ptr);
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;task type Alloc is
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; pragma Priority (0);
&lt;br&gt;&amp;nbsp; &amp;nbsp;end Alloc;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;task body Alloc is
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; L : array (1..10) of Large_Ptr;
&lt;br&gt;&amp;nbsp; &amp;nbsp;begin
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; for Count in Natural loop
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;for I in L'Range loop
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; L(I) := new Large;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;end loop;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;for I in L'Range loop
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Free (L(I));
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;end loop;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;-- To check for sufficient parallelism
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;-- Test on multi-core/multi-processor
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if Count mod 10000 = 0 then
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Text_Io.Put_Line (Count'Img);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;end if;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; end loop;
&lt;br&gt;&amp;nbsp; &amp;nbsp;end;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;Loads : array (1..4) of Alloc;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;procedure Show_Stats is
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Result : constant Mallinfo_Stats := mallinfo;
&lt;br&gt;&amp;nbsp; &amp;nbsp;begin
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; for Field in Result'Range loop
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Text_IO.Put (Field'Img &amp; &amp;quot;=&amp;quot; &amp; Result(Field)'Img &amp; &amp;quot; &amp;quot;);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; end loop;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Text_Io.New_Line;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; if Result(Hblks) not in 0..40 then
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;for T in Loads'Range loop
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; abort Loads(T);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;end loop;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;raise Program_Error;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; end if;
&lt;br&gt;&amp;nbsp; &amp;nbsp;end Show_Stats;
&lt;br&gt;&lt;br&gt;begin
&lt;br&gt;&amp;nbsp; &amp;nbsp;loop
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; delay 1.0;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Show_Stats;
&lt;br&gt;&amp;nbsp; &amp;nbsp;end loop;
&lt;br&gt;end;
&lt;br&gt;&lt;br&gt;output :
&lt;br&gt;&lt;br&gt;ARENA= 135984 ORDBLKS= 1 SMBLKS= 0 HBLKS= 0 HBLKHD=-20992000 USMBLKS=
&lt;br&gt;0 FSMBLKS= 0 UORDBLKS= 62424 FORDBLKS= 73560 KEEPCOST= 73560
&lt;br&gt;&amp;nbsp;22700000
&lt;br&gt;&amp;nbsp;22620000
&lt;br&gt;ARENA= 135984 ORDBLKS= 1 SMBLKS= 0 HBLKS= 17 HBLKHD= 50380800 USMBLKS=
&lt;br&gt;0 FSMBLKS= 0 UORDBLKS= 62424 FORDBLKS= 73560 KEEPCOST= 73560
&lt;br&gt;&amp;nbsp;22630000
&lt;br&gt;&amp;nbsp;22570000
&lt;br&gt;ARENA= 135984 ORDBLKS= 1 SMBLKS= 0 HBLKS= 7 HBLKHD= 8396800 USMBLKS= 0
&lt;br&gt;FSMBLKS= 0 UORDBLKS= 62424 FORDBLKS= 73560 KEEPCOST= 73560
&lt;br&gt;&amp;nbsp;22710000
&lt;br&gt;&amp;nbsp;22630000
&lt;br&gt;&amp;nbsp;22640000
&lt;br&gt;&amp;nbsp;22580000
&lt;br&gt;ARENA= 135984 ORDBLKS= 1 SMBLKS= 0 HBLKS= 2 HBLKHD=-12595200 USMBLKS=
&lt;br&gt;0 FSMBLKS= 0 UORDBLKS= 62424 FORDBLKS= 73560 KEEPCOST= 73560
&lt;br&gt;&amp;nbsp;22720000
&lt;br&gt;&amp;nbsp;22640000
&lt;br&gt;ARENA= 135984 ORDBLKS= 1 SMBLKS= 0 HBLKS= 0 HBLKHD=-20992000 USMBLKS=
&lt;br&gt;0 FSMBLKS= 0 UORDBLKS= 62424 FORDBLKS= 73560 KEEPCOST= 73560
&lt;br&gt;&amp;nbsp;22650000
&lt;br&gt;&amp;nbsp;22590000
&lt;br&gt;ARENA= 135984 ORDBLKS= 1 SMBLKS= 0 HBLKS= 26 HBLKHD= 88166400 USMBLKS=
&lt;br&gt;0 FSMBLKS= 0 UORDBLKS= 62424 FORDBLKS= 73560 KEEPCOST= 73560
&lt;br&gt;&amp;nbsp;22730000
&lt;br&gt;&amp;nbsp;22650000
&lt;br&gt;&amp;nbsp;22660000
&lt;br&gt;&amp;nbsp;22600000
&lt;br&gt;ARENA= 135984 ORDBLKS= 1 SMBLKS= 0 HBLKS=-1 HBLKHD=-25190400 USMBLKS=
&lt;br&gt;0 FSMBLKS= 0 UORDBLKS= 62424 FORDBLKS= 73560 KEEPCOST= 73560
&lt;br&gt;&lt;br&gt;raised PROGRAM_ERROR : t.adb:52 explicit raise 
&lt;br&gt;&lt;br&gt;Posted on :
&lt;br&gt;&lt;a href=&quot;http://groups.google.com/group/comp.os.linux.development.apps/browse_thread/thread/80b0c703fe7004c2/f512a2856b0eb3e3?lnk=raot&amp;pli=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://groups.google.com/group/comp.os.linux.development.apps/browse_thread/thread/80b0c703fe7004c2/f512a2856b0eb3e3?lnk=raot&amp;pli=1&lt;/a&gt;&lt;br&gt;&lt;br&gt;Found a comment stating mutexing was expensive :
&lt;br&gt;&lt;a href=&quot;http://groups.google.com/group/comp.os.linux.development.system/browse_thread/thread/c25c962a87d81895/674575250fd87044?q=mallinfo+hblk#674575250fd87044&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://groups.google.com/group/comp.os.linux.development.system/browse_thread/thread/c25c962a87d81895/674575250fd87044?q=mallinfo+hblk#674575250fd87044&lt;/a&gt;&lt;br&gt;&lt;br&gt;I've tried adding a mutex, and I don't see what is expensive. When I compare the
&lt;br&gt;latest version of glibc malloc after adding the mutex locking against the system
&lt;br&gt;default glibc behaviour I don't measure a difference, results are within 3%
&lt;br&gt;accurate (some fluctuations on the measure, just used time command), I guess
&lt;br&gt;mutex cost is much smaller than mmap cost. Anyway, that is only performance of
&lt;br&gt;iterative malloc/free of a 4 MB block, adding nothing more but a zero-fill of
&lt;br&gt;this memory makes the operation about 1000 times slower, so I don't see a
&lt;br&gt;significant issue with this mutex overhead.
&lt;br&gt;&lt;br&gt;In case overhead would be significant, at least a #define THREAD_SAFE 1 should
&lt;br&gt;activate a fix, or a dynamic option, but surely correct total heap count should
&lt;br&gt;be achievable.
&lt;br&gt;&lt;br&gt;My experiment :
&lt;br&gt;&lt;br&gt;$ diff -U3 arena.c.orig arena.c
&lt;br&gt;--- arena.c.orig	2009-12-13 18:00:55.000000000 +0100
&lt;br&gt;+++ arena.c	2009-12-13 18:03:12.000000000 +0100
&lt;br&gt;@@ -93,6 +93,13 @@
&lt;br&gt;&amp;nbsp;/* Mapped memory in non-main arenas (reliable only for NO_THREADS). */
&lt;br&gt;&amp;nbsp;static unsigned long arena_mem;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+static mutex_t mp_mmap_mutex;
&lt;br&gt;+/*Serialize access to (malloc.c) mp_.
&lt;br&gt;+ &amp;nbsp;int &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;n_mmaps;
&lt;br&gt;+ &amp;nbsp;int &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;n_mmaps_max;
&lt;br&gt;+ &amp;nbsp;int &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;max_n_mmaps;
&lt;br&gt;+*/
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;/* Already initialized? */
&lt;br&gt;&amp;nbsp;int __malloc_initialized = -1;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;@@ -354,6 +361,8 @@
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;if(ar_ptr == &amp;main_arena) break;
&lt;br&gt;&amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;nbsp; &amp;nbsp;mutex_init(&amp;list_lock);
&lt;br&gt;+ &amp;nbsp;mutex_init(&amp;mp_mmap_mutex);
&lt;br&gt;+
&lt;br&gt;&amp;nbsp; &amp;nbsp;atfork_recursive_cntr = 0;
&lt;br&gt;&amp;nbsp;}
&lt;br&gt;&amp;nbsp;
&lt;br&gt;$ diff -U3 malloc.c.org malloc.c
&lt;br&gt;--- malloc.c.org	2009-12-13 13:26:22.000000000 +0100
&lt;br&gt;+++ malloc.c	2009-12-13 18:13:13.000000000 +0100
&lt;br&gt;@@ -2359,6 +2359,8 @@
&lt;br&gt;&amp;nbsp; &amp;nbsp; ----------- Internal state representation and initialization -----------
&lt;br&gt;&amp;nbsp;*/
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+#define THREAD_STATS 1
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;struct malloc_state {
&lt;br&gt;&amp;nbsp; &amp;nbsp;/* Serialize access. &amp;nbsp;*/
&lt;br&gt;&amp;nbsp; &amp;nbsp;mutex_t mutex;
&lt;br&gt;@@ -2443,6 +2445,12 @@
&lt;br&gt;&amp;nbsp;/* There is only one instance of the malloc parameters. &amp;nbsp;*/
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;static struct malloc_par mp_;
&lt;br&gt;+static mutex_t mp_mmap_mutex;
&lt;br&gt;+/*Serialize access to (malloc.c) mp_.
&lt;br&gt;+ &amp;nbsp;int &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;n_mmaps;
&lt;br&gt;+ &amp;nbsp;int &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;n_mmaps_max;
&lt;br&gt;+ &amp;nbsp;int &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;max_n_mmaps;
&lt;br&gt;+*/
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;#ifdef PER_THREAD
&lt;br&gt;@@ -3055,7 +3063,8 @@
&lt;br&gt;&amp;nbsp;	 &amp;nbsp; &amp;nbsp;set_head(p, size|IS_MMAPPED);
&lt;br&gt;&amp;nbsp;	 &amp;nbsp;}
&lt;br&gt;&amp;nbsp;
&lt;br&gt;-	/* update statistics */
&lt;br&gt;+	/* begin update statistics */
&lt;br&gt;+	(void)mutex_lock(&amp;mp_mmap_mutex);
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;	if (++mp_.n_mmaps &amp;gt; mp_.max_n_mmaps)
&lt;br&gt;&amp;nbsp;	 &amp;nbsp;mp_.max_n_mmaps = mp_.n_mmaps;
&lt;br&gt;@@ -3071,6 +3080,10 @@
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;	check_chunk(av, p);
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+	(void)mutex_unlock(&amp;mp_mmap_mutex);
&lt;br&gt;+	/* end update statistics */
&lt;br&gt;+
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;	return chunk2mem(p);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;@@ -3521,6 +3534,7 @@
&lt;br&gt;&amp;nbsp;#endif
&lt;br&gt;&amp;nbsp;{
&lt;br&gt;&amp;nbsp; &amp;nbsp;INTERNAL_SIZE_T size = chunksize(p);
&lt;br&gt;+ &amp;nbsp;(void)mutex_lock(&amp;mp_mmap_mutex);
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp; &amp;nbsp;assert (chunk_is_mmapped(p));
&lt;br&gt;&amp;nbsp;#if 0
&lt;br&gt;@@ -3544,6 +3558,7 @@
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp; &amp;nbsp;mp_.n_mmaps--;
&lt;br&gt;&amp;nbsp; &amp;nbsp;mp_.mmapped_mem -= total_size;
&lt;br&gt;+ &amp;nbsp;(void)mutex_unlock(&amp;mp_mmap_mutex);
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp; &amp;nbsp;int ret __attribute__ ((unused)) = munmap((char *)block, total_size);
&lt;br&gt;&amp;nbsp;
&lt;br&gt;@@ -3726,6 +3741,7 @@
&lt;br&gt;&amp;nbsp; &amp;nbsp;_int_free(ar_ptr, p, 0);
&lt;br&gt;&amp;nbsp;#else
&lt;br&gt;&amp;nbsp;# if THREAD_STATS
&lt;br&gt;+
&lt;br&gt;&amp;nbsp; &amp;nbsp;if(!mutex_trylock(&amp;ar_ptr-&amp;gt;mutex))
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;++(ar_ptr-&amp;gt;stat_lock_direct);
&lt;br&gt;&amp;nbsp; &amp;nbsp;else {
&lt;br&gt;&lt;br&gt;P.S. This is actually a problem of a mission-critical system planned to become
&lt;br&gt;operational on Redhat el5 next year. Assertion on positive results is now turned
&lt;br&gt;into recoverable error, so non-critical but would like to get heap supervision
&lt;br&gt;correct in the future for monitoring of unexpected memory leaks. We pay support
&lt;br&gt;to HP (forwarding such problems to Redhat), so request for fixing might turn up
&lt;br&gt;via official channels.
&lt;br&gt;&lt;br&gt;Test still running, but at least getting further than before :
&lt;br&gt;&amp;nbsp;64660000
&lt;br&gt;&amp;nbsp;64800000
&lt;br&gt;&amp;nbsp;64240000
&lt;br&gt;&amp;nbsp;64810000
&lt;br&gt;ARENA= 135984 ORDBLKS= 1 SMBLKS= 0 HBLKS= 7 HBLKHD= 29388800 USMBLKS= 0 FSMBLKS=
&lt;br&gt;0 UORDBLKS= 62424 FORDBLKS= 73560 KEEPCOST= 73560 
&lt;br&gt;&amp;nbsp;64670000
&lt;br&gt;&amp;nbsp;64810000
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Summary: mallinfo miscounting hblks because of missing mutex
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Product: glibc
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Version: 2.9
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Status: NEW
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Severity: normal
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Priority: P2
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Component: libc
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AssignedTo: drepper at redhat dot com
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ReportedBy: stef dot van-vlierberghe at telenet dot be
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CC: glibc-bugs at sources dot redhat dot com
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://sourceware.org/bugzilla/show_bug.cgi?id=11087&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://sourceware.org/bugzilla/show_bug.cgi?id=11087&lt;/a&gt;&lt;br&gt;&lt;br&gt;------- You are receiving this mail because: -------
&lt;br&gt;You are on the CC list for the bug, or are watching someone who is.
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Sourceware---glibc-bugs-f12205.html&quot; embed=&quot;fixTarget[12205]&quot; target=&quot;_top&quot; &gt;Sourceware - glibc-bugs&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-Bug-libc-11087--New%3A-mallinfo-miscounting-hblks-because-of-missing-mutex-tp26774656p26774656.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26777852</id>
	<title>Re: reverse look up of INADDR_ANY, etc.</title>
	<published>2009-12-13T20:44:19Z</published>
	<updated>2009-12-13T20:44:19Z</updated>
	<author>
		<name>danielcavanagh</name>
	</author>
	<content type="html">&amp;gt; On 11/23/2009 08:33 PM, &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26777852&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;danielcavanagh@...&lt;/a&gt; wrote:
&lt;br&gt;&amp;gt;&amp;gt; is this consider a bug? if so, do you need me to file a report?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Not a bug. &amp;nbsp;It's &amp;quot;garbage in, garbage out&amp;quot;. &amp;nbsp;Just like any other invalid
&lt;br&gt;&amp;gt; address you will get the correct result but it'll take it's time for the
&lt;br&gt;&amp;gt; timeout to kick in.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; You'll have to show me a valid program which can regularly create such
&lt;br&gt;&amp;gt; calls t convince me otherwise.
&lt;br&gt;&lt;br&gt;this was found in the ruby language. there is a TCPServer class whose
&lt;br&gt;purpose should be clear. when you access the addr variable of this class,
&lt;br&gt;it returns an array with the address family, the port, the ip address and
&lt;br&gt;domain name bound to. the most common address to bind to is obviously
&lt;br&gt;INADDR_ANY, which then gets automatically looked up, leading to a huge
&lt;br&gt;pause &amp;nbsp;on startup for most things using TCPServer on a glibc system
&lt;br&gt;&lt;br&gt;really, the check should be pushed as far down the code path as possible
&lt;br&gt;and the very bottom is glibc. it's more efficient that way and avoids
&lt;br&gt;duplication. and as i said, every other system i've seen works properly
&lt;br&gt;(all the bsds, haiku, windows, non-glibc-based linuxes) so glibc should
&lt;br&gt;too
&lt;br&gt;&lt;br&gt;i should add that haiku did previously have this same bug but someone
&lt;br&gt;discovered and reported it and it got fixed. i'm not sure how it was
&lt;br&gt;discovered though
&lt;br&gt;&lt;br&gt;i personally don't really care about the checks for anything but
&lt;br&gt;INADDR_ANY, since i also can't foresee a situation where the others are a
&lt;br&gt;problem, but INADDR_ANY is a problem, so can't a simple &amp;quot;if (addr ==
&lt;br&gt;INADDR_ANY) return NULL;&amp;quot; or whatever be added?
&lt;br&gt;&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Sourceware---libc-alpha-f12199.html&quot; embed=&quot;fixTarget[12199]&quot; target=&quot;_top&quot; &gt;Sourceware - libc-alpha&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/reverse-look-up-of-INADDR_ANY%2C-etc.-tp26497699p26777852.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26769884</id>
	<title>PATCH: Define bit_SSE2 and index_SSE2</title>
	<published>2009-12-13T11:24:29Z</published>
	<updated>2009-12-13T11:24:29Z</updated>
	<author>
		<name>H.J. Lu-10</name>
	</author>
	<content type="html">On Wed, Dec 09, 2009 at 11:18:18AM -0800, H.J. Lu wrote:
&lt;br&gt;&amp;gt; Hi,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; This patch defines bit_XXX and index_XXX and use them to check processor
&lt;br&gt;&amp;gt; feature in assembly code. &amp;nbsp;It can prevent typos in processor feature
&lt;br&gt;&amp;gt; check.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&lt;br&gt;Hi,
&lt;br&gt;&lt;br&gt;This patch adds bit_SSE2 and index_SSE2 for 32bit assembly codes.
&lt;br&gt;&lt;br&gt;Thanks.
&lt;br&gt;&lt;br&gt;&lt;br&gt;H.J.
&lt;br&gt;---
&lt;br&gt;2009-12-13 &amp;nbsp;H.J. Lu &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26769884&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;hongjiu.lu@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; * sysdeps/i386/i686/multiarch/strcspn.S Include &amp;lt;init-arch.h&amp;gt;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; instead of &amp;lt;ifunc-defines.h&amp;gt;. &amp;nbsp;Use bit_XXX and index_XXX to
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; check processor feature.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; * sysdeps/i386/i686/multiarch/strlen.S: Likewise.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; * sysdeps/i386/i686/multiarch/strspn.S: Likewise.
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; * sysdeps/x86_64/multiarch/init-arch.h (bit_SSE2): New.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (index_SSE2): Likewise.
&lt;br&gt;&lt;br&gt;diff --git a/sysdeps/i386/i686/multiarch/strcspn.S b/sysdeps/i386/i686/multiarch/strcspn.S
&lt;br&gt;index 73e7eb4..b2310e4 100644
&lt;br&gt;--- a/sysdeps/i386/i686/multiarch/strcspn.S
&lt;br&gt;+++ b/sysdeps/i386/i686/multiarch/strcspn.S
&lt;br&gt;@@ -23,7 +23,7 @@
&lt;br&gt;&amp;nbsp;#ifdef HAVE_SSE4_SUPPORT
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;#include &amp;lt;sysdep.h&amp;gt;
&lt;br&gt;-#include &amp;lt;ifunc-defines.h&amp;gt;
&lt;br&gt;+#include &amp;lt;init-arch.h&amp;gt;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;#ifdef USE_AS_STRPBRK
&lt;br&gt;&amp;nbsp;#define STRCSPN_SSE42	__strpbrk_sse42
&lt;br&gt;@@ -64,7 +64,7 @@ ENTRY(STRCSPN)
&lt;br&gt;&amp;nbsp;	jne	1f
&lt;br&gt;&amp;nbsp;	call	__init_cpu_features
&lt;br&gt;&amp;nbsp;1:	leal	STRCSPN_IA32@GOTOFF(%ebx), %eax
&lt;br&gt;-	testl	$(1&amp;lt;&amp;lt;20), CPUID_OFFSET+COMMON_CPUID_INDEX_1*CPUID_SIZE+CPUID_ECX_OFFSET+__cpu_features@GOTOFF(%ebx)
&lt;br&gt;+	testl	$bit_SSE4_2, CPUID_OFFSET+index_SSE4_2+__cpu_features@GOTOFF(%ebx)
&lt;br&gt;&amp;nbsp;	jz	2f
&lt;br&gt;&amp;nbsp;	leal	STRCSPN_SSE42@GOTOFF(%ebx), %eax
&lt;br&gt;&amp;nbsp;2:	popl	%ebx
&lt;br&gt;@@ -80,7 +80,7 @@ ENTRY(STRCSPN)
&lt;br&gt;&amp;nbsp;	jne	1f
&lt;br&gt;&amp;nbsp;	call	__init_cpu_features
&lt;br&gt;&amp;nbsp;1:	leal	STRCSPN_IA32, %eax
&lt;br&gt;-	testl	$(1&amp;lt;&amp;lt;20), CPUID_OFFSET+COMMON_CPUID_INDEX_1*CPUID_SIZE+CPUID_ECX_OFFSET+__cpu_features
&lt;br&gt;+	testl	$bit_SSE4_2, CPUID_OFFSET+index_SSE4_2+__cpu_features
&lt;br&gt;&amp;nbsp;	jz	2f
&lt;br&gt;&amp;nbsp;	leal	STRCSPN_SSE42, %eax
&lt;br&gt;&amp;nbsp;2:	ret
&lt;br&gt;diff --git a/sysdeps/i386/i686/multiarch/strlen.S b/sysdeps/i386/i686/multiarch/strlen.S
&lt;br&gt;index 0c1e864..9786add 100644
&lt;br&gt;--- a/sysdeps/i386/i686/multiarch/strlen.S
&lt;br&gt;+++ b/sysdeps/i386/i686/multiarch/strlen.S
&lt;br&gt;@@ -19,7 +19,7 @@
&lt;br&gt;&amp;nbsp; &amp;nbsp; 02111-1307 USA. &amp;nbsp;*/
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;#include &amp;lt;sysdep.h&amp;gt;
&lt;br&gt;-#include &amp;lt;ifunc-defines.h&amp;gt;
&lt;br&gt;+#include &amp;lt;init-arch.h&amp;gt;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;/* Define multiple versions only for the definition in libc and for the
&lt;br&gt;&amp;nbsp; &amp;nbsp; DSO. &amp;nbsp;In static binaries, we need strlen before the initialization
&lt;br&gt;@@ -46,7 +46,7 @@ ENTRY(strlen)
&lt;br&gt;&amp;nbsp;	jne	1f
&lt;br&gt;&amp;nbsp;	call	__init_cpu_features
&lt;br&gt;&amp;nbsp;1:	leal	__strlen_ia32@GOTOFF(%ebx), %eax
&lt;br&gt;-	testl	$(1&amp;lt;&amp;lt;26), CPUID_OFFSET+COMMON_CPUID_INDEX_1*CPUID_SIZE+CPUID_EDX_OFFSET+__cpu_features@GOTOFF(%ebx)
&lt;br&gt;+	testl	$bit_SSE2, CPUID_OFFSET+index_SSE2+__cpu_features@GOTOFF(%ebx)
&lt;br&gt;&amp;nbsp;	jz	2f
&lt;br&gt;&amp;nbsp;	leal	__strlen_sse2@GOTOFF(%ebx), %eax
&lt;br&gt;&amp;nbsp;2:	popl	%ebx
&lt;br&gt;diff --git a/sysdeps/i386/i686/multiarch/strspn.S b/sysdeps/i386/i686/multiarch/strspn.S
&lt;br&gt;index f306d2d..7fe6f97 100644
&lt;br&gt;--- a/sysdeps/i386/i686/multiarch/strspn.S
&lt;br&gt;+++ b/sysdeps/i386/i686/multiarch/strspn.S
&lt;br&gt;@@ -23,7 +23,7 @@
&lt;br&gt;&amp;nbsp;#ifdef HAVE_SSE4_SUPPORT
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;#include &amp;lt;sysdep.h&amp;gt;
&lt;br&gt;-#include &amp;lt;ifunc-defines.h&amp;gt;
&lt;br&gt;+#include &amp;lt;init-arch.h&amp;gt;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;/* Define multiple versions only for the definition in libc. &amp;nbsp;*/
&lt;br&gt;&amp;nbsp;#ifndef NOT_IN_libc
&lt;br&gt;@@ -49,7 +49,7 @@ ENTRY(strspn)
&lt;br&gt;&amp;nbsp;	jne	1f
&lt;br&gt;&amp;nbsp;	call	__init_cpu_features
&lt;br&gt;&amp;nbsp;1:	leal	__strspn_ia32@GOTOFF(%ebx), %eax
&lt;br&gt;-	testl	$(1&amp;lt;&amp;lt;20), CPUID_OFFSET+COMMON_CPUID_INDEX_1*CPUID_SIZE+CPUID_ECX_OFFSET+__cpu_features@GOTOFF(%ebx)
&lt;br&gt;+	testl	$bit_SSE4_2, CPUID_OFFSET+index_SSE4_2+__cpu_features@GOTOFF(%ebx)
&lt;br&gt;&amp;nbsp;	jz	2f
&lt;br&gt;&amp;nbsp;	leal	__strspn_sse42@GOTOFF(%ebx), %eax
&lt;br&gt;&amp;nbsp;2:	popl	%ebx
&lt;br&gt;@@ -65,7 +65,7 @@ ENTRY(strspn)
&lt;br&gt;&amp;nbsp;	jne	1f
&lt;br&gt;&amp;nbsp;	call	__init_cpu_features
&lt;br&gt;&amp;nbsp;1:	leal	__strspn_ia32, %eax
&lt;br&gt;-	testl	$(1&amp;lt;&amp;lt;20), CPUID_OFFSET+COMMON_CPUID_INDEX_1*CPUID_SIZE+CPUID_ECX_OFFSET+__cpu_features
&lt;br&gt;+	testl	$index_SSE2, CPUID_OFFSET+index_SSE4_2+__cpu_features
&lt;br&gt;&amp;nbsp;	jz	2f
&lt;br&gt;&amp;nbsp;	leal	__strspn_sse42, %eax
&lt;br&gt;&amp;nbsp;2:	ret
&lt;br&gt;diff --git a/sysdeps/x86_64/multiarch/init-arch.h b/sysdeps/x86_64/multiarch/init-arch.h
&lt;br&gt;index 9e8915f..0f8f77a 100644
&lt;br&gt;--- a/sysdeps/x86_64/multiarch/init-arch.h
&lt;br&gt;+++ b/sysdeps/x86_64/multiarch/init-arch.h
&lt;br&gt;@@ -20,9 +20,11 @@
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;#include &amp;lt;ifunc-defines.h&amp;gt;
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+#define bit_SSE2	(1 &amp;lt;&amp;lt; 26)
&lt;br&gt;&amp;nbsp;#define bit_SSSE3	(1 &amp;lt;&amp;lt; 9)
&lt;br&gt;&amp;nbsp;#define bit_SSE4_2	(1 &amp;lt;&amp;lt; 20)
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+#define index_SSE2	COMMON_CPUID_INDEX_1*CPUID_SIZE+CPUID_EDX_OFFSET
&lt;br&gt;&amp;nbsp;#define index_SSSE3	COMMON_CPUID_INDEX_1*CPUID_SIZE+CPUID_ECX_OFFSET
&lt;br&gt;&amp;nbsp;#define index_SSE4_2	COMMON_CPUID_INDEX_1*CPUID_SIZE+CPUID_ECX_OFFSET
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Sourceware---libc-alpha-f12199.html&quot; embed=&quot;fixTarget[12199]&quot; target=&quot;_top&quot; &gt;Sourceware - libc-alpha&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/PATCH%3A-Define-bit_XXX-and-index_XXX-tp26716871p26769884.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26769883</id>
	<title>Re: reverse look up of INADDR_ANY, etc.</title>
	<published>2009-12-13T09:50:41Z</published>
	<updated>2009-12-13T09:50:41Z</updated>
	<author>
		<name>Ulrich Drepper</name>
	</author>
	<content type="html">On 11/23/2009 08:33 PM, &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26769883&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;danielcavanagh@...&lt;/a&gt; wrote:
&lt;br&gt;&amp;gt; is this consider a bug? if so, do you need me to file a report?
&lt;br&gt;&lt;br&gt;Not a bug. &amp;nbsp;It's &amp;quot;garbage in, garbage out&amp;quot;. &amp;nbsp;Just like any other invalid 
&lt;br&gt;address you will get the correct result but it'll take it's time for the 
&lt;br&gt;timeout to kick in.
&lt;br&gt;&lt;br&gt;You'll have to show me a valid program which can regularly create such 
&lt;br&gt;calls t convince me otherwise.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Sourceware---libc-alpha-f12199.html&quot; embed=&quot;fixTarget[12199]&quot; target=&quot;_top&quot; &gt;Sourceware - libc-alpha&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/reverse-look-up-of-INADDR_ANY%2C-etc.-tp26497699p26769883.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26744236</id>
	<title>[Bug libc/11082] fclose(f); ftell(f); results in accesses on free'd memory</title>
	<published>2009-12-11T05:24:48Z</published>
	<updated>2009-12-11T05:24:48Z</updated>
	<author>
		<name>Bugzilla from sourceware-bugzilla@sourceware.org</name>
	</author>
	<content type="html">&lt;br&gt;------- Additional Comments From pasky at suse dot cz &amp;nbsp;2009-12-11 13:24 -------
&lt;br&gt;Not really, file descriptor is something different from file stream. Something
&lt;br&gt;can close the file descriptor while keeping the stream alive (e.g. by obtaining
&lt;br&gt;it from stream using fileno() or by mass-closing all file descriptors), then
&lt;br&gt;this error would trigger.
&lt;br&gt;&lt;br&gt;But if you close the stream itself, there's no stream _of_ the underlying file
&lt;br&gt;descriptor. After you fclose(), the FILE* value is totally invalid and you must
&lt;br&gt;not use it anymore.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;What &amp;nbsp; &amp;nbsp;|Removed &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |Added
&lt;br&gt;----------------------------------------------------------------------------
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Status|REOPENED &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|RESOLVED
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Resolution| &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|INVALID
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://sourceware.org/bugzilla/show_bug.cgi?id=11082&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://sourceware.org/bugzilla/show_bug.cgi?id=11082&lt;/a&gt;&lt;br&gt;&lt;br&gt;------- You are receiving this mail because: -------
&lt;br&gt;You are on the CC list for the bug, or are watching someone who is.
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Sourceware---glibc-bugs-f12205.html&quot; embed=&quot;fixTarget[12205]&quot; target=&quot;_top&quot; &gt;Sourceware - glibc-bugs&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-Bug-libc-11082--New%3A-fclose%28f%29--ftell%28f%29--results-in-accesses-on-free%27d-memory-tp26741829p26744236.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26744077</id>
	<title>[Bug libc/11082] fclose(f); ftell(f); results in accesses on free'd memory</title>
	<published>2009-12-11T05:12:46Z</published>
	<updated>2009-12-11T05:12:46Z</updated>
	<author>
		<name>Bugzilla from sourceware-bugzilla@sourceware.org</name>
	</author>
	<content type="html">&lt;br&gt;------- Additional Comments From jur dot pauw at gmail dot com &amp;nbsp;2009-12-11 13:12 -------
&lt;br&gt;(In reply to comment #1)
&lt;br&gt;&amp;gt; ftell(3) needs a valid FILE pointer, not one already invalidated by fclose(3)
&lt;br&gt;&amp;gt; call. &amp;nbsp;For details see fclose(3) description that says: &amp;quot;any further access 
&lt;br&gt;to
&lt;br&gt;&amp;gt; the stream results in undefined behaviour&amp;quot;.
&lt;br&gt;&lt;br&gt;This implies that ftell its behaviour is not Posix compliant, see 
&lt;br&gt;&lt;a href=&quot;http://www.opengroup.org/onlinepubs/009695399/functions/ftell.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.opengroup.org/onlinepubs/009695399/functions/ftell.html&lt;/a&gt;&lt;br&gt;&lt;br&gt;ERRORS
&lt;br&gt;The ftell() [CX] &amp;nbsp; and ftello() &amp;nbsp;functions shall fail if:
&lt;br&gt;&lt;br&gt;[EBADF] 
&lt;br&gt;[CX] &amp;nbsp;The file descriptor underlying stream is not an open file descriptor. &amp;nbsp;
&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;What &amp;nbsp; &amp;nbsp;|Removed &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |Added
&lt;br&gt;----------------------------------------------------------------------------
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Status|RESOLVED &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|REOPENED
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Resolution|INVALID &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://sourceware.org/bugzilla/show_bug.cgi?id=11082&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://sourceware.org/bugzilla/show_bug.cgi?id=11082&lt;/a&gt;&lt;br&gt;&lt;br&gt;------- You are receiving this mail because: -------
&lt;br&gt;You are on the CC list for the bug, or are watching someone who is.
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Sourceware---glibc-bugs-f12205.html&quot; embed=&quot;fixTarget[12205]&quot; target=&quot;_top&quot; &gt;Sourceware - glibc-bugs&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-Bug-libc-11082--New%3A-fclose%28f%29--ftell%28f%29--results-in-accesses-on-free%27d-memory-tp26741829p26744077.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26742413</id>
	<title>[Bug libc/11082] fclose(f); ftell(f); results in accesses on free'd memory</title>
	<published>2009-12-11T03:10:15Z</published>
	<updated>2009-12-11T03:10:15Z</updated>
	<author>
		<name>Bugzilla from sourceware-bugzilla@sourceware.org</name>
	</author>
	<content type="html">&lt;br&gt;------- Additional Comments From ldv at altlinux dot org &amp;nbsp;2009-12-11 11:10 -------
&lt;br&gt;ftell(3) needs a valid FILE pointer, not one already invalidated by fclose(3)
&lt;br&gt;call. &amp;nbsp;For details see fclose(3) description that says: &amp;quot;any further access to
&lt;br&gt;the stream results in undefined behaviour&amp;quot;.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;What &amp;nbsp; &amp;nbsp;|Removed &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |Added
&lt;br&gt;----------------------------------------------------------------------------
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Status|NEW &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |RESOLVED
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Resolution| &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|INVALID
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://sourceware.org/bugzilla/show_bug.cgi?id=11082&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://sourceware.org/bugzilla/show_bug.cgi?id=11082&lt;/a&gt;&lt;br&gt;&lt;br&gt;------- You are receiving this mail because: -------
&lt;br&gt;You are on the CC list for the bug, or are watching someone who is.
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Sourceware---glibc-bugs-f12205.html&quot; embed=&quot;fixTarget[12205]&quot; target=&quot;_top&quot; &gt;Sourceware - glibc-bugs&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-Bug-libc-11082--New%3A-fclose%28f%29--ftell%28f%29--results-in-accesses-on-free%27d-memory-tp26741829p26742413.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26741829</id>
	<title>[Bug libc/11082] New: fclose(f); ftell(f); results in accesses on free'd memory</title>
	<published>2009-12-11T02:21:56Z</published>
	<updated>2009-12-11T02:21:56Z</updated>
	<author>
		<name>Bugzilla from sourceware-bugzilla@sourceware.org</name>
	</author>
	<content type="html">I used valgrind to find the origin of a crash. It shows that an ftell on a 
&lt;br&gt;closed file performs reads and writes on memory free'd by fclose. The 
&lt;br&gt;following small program (bug.c) reproduces the problem.
&lt;br&gt;&lt;br&gt;#include &amp;lt;stdio.h&amp;gt;
&lt;br&gt;&lt;br&gt;int main(int argc, char **argv)
&lt;br&gt;{
&lt;br&gt;&amp;nbsp; FILE *f = fopen(&amp;quot;bug.c&amp;quot;, &amp;quot;r&amp;quot;);
&lt;br&gt;&amp;nbsp; fclose(f);
&lt;br&gt;&amp;nbsp; ftell(f);
&lt;br&gt;}
&lt;br&gt;&lt;br&gt;compiler/kernel/libc versions:
&lt;br&gt;&lt;br&gt;gcc version 3.4.4
&lt;br&gt;&lt;br&gt;Linux c3svr30 2.6.9-89.0.16.ELsmp #1 SMP Tue Oct 27 03:51:52 EDT 2009 x86_64 
&lt;br&gt;x86_64 x86_64 GNU/Linux
&lt;br&gt;&lt;br&gt;/lib/tls/libc-2.3.4.so
&lt;br&gt;GNU C Library stable release version 2.3.4, by Roland McGrath et al.
&lt;br&gt;Copyright (C) 2005 Free Software Foundation, Inc.
&lt;br&gt;This is free software; see the source for copying conditions.
&lt;br&gt;There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
&lt;br&gt;PARTICULAR PURPOSE.
&lt;br&gt;Compiled by GNU CC version 3.4.6 20060404 (Red Hat 3.4.6-8).
&lt;br&gt;Compiled on a Linux 2.4.20 system on 2007-09-12.
&lt;br&gt;Available extensions:
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; GNU libio by Per Bothner
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; crypt add-on version 2.1 by Michael Glad and others
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Native POSIX Threads Library by Ulrich Drepper et al
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; RT using linux kernel aio
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; The C stubs add-on version 2.1.2.
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; BIND-8.2.3-T5B
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Glibc-2.0 compatibility add-on by Cristian Gafton 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; GNU Libidn by Simon Josefsson
&lt;br&gt;Thread-local storage support included.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Summary: fclose(f); ftell(f); results in accesses on free'd
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; memory
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Product: glibc
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Version: 2.3.4
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Status: NEW
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Severity: normal
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Priority: P2
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Component: libc
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AssignedTo: drepper at redhat dot com
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ReportedBy: jur dot pauw at gmail dot com
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CC: glibc-bugs at sources dot redhat dot com
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://sourceware.org/bugzilla/show_bug.cgi?id=11082&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://sourceware.org/bugzilla/show_bug.cgi?id=11082&lt;/a&gt;&lt;br&gt;&lt;br&gt;------- You are receiving this mail because: -------
&lt;br&gt;You are on the CC list for the bug, or are watching someone who is.
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Sourceware---glibc-bugs-f12205.html&quot; embed=&quot;fixTarget[12205]&quot; target=&quot;_top&quot; &gt;Sourceware - glibc-bugs&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-Bug-libc-11082--New%3A-fclose%28f%29--ftell%28f%29--results-in-accesses-on-free%27d-memory-tp26741829p26741829.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26736527</id>
	<title>[Bug nis/11000] _nss_nis_gethostbyname4_r: errnop and herrnop are not always set</title>
	<published>2009-12-10T15:45:36Z</published>
	<updated>2009-12-10T15:45:36Z</updated>
	<author>
		<name>Bugzilla from sourceware-bugzilla@sourceware.org</name>
	</author>
	<content type="html">&lt;br&gt;------- Additional Comments From drepper at redhat dot com &amp;nbsp;2009-12-10 23:45 -------
&lt;br&gt;Since you, as always, don't provide the details of the problem you're trying to
&lt;br&gt;fix I had to guess. &amp;nbsp;I checked in a different and in any case more complete patch.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;What &amp;nbsp; &amp;nbsp;|Removed &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |Added
&lt;br&gt;----------------------------------------------------------------------------
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Status|NEW &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |RESOLVED
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Resolution| &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|FIXED
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://sourceware.org/bugzilla/show_bug.cgi?id=11000&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://sourceware.org/bugzilla/show_bug.cgi?id=11000&lt;/a&gt;&lt;br&gt;&lt;br&gt;------- You are receiving this mail because: -------
&lt;br&gt;You are on the CC list for the bug, or are watching someone who is.
&lt;br&gt;&lt;p&gt;From forum: &lt;a href=&quot;http://old.nabble.com/Sourceware---glibc-bugs-f12205.html&quot; embed=&quot;fixTarget[12205]&quot; target=&quot;_top&quot; &gt;Sourceware - glibc-bugs&lt;/a&gt;&lt;/p&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-Bug-nis-11000--New%3A-_nss_nis_gethostbyname4_r%3A-errnop-and-herrnop-are-not-always-set-tp26470768p26736527.html" />
</entry>

</feed>
