diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2018-07-05 09:24:07 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2018-07-05 09:24:18 -0700 |
commit | 56ad703d56ffe5dc55d5e719a6ec41fd6cf9bfbe (patch) | |
tree | 4c8d32a8c815dff426de709fd8e47f7ff894a188 /bfd/elfxx-x86.c | |
parent | c524414837791938eb5aed58a3334c4f8e04fe4b (diff) | |
download | gdb-56ad703d56ffe5dc55d5e719a6ec41fd6cf9bfbe.zip gdb-56ad703d56ffe5dc55d5e719a6ec41fd6cf9bfbe.tar.gz gdb-56ad703d56ffe5dc55d5e719a6ec41fd6cf9bfbe.tar.bz2 |
x86: Remove x86 ISA properties with empty bits
There is no need to generate x86 ISA properties with empty bits in
linker output.
bfd/
PR ld/23372
* elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Remove x86
ISA properties with empty bits.
ld/
PR ld/23372
* testsuite/ld-i386/i386.exp: Run pr23372a and pr23372b.
* testsuite/ld-i386/pr23372a.d: New file.
* testsuite/ld-i386/pr23372a.s: Likewise.
* testsuite/ld-i386/pr23372b.d: Likewise.
* testsuite/ld-i386/pr23372b.s: Likewise.
* testsuite/ld-i386/pr23372c.s: Likewise.
* testsuite/ld-x86-64/pr23372a-x32.d: Likewise.
* testsuite/ld-x86-64/pr23372a.d: Likewise.
* testsuite/ld-x86-64/pr23372a.s: Likewise.
* testsuite/ld-x86-64/pr23372b-x32.d: Likewise.
* testsuite/ld-x86-64/pr23372b.d: Likewise.
* testsuite/ld-x86-64/pr23372b.s: Likewise.
* testsuite/ld-x86-64/pr23372c.s: Likewise.
* testsuite/ld-x86-64/x86-64.exp: Run pr23372a, pr23372a-x32,
pr23372b and pr23372b-x32.
Diffstat (limited to 'bfd/elfxx-x86.c')
-rw-r--r-- | bfd/elfxx-x86.c | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/bfd/elfxx-x86.c b/bfd/elfxx-x86.c index 827bb6c..a2497aa 100644 --- a/bfd/elfxx-x86.c +++ b/bfd/elfxx-x86.c @@ -2412,13 +2412,34 @@ _bfd_x86_elf_merge_gnu_properties (struct bfd_link_info *info, { number = aprop->u.number; aprop->u.number = number | bprop->u.number; - updated = number != (unsigned int) aprop->u.number; + /* Remove the property if ISA bits are empty. */ + if (aprop->u.number == 0) + { + aprop->pr_kind = property_remove; + updated = TRUE; + } + else + updated = number != (unsigned int) aprop->u.number; } else { - /* Return TRUE if APROP is NULL to indicate that BPROP should - be added to ABFD. */ - updated = aprop == NULL; + /* Only one of APROP and BPROP can be NULL. */ + if (aprop != NULL) + { + if (aprop->u.number == 0) + { + /* Remove APROP if ISA bits are empty. */ + aprop->pr_kind = property_remove; + updated = TRUE; + } + } + else + { + /* Return TRUE if APROP is NULL and ISA bits of BPROP + aren't empty to indicate that BPROP should be added + to ABFD. */ + updated = bprop->u.number != 0; + } } break; |