Commit graph

37811 commits

Author SHA1 Message Date
Elliott Hughes
4bfa3e385d Merge "Move to arm-optimized-routines memset()." am: db681c0223
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2307216

Change-Id: I60bcf6ed92653f6b8fa92021b715362821827cc9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-17 22:40:01 +00:00
Elliott Hughes
db681c0223 Merge "Move to arm-optimized-routines memset()." 2022-11-17 22:18:42 +00:00
Elliott Hughes
b968a2fc3e Merge "Switch to the arm-optimized-routines memcpy() and memmove()." am: 361ab5beab
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2305594

Change-Id: I2f57a9a160d3ea92a04e9bc7ac5cbd6b5504ea8d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-17 19:48:54 +00:00
Elliott Hughes
023e4e7840 Move to arm-optimized-routines memset().
This one's a bit simpler, because there is only one upstream memset()
implementation.

Test: treehugger
Change-Id: I2536d0eb72adaacfa6a0e40d2bd29fc833988c16
2022-11-17 19:28:06 +00:00
Elliott Hughes
361ab5beab Merge "Switch to the arm-optimized-routines memcpy() and memmove()." 2022-11-17 19:25:25 +00:00
Elliott Hughes
1c652bded3 Merge "Add invalid riscv64 ELF files for the linker tests." am: 1b1bb3543d
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2303265

Change-Id: I15d5f9530fd8b077842f6a6b6b4702a8aa4ff12e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-17 16:25:47 +00:00
Elliott Hughes
1b1bb3543d Merge "Add invalid riscv64 ELF files for the linker tests." 2022-11-17 15:51:01 +00:00
Elliott Hughes
7daf4596b7 Switch to the arm-optimized-routines memcpy() and memmove().
Outsource this to them, and choose the best of the two options available
based on the hardware we're running on.

Test: treehugger
Change-Id: I2fa7555c971b64a6decca132210e901ffa248efa
2022-11-17 00:38:49 +00:00
Treehugger Robot
265920e997 Merge "Implement __memset_chk as a copy & paste of __memcpy_chk." am: d26d3c0b5c
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2305394

Change-Id: Ia29bbd268c3e5eb558728baf73a901abb1edd416
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-16 23:51:03 +00:00
Treehugger Robot
d26d3c0b5c Merge "Implement __memset_chk as a copy & paste of __memcpy_chk." 2022-11-16 23:33:14 +00:00
Treehugger Robot
4895b28b50 Merge "Move memcpy_base.S into memcpy.S." am: 6c599e3a67
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2305393

Change-Id: Iff6c5e640f203b56b4e4bb0270850bdfcb129b51
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-16 22:12:50 +00:00
Treehugger Robot
c7a0f0edc5 Merge "Remove assembler wmemmove()." am: 06868c8646
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2305392

Change-Id: Iaa17a2c05ecb684c5ef193feda96314ab9c82563
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-16 22:11:59 +00:00
Treehugger Robot
6c599e3a67 Merge "Move memcpy_base.S into memcpy.S." 2022-11-16 22:11:53 +00:00
Treehugger Robot
06868c8646 Merge "Remove assembler wmemmove()." 2022-11-16 21:59:04 +00:00
Elliott Hughes
3cc366d3a2 Implement __memset_chk as a copy & paste of __memcpy_chk.
These two will stay behind when we move memcpy()/memmove()/memset() over
to arm-optimized-routines (which leaves fortify to us).

Test: treehugger
Change-Id: Ie683f71a5a141263ce3f4e8811df9eaf667584f4
2022-11-16 21:07:56 +00:00
Elliott Hughes
d5ac40cc9f Move memcpy_base.S into memcpy.S.
Just to make it clear that there's nothing interesting going on here ---
there's just one user, and the only symbol here is __memcpy().

Test: treehugger
Change-Id: I62d72c43c4c6d30442f05c1e08a0cb1a1ec42a8a
2022-11-16 18:50:54 +00:00
Elliott Hughes
0d4d276253 Remove assembler wmemmove().
The compiler turns our C wmemmove() into one shift instruction and a
branch, which is plenty for a function no-one uses anyway.

Why don't I just leave this alone, since we already have it? Because I'm
looking at finishing the project of "switch to arm-optimized-routines"
and getting rid of our assembler here, and Arm agrees that this isn't
worth having optimized assembler for in their optimized assembler
project, judging by its absence.

Test: treehugger
Change-Id: I985801241a8cbd7dbda51a447946affb1402effb
2022-11-16 18:44:56 +00:00
Elliott Hughes
ec9f023f41 Add invalid riscv64 ELF files for the linker tests.
The libtest_empty.so was built by the "libtest_empty" build rule, and
the other files are copies of that with small edits made by the toybox
hexedit tool. I worked out what to edit in each case from a combination
of "what does the name imply?" and "what does a diff of the xxd output
of the corresponding two arm64 files show?".

I failed to produce a working (by which I mean "failing") local-tls
file despite my best efforts. I'm not sure what exactly it was about the
gold-generated files we didn't like, because the commentary implies that
this would be problematic:

    39: 0000000000000004     4 TLS     LOCAL  DEFAULT   12 tls_var_2

But it loads without complaint.

Test: ran locally
Change-Id: I3b9b2b4db1f8827243541cf13380c6ceb840f123
2022-11-16 00:52:26 +00:00
Treehugger Robot
179fc3ddc0 Merge "Correctly print RISC-V arch name on error when verifying ELF header." am: 8d4014e135
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2303140

Change-Id: Ib786db7a49271eb6b15ef23da6efe097c2ad43af
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-15 18:17:27 +00:00
Treehugger Robot
8d4014e135 Merge "Correctly print RISC-V arch name on error when verifying ELF header." 2022-11-15 17:51:12 +00:00
Elliott Hughes
a2d3b1e8ee Merge "Update sys_ptrace_test.cpp for riscv64." am: 73840b56b2
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2299425

Change-Id: Ib9900bb91c504734cf0f51a50064ee4894457f0f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-15 17:49:55 +00:00
Elliott Hughes
73840b56b2 Merge "Update sys_ptrace_test.cpp for riscv64." 2022-11-15 17:22:35 +00:00
Elliott Hughes
d93bf64f95 Merge "Add riscv64 support to the linker relocation benchmark." am: 56c4db9aeb
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2302559

Change-Id: I805c2f1bbf24a3e64a95411ee7060628c84f4c4c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-15 16:57:10 +00:00
Elliott Hughes
56c4db9aeb Merge "Add riscv64 support to the linker relocation benchmark." 2022-11-15 16:12:45 +00:00
Ulya Trafimovich
b973c756a0 Correctly print RISC-V arch name on error when verifying ELF header.
Test: enable debug logging, observe EM_RISCV printed in dlopen error
message instead of default EM_???.

Change-Id: Ieed5bd3eecc5d4093ffcb40558c554bb747e7a4b
2022-11-15 15:18:33 +00:00
Elliott Hughes
20561b893d Add riscv64 support to the linker relocation benchmark.
Change-Id: I8274826803a07016b9fd08efe60a2f1c77751c5d
Signed-off-by: Mao Han <han_mao@linux.alibaba.com>
Signed-off-by: Xia Lifang <lifang_xia@linux.alibaba.com>
Signed-off-by: Chen Guoyin <chenguoyin.cgy@linux.alibaba.com>
Signed-off-by: Wang Chen <wangchen20@iscas.ac.cn>
Signed-off-by: Lu Xufan <luxufan@iscas.ac.cn>
Test: `mm -j` in bionic/
2022-11-14 21:43:30 +00:00
Treehugger Robot
00c63fc82f Merge "Nullability check for regex module." am: 9874c54c93
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2290254

Change-Id: I344962836c18881df95086bff96fb9469eb28395
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-12 10:28:34 +00:00
Treehugger Robot
9874c54c93 Merge "Nullability check for regex module." 2022-11-12 09:56:56 +00:00
Treehugger Robot
d3cc9e91d7 Merge "Update a comment to be more intention-revealing." am: 502c290a29
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2299424

Change-Id: I0fb7a90de41917d36c7f62e5f3a13a670c38f281
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-12 02:00:28 +00:00
Treehugger Robot
502c290a29 Merge "Update a comment to be more intention-revealing." 2022-11-12 01:37:31 +00:00
Elliott Hughes
89719df107 Update sys_ptrace_test.cpp for riscv64.
We'll want to come back to this once either Zcmp's push/pop instructions
or V's vector loads/stores are available. But for now, we have no >64b
stores.

But at least this builds.

Test: treehugger
Change-Id: I9503e890cacb198f4ba987bfc92f6eff21c290b0
2022-11-12 00:08:17 +00:00
Elliott Hughes
fc03503f67 Update a comment to be more intention-revealing.
And also inclusive of riscv64.

Test: treehugger
Change-Id: I27280e1d934ce3bb47026820b75850c824801022
2022-11-11 22:52:04 +00:00
Treehugger Robot
c24dc389d4 Merge "Simplify the malloc_debug unwind." am: cf74c0c020
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2298342

Change-Id: I06b46c31befc9c5ddda5e57c568d08c9bd68c1a7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-11 22:33:06 +00:00
Treehugger Robot
cf74c0c020 Merge "Simplify the malloc_debug unwind." 2022-11-11 22:05:24 +00:00
Edward Liaw
fdc005d39c Merge "TEST_MAPPING: add CTS bionic test to kernel-presubmit" am: 5c41b06529
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2299392

Change-Id: I291d7c1607daab4701f69e4d3fe91dbaa252d577
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-11 21:49:31 +00:00
Edward Liaw
5c41b06529 Merge "TEST_MAPPING: add CTS bionic test to kernel-presubmit" 2022-11-11 21:26:55 +00:00
Elliott Hughes
69528daecb Merge "Add a hack for a RISC-V bug." am: c272332747
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2298684

Change-Id: I3dea5d1c20bbbb3a4c0139b81e1bc1cbc480e75a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-11 20:52:28 +00:00
Elliott Hughes
c272332747 Merge "Add a hack for a RISC-V bug." 2022-11-11 20:19:31 +00:00
Edward Liaw
4a8d7d79e2 TEST_MAPPING: add CTS bionic test to kernel-presubmit
Bug: 258819618
Test: atest :kernel-presubmit
Change-Id: I6290d694137d1c4f3ea0a004562320ce4068463c
Signed-off-by: Edward Liaw <edliaw@google.com>
2022-11-11 18:46:19 +00:00
Elliott Hughes
ec9ff04075 Add a hack for a RISC-V bug.
I can't find this documented anywhere, other than people observing that
RISC-V appears to behave in this way. See the LLVM commit making a
similar change to similar code, for example: https://reviews.llvm.org/D87579.

Unsatisfying, but it works, and I suspect we're all too far down this
copy & paste hole to get back out now. See also psabi bug
https://github.com/riscv-non-isa/riscv-elf-psabi-doc/issues/18 for
more discussion.

Change-Id: I9e9d60bf859715895370861b2024deeb1d330577
Signed-off-by: Mao Han <han_mao@linux.alibaba.com>
Signed-off-by: Xia Lifang <lifang_xia@linux.alibaba.com>
Signed-off-by: Chen Guoyin <chenguoyin.cgy@linux.alibaba.com>
Signed-off-by: Wang Chen <wangchen20@iscas.ac.cn>
Signed-off-by: Lu Xufan <luxufan@iscas.ac.cn>
Test: treehugger
2022-11-11 17:12:57 +00:00
Elliott Hughes
eeaf9edb0b Simplify the malloc_debug unwind.
It's hard to find the start of the previous instruction for riscv64
(given the C extension), and discussion with the ART folks cast doubt
on the comment's claim that we do this correctly for arm32 anyway.

So, rather than add complexity for riscv64, let's simplify this routine
for everyone. I suspect we could probably get away with just `--ip` for
all architectures, but since it's trivial to at least maintain plausible
alignment, I've stuck with the correct "at least" byte counts instead.

(See the discussion on
https://lists.riscv.org/g/sig-android/topic/detecting_16_bit_vs_32_bit/94813787
for more about riscv64 specifically.)

Test: treehugger
Change-Id: Ie43451d329470b3ece8779d11eb705d24d01c3d7
2022-11-10 21:35:03 +00:00
Elliott Hughes
88c683a9e8 Merge "Remove strtoq() and strtouq()." am: ebe850e01c
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2295477

Change-Id: I1c2c0f4d4171625f2d8e9eff091ebe73489e3472
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-10 20:40:23 +00:00
Treehugger Robot
c29c53f2a1 Merge "Update the README.md" am: 4f8ead4a63
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2295378

Change-Id: I1ede6ae6732499c7d3a9bd63a3c30bfec3ffdfd9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-10 20:39:26 +00:00
zijunzhao
7ececf1140 Nullability check for regex module.
Bugs: b/245972273
Test: None
Change-Id: Ie2c0f3dcbbe1dcbe04d4a6acfac445d556f0c38d
2022-11-10 20:32:47 +00:00
Elliott Hughes
ebe850e01c Merge "Remove strtoq() and strtouq()." 2022-11-10 19:42:02 +00:00
Treehugger Robot
4f8ead4a63 Merge "Update the README.md" 2022-11-10 19:40:47 +00:00
zijunzhao
a3696c13cf Update the README.md
1. Update the link for device test.

2. Reformat the file.

Bugs: None
Test: None
Change-Id: I88b928d7b2247fb31e8adbd92a19f944cf0bafd4
2022-11-10 00:01:15 +00:00
Treehugger Robot
dba9325d55 Merge "Use the same union in riscv64's ucontext." am: e71efc5ca6
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2294860

Change-Id: I7693d4a49aabf4ebcc4bf4519a18a16b4e8b0e40
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-09 22:50:40 +00:00
Treehugger Robot
e71efc5ca6 Merge "Use the same union in riscv64's ucontext." 2022-11-09 22:21:25 +00:00
Treehugger Robot
a9f5c494b6 Merge "Failures to parse SYSCALLS.TXT-like files should be errors." am: 315373dcab
Original change: https://android-review.googlesource.com/c/platform/bionic/+/2290938

Change-Id: Ic88bbfabe08d7e7e5a755e323ab466de1a4b4faf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-09 17:51:32 +00:00