[Tinyos-devel] fix for tos-set-symbols to support more recent
linkers
Robert Schiele
rschiele at gmail.com
Fri Jan 12 10:29:06 PST 2007
Hi there!
Could someone please commit the following patch to make tos-set-symbols
support binaries linked with more recent versions of GNU ld (>= 2.17)? As an
alternative I could do it myself if you give SourceForge user "schiele" access
to the repository.
Index: tos-set-symbols.in
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tools/tinyos/misc/tos-set-symbols.in,v
retrieving revision 1.2
diff -u -r1.2 tos-set-symbols.in
--- tos-set-symbols.in 12 Jul 2006 17:00:51 -0000 1.2
+++ tos-set-symbols.in 12 Jan 2007 18:04:14 -0000
@@ -78,8 +78,6 @@
}
}
close(SECTS);
-die "Could not find data section in $exein, aborting.\n"
- unless defined $segment_vma && defined $segment_lma && defined $segment_off;
# build a hash of all data segment symbols to their address and size
my %exe_symbols = ();
@@ -110,6 +108,8 @@
if( defined $exe_symbols{$symbol} ) {
+ die "Could not find data section in $exein, aborting.\n"
+ unless defined $segment_vma && defined $segment_off;
my $addr = $exe_symbols{$symbol}->{addr};
my $size = $exe_symbols{$symbol}->{size};
my $filepos = $segment_off + ($addr - $segment_vma);
@@ -137,6 +137,8 @@
for my $symbol (sort keys %user_symbols) {
my $value = $user_symbols{$symbol};
if( defined $exe_symbols{$symbol} ) {
+ die "Could not find data section in $exein, aborting.\n"
+ unless defined $segment_vma && defined $segment_off;
my $addr = $exe_symbols{$symbol}->{addr};
my $size = $exe_symbols{$symbol}->{size};
my $filepos = $segment_off + ($addr - $segment_vma);
Explanation: Recent GNU lds strip empty sections from the binary. Thus an
application that does not have global variables with an initial value no
longer have a .data section although the binary is completely sane. Thus one
cannot install this binaries on the node because tos-set-symbols refuses to
work on them. The listed patch does fix this problem by moving the check for
the presence of the data section to the places where we actually need it.
With this patch installed we can use latest GNU ld with TinyOS again.
Robert
--
Robert Schiele
Dipl.-Wirtsch.informatiker mailto:rschiele at gmail.com
"Quidquid latine dictum sit, altum sonatur."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.millennium.berkeley.edu/pipermail/tinyos-devel/attachments/20070112/8c395d10/attachment.pgp
More information about the Tinyos-devel
mailing list