arm-none-eabi-gcc 5.3 and LTO, mixing ARM and Thumb instructions
Gabriel Marcano
gabemarcano@yahoo.com
Wed Jun 1 23:28:00 GMT 2016
My apologies, I forgot to attach the files.
----- Original Message -----
From: Gabriel Marcano <gabemarcano@yahoo.com>
To: "gcc-help@gcc.gnu.org" <gcc-help@gcc.gnu.org>
Sent: Wednesday, June 1, 2016 7:23 PM
Subject: arm-none-eabi-gcc 5.3 and LTO, mixing ARM and Thumb instructions
Could someone help me understand this behavior with LTO? I am working with an
ARM cross compiler, arm-none-eabi. I am trying to make the compiler compile two
separate files in different ARM modes/targets, one of them in ARM, one of them
in Thumb. When I compile the two source files without -flto, one with -mthumb
-thumb-interwork, and the other with the same flags just -marm appended as to
override -mthumb, the resulting binary, when dissasembled with objdump, has code
in both modes, and it is rather aparent. When I enable -flto, the resulting
program ends up in a single mode, all of it.
I am attaching a couple of files to this email:
arm.c : The file to be compiled as ARM
main.c : The main function, compiled as Thumb
Makefile : Add -flto to LDFLAGS and CFLAGS to enable lto, remvove it to
disable it.
lto.txt : The arm-none-eabi-objdump dissassembly of the resulting lto
binary.
no-lto.txt : the arm-none-eabi-objdump dissassembly of the resulting binary
without lto.
Is there something obvious about the behavior of LTO that I'm missing? Does it
just generate the final machine code at link time, scrapping the flags used to
compile object files?
Thanks,
Gabriel E. Marcano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: arm.c
Type: text/x-csrc
Size: 41 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20160601/1dba449f/attachment.bin>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: lto.txt
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20160601/1dba449f/attachment.txt>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.c
Type: text/x-csrc
Size: 68 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20160601/1dba449f/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile
Type: application/octet-stream
Size: 202 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20160601/1dba449f/attachment.obj>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: no-lto.txt
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20160601/1dba449f/attachment-0001.txt>
More information about the Gcc-help
mailing list