[AIX][Driver] Implement -mxcoff-build-id option
authorWael Yehia <wyehia@ca.ibm.com>
Tue, 28 Feb 2023 04:26:52 +0000 (23:26 -0500)
committerWael Yehia <wyehia@ca.ibm.com>
Mon, 27 Mar 2023 15:36:41 +0000 (15:36 +0000)
commitda92f2fb33c4e5fc570a51b0615e3d30a5b0bf8f
tree7442969961204f1da81541ea447fb5b72b2f8e76
parent88383f18f3a693f9ea02733c680a32961e038b1e
[AIX][Driver] Implement -mxcoff-build-id option

The -mxcoff-build-id=0xHEXSTRING option is an alternative to the
--build-id=0xHEXSTRING linker option that is not currently available in
the AIX linker.

If HEXSTRING is an odd number of hex digits then a '0' character is prepended.
The characters ':' and '-' are not allowed (unlike the GNU linker option).
The given build-id will be saved in the string table of the loader section.

A subsequent commit will teach the profile runtime to read and use the embedded id.

Reviewed By: daltenty, qiongsiwu1, stephenpeckham

Differential Revision: https://reviews.llvm.org/D146431
clang/include/clang/Driver/Options.td
clang/lib/Driver/ToolChains/AIX.cpp
clang/test/Driver/xcoff-build-id.c [new file with mode: 0644]