Commit Graph

31916 Commits

Author SHA1 Message Date
Adhemerval Zanella
82efa1ffd4 posix: Set p{read,write}v2 to return ENOTSUP (BZ#21780)
Different than other architectures hppa-linux-gnu define different values
for ENOTSUP and EOPNOTSUPP, where the later is a Linux specific one.
This leads to tst-preadwritev{64}v2 tests failures:

$ ./testrun.sh misc/tst-preadvwritev2
error: tst-preadvwritev2-common.c:35: preadv2 failure did not set errno to ENOTSUP (223)
error: 1 test failures

The straightforward fix is to return the POSIX defined ENOTSUP on all
p{read,write}v{64}v2 implementations instead of Linux specific one.

Checked on x86_64-linux-gnu and the tst-preadwritev{64}v2 on
hppa-linux-gnu (although due the installed kernel on my testing system
the pwritev{64}v2 with an invalid flag still fails due a known kernel
issue [1]).

	[BZ #21780]
	* sysdeps/posix/preadv2.c (preadv2): Use ENOTSUP instead of
	EOPNOTSUPP.
	* sysdeps/posix/preadv64v2.c (preadv64v2): Likewise.
	* sysdeps/posix/pwritev2.c (pwritev2): Likewise.
	* sysdeps/posix/pwritev64v2.c (pwritev64v2): Likewise.
	* sysdeps/unix/sysv/linux/preadv2.c (preadv2): Likewise.
	* sysdeps/unix/sysv/linux/preadv64v2.c (preadv64v2): Likewise.
	* sysdeps/unix/sysv/linux/pwritev2.c (pwritev2): Likewise.
	* sysdeps/unix/sysv/linux/pwritev64v2.c (pwritev64v2): Likewise.

[1] https://sourceware.org/ml/libc-alpha/2017-06/msg00726.html

Cherry-pick of 852d631207
2017-08-09 11:13:18 -03:00
H.J. Lu
799859f663 x86-64: Use _dl_runtime_resolve_opt only with AVX512F [BZ #21871]
On AVX machines with XGETBV (ECX == 1) like Skylake processors,

(gdb) disass _dl_runtime_resolve_avx_opt
Dump of assembler code for function _dl_runtime_resolve_avx_opt:
   0x0000000000015890 <+0>:	push   %rax
   0x0000000000015891 <+1>:	push   %rcx
   0x0000000000015892 <+2>:	push   %rdx
   0x0000000000015893 <+3>:	mov    $0x1,%ecx
   0x0000000000015898 <+8>:	xgetbv
   0x000000000001589b <+11>:	mov    %eax,%r11d
   0x000000000001589e <+14>:	pop    %rdx
   0x000000000001589f <+15>:	pop    %rcx
   0x00000000000158a0 <+16>:	pop    %rax
   0x00000000000158a1 <+17>:	and    $0x4,%r11d
   0x00000000000158a5 <+21>:	bnd je 0x16200 <_dl_runtime_resolve_sse_vex>
End of assembler dump.

is slower than:

(gdb) disass _dl_runtime_resolve_avx_slow
Dump of assembler code for function _dl_runtime_resolve_avx_slow:
   0x0000000000015850 <+0>:	vorpd  %ymm0,%ymm1,%ymm8
   0x0000000000015854 <+4>:	vorpd  %ymm2,%ymm3,%ymm9
   0x0000000000015858 <+8>:	vorpd  %ymm4,%ymm5,%ymm10
   0x000000000001585c <+12>:	vorpd  %ymm6,%ymm7,%ymm11
   0x0000000000015860 <+16>:	vorpd  %ymm8,%ymm9,%ymm9
   0x0000000000015865 <+21>:	vorpd  %ymm10,%ymm11,%ymm10
   0x000000000001586a <+26>:	vpcmpeqd %xmm8,%xmm8,%xmm8
   0x000000000001586f <+31>:	vorpd  %ymm9,%ymm10,%ymm10
   0x0000000000015874 <+36>:	vptest %ymm10,%ymm8
   0x0000000000015879 <+41>:	bnd jae 0x158b0 <_dl_runtime_resolve_avx>
   0x000000000001587c <+44>:	vzeroupper
   0x000000000001587f <+47>:	bnd jmpq 0x16200 <_dl_runtime_resolve_sse_vex>
End of assembler dump.
(gdb)

since xgetbv takes much more cycles than single cycle operations like
vpord/vvpcmpeq/ptest.  _dl_runtime_resolve_opt should be used only with
AVX512 where AVX512 instructions lead to lower CPU frequency on Skylake
server.

	[BZ #21871]
	* sysdeps/x86/cpu-features.c (init_cpu_features): Set
	bit_arch_Use_dl_runtime_resolve_opt only with AVX512F.

(cherry picked from commit d2cf37c0a2)
2017-08-06 10:44:44 -07:00
Aurelien Jarno
a4e5aa1a44 Fix the return type of the getentropy stub
The return type of the getentropy stub is wrongly defined as ssize_t,
while both the <sys/random.h> header and the Linux implementation
define it as int. This patch fixes that.

Changelog:
	* stdlib/getentropy.c (getentropy): Change return type to int.
(cherry picked from commit 2b34e2716f)
2017-08-04 00:41:42 +02:00
Aurelien Jarno
665ce88d68 i686/multiarch: Regenerate ulps
This comes from running “make regen-ulps” on an AMD Opteron 2378 CPU.

Changelog:
	* sysdeps/i386/i686/fpu/multiarch/libm-test-ulps: Regenerated.
(cherry picked from commit 144bdab050)
2017-08-04 00:40:31 +02:00
Florian Weimer
dc258ce62a getaddrinfo: Release resolver context on error in gethosts [BZ #21885]
(cherry picked from commit 964263bb8d)
2017-08-03 13:59:17 +02:00
Siddhesh Poyarekar
1c9a5c270d Update for 2.26 release 2017-08-02 18:27:16 +05:30
Siddhesh Poyarekar
15192aaa25 Update contributors and latest gcc and binutils versions 2017-08-02 18:22:58 +05:30
Siddhesh Poyarekar
4d9a5c60e1 Fix up ChangeLog formatting 2017-08-02 13:34:13 +05:30
Siddhesh Poyarekar
e061bd1771 Add list of bugs fixed in 2.26 2017-08-02 08:26:45 +05:30
Siddhesh Poyarekar
9938cc545d Update translations 2017-08-02 08:07:58 +05:30
Siddhesh Poyarekar
e1113af30d Update NEWS 2017-08-02 08:07:16 +05:30
Siddhesh Poyarekar
930324b356 Update translations 2017-07-31 00:13:08 +05:30
Carlos O'Donell
5920a4a624 mutex: Fix robust mutex lock acquire (Bug 21778)
65810f0ef0 fixed a robust mutex bug but
introduced BZ 21778: if the CAS used to try to acquire a lock fails, the
expected value is not updated, which breaks other cases in the loce
acquisition loop.  The fix is to simply update the expected value with
the value returned by the CAS, which ensures that behavior is as if the
first case with the CAS never happened (if the CAS fails).

This is a regression introduced in the last release.

Tested on x86_64, i686, ppc64, ppc64le, s390x, aarch64, armv7hl.
2017-07-29 00:02:03 -04:00
Nathan Rossi
d95fcb2df4 microblaze: Resolve non-relocatable branch in pt-vfork.S (BZ#21779)
The relative branch directly to __libc_vfork results in an relocation
that cannot be resolved. Specifically a R_MICROBLAZE_64_PCREL relocation
is created for this branch, however for MicroBlaze R_MICROBLAZE_64_PCREL
type relocations symbols are not resolved. Additionally due to the
branch being located in the .text section the instruction cannot be
rewritten as the section is not writable, and causes a segfault at
runtime when loading libpthread.

To resolve this issue, ensure the branch is done using PLT. This removes
the need to modify the instruction and trades the R_MICROBLAZE_64_PCREL
for a more common R_MICROBLAZE_JUMP via the PLT.

	[BZ #21779]
	* sysdeps/unix/sysv/linux/microblaze/pt-vfork.S: Branch using PLT.
2017-07-28 09:21:14 -03:00
Nathan Rossi
0aab054a92 Update Microblaze libm-test-ulps
* sysdeps/microblaze/libm-test-ulps: Update.
2017-07-28 09:19:40 -03:00
Chung-Lin Tang
d4550bd002 Update Nios II ULPs file. 2017-07-28 03:54:35 -07:00
Carlos O'Donell
faf8c066df rwlock: Fix explicit hand-over (bug 21298)
Without this fix, the rwlock can fail to execute the explicit hand-over
in certain cases (e.g., empty critical sections that switch quickly between
read and write phases).  This can then lead to errors in how __wrphase_futex
is accessed, which in turn can lead to deadlocks.
2017-07-28 00:23:58 -04:00
Adhemerval Zanella
2557ae38f3 Update Alpha libm-test-ulps
* sysdeps/alpha/fpu/libm-test-ulps: Update.
2017-07-27 14:21:28 -03:00
Akhilesh Kumar
10b8eb8fcc Fix country name in title of mai_NP locale
[BZ #21848]
	* locales/mai_NP (LC_IDENTIFICATION): Fix country name in title.
2017-07-27 16:24:07 +02:00
Ihar Hrachyshka
551d64b2d7 Improve country_name in be_BY@latin 2017-07-27 16:11:04 +02:00
Mike FABIAN
c5527d7ddc Minor improvements to new az_IR locale
* locales/az_IR (LC_MESSAGES): Improve yesexpr and noexpr.
	* locales/az_IR (LC_ADDRESS): Fix typo in comment  and
	use the individual iso-639-3 code for South Azerbaijani
	"azb" in lang_term.
	* locales/az_IR (LC_NAME): Improve readability of name_fmt in source.
2017-07-27 16:11:04 +02:00
Mousa Moradi
30c0c707f7 Add new az_IR locale
[BZ #14172]
	* locales/az_IR: New file.
2017-07-27 16:10:12 +02:00
Akhilesh Kumar
9e17c7aee3 Fix wrong monetary system used in ta_LK locale
[BZ #21839]
	* locales/ta_LK (LC_MONETARY): copy "si_LK"
2017-07-27 16:10:12 +02:00
Rical Jasan
d3675d957b manual: Refactor documentation of CHAR_BIT.
This single-@item @table is better defined with @deftypevr, since the
CHAR_BIT macro has @standards (being declared in a header), and @items
in @tables are not considered annotatable.  Using @deftypevr
automatically includes the macro in the Variable and Constant Macro
Index and ensures its inclusion the Summary of Library Facilities.
@deftypevr is used to record the type of the macro so that it also
appears in the Summary.

The description is updated to mention a later POSIX requirement that
this macro have the value 8.

	* manual/lang.texi (CHAR_BIT): Convert from an @table to an
	@deftypevr.  Change standard from ISO to C90.  Mention the
	POSIX.1-2001 requirement of the value 8.
2017-07-27 04:47:42 -07:00
Rical Jasan
88f9e73943 manual: Complete @standards in creature.texi.
* manual/creature.texi (_REENTRANT): Annotate as obsolete.
	(_THREAD_SAFE): Likewise.
2017-07-27 03:21:56 -07:00
Mike FABIAN
3632e5912b Fix country_name in nds_NL 2017-07-27 09:33:56 +02:00
Akhilesh Kumar
90880d384c Fix Latin characters and month sequence in mai_IN
Fixes [BZ #21822] with commit id 832f8e0487

	[BZ #21844]
	* locales/mai_IN (LC_TIME): Fix Latin characters and month sequence.
2017-07-27 09:32:40 +02:00
Mike FABIAN
1086114ba1 Revert "Remove redundant data for LC_MONETARY for Indian locales"
This reverts commit 480af555f3.

	Revert:
	2017-07-26  Akhilesh Kumar <akhilesh.k@samsung.com>

	Remove redundant data for LC_MONETARY

	[BZ #21836]
	* locales/ar_IN (LC_MONETARY): copy "hi_IN"
	* locales/as_IN (LC_MONETARY): copy "hi_IN"
	* locales/bhb_IN (LC_MONETARY): copy "hi_IN"
	* locales/bn_IN (LC_MONETARY): copy "hi_IN"
	* locales/en_IN (LC_MONETARY): copy "hi_IN"
	* locales/gu_IN (LC_MONETARY): copy "hi_IN"
	* locales/kn_IN (LC_MONETARY): copy "hi_IN"
	* locales/kok_IN (LC_MONETARY): copy "hi_IN"
	* locales/ks_IN (LC_MONETARY): copy "hi_IN"
	* locales/ml_IN (LC_MONETARY): copy "hi_IN"
	* locales/mr_IN (LC_MONETARY): copy "hi_IN"
	* locales/or_IN (LC_MONETARY): copy "hi_IN"
	* locales/pa_IN (LC_MONETARY): copy "hi_IN"
	* locales/sa_IN (LC_MONETARY): copy "hi_IN"
	* locales/sd_IN (LC_MONETARY): copy "hi_IN"
	* locales/ta_IN (LC_MONETARY): copy "hi_IN"
	* locales/tcy_IN (LC_MONETARY): copy "hi_IN"
	* locales/te_IN (LC_MONETARY): copy "hi_IN"
	* locales/ur_IN (LC_MONETARY): copy "hi_IN"
2017-07-26 20:53:38 +02:00
Mike FABIAN
ec1cff5a6b Remove erroneous spaces from some strings in locale files
* locales/hif_FJ (LC_TIME): Remove erroneous spaces from d_t_fmt.
	* locales/km_KH (LC_TIME): Remove erroneous space from d_t_fmt.
	* locales/sm_WS (LC_TIME): Remove erroneous spaces from day.
2017-07-26 16:47:00 +02:00
Mike FABIAN
7a7a7d2c16 Remove erroneous tabs from some strings in locale files
* locales/et_EE (LC_ADDRESS): Remove tabs in postal_fmt.
	* locales/hif_FJ (LC_TIME): Remove tabs in t_fmt_ampm.
	* locales/hif_FJ (LC_NAME): Remove tabs in name_fmt.
2017-07-26 16:47:00 +02:00
Mike FABIAN
890472957c Fix inappropriate characters in LC_IDENTIFICATION in several locales
Found using the script check-localedef.py by Zack Weinberg.

	* locales/agr_PE (LC_IDENTIFICATION): Fix inappropriate character.
	* locales/an_ES (LC_IDENTIFICATION): Fix inappropriate character.
	* locales/gv_GB (LC_IDENTIFICATION): Fix inappropriate character.
	* locales/kw_GB (LC_IDENTIFICATION): Fix inappropriate character.
	* locales/ln_CD (LC_IDENTIFICATION): Fix inappropriate character.
	* locales/nb_NO (LC_IDENTIFICATION): Fix inappropriate character.
	* locales/pap_CW (LC_IDENTIFICATION): Fix inappropriate character.
	* locales/se_NO (LC_IDENTIFICATION): Fix inappropriate character.
	* locales/sgs_LT (LC_IDENTIFICATION): Fix inappropriate character.
2017-07-26 16:47:00 +02:00
Mike FABIAN
95fe8c477f Fix inappropriate escape sequences in LC_IDENTIFICATION in several locales
Found using the script check-localedef.py by Zack Weinberg.

	* locales/aa_DJ (LC_IDENTIFICATION): Fix inappropriate escape sequence.
	* locales/aa_ER (LC_IDENTIFICATION): Fix inappropriate escape sequence.
	* locales/aa_ET (LC_IDENTIFICATION): Fix inappropriate escape sequence.
	* locales/ak_GH (LC_IDENTIFICATION): Fix inappropriate escape sequence.
	* locales/bn_BD (LC_IDENTIFICATION): Fix inappropriate escape sequence.
	* locales/de_IT (LC_IDENTIFICATION): Fix inappropriate escape sequence.
	* locales/es_CU (LC_IDENTIFICATION): Fix inappropriate escape sequence.
	* locales/gd_GB (LC_IDENTIFICATION): Fix inappropriate escape sequence.
	* locales/gl_ES (LC_IDENTIFICATION): Fix inappropriate escape sequence.
	* locales/he_IL (LC_IDENTIFICATION): Fix inappropriate escape sequence.
	* locales/hr_HR (LC_IDENTIFICATION): Fix inappropriate escape sequence.
	* locales/ht_HT (LC_IDENTIFICATION): Fix inappropriate escape sequence.
	* locales/hy_AM (LC_IDENTIFICATION): Fix inappropriate escape sequence.
	* locales/lg_UG (LC_IDENTIFICATION): Fix inappropriate escape sequence.
	* locales/mai_IN (LC_IDENTIFICATION): Fix inappropriate escape sequence.
	* locales/mg_MG (LC_IDENTIFICATION): Fix inappropriate escape sequence.
	* locales/pl_PL (LC_IDENTIFICATION): Fix inappropriate escape sequence.
	* locales/quz_PE (LC_IDENTIFICATION): Fix inappropriate escape sequence.
	* locales/se_NO (LC_IDENTIFICATION): Fix inappropriate escape sequence.
	* locales/sl_SI (LC_IDENTIFICATION): Fix inappropriate escape sequence.
	* locales/ta_LK (LC_IDENTIFICATION): Fix inappropriate escape sequence.
2017-07-26 16:47:00 +02:00
Rafal Luzynski
1ac85c13b0 Indian scripts: More fixes after the recent import.
After the recent import of month names from CLDRv31 (bug 21217,
commit c853f14) an import of abbreviated month names is also needed
to make sure they match the full forms.

In case of kok_IN CLDR does not provide the abbreviated month names
explicitly but uses full month names in such cases so abmon section
has been copied from mon.

* localedata/locales/as_IN (abmon): Update from CLDR.
* localedata/locales/bn_BD (abmon): Likewise.
* localedata/locales/bn_IN (abmon): Likewise.
* localedata/locales/gu_IN (abmon): Likewise.
* localedata/locales/hi_IN (abmon): Likewise.
* localedata/locales/kn_IN (abmon): Likewise.
* localedata/locales/ml_IN (abmon): Likewise.
* localedata/locales/mr_IN (abmon): Likewise.
* localedata/locales/ne_NP (abmon): Likewise.
* localedata/locales/or_IN (abmon): Likewise.
* localedata/locales/pa_IN (abmon): Likewise.
* localedata/locales/ta_IN (abmon): Likewise.
* localedata/locales/te_IN (abmon): Likewise.

* localedata/locales/kok_IN (abmon): Likewise but copied from mon.
2017-07-26 16:47:00 +02:00
Siddhesh Poyarekar
a352570d6b Update translations
* po/bg.po: Update translations.
       * po/cs.po: Likewise.
       * po/de.po: Likewise.
       * po/pl.po: Likewise.
       * po/uk.po: Likewise.
       * po/vi.po: Likewise.
2017-07-26 18:27:41 +05:30
Mike FABIAN
cd5919cb61 Use POSIX Portable Character Set in the new mai_NP locale source file instead of <Uxxxx>
* localedata/locales/mai_NP: Use POSIX Portable Character Set.
2017-07-26 12:25:58 +02:00
Akhilesh Kumar
64d38726e1 Added New Locale mai_NP
Maithili which is an official language not only in India but in Nepal as well.
https://en.wikipedia.org/wiki/Maithili_language
Reference is taken form mai_IN.

	[BZ #21835]
	* localedata/locales/mai_NP: New file.
	* localedata/SUPPORTED: Add mai_NP/UTF-8.
2017-07-26 12:19:53 +02:00
Akhilesh Kumar
a426a65ce8 Removed redundant data for the_NP locale
[BZ #21838]
	* locales/the_NP (LC_CTYPE): copy "ne_NP"
	* locales/the_NP (LC_COLLATE): copy "ne_NP"
	* locales/the_NP (LC_MONETARY): copy "ne_NP"
	* locales/the_NP (LC_TELEPHONE): copy "ne_NP"
2017-07-26 11:23:54 +02:00
Mike FABIAN
3760ff7756 Remove redundant data for LC_MONETARY in sd_IN@devanagari 2017-07-26 11:15:16 +02:00
Akhilesh Kumar
480af555f3 Remove redundant data for LC_MONETARY for Indian locales
[BZ #21836]
	* locales/ar_IN (LC_MONETARY): copy "hi_IN"
	* locales/as_IN (LC_MONETARY): copy "hi_IN"
	* locales/bhb_IN (LC_MONETARY): copy "hi_IN"
	* locales/bn_IN (LC_MONETARY): copy "hi_IN"
	* locales/en_IN (LC_MONETARY): copy "hi_IN"
	* locales/gu_IN (LC_MONETARY): copy "hi_IN"
	* locales/kn_IN (LC_MONETARY): copy "hi_IN"
	* locales/kok_IN (LC_MONETARY): copy "hi_IN"
	* locales/ks_IN (LC_MONETARY): copy "hi_IN"
	* locales/ml_IN (LC_MONETARY): copy "hi_IN"
	* locales/mr_IN (LC_MONETARY): copy "hi_IN"
	* locales/or_IN (LC_MONETARY): copy "hi_IN"
	* locales/pa_IN (LC_MONETARY): copy "hi_IN"
	* locales/sa_IN (LC_MONETARY): copy "hi_IN"
	* locales/sd_IN (LC_MONETARY): copy "hi_IN"
	* locales/ta_IN (LC_MONETARY): copy "hi_IN"
	* locales/tcy_IN (LC_MONETARY): copy "hi_IN"
	* locales/te_IN (LC_MONETARY): copy "hi_IN"
	* locales/ur_IN (LC_MONETARY): copy "hi_IN"
2017-07-26 11:15:15 +02:00
Mike FABIAN
0aa573a44d Add [BZ #21828] to ChangeLog 2017-07-26 08:20:20 +02:00
Mike FABIAN
a0e5259830 Mention in NEWS that the Unicode 10.0.0 update causes user visible changes 2017-07-26 08:17:23 +02:00
Siddhesh Poyarekar
f4ecd7ddc7 sv: Update translation 2017-07-26 07:09:50 +05:30
Akhilesh Kumar
c771b59a24 Fix inconsistency in country_isbn and missing prefixes
[BZ #21797]
	* locales/et_EE (LC_ADDRESS): Fix country_isbn.
	* locales/hy_AM (LC_ADDRESS): Fix country_isbn.
2017-07-25 13:25:18 +02:00
Mike FABIAN
1b768b4897 Add country_name to several locales
* locales/an_ES (LC_ADDRESS): Add country_name.
	* locales/ayc_PE (LC_ADDRESS): Add country_name.
	* locales/be_BY@latin (LC_ADDRESS): Add country_name.
	* locales/dv_MV (LC_ADDRESS): Add country_name,
	country_ab2, and country_ab3
	* locales/ia_FR (LC_ADDRESS): Add country_name.
	* locales/ik_CA (LC_ADDRESS): Add country_name.
	* locales/lij_IT (LC_ADDRESS): Add country_name.
	* locales/mi_NZ (LC_ADDRESS): Add country_name.
	* locales/nds_DE (LC_ADDRESS): Add country_name.
	* locales/nds_NL (LC_ADDRESS): Add country_name.
	* locales/oc_FR (LC_ADDRESS): Add country_name.
	* locales/sa_IN (LC_ADDRESS): Add country_name.
	* locales/sc_IT (LC_ADDRESS): Add country_name.
	* locales/sd_IN (LC_ADDRESS): Add country_name.
	* locales/tcy_IN (LC_ADDRESS): Add country_name.
	* locales/tg_TJ (LC_ADDRESS): Add country_name.
	* locales/tl_PH (LC_ADDRESS): Add country_name.
	* locales/tt_RU (LC_ADDRESS): Add country_name.
	* locales/wo_SN (LC_ADDRESS): Add country_name.
	* locales/zh_SG (LC_ADDRESS): Add country_name.
2017-07-25 12:17:02 +02:00
Akhilesh Kumar
ffe6d539df Fix name_mrs for mag_IN
[BZ #21825]
	* locales/mag_IN(LC_NAME): Fix name_mrs.
2017-07-25 12:17:02 +02:00
Akhilesh Kumar
b0edfa40c6 Added yesstr/nostr for sa_IN
[BZ #21823]
	* locales/sa_IN (LC_MESSAGES): Add yesstr,nostr
2017-07-25 12:17:02 +02:00
Akhilesh Kumar
832f8e0487 Fix LC_TIME for mai_IN
[BZ #21822]
	* locales/mai_IN (LC_TIME): Fix abday, day, mon etc...
2017-07-25 12:17:02 +02:00
Siddhesh Poyarekar
94955362dd zic: Use PRIdMAX to print line numbers
The PRIdLINENUM abstraction is unnecessary and breaks libc.pot
generation.

	* timezone.zic (PRIdLINENO): Remove.
	(verror): Use PRIdMAX.
	* po/libc.pot: Regenerate.
2017-07-25 12:34:14 +05:30
Adhemerval Zanella
95a7339258 tunables: Use direct syscall for access (BZ#21744)
The function maybe_enable_malloc_check, which is called by
__tunables_init, calls __access_noerrno.  It isn't problem when
symbol is is in ld.so, which has a special version of __access_noerrno
without stack protector.  But when glibc is built with stack protector,
maybe_enable_malloc_check in libc.a can't call the regular version of
__access_noerrno with stack protector.

This patch changes how Linux defines the __access_noerrno to be an
inline call instead and thus preventing defining different build
rules for ld/static and shared.

	H.J. Lu  <hongjiu.lu@intel.com>
	Adhemerval Zanella  <adhemerval.zanella@linaro.org>

	[BZ #21744]
	* elf/dl-tunables.c: Include not-errno.h header.
	* include/unistd.h (__access_noerrno): Remove definition.
	* sysdeps/unix/sysv/linux/access.c (__access_noerrno): Likewise.
	* sysdeps/generic/not-errno.h: New file.
	* sysdeps/unix/sysv/linux/not-errno.h: Likewise.
2017-07-24 11:21:07 -03:00
H.J. Lu
422ff87c24 Avoid accessing corrupted stack from __stack_chk_fail [BZ #21752]
__libc_argv[0] points to address on stack and __libc_secure_getenv
accesses environment variables which are on stack.  We should avoid
accessing stack when stack is corrupted.

This patch also renames function argument in __fortify_fail_abort
from do_backtrace to need_backtrace to avoid confusion with do_backtrace
from enum __libc_message_action.

	[BZ #21752]
	* debug/fortify_fail.c (__fortify_fail_abort): Don't pass down
	__libc_argv[0] if we aren't doing backtrace.  Rename do_backtrace
	to need_backtrace.
	* sysdeps/posix/libc_fatal.c (__libc_message): Don't call
	__libc_secure_getenv if we aren't doing backtrace.
2017-07-24 06:06:24 -07:00