Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: [lpc2000] Re: Problems with sting constants and gcc -On

2005-10-18 by Tom Walsh

Guillermo Prandi wrote:

>I too gave a suspicious look at the startup code. But the thing is, 
>in order to copy the modifiable data to RAM it must be in the ROM in 
>the first place! It doesn't show in the lst file, whilst puts() 
>parameters do.
>
>I tried giving a const to the function's declaration, with no luck. 
>However, I narrowed down the problem to auto-inlining: if I move the 
>do_something() function to another source (I was testing with an 
>empty body on the function!), the strings do show in the .data. This 
>kinda makes sense, since the compiler realized that there was no 
>point for that constant to be in the code in the first place. What do 
>not makes much sense (but works well somehow) is:
>
>  
>

Well, there is always objdump: 'arm-elf-objdump -d -S -x -s <filename>.o'

BTW, objdump not only works for object files but it also works quite 
nicely on elf files as well so you can see what your linker + ld script 
was up to...

That'll get you started, then 'man nm' and 'man objdump', pretty 
powerfull tools to drill down inside various file formats.  Also, by 
using them, you can get a good education on just what it is that your 
compiler does and where it is deciding to put things (which Sections).

TomW


-- 
Tom Walsh - WN3L - Embedded Systems Consultant
http://openhardware.net, http://cyberiansoftware.com
"Windows? No thanks, I have work to do..."
----------------------------------------------------

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.