File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -1403,11 +1403,7 @@ void Writer::assignAddresses() {
1403
1403
1404
1404
// If /FUNCTIONPADMIN is used, functions are padded in order to create a
1405
1405
// hotpatchable image.
1406
- const bool isCodeSection =
1407
- (sec->header.Characteristics & IMAGE_SCN_CNT_CODE) &&
1408
- (sec->header.Characteristics & IMAGE_SCN_MEM_READ) &&
1409
- (sec->header.Characteristics & IMAGE_SCN_MEM_EXECUTE);
1410
- uint32_t padding = isCodeSection ? config->functionPadMin : 0;
1406
+ uint32_t padding = sec->isCodeSection() ? config->functionPadMin : 0;
1411
1407
1412
1408
for (Chunk *c : sec->chunks) {
1413
1409
if (padding && c->isHotPatchable())
Original file line number Diff line number Diff line change @@ -64,6 +64,12 @@ class OutputSection {
64
64
// Used only when the name is longer than 8 bytes.
65
65
void setStringTableOff(uint32_t v) { stringTableOff = v; }
66
66
67
+ bool isCodeSection() const {
68
+ return (header.Characteristics & llvm::COFF::IMAGE_SCN_CNT_CODE) &&
69
+ (header.Characteristics & llvm::COFF::IMAGE_SCN_MEM_READ) &&
70
+ (header.Characteristics & llvm::COFF::IMAGE_SCN_MEM_EXECUTE);
71
+ }
72
+
67
73
// N.B. The section index is one based.
68
74
uint32_t sectionIndex = 0;
69
75
You can’t perform that action at this time.
0 commit comments