|
1 | 1 | # |
2 | | -# SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD |
| 2 | +# SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD |
3 | 3 | # SPDX-License-Identifier: Apache-2.0 |
4 | 4 | # |
5 | 5 | import collections |
@@ -83,11 +83,22 @@ def is_significant(self): |
83 | 83 | # |
84 | 84 | # Placement can also be a basis if it has flags |
85 | 85 | # (self.flags) or its basis has flags (self.basis.flags) |
86 | | - return (not self.basis or |
87 | | - self.target != self.basis.target or |
88 | | - (self.flags and not self.basis.flags) or |
89 | | - (not self.flags and self.basis.flags) or |
90 | | - self.force) |
| 86 | + significant = (not self.basis or |
| 87 | + self.target != self.basis.target or |
| 88 | + (self.flags and not self.basis.flags) or |
| 89 | + (not self.flags and self.basis.flags) or |
| 90 | + self.force) |
| 91 | + |
| 92 | + if significant and not self.explicit and not self.sections: |
| 93 | + # The placement is significant, but it is an intermediate placement |
| 94 | + # for an expanded object with no input sections. In this situation, |
| 95 | + # report the placement as not significant, so its command is not |
| 96 | + # emitted in the linker script. Otherwise, only the entity without |
| 97 | + # input sections would be emitted, and the linker would include |
| 98 | + # all input sections that have not yet been mapped. |
| 99 | + significant = False |
| 100 | + |
| 101 | + return significant |
91 | 102 |
|
92 | 103 | def force_significant(self): |
93 | 104 | if not self.is_significant(): |
|
0 commit comments