Sorry, you need to enable JavaScript to visit this website.

linker script errors

Unsolved
2 posts / 0 new
asmiley's picture
asmiley
Junior(0)
linker script errors

Working in Vivado SDK 2014.2, MicroZed z7010 board:

I've been working on a program that collects data from a device off-board, and writes the data to a SD card. This began as a bare-metal application, which I was able to develop, compile, and test successfully.

Now I am trying to adapt the program to run in the Zynq Linux environment. I created a new Linux Application Project and copied my source files into it. I had to change all my references from xil_print to standard print, but otherwise the code seems entirely portable.

However, I have a recurring build error that I cannot figure out how to fix:

error: required section '.got' not found in the linker script
final link failed: Invalid operation
collect2.exe: error: ld returned 1 exit status
make: *** [hyddrate_comms_linux.elf] Error 1

I've found similar errors to this in the forums, but none of the advise has helped so far:
-checked that .got is actually in the linker source
-cleaned out redundant Software Platform Inferred Flags
-reselected the BSP
-confirmed assembler is arm-xilinx-linux-gnueabi-gcc
-confirmed compiler is arm-xilinx-linux-gnueabi-gcc
-confirmed linker is arm-xilinx-linux-gnueabi-gcc

I've refreshed and cleaned the project after each step as well.

Does anyone have more thoughts on what the issue might be? I am willing to post the source and full console log if that might be useful.

-Adam

hockeyman1972's picture
hockeyman1972
Junior(11)
Build Settings incorrect

Adam,
  This seems like there might be a problem with the way you converted the project from standalone to a Linux application.  I just tried creating a standalone "helloworld" application project, then an empty Linux application project, and I copied the helloworld source file into it.  Once I removed the platform dependencies from standalone, and converted the "print" statement to "printf", it built fine.  I can generate a link map at this point, by opening the build settings, and adding the following to the Miscellaneous linker options:
-Wl,-Map=myMap.txt
This generates the object map in the Debug folder, and when I opened it I could see that indeed the .got section was correctly generated.  If you give this a try and confirm for yourself that the procedure works, it might lead you to a difference in the steps used to port your real application code.
Ron