UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
4,392 Views
Registered: ‎04-23-2013

Linux Kernel not removing .note.gnu.build-id section

Hi,

 

I'm trying to get the Linux Kernel to boot from the compact flash of my ML605 board with no joy even though I can with another application that is based on the XilKernel.  I read that the most common reason for this is that the bootloop gets overwritten at 0x00000000.

An objdump of my simpleImage.xilinx shows that the GNU build-id is present at 0x00000000 and is loaded.

martin@ubuntu:~/xsi_workspace/linux-xlnx$ microblazeel-unknown-linux-gnu-objdump -h  arch/microblaze/boot/simpleImage.xilinx

arch/microblaze/boot/simpleImage.xilinx:     file format elf32-microblazeel

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .note.gnu.build-id 00000024  00000000  00000000  00001000  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  1 .text         00335c40  c0000000  c0000000  00002000  2**4
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
....

 

I connected with XMD and confirmed that 0x00000000 contained the .note.gnu.build-id.  I could rst the processor set the PC to 0xC0000000 and run and see that the Kernel would start booting which shows that the ace file I've created should be good.

 

So I rebuilt the kernel with V=1 to see the output at the linker stage and it looks like it should remove this section, here's the build output:

....

make -f scripts/Makefile.build obj=arch/microblaze/boot arch/microblaze/boot/simpleImage.xilinx
  cat vmlinux >arch/microblaze/boot/simpleImage.xilinx.unstrip || (rm -f arch/microblaze/boot/simpleImage.xilinx && echo false)
  microblazeel-unknown-linux-gnu-objcopy -R .note -R .comment -R .note.gnu.build-id -O binary  vmlinux arch/microblaze/boot/simpleImage.xilinx
  /bin/sh /home/martin/xsi_workspace/linux-xlnx/scripts/mkuboot.sh -A microblaze -O linux -C none  -T kernel -a 0xC0000000 -e 0xC0000000 -n 'Linux-3.8.0' -d arch/microblaze/boot/simpleImage.xilinx arch/microblaze/boot/simpleImage.xilinx.ub
....

 

but when I use objdump the .note.gnu.build-id is still present.

Here's the version of my Microblaze objcopy:

GNU objcopy (crosstool-NG 1.14.1) 2.21.53.20110813
Copyright 2011 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.

Does anyone have any idea as to why this is happening? Is there something in the Kernel configuration I have to set? Is there a command I can run to remove the section just to see if this is why I can't boot linux from the CF?

 

Many Thanks,

Martin.

0 Kudos
3 Replies
4,391 Views
Registered: ‎04-23-2013

Re: Linux Kernel not removing .note.gnu.build-id section

BTW the kernel was checkdout using

git clone git://git.xilinx.com/linux-xlnx.git

 

Best Regards,

Martin.

0 Kudos
4,383 Views
Registered: ‎04-23-2013

Re: Linux Kernel not removing .note.gnu.build-id section

UPDATE:

 

The objcopy is removing the section but the following strip command is putting it back in again.

microblazeel-unknown-linux-gnu-strip -K microblaze_start -K _end -K __log_buf -K _fdt_start vmlinux -o simpleImage.xilinx

 

I've manually ran the linking stage again but removing the build-id section again in the strip:

microblazeel-unknown-linux-gnu-strip -R .note.gnu.build-id -K microblaze_start -K _end -K __log_buf -K _fdt_start vmlinux -o simpleImage.xilinx

Although the new elf file doesn't have the offending section it hasn't fixed my problem.

 

Best Regards,

Martin.

0 Kudos
4,356 Views
Registered: ‎04-23-2013

Re: Linux Kernel not removing .note.gnu.build-id section

I connected with XMD and see that linux has loaded and that PC contains the correct start address.

 

XMD% rrd

    r0: 0x00000000      r1: 0x00000000      r2: 0x00000000      r3: 0x00000000 
    r4: 0x00000000      r5: 0x00000000      r6: 0x00000000      r7: 0x00000000 
    r8: 0x00000000      r9: 0x00000000     r10: 0x00000000     r11: 0x0016ad4a 
   r12: 0x00000000     r13: 0x00000000     r14: 0x00000000     r15: 0x00000000 
   r16: 0x00000000     r17: 0x00000000     r18: 0x00000000     r19: 0x00000000 
   r20: 0x00000000     r21: 0x00000000     r22: 0x00000000     r23: 0x00000000 
   r24: 0x00000000     r25: 0x00000000     r26: 0x00000000     r27: 0x00000000 
   r28: 0x00000000     r29: 0x00000000     r30: 0x00000000     r31: 0x00000000 
    pc: 0xc0000000     msr: 0x00000400

 

but for some reason it's not running, so if I type "con" I get.

RUNNING> XMD% External Interrupt, Processor Stopped at 0xc0000000

 

So I reset with "rst", setup the PC manually and then stepped through the code a few times to check it's working and then type "con" and linux boots up ok.

 

Here is how I generated the ace file.

 

xmd -tcl genace.tcl -opt genace-xilinx-lnx.opts

 

where opts file contains

 

-jprog
-hw ./system.bit
-elf ./simpleImage.xilinx
-board ml605
-target mdm
-ace linux.ace

 

Am I missing something?

 

0 Kudos