This is the mail archive of the
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: Wed, 08 May 2013 18:38:31 +0100
- Subject: Re: Possible bug; code-block vanishes when adding one assembler-instruction.
- References: <20130507122903314912 dot 0457de47 at gpio dot dk>
Jens Bauer <firstname.lastname@example.org> writes:
> Now, one interesting thing is that the disassembly looks just fine to
> me, so does the linker map.
> I'm using gcc -x assembler-with-cpp for assembling, and g++ for linking.
> Since the disassembly looks fine and the linker map looks fine and the
> hex file looks wrong, I suspect that it has to do with objcopy.
Probably a daft question, sorry, but do you mean the disassembly of
the linked .elf file rather than the .o file? If so, then I agree
objcopy sounds like the most likely culprit.
Out of interest, do you get the same weirdness if you drop the:
> This is the objcopy part of my Makefile:
> $(PROJECT).hex: $(PROJECT).elf
> $(OBJCOPY) -R .stack -O ihex $(PROJECT).elf $(PROJECT).hex
-R .stack from here? (I realise that might not give a viable executable.
It'd just be interesting to know whether the same weirdness was visible.)
Have you tried using the linker script to discard the sections you don't
need, e.g. via DISCARD?