This is the mail archive of the 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.

Jens Bauer <> 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?


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