Previously, object files were bundled using partial linking. It resulted
in the following structure of the bundled objects:
clang-offload-bundle __CLANG_OFFLOAD_BUNDLE__<target> <target_code> <host_code>
But when we tried to unbundle object files, it worked correctly only for
the target objects. The host object remain bundled. It produced a lot of
junk sections in the host object files and in some cases may caused
incorrect linking.
Patch improves bundling of the object files. After this patch the
bundled object looks like this:
clang-offload-bundle __CLANG_OFFLOAD_BUNDLE__<target> <target_code> __CLANG_OFFLOAD_BUNDLE__<host> <host_code>
With this structure we are able to unbundle the host object files too so
that fter unbundling they are the same as were before.