All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeroen Hofstee <jeroen@myspectrum.nl>
To: u-boot@lists.denx.de
Subject: [U-Boot] recent tools on FreeBSD
Date: Wed, 04 Feb 2015 20:37:37 +0100	[thread overview]
Message-ID: <54D27501.7040304@myspectrum.nl> (raw)

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; */

             reply	other threads:[~2015-02-04 19:37 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-04 19:37 Jeroen Hofstee [this message]
2015-02-05  3:34 ` [U-Boot] recent tools on FreeBSD 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54D27501.7040304@myspectrum.nl \
    --to=jeroen@myspectrum.nl \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.