diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2021-01-09 06:11:06 -0800 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2021-01-09 06:13:11 -0800 |
commit | 0a94990bf64a82bdf73960fec1b47fef7c6a6ced (patch) | |
tree | 739ccefb6a395a463262da661010b90716fe9ccc /bfd | |
parent | f41464416a1744ca0151d61de1a7e405664dd9b7 (diff) | |
download | gdb-0a94990bf64a82bdf73960fec1b47fef7c6a6ced.zip gdb-0a94990bf64a82bdf73960fec1b47fef7c6a6ced.tar.gz gdb-0a94990bf64a82bdf73960fec1b47fef7c6a6ced.tar.bz2 |
ld/x86-64: Properly Handle -z lam-u48/lam-u57
Properly merge GNU properties for LAM_U48 and LAM_U57.
bfd/
PR ld/27166
* elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Handle
-z lam-u48 and -z lam-u57.
ld/
PR ld/27166
* testsuite/ld-x86-64/lam-u48.rd: New file.
* testsuite/ld-x86-64/lam-u57.rd: Likewise.
* testsuite/ld-x86-64/x86-64.exp: Add PR ld/27166 tests.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 6 | ||||
-rw-r--r-- | bfd/elfxx-x86.c | 16 |
2 files changed, 20 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 560287f..d33445f 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2021-01-09 H.J. Lu <hongjiu.lu@intel.com> + + PR ld/27166 + * elfxx-x86.c (_bfd_x86_elf_merge_gnu_properties): Handle + -z lam-u48 and -z lam-u57. + 2021-01-09 Nick Clifton <nickc@redhat.com> * version.m4: Change to 2.36.50. diff --git a/bfd/elfxx-x86.c b/bfd/elfxx-x86.c index c47f482..3a0dffc 100644 --- a/bfd/elfxx-x86.c +++ b/bfd/elfxx-x86.c @@ -2449,8 +2449,15 @@ _bfd_x86_elf_merge_gnu_properties (struct bfd_link_info *info, features = GNU_PROPERTY_X86_FEATURE_1_IBT; if (htab->params->shstk) features |= GNU_PROPERTY_X86_FEATURE_1_SHSTK; - /* Add GNU_PROPERTY_X86_FEATURE_1_IBT and - GNU_PROPERTY_X86_FEATURE_1_SHSTK. */ + if (htab->params->lam_u48) + features |= (GNU_PROPERTY_X86_FEATURE_1_LAM_U48 + | GNU_PROPERTY_X86_FEATURE_1_LAM_U57); + else if (htab->params->lam_u57) + features |= GNU_PROPERTY_X86_FEATURE_1_LAM_U57; + /* Add GNU_PROPERTY_X86_FEATURE_1_IBT, + GNU_PROPERTY_X86_FEATURE_1_SHSTK, + GNU_PROPERTY_X86_FEATURE_1_LAM_U48 and + GNU_PROPERTY_X86_FEATURE_1_LAM_U57. */ aprop->u.number |= features; } updated = number != (unsigned int) aprop->u.number; @@ -2470,6 +2477,11 @@ _bfd_x86_elf_merge_gnu_properties (struct bfd_link_info *info, features = GNU_PROPERTY_X86_FEATURE_1_IBT; if (htab->params->shstk) features |= GNU_PROPERTY_X86_FEATURE_1_SHSTK; + if (htab->params->lam_u48) + features |= (GNU_PROPERTY_X86_FEATURE_1_LAM_U48 + | GNU_PROPERTY_X86_FEATURE_1_LAM_U57); + else if (htab->params->lam_u57) + features |= GNU_PROPERTY_X86_FEATURE_1_LAM_U57; } if (features) { |