Snap for 11954976 from f589eac769 to 24Q3-release

Change-Id: Ia37c6453c8b44042bdecc87250a2da1de41245f2
This commit is contained in:
Android Build Coastguard Worker 2024-06-11 23:01:01 +00:00
commit 0fd0ec009d
3 changed files with 20 additions and 4 deletions

View file

@ -37,7 +37,9 @@
// This function needs to be safe to call before TLS is set up, so it can't // This function needs to be safe to call before TLS is set up, so it can't
// access errno or the stack protector. // access errno or the stack protector.
__LIBC_HIDDEN__ unsigned long __bionic_getauxval(unsigned long type, bool* exists) { // Cannot use HWASan, as this is called during setup of the HWASan runtime to
// determine the page size.
__LIBC_HIDDEN__ unsigned long __bionic_getauxval(unsigned long type, bool* exists) __attribute__((no_sanitize("hwaddress"))) {
for (ElfW(auxv_t)* v = __libc_shared_globals()->auxv; v->a_type != AT_NULL; ++v) { for (ElfW(auxv_t)* v = __libc_shared_globals()->auxv; v->a_type != AT_NULL; ++v) {
if (v->a_type == type) { if (v->a_type == type) {
*exists = true; *exists = true;
@ -48,7 +50,9 @@ __LIBC_HIDDEN__ unsigned long __bionic_getauxval(unsigned long type, bool* exist
return 0; return 0;
} }
extern "C" unsigned long getauxval(unsigned long type) { // Cannot use HWASan, as this is called during setup of the HWASan runtime to
// determine the page size.
extern "C" unsigned long getauxval(unsigned long type) __attribute__((no_sanitize("hwaddress"))) {
bool exists; bool exists;
unsigned long result = __bionic_getauxval(type, &exists); unsigned long result = __bionic_getauxval(type, &exists);
if (!exists) errno = ENOENT; if (!exists) errno = ENOENT;

View file

@ -223,8 +223,6 @@ typedef Elf64_Xword Elf64_Relr;
#undef SHT_NUM #undef SHT_NUM
#define SHT_NUM 20 #define SHT_NUM 20
#define SHT_RISCV_ATTRIBUTES 0x70000003
/* /*
* Experimental support for SHT_RELR sections. For details, see proposal * Experimental support for SHT_RELR sections. For details, see proposal
* at https://groups.google.com/forum/#!topic/generic-abi/bX460iggiKg. * at https://groups.google.com/forum/#!topic/generic-abi/bX460iggiKg.
@ -254,6 +252,8 @@ typedef Elf64_Xword Elf64_Relr;
#define DT_ANDROID_RELA 0x60000011 // DT_LOOS + 4 #define DT_ANDROID_RELA 0x60000011 // DT_LOOS + 4
#define DT_ANDROID_RELASZ 0x60000012 // DT_LOOS + 5 #define DT_ANDROID_RELASZ 0x60000012 // DT_LOOS + 5
/* arm64 psabi. */
/* TODO: upstreamed to FreeBSD as https://github.com/freebsd/freebsd-src/pull/1141/. */ /* TODO: upstreamed to FreeBSD as https://github.com/freebsd/freebsd-src/pull/1141/. */
#define DT_AARCH64_MEMTAG_MODE 0x70000009 #define DT_AARCH64_MEMTAG_MODE 0x70000009
#define DT_AARCH64_MEMTAG_HEAP 0x7000000b #define DT_AARCH64_MEMTAG_HEAP 0x7000000b
@ -270,6 +270,8 @@ typedef Elf64_Xword Elf64_Relr;
#define R_ARM_TLS_DESC 13 #define R_ARM_TLS_DESC 13
#define R_ARM_IRELATIVE 160 #define R_ARM_IRELATIVE 160
/* riscv64 psabi. */
/* FreeBSD is missing these, found in /* FreeBSD is missing these, found in
* https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-elf.adoc#relocations * https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-elf.adoc#relocations
* so I've sent https://github.com/freebsd/freebsd-src/pull/1141 upstream. * so I've sent https://github.com/freebsd/freebsd-src/pull/1141 upstream.
@ -283,6 +285,12 @@ typedef Elf64_Xword Elf64_Relr;
#define R_RISCV_TLSDESC_ADD_LO12 64 #define R_RISCV_TLSDESC_ADD_LO12 64
#define R_RISCV_TLSDESC_CALL 65 #define R_RISCV_TLSDESC_CALL 65
/* https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-elf.adoc#program-header-table */
#define PT_RISCV_ATTRIBUTES 0x70000003
/* https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-elf.adoc#section-types */
#define SHT_RISCV_ATTRIBUTES 0x70000003
/* FreeBSD spells this slightly differently to Linux. Linux is correct according to /* FreeBSD spells this slightly differently to Linux. Linux is correct according to
* https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-elf.adoc#file-header * https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-elf.adoc#file-header
* so I've sent https://github.com/freebsd/freebsd-src/pull/1148 upstream. * so I've sent https://github.com/freebsd/freebsd-src/pull/1148 upstream.

View file

@ -32,7 +32,11 @@
#include <math.h> // For M_PI_2/M_PI_2l. #include <math.h> // For M_PI_2/M_PI_2l.
// Prettify gtest Complex printing. // Prettify gtest Complex printing.
// Macro 'complex' defined in complex.h conflicts with iostream.
#pragma push_macro("complex")
#undef complex
#include <iostream> #include <iostream>
#pragma pop_macro("complex")
namespace testing { namespace testing {
namespace internal { namespace internal {
inline void PrintTo(const double _Complex& c, std::ostream* os) { inline void PrintTo(const double _Complex& c, std::ostream* os) {