[lld][COFF] Restore lto-embed-bitcode and -fembed-bitcode Bitcode Embedding Features (#188398)
Removes the patches introduced by #150897 which broke LTO embed
documented features for creating whole-program-bitcode representations
of executables, used in production analysis/rewriting toolsets. This was
a documented feature available up until 21.1.8 broken by 22.x release.
This previously allowed the users to have a whole-program-bitcode
section `.llvmbc` embedded inside of the final executable.
(cherry picked from commit 1e99c9e4c7)
This commit is contained in:
parent
8fef0fb1a2
commit
dc9d64aad7
2 changed files with 0 additions and 35 deletions
|
|
@ -403,11 +403,6 @@ SectionChunk *ObjFile::readSection(uint32_t sectionNumber,
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
// Those sections are generated by -fembed-bitcode and do not need to be kept
|
||||
// in executable files.
|
||||
if (name == ".llvmbc" || name == ".llvmcmd")
|
||||
return nullptr;
|
||||
|
||||
// Object files may have DWARF debug info or MS CodeView debug info
|
||||
// (or both).
|
||||
//
|
||||
|
|
|
|||
|
|
@ -1,30 +0,0 @@
|
|||
# RUN: yaml2obj %s -o %t.obj
|
||||
# RUN: lld-link /entry:main /subsystem:console /out:%t.exe %t.obj
|
||||
# RUN: llvm-readobj -S %t.exe | FileCheck %s
|
||||
|
||||
# CHECK-NOT: Name: .llvmbc
|
||||
# CHECK-NOT: Name: .llvmcmd
|
||||
|
||||
--- !COFF
|
||||
header:
|
||||
Machine: IMAGE_FILE_MACHINE_AMD64
|
||||
|
||||
sections:
|
||||
- Name: .text
|
||||
Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
|
||||
SectionData: "C3"
|
||||
- Name: .llvmbc
|
||||
Characteristics: [ IMAGE_SCN_MEM_DISCARDABLE ]
|
||||
SectionData: "4243C0DE"
|
||||
- Name: .llvmcmd
|
||||
Characteristics: [ IMAGE_SCN_MEM_DISCARDABLE ]
|
||||
SectionData: "2D63633100"
|
||||
|
||||
symbols:
|
||||
- Name: main
|
||||
Value: 0
|
||||
SectionNumber: 1
|
||||
SimpleType: IMAGE_SYM_TYPE_NULL
|
||||
ComplexType: IMAGE_SYM_DTYPE_FUNCTION
|
||||
StorageClass: IMAGE_SYM_CLASS_EXTERNAL
|
||||
...
|
||||
Loading…
Reference in a new issue