We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello-
I am using uVision version 4.72.1 with version 5.03.0.76 of the compile & link tools.
I am working with a set of 5 files (3 source and 2 header files) that compile and link with zero errors and warnings. However, if I copy these files into a new folder and make a brand new project in that same folder, I now get two link errors when attempting to build the project:
.\Semaphores.axf: Warning: L6305W: Image does not have an entry point. (Not specified or not set due to multiple choices.)
.\Semaphores.sct(8): warning: L6314W: No section matches pattern *(InRoot$$Sections).
When I make a new project, all I do is select the processor and set the debugger to use the Ulink-ME instead of the simulator. Everything else is left at the default settings, so you can understand my confusion as to why my files work in project A but not project B.
I've already read this article as regards to warning L6305W:
ARM Information Center
This basically says that the `-entry 0xXXXXX` command must be used to identify an entry point if the ENTRY keyword is not used to specify it. It also goes on to say that __main counts as an entry point, which of course my code includes, and as it is I've never had to worry about this stuff before when making other projects. I did not read the ARM article on warning L6314W, however, additional searches for `L6305W` turn up this article:
This article discusses how to suppress warnings. I find it highly suspicious that the warnings they explicitly use in this article are both L6305W and L6314W- it's almost as if ARM is aware that these may randomly appear as warnings due to some bug and you are going to want to suppress them. Is this the case, or is there some other knowable reason that these things pop up as warnings which will allow me to modify my code to prevent them? As my title says, I would prefer to solve the actual problem (if any) rather than suppress the warnings.
You get this message either when there is no entry point in your code OR there are multiple entry points in your code.
In the second case (multiple entry points specific) the --entry flag tells the linker which one to use for the image.
For some background, an "entry point" is a place where execution can start (or "enter") without there being a call from somewhere else in the code. Typical examples are the vector table in ARMv7-A/R, or reset handlers. These points are important to the linker when looking for redundant functions (i.e. does anything call this function).
A linked image also an entry point. This is where the debugger will set the PC to when you load the image.
The problem is that I should not be seeing this message at all. Since my files contain __main, I have one and only one valid entry point for the system as I am not using the ENTRY flag or the --entry command for the linker.
A quick summary of the issue:
After spending some time comparing projects that work vs projects that don't work, I've discovered that in a correctly working project, the `Linker Control String` (which can be viewed under the Project Options->Linker tab) is completely different than the one that is generated when I get the warnings. In the correct string, the -entry command is being used to point to the Reset_Handler function found in the auto-generated startup_TM4C123.s file. In the incorrect string, the -entry tag is omitted so I end up with the L6305W warning, and the -scatter command is added which auto-generates a scatter file that gives the L6314W warning.
The problem here is that the linker control string is not something that can be edited, it gets generated from other settings somewhere in the interface. It is not clear to me what needs to be changed in order to get the correct string once I see that it is incorrect. It also remains a mystery why this string is ever incorrect in the first place when I follow the *exact same* project creation steps every time I make a project and accept all the default values.
There is also another separate bug in this Linker tab: if I have a `good` control string and check the `Use Memory Layout from Target Dialog` box, the string will be altered to `bad` settings, but if I then uncheck the box, the string remains as the `bad` version and does not get reset to the `good` version.