summaryrefslogtreecommitdiff
path: root/examples/standalone
Commit message (Collapse)AuthorAgeLines
* powerpc: mpc8260: consolidate CONFIG_MPC8260 and CONFIG_8260Masahiro Yamada2014-03-07-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Before this commit, CONFIG_MPC8260 and CONFIG_8260 were used mixed-up. All boards with mpc8260 cpu defined both of them: - CONFIG_MPC8260 was defined in board config headers and include/common.h - CONFIG_8260 was defined arch/powerpc/cpu/mpc8260/config.mk We do not need to have both of them. This commit keeps only CONFIG_MPC8260. This commit does: - Delete CONFIG_8260 and CONFIG_MPC8260 definition in config headers and include/common.h - Rename CONFIG_8260 to CONFIG_MPC8260 in arch/powerpc/cpu/mpc8260/config.mk. - Rename #ifdef CONFIG_8260 to #ifdef CONFIG_MPC8260 Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Wolfgang Denk <wd@denx.de>
* kbuild: improve Kbuild speedMasahiro Yamada2014-03-07-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Kbuild brought about many advantages for us but a significant performance regression was reported by Simon Glass. After some discussions and analysis, it turned out its main cause is in $(call cc-option,...). Historically, U-Boot parses all config.mk (arch/*/config.mk and board/*/config.mk) every time descending into subdirectories. That means cc-options are evaluated over and over again. $(call cc-option,...) is useful but costly. So we want to evaluate them only in ./Makefile and spl/Makefile and export compiler flags. This commit changes the build system as follows: - Modify scripts/Makefile.build to not include config.mk Instead, add $(PLATFORM_CPPFLAGS) to asflags-y, ccflags-y, cppflags-y. - Export many variables Going forward, Kbuild will not parse config.mk files when it descends into subdirectories. If we want to set variables in config.mk and use them in subdirectories, they must be exported. This is the list of variables to get exported: PLATFORM_CPPFLAGS CPUDIR BOARDDIR OBJCOPYFLAGS LDFLAGS LDFLAGS_FINAL (used in nand_spl/board/*/*/Makefile) CONFIG_STANDALONE_LOAD_ADDR (used in examples/standalone/Makefile) SYM_PREFIX (used in examples/standalone/Makefile) RELFLAGS (used in examples/standalone/Makefile) - Delete CPPFLAGS This variable has been replaced with PLATFORM_CPPFLAGS - Copy gcclibdir from example/standalone/Makefile to arch/sparc/config.mk The reference in CONFIG_STANDALONE_LOAD_ADDR must be resolved before it is exported. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Reported-by: Simon Glass <sjg@chromium.org> Acked-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org> [on Sandbox] Tested-by: Stephen Warren <swarren@nvidia.com> [on Tegra]
* kbuild: use shorten logs for misc targetsMasahiro Yamada2014-02-25-14/+11
| | | | Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* kbuild: use shorten logs objcopy rulesMasahiro Yamada2014-02-25-4/+6
| | | | Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* examples: move api/ and standalone/ entry to examples/MakefileMasahiro Yamada2014-02-19-4/+0
| | | | Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* kbuild: use Linux Kernel build scriptsMasahiro Yamada2014-02-19-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | Now we are ready to switch over to real Kbuild. This commit disables temporary scripts: scripts/{Makefile.build.tmp, Makefile.host.tmp} and enables real Kbuild scripts: scripts/{Makefile.build,Makefile.host,Makefile.lib}. This switch is triggered by the line in scripts/Kbuild.include -build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build.tmp obj +build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj We need to adjust some build scripts for U-Boot. But smaller amount of modification is preferable. Additionally, we need to fix compiler flags which are locally added or removed. In Kbuild, it is not allowed to change CFLAGS locally. Instead, ccflags-y, asflags-y, cppflags-y, CFLAGS_$(basetarget).o, CFLAGS_REMOVE_$(basetarget).o are prepared for that purpose. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Tested-by: Gerhard Sittig <gsi@denx.de>
* kbuild: change out-of-tree buildMasahiro Yamada2014-02-19-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit changes the working directory where the build process occurs. Before this commit, build process occurred under the source tree for both in-tree and out-of-tree build. That's why we needed to add $(obj) prefix to all generated files in makefiles like follows: $(obj)u-boot.bin: $(obj)u-boot Here, $(obj) is empty for in-tree build, whereas it points to the output directory for out-of-tree build. And our old build system changes the current working directory with "make -C <sub-dir>" syntax when descending into the sub-directories. On the other hand, Kbuild uses a different idea to handle out-of-tree build and directory descending. The build process of Kbuild always occurs under the output tree. When "O=dir/to/store/output/files" is given, the build system changes the current working directory to that directory and restarts the make. Kbuild uses "make -f $(srctree)/scripts/Makefile.build obj=<sub-dir>" syntax for descending into sub-directories. (We can write it like "make $(obj)=<sub-dir>" with a shorthand.) This means the current working directory is always the top of the output directory. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Tested-by: Gerhard Sittig <gsi@denx.de>
* Makefile: move some flags to examples makefilesMasahiro Yamada2014-02-19-0/+4
| | | | | | | This commit moves some flags which are used under examples/ directory only. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* examples: Use scripts/Makefile.buildMasahiro Yamada2014-02-19-32/+14
| | | | Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* arc: add support for standalone programsAlexey Brodkin2014-02-07-0/+13
| | | | | | | | | Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> Cc: Vineet Gupta <vgupta@synopsys.com> Cc: Francois Bedard <fbedard@synopsys.com> Cc: Wolfgang Denk <wd@denx.de> Cc: Heiko Schocher <hs@denx.de>
* Merge branch 'master' of git://git.denx.de/u-boot-armTom Rini2014-01-10-2/+17
|\ | | | | | | | | | | | | | | | | | | Bringing in the MMC tree means that CONFIG_BOUNCE_BUFFER needed to be added to include/configs/exynos5-dt.h now. Conflicts: include/configs/exynos5250-dt.h Signed-off-by: Tom Rini <trini@ti.com>
| * arm64: core supportDavid Feng2014-01-09-0/+15
| | | | | | | | | | | | | | Relocation code based on a patch by Scott Wood, which is: Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: David Feng <fenghua@phytium.com.cn>
| * ARM: fix the standalone programsJeroen Hofstee2013-12-12-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The standalone programs do not use the api calls, but rely directly on u-boot variable gd->jt for the jump table. Commit fe1378a - "ARM: use r9 for gd" changed the register holding the address of gd, but the assembly code in the standalone examples was not updated accordingly. This broke the programs on ARM relying on the jumptable in the v2013.10 release. This patch unbricks them by using the correct register. Cc: Michal Simek <monstr@monstr.eu> Cc: Albert ARIBAUD <albert.u.boot@aribaud.net> Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
* | Makefile, .gitignore: Cleanup non-existing binariesMasahiro Yamada2013-12-16-1/+0
| | | | | | | | Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* | examples: x86: delete 82559_eepromMasahiro Yamada2013-12-16-362/+0
| | | | | | | | | | | | | | | | | | | | | | | | Commit fea25720 renamed arch/i386 to arch/x86. But it missed to modify examples/standalone/Makefile. Since then, examples/standalone/82559_eeprom has never compiled and nobody has noticed that. After some discussion on ML, we agreed to delete this example. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* | Makefile: Select objects by CONFIG_ rather than $(ARCH) or $(CPU)Masahiro Yamada2013-12-16-13/+13
|/ | | | | | | | | | | | | | | | | Convert like follows: CPU mpc83xx -> CONFIG_MPC83xx CPU mpc85xx -> CONFIG_MPC85xx CPU mpc86xx -> CONFIG_MPC86xx CPU mpc5xxx -> CONFIG_MPC5xxx CPU mpc8xx -> CONFIG_8xx CPU mpc8260 -> CONFIG_8260 CPU ppc4xx -> CONFIG_4xx CPU x86 -> CONFIG_X86 ARCH x86 -> CONFIG_X86 ARCH powerpc -> CONFIG_PPC Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* examples: delete unnecessary CPPFLAGSMasahiro Yamada2013-11-25-2/+0
| | | | Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* examples: remove the remainders of dead boardMasahiro Yamada2013-11-15-217/+1
| | | | | | | | | Commit 309a292e deleted OXC board, but missed to remove the standalone example specific to OXC board. eepro100_eeprom.c has been an orphan file for a long term. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* cosmetic: remove empty lines at the top of fileMasahiro Yamada2013-11-08-1/+0
| | | | Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* Cosmetic: Fix a number of typos, no functional changes.Robert P. J. Day2013-09-20-3/+3
| | | | | | | Fix various misspellings of things like "environment", "kernel", "default" and "volatile", and throw in a couple grammar fixes. Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
* Revert "standalone-examples: support custom GCC lib"Tom Rini2013-09-12-13/+2
| | | | | | | | | | | | After further testing, this patch has two problems. First, examples/standalone/Makefile was already inherting PLATFORM_LIBS from the top-level Makefile so this lead to duplicating the private libgcc. Second, currently the private libgcc has a reference to 'hang' that is not being fulfilled. This reverts commit 4412db46468d5965da736d06f84d13e68a6e0b51. Signed-off-by: Tom Rini <trini@ti.com>
* standalone-examples: support custom GCC libJack Mitchell2013-09-06-2/+13
| | | | | | | Add support for defining the gcc lib in standalone examples as is done in the main u-boot Makefile Signed-off-by: Jack Mitchell <jack.mitchell@dbbroadcast.co.uk>
* Add LGPL-2.1+ SPDX-License-Identifier to source filesWolfgang Denk2013-07-24-28/+4
| | | | Signed-off-by: Wolfgang Denk <wd@denx.de>
* Add GPL-2.0+ SPDX-License-Identifier to source filesWolfgang Denk2013-07-24-218/+13
| | | | | | Signed-off-by: Wolfgang Denk <wd@denx.de> [trini: Fixup common/cmd_io.c] Signed-off-by: Tom Rini <trini@ti.com>
* powerpc: fix 8xx and 82xx type-punning warnings with GCC 4.7Scott Wood2013-06-11-1/+2
| | | | | | | | | | | C99's strict aliasing rules are insane to use in low-level code such as a bootloader, but as Wolfgang has rejected -fno-strict-aliasing in the past, add a union so that 16-bit accesses can be performed. Compile-tested only. Signed-off-by: Scott Wood <scottwood@freescale.com> Acked-by: Wolfgang Denk <wd@denx.de>
* Change stub example to use asm-generic/sections.hSimon Glass2013-03-15-4/+3
| | | | | | | We can use the declarations of __bss_start and _end from this header instead of declaring them locally. Signed-off-by: Simon Glass <sjg@chromium.org>
* ppc: Move dp_alloc_base, dp_alloc_top to arch_global_dataSimon Glass2013-02-04-2/+2
| | | | | | Move these fields into arch_global_data and tidy up. Signed-off-by: Simon Glass <sjg@chromium.org>
* common: Add .u_boot_list into all linker filesMarek Vasut2012-10-22-0/+1
| | | | | | | | | | Add section for the linker-generated lists into all possible linker files, so that everyone can easily use these lists. This is mostly a mechanical adjustment. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Joe Hershberger <joe.hershberger@gmail.com> Cc: Mike Frysinger <vapier@gentoo.org>
* MIPS: add board qemu-mips64 supportZhi-zhou Zhang2012-10-16-0/+59
| | | | | | | | | | | | | Both big-endian and little-endian are tested with below commands: Rom version: (Default, Now we config it as rom version) qemu-system-mips64el -M mips -bios u-boot.bin -cpu MIPS64R2-generic -nographic qemu-system-mips64 -M mips -bios u-boot.bin -cpu MIPS64R2-generic -nographic Ram version: qemu-system-mips64el -M mips -cpu MIPS64R2-generic -kernel u-boot -nographic qemu-system-mips64 -M mips -cpu MIPS64R2-generic -kernel u-boot -nographic Signed-off-by: Zhizhou Zhang <etou.zh@gmail.com> Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
* Examples: Properly append LDFLAGS to LD commandMarek Vasut2012-03-26-1/+1
| | | | | | | | | The LD command in examples/standalone/Makefile ignored platform specific LDFLAGS setup. Pass these LDFLAGS to the command. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Bryan Hundven <bryanhundven@gmail.com> Cc: Michael Schwingen <rincewind@discworld.dascon.de>
* openrisc: Add support for standalone programsStefan Kristiansson2012-01-13-0/+14
| | | | Signed-off-by: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
* Standalone Apps: Standalone apps should need only exports.h.Mike Partington2011-12-06-0/+2
| | | | | | | | | Modify exports.h to remove its dependencies on other files, thus enabling standalone apps to require only exports.h from the U-Boot source tree. This appears to be the intent based on the following note: http://lists.denx.de/pipermail/u-boot/2010-January/067174.html Signed-off-by: Mike Partington <mparting@lexmark.com>
* Reduce build timesWolfgang Denk2011-11-03-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | U-Boot Makefiles contain a number of tests for compiler features etc. which so far are executed again and again. On some architectures (especially ARM) this results in a large number of calls to gcc. This patch makes sure to run such tests only once, thus largely reducing the number of "execve" system calls. Example: number of "execve" system calls for building the "P2020DS" (Power Architecture) and "qong" (ARM) boards, measured as: -> strace -f -e trace=execve -o /tmp/foo ./MAKEALL <board> -> grep execve /tmp/foo | wc -l Before: After: Reduction: ================================== P2020DS 20555 15205 -26% qong 31692 14490 -54% As a result, built times are significantly reduced, typically by 30...50%. Signed-off-by: Wolfgang Denk <wd@denx.de> Cc: Andy Fleming <afleming@gmail.com> Cc: Kumar Gala <galak@kernel.crashing.org> Cc: Albert Aribaud <albert.aribaud@free.fr> cc: Graeme Russ <graeme.russ@gmail.com> cc: Mike Frysinger <vapier@gentoo.org> Tested-by: Graeme Russ <graeme.russ@gmail.com> Tested-by: Matthias Weisser <weisserm@arcor.de> Tested-by: Sanjeev Premi <premi@ti.com> Tested-by: Simon Glass <sjg@chromium.org> Tested-by: Macpaul Lin <macpaul@gmail.com> Acked-by: Mike Frysinger <vapier@gentoo.org>
* nds32: standalone supportMacpaul Lin2011-10-22-1/+85
| | | | | | Add standalone program related support for nds32 architecture. Signed-off-by: Macpaul Lin <macpaul@andestech.com>
* Replace space and tab checks with isblankJason Hobbs2011-10-17-2/+3
| | | | | | | These are various places I found that checked for conditions equivalent to isblank. Signed-off-by: Jason Hobbs <jason.hobbs@calxeda.com>
* Fix a few gcc warnings.Joakim Tjernlund2011-05-12-3/+3
| | | | | | | | | | | | | | | | | | | | | Noticed while building all of mpc8xx. Also constify usage string in timer.c Warnings fixed are: timer.c: In function 'timer': timer.c:189: warning: format not a string literal and no format arguments timer.c:258: warning: format not a string literal and no format arguments atm.c: In function 'atmUnload': atm.c:99: warning: array subscript is above array bounds atm.c: In function 'atmLoad': atm.c:65: warning: array subscript is above array bounds codec.c: In function 'codsp_write_pop_int': codec.c:678: warning: array subscript is above array bounds codec.c: In function 'codsp_write_cop_short': codec.c:585: warning: array subscript is above array bounds codec.c: In function 'codsp_write_sop_int': codec.c:512: warning: array subscript is above array bounds Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
* Fix variable flavor in examples/standalone/MakefileChe-liang Chiou2011-05-12-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GNU Makefile have two flavors of variables, recursively expanded that is defined by using '=', and simply expanded that is defined by using ':='. The bug is caused by using recursively expanded flavor for BIN and SREC. As you can see below, they are prepended by $(obj) twice. We can reproduce this bug with a simplified version of this Makefile: $ cat >Makefile <<\EOF obj := /path/to/obj/ ELF := hello_world BIN_rec = $(addsuffix .bin,$(ELF)) # recursively expanded BIN_sim := $(addsuffix .bin,$(ELF)) # simply expanded ELF := $(addprefix $(obj),$(ELF)) BIN_rec := $(addprefix $(obj),$(BIN_rec)) BIN_sim := $(addprefix $(obj),$(BIN_sim)) show: @echo BIN_rec=$(BIN_rec) @echo BIN_sim=$(BIN_sim) .PHONY: show EOF $ make show BIN_rec=/path/to/obj//path/to/obj/hello_world.bin BIN_sim=/path/to/obj/hello_world.bin Signed-off-by: Che-Liang Chiou <clchiou@chromium.org>
* MIPS: Introduce --gc-sections for MIPSDaniel Schwierzeck2011-05-10-5/+5
| | | | | | | | | | | | All architectures but MIPS are using --gc-sections on final linking. This patch introduces that feature for MIPS to reduce the memory and flash footprint. Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com> Cc: Wolfgang Denk <wd@denx.de> Cc: Stefan Roese <sr@denx.de> Cc: Thomas Lange <thomas@corelatus.se> Cc: Vlad Lungu <vlad.lungu@windriver.com> Signed-off-by: Shinya Kuribayashi <skuribay@pobox.com>
* x86: Rename i386 to x86Graeme Russ2011-04-13-2/+2
| | | | Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
* Make STANDALONE_LOAD_ADDR configurable per boardWolfgang Denk2011-04-12-1/+1
| | | | | | | | | | | | | Rename STANDALONE_LOAD_ADDR into CONFIG_STANDALONE_LOAD_ADDR and allow that the architecture-specific default value gets overwritten by defining the value in the board header file. Signed-off-by: Wolfgang Denk <wd@denx.de> Cc: Mike Frysinger <vapier@gentoo.org> Cc: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp> Cc: Daniel Hellstrom <daniel@gaisler.com> Cc: Tsi Chung Liew <tsi-chung.liew@freescale.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
* Fix build problems caused by "_end" -> "__bss_end__" renameWolfgang Denk2011-03-31-4/+4
| | | | | | | | | | | | | | | | Commit 44c6e65 "rename _end to __bss_end__ broke building of a large number of systems (at least all PowerPC?): libstubs.o: In function `app_startup': examples/standalone/stubs.c:197: undefined reference to `__bss_end__' The rename should not be done for the files in the examples/standalone/ directory, as these are not using the code from start.S, but do their own BSS clearing, and either use their own linker scripts or the ones provided by the compilers. Signed-off-by: Po-Yu Chuang <ratbert@faraday-tech.com> Signed-off-by: Wolfgang Denk <wd@denx.de>
* rename _end to __bss_end__Po-Yu Chuang2011-03-27-4/+4
| | | | | | | Currently, _end is used for end of BSS section. We want _end to mean end of u-boot image, so we rename _end to __bss_end__ first. Signed-off-by: Po-Yu Chuang <ratbert@faraday-tech.com>
* Switch from archive libraries to partial linkingSebastien Carlier2010-11-17-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Before this commit, weak symbols were not overridden by non-weak symbols found in archive libraries when linking with recent versions of binutils. As stated in the System V ABI, "the link editor does not extract archive members to resolve undefined weak symbols". This commit changes all Makefiles to use partial linking (ld -r) instead of creating library archives, which forces all symbols to participate in linking, allowing non-weak symbols to override weak symbols as intended. This approach is also used by Linux, from which the gmake function cmd_link_o_target (defined in config.mk and used in all Makefiles) is inspired. The name of each former library archive is preserved except for extensions which change from ".a" to ".o". This commit updates references accordingly where needed, in particular in some linker scripts. This commit reveals board configurations that exclude some features but include source files that depend these disabled features in the build, resulting in undefined symbols. Known such cases include: - disabling CMD_NET but not CMD_NFS; - enabling CONFIG_OF_LIBFDT but not CONFIG_QE. Signed-off-by: Sebastien Carlier <sebastien.carlier@gmail.com>
* examples/standalone: Use gcc's -fno-toplevel-reorderPeter Tyser2010-10-12-0/+5
| | | | | | | | | | | | | | | | Using -fno-toplevel-reorder causes gcc to not reorder functions. This ensures that an application's entry point will be the first function in the application's source file. This change, along with commit 620bbba524fbaa26971a5004793010b169824f1b should cause a standalone application's entry point to be at the base of the compiled binary. Previously, the entry point could change depending on gcc version and flags. Note -fno-toplevel-reorder is only available in gcc version 4.2 or greater. Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
* MIPS: update the MIPS u-boot.ldsXiangfu Liu2010-09-04-1/+1
| | | | | | | | | | From the document, if set all arguments in "OUTPUT_FORMAT" to "tradbigmips", then even add "-EL" to gcc we still get EB format. pb1x00 is only used in Little-endian, so its default endian should be set to LE. Signed-off-by: Xiangfu Liu <xiangfu@openmobilefree.net> Signed-off-by: Shinya Kuribayashi <skuribay@pobox.com>
* smc91xx_eeprom: Correct chip detection check.Juergen Kilb2010-07-12-1/+1
| | | | | | | | | | | | | | The smc911x_detect function in /net/driver/net/smc911x.c returns a 0 if everything was ok (a chip was found) and -1 else. In the standalone example 'smc911x_eeprom' the return value of smc911x_detect is interpreted in a different way (0 for error, !0 as OK). This leads to the error that the chip will not be detected. Signed-off-by: Juergen Kilb <j.kilb@phytec.de> Acked-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
* Make sure that argv[] argument pointers are not modified.Wolfgang Denk2010-07-04-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The hush shell dynamically allocates (and re-allocates) memory for the argument strings in the "char *argv[]" argument vector passed to commands. Any code that modifies these pointers will cause serious corruption of the malloc data structures and crash U-Boot, so make sure the compiler can check that no such modifications are being done by changing the code into "char * const argv[]". This modification is the result of debugging a strange crash caused after adding a new command, which used the following argument processing code which has been working perfectly fine in all Unix systems since version 6 - but not so in U-Boot: int main (int argc, char **argv) { while (--argc > 0 && **++argv == '-') { /* ====> */ while (*++*argv) { switch (**argv) { case 'd': debug++; break; ... default: usage (); } } } ... } The line marked "====>" will corrupt the malloc data structures and usually cause U-Boot to crash when the next command gets executed by the shell. With the modification, the compiler will prevent this with an error: increment of read-only location '*argv' N.B.: The code above can be trivially rewritten like this: while (--argc > 0 && **++argv == '-') { char *arg = *argv; while (*++arg) { switch (*arg) { ... Signed-off-by: Wolfgang Denk <wd@denx.de> Acked-by: Mike Frysinger <vapier@gentoo.org>
* examples/standalone: Remove relocation compile flags for PowerPCPeter Tyser2010-06-29-0/+10
| | | | | | | | | | | | | | | | | | | | Previously, standalone applications were compiled with gcc flags that produced relocatable executables on the PowerPC architecture (eg with the -mrelocatable and -fPIC flags). There's no reason for these applications to be fully relocatable at this time since no relocation fixups are performed on standalone applications. Additionally, removing the gcc relocation flags results in the entry point of applications residing at the base of the image. When a standalone application was relocatable, the entry point was generally located at an offset into the image which was confusing and prone to errors. This change moves the entry point of PowerPC standalone applications from 0x40004 (usually) to 0x40000. Signed-off-by: Peter Tyser <ptyser@xes-inc.com> Signed-off-by: Wolfgang Denk <wd@denx.de>
* nios: remove nios-32 archThomas Chou2010-05-28-17/+0
| | | | | | The nios-32 arch is obsolete and broken. So it is removed. Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
* nios2: fix r15 issue for gcc4Thomas Chou2010-05-28-3/+3
| | | | | | | | | | The "-ffixed-r15" option doesn't work well for gcc4. Since we don't use gp for small data with option "-G0", we can use gp as global data pointer. This allows compiler to use r15. It is necessary for gcc4 to work properly. Signed-off-by: Thomas Chou <thomas@wytron.com.tw> Signed-off-by: Scott McNutt <smcnutt@psyent.com>