This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Possible bug; code-block vanishes when adding one assembler-instruction.


On Thu, 09 May 2013 10:53:59 +0100, Richard Sandiford wrote:
>> As I understand it, -d disassembles all the executable sections, but I
>> can't seem to find out how to mark a section 'executable' either.
> 
> Using:
> 
> 	.section .fastcode, "ax", @progbits
> 
> rather than:
> 
> 	.section .fastcode
> 
> ought to do the trick.

Hmm.. I get an error, when I try to build the code with...
	.section .fastcode, "ax", @progbits
...It doesn't like the extra parameters:

arm-none-eabi-gcc  -mcpu=cortex-m3 -mthumb -x assembler-with-cpp -I./src/ -I"../lpc175x_6x/Core/Device/NXP/LPC17xx/Include/" -I"../lpc175x_6x/Core/CMSIS/Include/" -I"../lpc175x_6x/Drivers/include/" -I. -D__BUILD_WITH_EXAMPLE__=1 -c src/fastcode.S -o src/fastcode.o
src/fastcode.S: Assembler messages:
src/fastcode.S:3: Error: junk at end of line, first unrecognized character is `,'
make: *** [src/fastcode.o] Error 1

>> -I've also included the .map, the .dis and the .bin files, just in case
>> they can provide additional information.
>> I just made a .diff on the .dis files; it seems that the label of the
>> interrupt routine differs.
>> In one file, it's named _edata, in the other, it's named _sfastcode.
>> -So after all, there might be a difference in the .elf file too...
>> 
>> Fastcode-test1.dis:
>> Disassembly of section .fastcode:
>> 
>> 10000000 <_edata>:
>> 10000000:	6001      	str	r1, [r0, #0]
>> 10000002:	f241 2034 	movw	r0, #4660	; 0x1234
>> 10000006:	f2c5 6078 	movt	r0, #22136	; 0x5678
>> 1000000a:	4770      	bx	lr
>> 
>> Fastcode-test2.dis:
>> Disassembly of section .fastcode:
>> 
>> 10000000 <_sfastcode>:
>> 10000000:	f241 2034 	movw	r0, #4660	; 0x1234
>> 10000004:	f2c5 6078 	movt	r0, #22136	; 0x5678
>> 10000008:	4770      	bx	lr
>> 	...
>> 
>> ...It may just be a side-effect, though.

New information:
I sat back and started thinking... The reason I started looking into this, was because I was flashing the microcontroller with an .ELF file.
As I did not get the results I expected, I started dumping the contents of RAM on my LEDs. I got only 0xffff-instructions, which meant that the code was not there.
Notice: I use the .elf for flashing, not the .hex-file.
This again suggests that the problem is with the .elf file.
-So objcopy may behave correctly after all; although my code is being stripped away.

> Thanks, I'll take a look (might not be till the weekend).

I'm grateful that you're looking into it. :)


Love
Jens


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]