diff options
author | Andrey Kazmin <a.kazmin@partner.samsung.com> | 2020-03-06 17:01:37 +0300 |
---|---|---|
committer | Andrey Kazmin <a.kazmin@partner.samsung.com> | 2020-09-14 09:52:42 +0000 |
commit | da700353a1e7416d8974bd39671a6a0569d9dc7c (patch) | |
tree | cc7b288498a700ab504b9186a01a076f5fb503b9 | |
parent | e7eb721bd3b64ad4c2218df333cd51408b175e2a (diff) | |
download | binutils-da700353a1e7416d8974bd39671a6a0569d9dc7c.tar.gz binutils-da700353a1e7416d8974bd39671a6a0569d9dc7c.tar.bz2 binutils-da700353a1e7416d8974bd39671a6a0569d9dc7c.zip |
Add gnu.property new C++ dual ABI compiler flagsubmit/tizen_base/20200917.055737accepted/tizen/base/tool/20200917.222725
It denotes that object file doesn't rely on any C++ ABI.
Also this flag is used to skip C++ ABI validation in linker.
Change-Id: I1ed4be997190a2ffdc4642946743ee9908a30348
Signed-off-by: Andrey Kazmin <a.kazmin@partner.samsung.com>
-rw-r--r-- | bfd/elf-properties.c | 23 | ||||
-rw-r--r-- | binutils/readelf.c | 5 | ||||
-rw-r--r-- | include/elf/common.h | 11 |
3 files changed, 27 insertions, 12 deletions
diff --git a/bfd/elf-properties.c b/bfd/elf-properties.c index d942012046e..537dc0061b7 100644 --- a/bfd/elf-properties.c +++ b/bfd/elf-properties.c @@ -294,7 +294,9 @@ elf_validate_compiler_flags_properties (bfd *abfd, return FALSE; } - if (!elf_gnu_property_validate_flag(aprop->u.number, + if (!(aprop->u.number & GNU_PROPERTY_DUAL_CXX_ABI || + bprop->u.number & GNU_PROPERTY_DUAL_CXX_ABI) && + !elf_gnu_property_validate_flag(aprop->u.number, bprop->u.number, GNU_PROPERTY_USECXX_VALIDATION, GNU_PROPERTY_USECXX11_ABI)) @@ -364,10 +366,23 @@ elf_merge_gnu_properties_compiler_flags (elf_property *aprop, is_updated = TRUE; } - if ((aprop->u.number ^ bprop->u.number) & GNU_PROPERTY_USECXX11_ABI) + if (aprop->u.number & GNU_PROPERTY_DUAL_CXX_ABI) { - aprop->u.number |= GNU_PROPERTY_USECXX11_ABI; - is_updated = TRUE; + if (!(bprop->u.number & GNU_PROPERTY_DUAL_CXX_ABI)) + { + aprop->u.number &= ~(GNU_PROPERTY_DUAL_CXX_ABI | GNU_PROPERTY_USECXX11_ABI); + aprop->u.number |= bprop->u.number & GNU_PROPERTY_USECXX11_ABI; + is_updated = TRUE; + } + } + else + { + if ((aprop->u.number ^ bprop->u.number) & GNU_PROPERTY_USECXX11_ABI && + !(bprop->u.number & GNU_PROPERTY_DUAL_CXX_ABI)) + { + aprop->u.number |= GNU_PROPERTY_USECXX11_ABI; + is_updated = TRUE; + } } if ((aprop->u.number ^ bprop->u.number) & GNU_PROPERTY_TIZEN_VALIDATION) diff --git a/binutils/readelf.c b/binutils/readelf.c index 3dfcb553da7..ed8c85085c4 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -17754,8 +17754,9 @@ decode_compiler_flags_notes (unsigned long bitmask) { printf("%#lx [", bitmask); - printf("%c%ccxx11, ", bitmask & GNU_PROPERTY_USECXX_VALIDATION ? '=' : '~', - bitmask & GNU_PROPERTY_USECXX11_ABI ? '+' : '!'); + printf("%c%ccxx11 %cdual, ", bitmask & GNU_PROPERTY_USECXX_VALIDATION ? '=' : '~', + bitmask & GNU_PROPERTY_USECXX11_ABI ? '+' : '!', + bitmask & GNU_PROPERTY_DUAL_CXX_ABI ? '+' : '!'); printf("%c%casan, ", bitmask & GNU_PROPERTY_SANITIZE_VALIDATION ? '=' : '~', bitmask & GNU_PROPERTY_SANITIZE_ADDRESS ? '+' : '!'); diff --git a/include/elf/common.h b/include/elf/common.h index 55b0ec2bbf9..dcf9df40519 100644 --- a/include/elf/common.h +++ b/include/elf/common.h @@ -748,13 +748,12 @@ /* Pre/post cxx11 ABI. */ #define GNU_PROPERTY_USECXX_VALIDATION (1U << 0) #define GNU_PROPERTY_USECXX11_ABI (1U << 1) +#define GNU_PROPERTY_DUAL_CXX_ABI (1U << 2) /* Sanitizer flags. */ -#define GNU_PROPERTY_SANITIZE_VALIDATION (1U << 2) -#define GNU_PROPERTY_SANITIZE_ADDRESS (1U << 3) -#define GNU_PROPERTY_SANITIZE_UNDEFINED (1U << 4) -#define GNU_PROPERTY_SANITIZE_THREAD (1U << 5) -/* Reserved flag */ -#define GNU_PROPERTY_RESERVED_FIELD (1U << 6) +#define GNU_PROPERTY_SANITIZE_VALIDATION (1U << 3) +#define GNU_PROPERTY_SANITIZE_ADDRESS (1U << 4) +#define GNU_PROPERTY_SANITIZE_UNDEFINED (1U << 5) +#define GNU_PROPERTY_SANITIZE_THREAD (1U << 6) /* Tizen version flag */ #define GNU_PROPERTY_TIZEN_VALIDATION (1U << 7) /* Tizen version offset and mask */ |