They're POSIX, and they're implemented in iOS and glibc, but they're
not actually used in any codebase I have access to. They're *defined*
in several places, and some of those places have a handful of tests,
but I couldn't find a single genuine caller.
Bug: N/A
Test: N/A
Change-Id: Id3e2c36183fcff323aa5a2e3a3dabaa8378fae56
I'm skeptical about the usefulness of this, but it's in POSIX, it's
in glibc (but not iOS), and it is used in some internal source (test
runners and container code).
Bug: N/A
Test: ran tests
Change-Id: I92c5398f2a679b21a33fba92bc8e67e3ae2eb76f
Went through the POSIX spec for the _POSIX* and _XOPEN* constants.
Bug: http://b/32776472
Test: ran tests
Change-Id: I389100dbc7de354eae9056e44b0a7fa8c37374e3
We store a pointer to the long ro. property within the shared property
area, as we know that this pointer will never change locations or be
invalidated and it saves us from needing to allocate arbitrarily sized
storage for the property.
Bug: 23102347
Bug: 34954705
Test: bionic-unit-tests
Change-Id: I9f9147a2f951f20f51e4664c6faf9ff7f6a9502a
The no-arg function definitions in libdl.c weren't strictly correct,
because they should have taken void. Rename .c to .cpp instead of
fixing them.
Test: mma
Change-Id: I9e3528c836ffc8625a6a4d529034263b19b9fb3a
Add a static library containing the non-pthread dependent parts of
libc.
Bug: http://b/64400027
Test: sailfish boots
Test: bionic-unit-tests32/64, no new failures
Test: bionic-unit-tests-static32/64, no new failures
Change-Id: I93dc3811acddad7936d11b369b98cefd945ee2d5
I noticed that sometimes the old unwinder will add an extra PC 0 frame
after this change, but the new unwinder works in all cases. I'm not going
to fix the old unwinder since I plan to remove it very soon.
Bug: 67784501
Test: Forced a crash in the linker and verified that the unwind
Test: stops in __dl_start. Tested on arm/aarch64/x86/x86_64.
Change-Id: Id6585768023256be5c1d341df7b06b786a220b40
Add all the missing <netdb.h> functions.
Also fix getservbyport to handle a null protocol correctly.
Also fix getservbyname/getservbyport to not interfere with getservent.
Also fix endservent to reset getservent iteration.
Also reduce unnecessary differences from upstream NetBSD sethostent.c.
The servent implementation is still horrific, and we should
probably support protoent too so that debugging tools can use
getprotobyname/getprotobynumber.
Bug: N/A
Test: ran tests
Change-Id: I639108c46df0a768af297cf3bbce857cb1bef9d9
We don't want to be exposing so much through the headers for the
implementation details unless we have to.
Test: make checkbuild
Bug: None
Change-Id: Ieca9cd8106725e08887a3e9fde60d1eef64ef98b
They're marked obsolescent in POSIX, don't clearly mean anything, aren't
portable because the values don't mean anything, and are no-ops in other
C libraries that do "implement" them.
Bug: N/A
Test: N/A
Change-Id: I07342a0a6a5f6616a8432bfea24ed944c7971d27
This fixes mips and mips64 build failures.
Test: successful aosp_mips-eng and aosp_mips64-eng builds
Change-Id: I6648b9cae876cda13369cf10edf61ce9fdca342c
This patch resolves two issues:
(1) AOSP MIPS linker crash with SIGSEGV while relocating VDSO GOT
(2) Missing of MIPS_ABI_FP_ANY flag while ckecking & adjusting MIPS FP modes
(1): AOSP MIPS linker crash with SIGSEGV while relocating VDSO GOT
During bringup and testing of the kernel VDSO support on the emulator we
encountered an issue where all userspace processes were crashing due to
linker crash with SIGSEGV during VDSO GOT relocation.
The mentioned scenario will trigger SIGSEGV in the linker only if the kernel
code base contains VDSO implementation introduced with the following commits:
a7f4df4 MIPS: VDSO: Add implementations of gettimeofday() and clock_gettime()
c0a9f72 irqchip: irq-mips-gic: Provide function to map GIC user section
ebb5e78 MIPS: Initial implementation of a VDSO
Another prerequisite is that the linker contains the following commit from AOSP:
https://android-review.googlesource.com/#/c/264857/
The above commit introduces auxvec.h header containing definition of
AT_SYSINFO_EHDR in:
https://android.googlesource.com/platform/bionic/+/master/libc/kernel/uapi/asm-mips/asm/auxvec.h,
which in turn activates VDSO GOT relocations in mips_relocate_got():
https://android.googlesource.com/platform/bionic/+/master/linker/linker_mips.cpp#149
Since VDSO is mapped as a RO region, writing anything to its page will result
in SIGSEGV.
Removing this 0xdeadbeef cookies writes to the got[0]/got[1] solved SIGSEGV issue.
We also compared with the glibc linker code and we haven't seen anything similar
like writing some cookie values into GOT entries.
(2): Missing of MIPS_ABI_FP_ANY flag while checking & adjusting MIPS FP modes
This issue was found during testing of the patch:
https://android-review.googlesource.com/#/c/platform/bionic/+/494440/
This patch adds a bionic dlfcn.dlopen_vdso test which tries to open "linux-vdso.so.1"
(virtual ELF shared library) and expects to succeed.
dlopen fails in the mips linker part due to the following error:
"Unsupported MIPS32 FloatPt ABI 0 found in linux.vdso.so.1"
According to:
https://dmz-portal.imgtec.com/wiki/MIPS_O32_ABI_-_FR0_and_FR1_Interlinking#A.2._O32_FPXX_code_calling_FPXX,
ABI 0 is:
Val_GNU_MIPS_ABI_FP_ANY = 0 /* Not tagged or not using any ABIs affected by the differences. */
The issue appeared because MIPS_ABI_FP_ANY is not supposed to be checked as
a possible FP ABI-variant compatibility flag.
This patch adds logic to MIPS linker to handle this case appropriately,
after which dlfcn.dlopen_vdso test passes.
Test:
* bionic-unit-tests --gtest_filter=dlfcn.dlopen_vdso
* Boot android in emulator with kernel which supports VDSO optimizations
Change-Id: Icbcd9879beea1b38fbe8d97b3b205058eaa861f4
Signed-off-by: Goran Ferenc <goran.ferenc@imgtec.com>
We have no utmp, and we're ignoring getutxent/setutxent, and endutxent
belongs in the same group.
Bug: N/A
Test: N/A
Change-Id: Ide032960a0f95750f3bb8f2e62a25e5e7d25c7b6
<machine/asm.h> was internal use only.
<machine/fenv.h> is quite large, but can live in <bits/...>.
<machine/regdef.h> is trivially replaced by saying $x instead of x in
our assembler.
<machine/setjmp.h> is trivially inlined into <setjmp.h>.
<sgidefs.h> is unused.
Bug: N/A
Test: builds
Change-Id: Id05dbab43a2f9537486efb8f27a5ef167b055815
The executable flag might not be present for the executable segment
if the code is being handled by native bridge implementation. This
commit changes the test to restore executable flag for first segment
if it was removed.
Test: bionic-unit-tests
Change-Id: Ie930539135edc4db3245574b5cbe476aa1ad49c7