Fixed few issues with loader and basic image loading.

Declaring section of the form:

.align 4
.section "kernel"
.incbin "path-to-kernel"

And defining a linker variable before the section output does not always seem to work.
The linker seems to add padding even though .align directive comes before .section

	modified:   SConstruct.loader
	modified:   loader/linker.lds
	modified:   loader/main.c
This commit is contained in:
Bahadir Balban
2009-09-17 19:19:03 +03:00
parent 6a654a9dc5
commit 6538e70b39
3 changed files with 28 additions and 7 deletions

View File

@@ -33,7 +33,8 @@ env = Environment(CC = 'arm-none-eabi-gcc',
ASFLAGS = ['-D__ASSEMBLY__'],
PROGSUFFIX = '.elf',
ENV = {'PATH' : os.environ['PATH']},
LIBS = ['gcc'],
LIBS = ['gcc', 'elf', 'c-baremetal', 'gcc'],
LIBPATH = [join('build', LIBELF_PATH), join('build', LIBC_PATH)],
CPPPATH = ['#include', LIBC_INCPATH, LIBELF_INCPATH])
libc = SConscript('loader/libs/c/SConscript', \
@@ -45,4 +46,6 @@ libelf = SConscript('loader/libs/elf/SConscript', exports = { 'env' : env }, \
loader_objs = SConscript('loader/SConscript', exports = { 'env' : env }, \
duplicate = 0, variant_dir = 'build/loader')
env.Program('build/final.elf', [loader_objs + libc + libelf])
env.Program('build/final.elf', [libelf + libc + loader_objs])
Depends(loader_objs, libelf)
Depends(loader_objs, libc)