]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
plat/common: Align TLS sections to PAGE_SIZE
authorSergiu Moga <sergiu@unikraft.io>
Mon, 14 Aug 2023 15:33:25 +0000 (18:33 +0300)
committerUnikraft <monkey@unikraft.io>
Tue, 15 Aug 2023 18:21:41 +0000 (18:21 +0000)
`mkbootinfo.py` takes each ELF segment and aligns it to PAGE_SIZE to
convert it to a `struct ukplat_memregion_desc`. However, this ends up
generating overlapping memregion descriptors in the case of the ELF
segment corresponding to the TLS sections.

To solve this, simply ensure that the TLS sections are already aligned
by PAGE_SIZE.

Signed-off-by: Sergiu Moga <sergiu@unikraft.io>
Reviewed-by: Michalis Pappas <michalis@unikraft.io>
Reviewed-by: Marco Schlumpp <marco@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #1050

plat/common/include/uk/plat/common/common.lds.h

index dae12630dc56101bb9c1c77199f7c357beeadcbd..28dabf021e87fe661b56c90d90fb4cab70b219a0 100644 (file)
        }
 
 #define TLS_SECTIONS                                                   \
-       . = ALIGN(0x20);                                                \
+       . = ALIGN(__PAGE_SIZE);                                         \
        _tls_start = .;                                                 \
        .tdata :                                                        \
        {                                                               \