Skip to content

Commit

Permalink
s390/boot: fix compiler error due to missing awk strtonum
Browse files Browse the repository at this point in the history
The strtonum awk function is a GNU extension and is not available with
all versions of awk. The link of bzImage fails with this error message:

>> awk: line 2: function or never defined
>> awk: line 2: function strtonum never defined
   objcopy: --pad-to: bad number: arch/s390/boot/compressed/vmlinux

Drop the awk script and the --pad-to objcopy parameter it generated and
use a FILL pattern with an appropriate alignment in the linker script
for the arch/s390/boot/compressed/vmlinux file.

Fixes: f678068 ("s390/boot: pad bzImage to 4K")
Reported-by: kbuild test robot <lkp@intel.com>
Suggested-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Martin Schwidefsky committed May 7, 2019
1 parent 71ae5fc commit 8db16d1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 0 additions & 1 deletion arch/s390/boot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ define cmd_section_cmp
touch $@
endef

OBJCOPYFLAGS_bzImage := --pad-to $$(readelf -s $(obj)/compressed/vmlinux | awk '/\<_end\>/ {print or(strtonum("0x"$$2),4095)+1}')
$(obj)/bzImage: $(obj)/compressed/vmlinux $(obj)/section_cmp.boot.data $(obj)/section_cmp.boot.preserved.data FORCE
$(call if_changed,objcopy)

Expand Down
2 changes: 2 additions & 0 deletions arch/s390/boot/compressed/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ SECTIONS
_compressed_start = .;
*(.vmlinux.bin.compressed)
_compressed_end = .;
FILL(0xff);
. = ALIGN(4096);
}
. = ALIGN(256);
.bss : {
Expand Down

0 comments on commit 8db16d1

Please sign in to comment.