Hello,I try to add a script '-Wl,--mgen-symbol-ld-script=export.txt' in "optins for target"/"linker"/"misc controls". After build, when linking it shows
error: L3900U: Unrecognized option '-Wl,--mgen-symbol-ld-script=export.txt'.
Any idea how to fix this error?
Hi Kelong
it looks like you are using Keil MDK so you may get a higher qualith answer in that forum.
My guess from the error message is that the string in that box is passed to armlink so needs to be valid armlink options. -Wl, is not an armlink option, it is an armclang option to prefix other options that you want to pass to the linker when invoking it from the compiler driver (including when compiling and linking in one step.) So I would forst remove the -Wl, prefix.
You then need to check in your manual whether mgen-symbol-ld-script=export.txt is also a valid armlink option. It looks wrong to me, I think armlink doesn’t support GNU linker scripts. I am guessing you might be looking for the —symdefs option given that you pass a scatter file in the below box. But my knowledge of armlink’s commandline is out of date so you are better off asking in the Keil forum.
Hope that is helpful
Rich
Hi Rich
Thanks for your quick answer,it's very helpful to me.
You are right, I'm trying to use scatter file in keil. It seems I couldn't change the scatter file in project setting,it's grey as pitcture shows.
Any suggestion to enable it?
Glad I could help just a little.
I think you will need to go to the Keil forum for the answer to that one!
I can see that you are passing a scatter file already in the "user control string" box below (see --scatter option) so perhaps MDK won't let you also add one with the "Scatter file" box? That is a guess though, best to seek expert advice.
Ta
You are right!
If I disable "Use Memory Layout from Target Dialog", I could add othes with the "Scatter file"box.
Thanks very much,