| 33 | |
| 34 | @dataclass |
| 35 | class Section: |
| 36 | name: str |
| 37 | addr: int |
| 38 | size: int |
| 39 | flags: str |
| 40 | |
| 41 | @property |
| 42 | def end(self) -> int: |
| 43 | return self.addr + self.size |
| 44 | |
| 45 | @property |
| 46 | def is_loadable(self) -> bool: |
| 47 | # Sections that contribute bytes to firmware.bin: PROGBITS with A (alloc) flag |
| 48 | # AND non-zero size. |
| 49 | return "A" in self.flags and self.size > 0 |
| 50 | |
| 51 | |
| 52 | @dataclass |