All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] recent tools on FreeBSD
@ 2015-02-04 19:37 Jeroen Hofstee
  2015-02-05  3:34 ` Simon Glass
  2015-02-05 12:27 ` Guilherme Maciel Ferreira
  0 siblings, 2 replies; 26+ messages in thread
From: Jeroen Hofstee @ 2015-02-04 19:37 UTC (permalink / raw)
  To: u-boot

Hello Guilherme / Simon,

It seems that commit f86ed6a8d52c99bb2d17d3cac1647edca0c4399c,
"tools: moved code common to all image tools to a separated module."

cause some trouble when building on FreeBSD.

/usr/bin/ld:./tools/imagetool.lds:24: syntax error
cc: error: linker command failed with exit code 1 (use -v to see invocation)

which is about the last line, /* INSERT BEFORE .data; */

And thereafter about:
/usr/lib/crt1.o: In function `_start':
/usr/src/lib/csu/amd64/crt1.c:(.text+0x90): undefined reference to 
`__preinit_array_start'
/usr/src/lib/csu/amd64/crt1.c:(.text+0x95): undefined reference to 
`__preinit_array_end'
/usr/src/lib/csu/amd64/crt1.c:(.text+0xb1): undefined reference to 
`__preinit_array_start'
/usr/src/lib/csu/amd64/crt1.c:(.text+0xb6): undefined reference to 
`__preinit_array_end'
/usr/src/lib/csu/amd64/crt1.c:(.text+0xd4): undefined reference to 
`__preinit_array_start'
/usr/src/lib/csu/amd64/crt1.c:(.text+0xf9): undefined reference to 
`__init_array_start'
/usr/src/lib/csu/amd64/crt1.c:(.text+0xfe): undefined reference to 
`__init_array_end'
/usr/src/lib/csu/amd64/crt1.c:(.text+0x11a): undefined reference to 
`__init_array_start'
/usr/src/lib/csu/amd64/crt1.c:(.text+0x11f): undefined reference to 
`__init_array_end'
/usr/src/lib/csu/amd64/crt1.c:(.text+0x144): undefined reference to 
`__init_array_start'
/usr/lib/crt1.o: In function `finalizer':
/usr/src/lib/csu/amd64/crt1.c:(.text+0x187): undefined reference to 
`__fini_array_start'
/usr/src/lib/csu/amd64/crt1.c:(.text+0x18c): undefined reference to 
`__fini_array_end'
/usr/src/lib/csu/amd64/crt1.c:(.text+0x1b4): undefined reference to 
`__fini_array_start'
/usr/bin/ld: tools/mkenvimage: hidden symbol `__preinit_array_start' 
isn't defined

Which seems to be about missing sections. The (default) ld on FreeBSD 
branched of from an old version [1],
With below patch [2] things build at least.

Some question about this:
- why do we need linker magic for tools at all? Given that there is no 
custom linker script for tools (or I failed
   to find it), this adds a dependency between the host default linker 
script and the tweaks in imagetool.lds
- what it the INSERT BEFORE .data supposed to do?
- and last but not least, how can we make this work in general
- and really last, how do I test if it works..

With kind regards,
Jeroen

[1]
ld --version
GNU ld 2.17.50 [FreeBSD] 2007-07-03

[2]
diff --git a/tools/imagetool.lds b/tools/imagetool.ldsdiff --git 
a/tools/imagetool.lds b/tools/imagetool.lds
index 7e92b4a..b18eadb 100644
--- a/tools/imagetool.lds
+++ b/tools/imagetool.lds
@@ -19,6 +19,17 @@ SECTIONS
         __u_boot_sandbox_option_end = .;

         __bss_start = .;
+
+       . = ALIGN(32 / 8);
+         PROVIDE (__preinit_array_start = .);
+         .preinit_array     : { *(.preinit_array) }
+         PROVIDE (__preinit_array_end = .);
+         PROVIDE (__init_array_start = .);
+         .init_array     : { *(.init_array) }
+         PROVIDE (__init_array_end = .);
+         PROVIDE (__fini_array_start = .);
+         .fini_array     : { *(.fini_array) }
+         PROVIDE (__fini_array_end = .);
  }

-INSERT BEFORE .data;
+/* INSERT BEFORE .data; */

^ permalink raw reply related	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2015-02-10 15:34 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-04 19:37 [U-Boot] recent tools on FreeBSD Jeroen Hofstee
2015-02-05  3:34 ` Simon Glass
2015-02-05  7:07   ` Jeroen Hofstee
2015-02-05 12:37   ` Guilherme Maciel Ferreira
2015-02-05 12:27 ` Guilherme Maciel Ferreira
2015-02-05 19:51   ` Jeroen Hofstee
2015-02-06  3:05     ` Simon Glass
2015-02-06 19:56       ` Jeroen Hofstee
2015-02-06 20:40         ` Andreas Bießmann
2015-02-06 21:00           ` Simon Glass
2015-02-07 10:04             ` Jeroen Hofstee
2015-02-07 15:10               ` Simon Glass
2015-02-07 16:23                 ` Andreas Bießmann
2015-02-07 16:29                   ` Simon Glass
2015-02-07 17:08                     ` Andreas Bießmann
2015-02-07 17:19                       ` Simon Glass
2015-02-07 21:19                       ` [U-Boot] [RFC PATCH] tools/imagetool: remove linker generated list Andreas Bießmann
2015-02-07 21:38                         ` Jeroen Hofstee
2015-02-08  0:05                         ` Guilherme Maciel Ferreira
2015-02-10 15:01                         ` Simon Glass
2015-02-07 20:17                 ` [U-Boot] recent tools on FreeBSD Jeroen Hofstee
2015-02-07 21:02                   ` Simon Glass
2015-02-08 10:03                     ` Jeroen Hofstee
2015-02-10 14:52                       ` Simon Glass
2015-02-09 23:20                 ` [U-Boot] sandbox " Jeroen Hofstee
2015-02-10 15:34                   ` Simon Glass

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.