summaryrefslogtreecommitdiff
path: root/kexec/libfdt/fdt_wip.c
diff options
context:
space:
mode:
authorPingfan Liu <piliu@redhat.com>2022-03-31 13:59:34 +0800
committerSimon Horman <horms@verge.net.au>2022-04-01 15:54:56 +0200
commit2b78a27a64f097dd5d6e051c9a4b8a1b286c9ed0 (patch)
tree44f43d7b805bc338345859a4b2d7820de81956eb /kexec/libfdt/fdt_wip.c
parent1d8273d82b667d168939ba322adb5449d6171704 (diff)
kexec/elf: assign one to align if sh_addralign equals zero
According to ELF specification, if sh_addralign equals zero or one, then the section has no alignment requirement on the start address. (I.e. it can be aligned on 1 byte) Since modern cpu asks the .text, .data, .bss to be aligned on the machine word boundary at least, so in elf_rel_load(), sh_addralign can not be zero, and align = shdr->sh_addralign; ... bufsz = _ALIGN(bufsz, align); will not render a result of 'bufsz = 0'. But it had better have a check on the case of 'sh_addralign == 0' regardless of the assumption of machine word alignment. This patch has no functional change. Signed-off-by: Pingfan Liu <piliu@redhat.com> Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'kexec/libfdt/fdt_wip.c')
0 files changed, 0 insertions, 0 deletions