mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] ld-wrapper mislinks at91bootstrap
@ 2017-11-06 18:58 Ladislav Michl
  2017-11-07  7:11 ` Ladislav Michl
  0 siblings, 1 reply; 4+ messages in thread
From: Ladislav Michl @ 2017-11-06 18:58 UTC (permalink / raw)
  To: ptxdist

Hi there,

I just added new platform (at91) to my BSP and configured at91bootstrap
v3.8.9.

Problem is that PTXDist-2017.10 produces way too large binary:
2099622 at91sam9260ek-dataflashboot-barebox-3.8.9.bin
while correct size is:
   2470 at91sam9260ek-dataflashboot-barebox-3.8.9.bin

Problem turned out to be ld-wrapper script or something it calls.
Just replacing ld-wrapper in ptxdist-2017.10.0/scripts/wrapper to point
directly to arm-v5te-linux-gnueabi-ld is enough to solve problem.
Does anyone clue where to look? Call path is:
sysroot-host/lib/wrapper in $PATH where
arm-v5te-linux-gnueabi-ld -> ptxdist-2017.10.0/scripts/wrapper/ld-wrapper

Thank you,
	ladis

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] ld-wrapper mislinks at91bootstrap
  2017-11-06 18:58 [ptxdist] ld-wrapper mislinks at91bootstrap Ladislav Michl
@ 2017-11-07  7:11 ` Ladislav Michl
  2017-11-07  7:26   ` Ladislav Michl
  0 siblings, 1 reply; 4+ messages in thread
From: Ladislav Michl @ 2017-11-07  7:11 UTC (permalink / raw)
  To: ptxdist

On Mon, Nov 06, 2017 at 07:58:58PM +0100, Ladislav Michl wrote:
> Hi there,
> 
> I just added new platform (at91) to my BSP and configured at91bootstrap
> v3.8.9.
> 
> Problem is that PTXDist-2017.10 produces way too large binary:
> 2099622 at91sam9260ek-dataflashboot-barebox-3.8.9.bin
> while correct size is:
>    2470 at91sam9260ek-dataflashboot-barebox-3.8.9.bin
> 
> Problem turned out to be ld-wrapper script or something it calls.
> Just replacing ld-wrapper in ptxdist-2017.10.0/scripts/wrapper to point
> directly to arm-v5te-linux-gnueabi-ld is enough to solve problem.
> Does anyone clue where to look? Call path is:
> sysroot-host/lib/wrapper in $PATH where
> arm-v5te-linux-gnueabi-ld -> ptxdist-2017.10.0/scripts/wrapper/ld-wrapper

So, ld-wrapper is adding:
--- at91sam9260ek-dataflashboot-barebox-3.8.9.map	2017-11-07 07:50:28.819011233 +0100
+++ at91sam9260ek-dataflashboot-barebox-3.8.9.map	2017-11-07 07:47:48.605530524 +0100
@@ -155,6 +155,11 @@
 
                 0x0000000000000000                . = ALIGN (0x4)
 
+.note.gnu.build-id
+                0x0000000000000000       0x24
+ .note.gnu.build-id
+                0x0000000000000000       0x24 linker stubs
+
 .text           0x0000000000200000      0x1a0
                 0x0000000000200000                _stext = .
  *(.text)

Modifying at91bootstrap's Makefile to do --remove-section=.note.gnu.build-id
fixes it.

Are there other options to fix this?

	ladis

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] ld-wrapper mislinks at91bootstrap
  2017-11-07  7:11 ` Ladislav Michl
@ 2017-11-07  7:26   ` Ladislav Michl
  2017-11-07  8:37     ` Michael Olbrich
  0 siblings, 1 reply; 4+ messages in thread
From: Ladislav Michl @ 2017-11-07  7:26 UTC (permalink / raw)
  To: ptxdist

On Tue, Nov 07, 2017 at 08:11:17AM +0100, Ladislav Michl wrote:
> On Mon, Nov 06, 2017 at 07:58:58PM +0100, Ladislav Michl wrote:
> > Hi there,
> > 
> > I just added new platform (at91) to my BSP and configured at91bootstrap
> > v3.8.9.
> > 
> > Problem is that PTXDist-2017.10 produces way too large binary:
> > 2099622 at91sam9260ek-dataflashboot-barebox-3.8.9.bin
> > while correct size is:
> >    2470 at91sam9260ek-dataflashboot-barebox-3.8.9.bin
> > 
> > Problem turned out to be ld-wrapper script or something it calls.
> > Just replacing ld-wrapper in ptxdist-2017.10.0/scripts/wrapper to point
> > directly to arm-v5te-linux-gnueabi-ld is enough to solve problem.
> > Does anyone clue where to look? Call path is:
> > sysroot-host/lib/wrapper in $PATH where
> > arm-v5te-linux-gnueabi-ld -> ptxdist-2017.10.0/scripts/wrapper/ld-wrapper
> 
> So, ld-wrapper is adding:
> --- at91sam9260ek-dataflashboot-barebox-3.8.9.map	2017-11-07 07:50:28.819011233 +0100
> +++ at91sam9260ek-dataflashboot-barebox-3.8.9.map	2017-11-07 07:47:48.605530524 +0100
> @@ -155,6 +155,11 @@
>  
>                  0x0000000000000000                . = ALIGN (0x4)
>  
> +.note.gnu.build-id
> +                0x0000000000000000       0x24
> + .note.gnu.build-id
> +                0x0000000000000000       0x24 linker stubs
> +
>  .text           0x0000000000200000      0x1a0
>                  0x0000000000200000                _stext = .
>   *(.text)
> 
> Modifying at91bootstrap's Makefile to do --remove-section=.note.gnu.build-id
> fixes it.
> 
> Are there other options to fix this?

Well, I'll fix upstream the same way kernel handles this.
Kernel is always right: https://lkml.org/lkml/2011/12/15/162
Another option is to use u-boot way, ie. nicely align a embed
this section into binary, but as every byte matters here, lets
not do this.

	ladis

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] ld-wrapper mislinks at91bootstrap
  2017-11-07  7:26   ` Ladislav Michl
@ 2017-11-07  8:37     ` Michael Olbrich
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Olbrich @ 2017-11-07  8:37 UTC (permalink / raw)
  To: ptxdist

On Tue, Nov 07, 2017 at 08:26:17AM +0100, Ladislav Michl wrote:
> On Tue, Nov 07, 2017 at 08:11:17AM +0100, Ladislav Michl wrote:
> > On Mon, Nov 06, 2017 at 07:58:58PM +0100, Ladislav Michl wrote:
> > > Hi there,
> > > 
> > > I just added new platform (at91) to my BSP and configured at91bootstrap
> > > v3.8.9.
> > > 
> > > Problem is that PTXDist-2017.10 produces way too large binary:
> > > 2099622 at91sam9260ek-dataflashboot-barebox-3.8.9.bin
> > > while correct size is:
> > >    2470 at91sam9260ek-dataflashboot-barebox-3.8.9.bin
> > > 
> > > Problem turned out to be ld-wrapper script or something it calls.
> > > Just replacing ld-wrapper in ptxdist-2017.10.0/scripts/wrapper to point
> > > directly to arm-v5te-linux-gnueabi-ld is enough to solve problem.
> > > Does anyone clue where to look? Call path is:
> > > sysroot-host/lib/wrapper in $PATH where
> > > arm-v5te-linux-gnueabi-ld -> ptxdist-2017.10.0/scripts/wrapper/ld-wrapper
> > 
> > So, ld-wrapper is adding:
> > --- at91sam9260ek-dataflashboot-barebox-3.8.9.map	2017-11-07 07:50:28.819011233 +0100
> > +++ at91sam9260ek-dataflashboot-barebox-3.8.9.map	2017-11-07 07:47:48.605530524 +0100
> > @@ -155,6 +155,11 @@
> >  
> >                  0x0000000000000000                . = ALIGN (0x4)
> >  
> > +.note.gnu.build-id
> > +                0x0000000000000000       0x24
> > + .note.gnu.build-id
> > +                0x0000000000000000       0x24 linker stubs
> > +
> >  .text           0x0000000000200000      0x1a0
> >                  0x0000000000200000                _stext = .
> >   *(.text)
> > 
> > Modifying at91bootstrap's Makefile to do --remove-section=.note.gnu.build-id
> > fixes it.
> > 
> > Are there other options to fix this?
> 
> Well, I'll fix upstream the same way kernel handles this.
> Kernel is always right: https://lkml.org/lkml/2011/12/15/162
> Another option is to use u-boot way, ie. nicely align a embed
> this section into binary, but as every byte matters here, lets
> not do this.

You can also add TARGET_BUILD_ID to <PKG>_WRAPPER_BLACKLIST. We do the same
for the kernel.

Michael

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

end of thread, other threads:[~2017-11-07  8:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-06 18:58 [ptxdist] ld-wrapper mislinks at91bootstrap Ladislav Michl
2017-11-07  7:11 ` Ladislav Michl
2017-11-07  7:26   ` Ladislav Michl
2017-11-07  8:37     ` Michael Olbrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox