Skip to content

Commit

Permalink
s390: expicitly align _edata and _end symbols on page boundary
Browse files Browse the repository at this point in the history
Symbols _edata and _end in the linker script are the
only unaligned expicitly on page boundary. Although
_end is aligned implicitly by BSS_SECTION macro that
is still inconsistent and could lead to a bug if a tool
or function would assume that _edata is as aligned as
others.

For example, vmem_map_init() function does not align
symbols _etext, _einittext etc. Should these symbols
be unaligned as well, the size of ranges to update
were short on one page.

Instead of fixing every occurrence of this kind in the
code and external tools just force the alignment on
these two symbols.

Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
  • Loading branch information
Alexander Gordeev authored and Heiko Carstens committed Jan 6, 2023
1 parent 0d4d523 commit 45d619b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/s390/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
@@ -79,6 +79,7 @@ SECTIONS
_end_amode31_refs = .;
}

. = ALIGN(PAGE_SIZE);
_edata = .; /* End of data section */

/* will be freed after init */
@@ -193,6 +194,7 @@ SECTIONS

BSS_SECTION(PAGE_SIZE, 4 * PAGE_SIZE, PAGE_SIZE)

. = ALIGN(PAGE_SIZE);
_end = . ;

/*

0 comments on commit 45d619b

Please sign in to comment.