summaryrefslogtreecommitdiffstats
path: root/linkers/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
commit977c3de534bb5cce7935b47138efc2eac8e5ae23 (patch)
tree7a5625763dea69077a70265a41da4f4d6ea7eca6 /linkers/wscript
parentFix spelling. (diff)
downloadrtems-tools-977c3de534bb5cce7935b47138efc2eac8e5ae23.tar.bz2
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 'linkers/wscript')
-rw-r--r--linkers/wscript38
1 files changed, 27 insertions, 11 deletions
diff --git a/linkers/wscript b/linkers/wscript
index 3a993d5..4649c7f 100644
--- a/linkers/wscript
+++ b/linkers/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,