summaryrefslogtreecommitdiff
path: root/wscript
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2012-11-17 17:34:33 +1100
committerChris Johns <chrisj@rtems.org>2012-11-17 17:34:33 +1100
commit7ee957ca2f579802b4823ad562f05bd27ad425e1 (patch)
tree5f085ca653f2d80496e984b978b556b561127064 /wscript
parentd68833ada79a4255e95017b44f73dcb21c7a7701 (diff)
Refactor the ELF support to allow ELF write suppport.
The refactoring allows better reuse of the ELF support and cleans up some hacks from the generic file and archive handling improving the separation of the file handling from the file format, ie ELF. The handling of ELF object files and ELF object files inside archives is cleaner. The refactor cleaned up the symbol handling where the symbols now reside in the ELF file object and references are take in symbol pointer containers and symbol table containers. The main purpose of the refactor is to allow support for creating and writing ELF files. Also added an rtems-syms command where special symbol support can be added.
Diffstat (limited to 'wscript')
-rw-r--r--wscript38
1 files changed, 27 insertions, 11 deletions
diff --git a/wscript b/wscript
index 3a993d5..4649c7f 100644
--- a/wscript
+++ b/wscript
@@ -60,7 +60,7 @@ def build(bld):
# Build flags.
#
bld.warningflags = ['-Wall', '-Wextra', '-pedantic']
- bld.optflags = ['-O2']
+ bld.optflags = [] #['-O2']
bld.cflags = ['-pipe', '-g'] + bld.optflags
bld.cxxflags = ['-pipe', '-g'] + bld.optflags
bld.linkflags = ['-g']
@@ -79,19 +79,35 @@ def build(bld):
modules = ['fastlz', 'elf', 'iberty']
#
+ # RLD source.
+ #
+ rld_source = ['rld-elf.cpp',
+ 'rld-files.cpp',
+ 'rld-cc.cpp',
+ 'rld-outputter.cpp',
+ 'rld-process.cpp',
+ 'rld-resolver.cpp',
+ 'rld-symbols.cpp',
+ 'rld.cpp']
+
+ #
# Build the linker.
#
bld.program(target = 'rtems-ld',
- source = ['main.cpp',
- 'pkgconfig.cpp',
- 'rld-elf.cpp',
- 'rld-files.cpp',
- 'rld-cc.cpp',
- 'rld-outputter.cpp',
- 'rld-process.cpp',
- 'rld-resolver.cpp',
- 'rld-symbols.cpp',
- 'rld.cpp'],
+ source = ['rtems-ld.cpp',
+ 'pkgconfig.cpp'] + rld_source,
+ defines = ['HAVE_CONFIG_H=1', 'RTEMS_VERSION=' + bld.env.RTEMS_VERSION],
+ includes = ['.'] + bld.includes,
+ cflags = bld.cflags + bld.warningflags,
+ cxxflags = bld.cxxflags + bld.warningflags,
+ linkflags = bld.linkflags,
+ use = modules)
+
+ #
+ # Build the symbols.
+ #
+ bld.program(target = 'rtems-syms',
+ source = ['rtems-syms.cpp'] + rld_source,
defines = ['HAVE_CONFIG_H=1', 'RTEMS_VERSION=' + bld.env.RTEMS_VERSION],
includes = ['.'] + bld.includes,
cflags = bld.cflags + bld.warningflags,