Message ID | 1406179627-9496-1-git-send-email-judge.packham@gmail.com |
---|---|
State | Accepted |
Delegated to: | Tom Rini |
Headers | show |
Dear Chris Packham, In message <1406179627-9496-1-git-send-email-judge.packham@gmail.com> you wrote: > u-boot.map is generated automatically by the compiler and more > importantly can handle addresses >4GB. ... > > I think it should be possible to change binary_size_check to use > > u-boot.map instead of System.map but would that be OK for all > > architectures? ... > Something like this works for me but maybe there is a way to get nm to handle > addresses >4GB. ... > + map_size=$(shell cat u-boot.map | \ > awk '/_image_copy_start/ {start = $$1} /_image_binary_end/ {end = $$1} END {if (start != "" && end != "") print "ibase=16; " toupper(end) " - " toupper(start)}' \ > + | sed 's/0X//g' \ Do we _really_ need all of this? This looks very much like creaping featurism to me... Best regards, Wolfgang Denk
On Thu, Jul 24, 2014 at 10:31:14AM +0200, Wolfgang Denk wrote: > Dear Chris Packham, > > In message <1406179627-9496-1-git-send-email-judge.packham@gmail.com> you wrote: > > u-boot.map is generated automatically by the compiler and more > > importantly can handle addresses >4GB. > ... > > > I think it should be possible to change binary_size_check to use > > > u-boot.map instead of System.map but would that be OK for all > > > architectures? > ... > > Something like this works for me but maybe there is a way to get nm to handle > > addresses >4GB. > ... > > + map_size=$(shell cat u-boot.map | \ > > awk '/_image_copy_start/ {start = $$1} /_image_binary_end/ {end = $$1} END {if (start != "" && end != "") print "ibase=16; " toupper(end) " - " toupper(start)}' \ > > + | sed 's/0X//g' \ > > > Do we _really_ need all of this? > > This looks very much like creaping featurism to me... So it's a safetey check. The various linker script clean-ups we've been doing have introduced a problem from time to time and binary_check_size gives a sanity check. This just fixes a corner case in the test.
Hi Wolfgang, Tom, On Fri, Jul 25, 2014 at 1:50 AM, Tom Rini <trini@ti.com> wrote: > On Thu, Jul 24, 2014 at 10:31:14AM +0200, Wolfgang Denk wrote: >> Dear Chris Packham, >> >> In message <1406179627-9496-1-git-send-email-judge.packham@gmail.com> you wrote: >> > u-boot.map is generated automatically by the compiler and more >> > importantly can handle addresses >4GB. >> ... >> > > I think it should be possible to change binary_size_check to use >> > > u-boot.map instead of System.map but would that be OK for all >> > > architectures? >> ... >> > Something like this works for me but maybe there is a way to get nm to handle >> > addresses >4GB. >> ... >> > + map_size=$(shell cat u-boot.map | \ >> > awk '/_image_copy_start/ {start = $$1} /_image_binary_end/ {end = $$1} END {if (start != "" && end != "") print "ibase=16; " toupper(end) " - " toupper(start)}' \ >> > + | sed 's/0X//g' \ >> >> >> Do we _really_ need all of this? >> >> This looks very much like creaping featurism to me... Do we need it? Maybe not I'd defer that judgement to you. My problem is binary_size_check is on by default and my particular platform (an out of tree ARM board) fails to build because of it. If there was a way of opting out I'd happily use it. > > So it's a safetey check. The various linker script clean-ups we've been > doing have introduced a problem from time to time and binary_check_size > gives a sanity check. This just fixes a corner case in the test. I wouldn't say this is a corner case. Certainly for the ARM target I'm building it is unusual but I know plenty of powerpc boards would hit the same problem becuase they have a jump instruction at the top of their address space. > > -- > Tom
On Thu, Jul 24, 2014 at 05:27:07PM +1200, Chris Packham wrote: > u-boot.map is generated automatically by the compiler and more > importantly can handle addresses >4GB. Applied to u-boot/master, thanks!
diff --git a/Makefile b/Makefile index b98a80a..3ed02a4 100644 --- a/Makefile +++ b/Makefile @@ -785,14 +785,15 @@ u-boot.hex u-boot.srec: u-boot FORCE OBJCOPYFLAGS_u-boot.bin := -O binary -binary_size_check: u-boot.bin System.map FORCE +binary_size_check: u-boot.bin FORCE @file_size=$(shell wc -c u-boot.bin | awk '{print $$1}') ; \ - map_size=$(shell cat System.map | \ + map_size=$(shell cat u-boot.map | \ awk '/_image_copy_start/ {start = $$1} /_image_binary_end/ {end = $$1} END {if (start != "" && end != "") print "ibase=16; " toupper(end) " - " toupper(start)}' \ + | sed 's/0X//g' \ | bc); \ if [ "" != "$$map_size" ]; then \ if test $$map_size -ne $$file_size; then \ - echo "System.map shows a binary size of $$map_size" >&2 ; \ + echo "u-boot.map shows a binary size of $$map_size" >&2 ; \ echo " but u-boot.bin shows $$file_size" >&2 ; \ exit 1; \ fi \