glibc doesn't do this, and we probably shouldn't either.
Bug: 16703540
Bug: 17436734
(cherry picked from commit afe58ad989)
Change-Id: Iada5d0ae814f438cb276f056b2b5e3675f0e3666
This change provides __restore/__restore_rt on x86 and __restore_rt on
x86_64 with unwinding information to be able to unwind through signal
frame via libgcc provided unwinding interface. See comments inlined for
more details.
Also remove the test that had a dependency on
__attribute__((cleanup(foo_cleanup))). It doesn't provide us with any
better test coverage than we have from the newer tests, and it doesn't
work well across a variety architectures (presumably because no one uses
this attribute in the real world).
Tested this on host via bionic-unit-tests-run-on-host on both x86 and
x86-64.
Bug: 17436734
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
(cherry picked from commit 50321e2e66)
Change-Id: Iba90e36958b00c7cc7db5eeebf888dc89ce4d619
gdb was happy with what we had, but libgcc and libunwind weren't.
libgcc is happy with the kernel's restorer (because of the extra nop),
though libunwind looks like it's going to need code changes regardless.
We could make our restorer more like the kernel's one, but why bother
when we can just let the kernel supply the canonical one?
Bug: 17436734
(cherry picked from commit 1cff9a8964)
Change-Id: Ie13d73fd97395e1979a67c2294e036a97c50000d
gdb was already okay; libgcc and libunwind need a little extra help.
Bug: 17436734
(cherry picked from commit 148dff3ec6)
Change-Id: I2cc997017acc57c930284af5264f353656b98c7b
* LP32 should use sa_restorer too. gdb expects this, and future (>= 3.15) x86
kernels will apparently stop supporting the case where SA_RESTORER isn't
set.
* gdb and libunwind care about the exact instruction sequences, so we need to
modify the code slightly in a few cases to match what they're looking for.
* gdb also cares about the exact function names (for some architectures),
so we need to use __restore and __restore_rt rather than __sigreturn and
__rt_sigreturn.
* It's possible that we don't have a VDSO; dl_iterate_phdr shouldn't assume
that getauxval(AT_SYSINFO_EHDR) will return a non-null pointer.
This fixes unwinding through a signal handler in gdb for all architectures.
It doesn't fix libunwind for arm and arm64. I'll keep investigating that...
(cherry picked from commit 36f451a6d9)
Bug: 17436734
Change-Id: Ic1ea1184db6655c5d96180dc07bcc09628e647cb
From the release notes:
Changes affecting future time stamps
Pacific/Fiji will observe DST from 2014-11-02 02:00 to
2015-01-18 03:00. (Thanks to Ken Rylander for the heads-up.)
Guess that future years will use a similar pattern.
A new Zone Pacific/Bougainville, for the part of Papua New
Guinea that plans to switch from UTC+10 to UTC+11 on
2014-12-28 at 02:00. (Thanks to Kiley Walbom for the
heads-up.)
Changes affecting time zone abbreviations
Since Belarus is not changing its clocks even though Moscow
is, the time zone abbreviation in Europe/Minsk is changing
from FET to its more-traditional value MSK on 2014-10-26 at
01:00. (Thanks to Alexander Bokovoy for the heads-up about
Belarus.)
The new abbreviation IDT stands for the pre-1976 use of UT+8
in Indochina, to distinguish it better from ICT (UT+7).
Changes affecting past time stamps
Many time stamps have been corrected for Asia/Ho_Chi_Minh
before 1976 (thanks to Trần Ngọc Quân for an indirect pointer
to Trần Tiến Bình's authoritative book). Asia/Ho_Chi_Minh has
been added to zone1970.tab, to give tzselect users in Vietnam
two choices, since north and south Vietnam disagreed after our
1970 cutoff.
Asia/Phnom_Penh and Asia/Vientiane have been turned into
links, as they differed from existing zones only for older
time stamps. As usual, these changes affect pre-1970 time
stamps only. Their old contents have been moved to the
'backzone' file.
Bug: 18085936
(cherry picked from commit a05c2a2a70)
Change-Id: If0253cc1515e1bc98e99c6e24eec797836ca7c27
- Clean up the labels (add .L to make them local).
- Change to using cfi directives.
- Fix unwinding of the __memcpy_chk fail path.
Bug: 18033671
(cherry pick from commit 7123d4371a)
Change-Id: Ife93bcbfc1949ef29fc8e2dc515b7120632b82b1
replace lseek() and use pread() instead
add test for library_fd_offset > file_size case
Bug: 17762003
(cherry picked from commit a6c1279098)
Change-Id: Ie117c745081ee33d07db5341115ff6c8e98b0dec
Use $(BUILD_SYSTEM)/base_rules to build it as custom module, so that
it's exposed to utilities like mm/mmma etc.
Bug: 17887283
Bug: 17762003
(cherry picked from commit 667853d477)
Change-Id: I405797d16f20dc09e5d84b93b6727b634db2fc2c
When setting a repeat timer using the SIGEV_THREAD mechanism, it's possible
that the callback can be called after the timer is disarmed or deleted.
This happens because the kernel can generate signals that the timer thread
will continue to handle even after the timer is supposed to be off.
Add two new tests to verify that disarming/deleting doesn't continue to
call the callback.
Modify the repeat test to finish more quickly than before.
Refactor the Counter implementation a bit.
Bug: 18039727
Change-Id: I73192c915cdacf608521b1792c54e5af14a34907
We were missing that using directive when including <atomic>.
Bug:17736764
Change-Id: Ie8ca92a952749415567bcd5fa21d56629a364660
(cherry picked from commit 76ac4d0853)
The mallinfo usmblks value returned by dlmalloc is a little misleading.
It's not the current max, it's the historical high water mark. This
leads to dumpsys meminfo producing native memory numbers that don't add up.
Change this to the real total footprint, not this high water mark.
Bug: 17265653
Change-Id: Id0293a1b50c9b0be8795405049f537a51ab0e8b7
valgrind seems to mess with the stack enough that the kernel will
report "[stack:pid]" rather than "[stack]" in /proc/self/maps, so
switch to the task-specific file instead to force "[stack]". (There
are two conditions in the kernel code that decides which form to
output.)
Bug: 17897476
(cherry picked from commit 9afb2f2106)
Change-Id: I92c331ef6fb5868af49e75bc595710d290a95f5b
It turns out that appportable has a version that calls dlmalloc directly.
Re-add the dlmalloc symbol for 32 bit only as a compatibility shim that
calls malloc.
Bug: 17881362
Change-Id: I8f20963b0b8d323489dc083e4063779e0d1d7447
__open_2() is used by the fortify implementation of open(2) in
fcntl.h, and as such needs an unmangled C name. For some reason
(inlining?), this doesn't cause problems at the default optimization
level, but does for -O0.
The rest of these didn't cause build failures, but they look suspect
and probably will, we just haven't caught them yet.
(cherry-pick of 658727e111 with conflicts
in stdio.h and string.h.)
Bug: 17784968
Change-Id: I7391a7a8999ee204eaf6abd14a3d5373ea419d5b
Otherwise the gcc compiler warning doesn't show up.
Add -Wno-error to fortify related tests. Fortify related tests
are expected to be examples of bad programs, and in many
cases shouldn't compile cleanly. Rewriting them to compile
cleanly isn't feasible nor desirable.
Bug: 17784968
(cherry picked from commit 1aaa17802c)
Change-Id: Ib6df1a3f44b55b1fff222e78395c10c51cd39817
This library calls pthread_mutex_lock and pthread_mutex_unlock with a NULL
pthread_mutex_t*. This gives them (and their users) one release to fix things.
Bug: 17443936
(cherry picked from commit 7d3f553f98)
Change-Id: Ie26bbecd3a74d61113b51c18832872499b97ee86
(cherry picked from commit b5e7eba6d1)
This library calls pthread_mutex_lock and pthread_mutex_unlock with a NULL
pthread_mutex_t*. This gives them (and their users) one release to fix things.
Bug: 17443936
(cherry picked from commit 7d3f553f98)
Change-Id: Ie26bbecd3a74d61113b51c18832872499b97ee86
Fix and use __RENAME (and lose ___RENAME --- two underscores should be
enough for anybody). This was the point of this change, because I want
to use __RENAME to support the two basename variants and the two
strerror_r variants.
Lose a bunch of macros that weren't being used.
Lose three dead files from the DNS code.
Bug: 17784968
(cherry picked from commit 2cfb4e8e2e)
Change-Id: I5e96146f92c0521248c78c0933bec5e9a9818222
For silvermont, the __popcountsi2 symbol does not get exported by libc.
But for atom, this symbol is exported. Since we already exported this symbol
for previous releases, it's better to just follow through and force
the export, but only for 32 bit. x86 64 bit will not export this symbol.
Bug: 17681440
Change-Id: I6c62245f0960910f64baaaf6d9d090bf3ea5f435
Unlike times(), clock_gettime() is implemented as a vDSO on many architectures.
So, using clock_gettime() will return a more accurate time and do so with less
overhead because it does have the overhead of calling into the kernel.
It is also significantly more accurate because it measures the actual time in
nanoseconds rather than the number of ticks (typically 1 millisecond or more).
Bug: 17814435
(cherry picked from commit 8d0b2dbf21)
Change-Id: Id4945d9f387330518f78669809639952e9227ed9
Get dynamic flags from phdr table's correct entry rather the first
entry, so that the following DT_DEBUG entry can be set.
Also fix the undefined reference to LoadTask::deleter issue under gcc
-O0 option.
Bug: 17524778
(cherry picked from commit e93be99da0)
Change-Id: I347792dab25c7b19c3fc690e03d20899ce1e26e0
Reset soinfo version to 0.
Disable ifunc test for arm64 because of old toolchain
in lmp-mr1-dev branch
Note: this commit should be reverted in -plus-aosp branch.
Change-Id: I2d6d996d43bc35d5d4975c745779f43a988b31e6
Expanded test for recursive libs. Fixed bug with unnecessary
soinfo_free of already loaded library.
(cherry picked from commit a6ac54a215)
Change-Id: I6907c723d9fbdf6b2777f3f236b1e29b0843edd6
There are number of changes in the way IFUNC related relocations are done:
1. IRELATIVE relocations are now supported for x86/x86_64 and arm64.
2. IFUNC relocations are now relying on static linker to generate
them in correct order - this removes necessety of additional
relocation pass for ifuncs.
3. Related to 2: rela?.dyn relocations are preformed before .plt ones.
4. Ifunc are resolved on symbol lookup this approach allowed to avoid
mprotect(PROT_WRITE) call on r-x program segments.
Bug: 17399706
Bug: 17177284
(cherry picked from commit 9aea164457)
Change-Id: Ie19d900fc203beb93faf8943b0d06d534a6de4ad