This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Possible bug; code-block vanishes when adding one assembler-instruction.
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: Jens Bauer <jens-lists at gpio dot dk>
- Cc: binutils at sourceware dot org
- Date: Thu, 09 May 2013 10:53:59 +0100
- Subject: Re: Possible bug; code-block vanishes when adding one assembler-instruction.
- References: <20130507122903314912 dot 0457de47 at gpio dot dk> <87sj1xv0bs dot fsf at talisman dot default> <20130508213144132481 dot 9400973e at gpio dot dk> <877gj83448 dot fsf at sandifor-thinkpad dot stglab dot manchester dot uk dot ibm dot com> <20130509113822748942 dot 6df40120 at gpio dot dk>
Jens Bauer <jens-lists@gpio.dk> writes:
>> Normally you'd have a fake "section" like:
>>
>> /DISCARD/ : { *(.stack) }
>>
>> I don't know whether there is something special about .stack on ARM
>> that stops that from working though.
>
> Does this differ from removing the section from the linker script completely ?
Yeah. By default, all input sections are linked, even those not listed
in the linker script. If you omit a section from the linker script,
the linker will try to find a logical place for it, based on things like
section type. /DISCARD/ says you explicitly don't want the section to
be linked.
>>> <http://scratch.gpio.dk/Fcode-Test.zip>
>>
>> I'm afraid I don't have a full EABI toolchain to hand. Could you upload
>> the .elf and .hex files? That ought to be enough to see what objcopy
>> is doing.
>
> Definitely, here they are:
>
> <http://scratch.gpio.dk/Fcode-test-results.zip>
>
> -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.
Thanks, I'll take a look (might not be till the weekend).
Richard