bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/31921] [ARM][2.36] Linker produces bad executable


From: christoph.franck at arcor dot de
Subject: [Bug ld/31921] [ARM][2.36] Linker produces bad executable
Date: Tue, 25 Jun 2024 16:34:13 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=31921

--- Comment #2 from Christoph Franck <christoph.franck at arcor dot de> ---
Hi Nick,

thank you for taking the time to look into this despite it being an issue with
an older tool revision. I submitted the report to verify that it actually is a
linker issue and not due to my lack of understanding, and to document it as
true linker bugs that silently result in a bad executable are rare. I have not
encountered any in over two decades.


> Unfortunately without the files to examine, I cannot be sure.

crti.s and crtn.s should be available here:

https://github.com/STMicroelectronics/gnu-tools-for-stm32/tree/10.3-2021.10/src/gcc/libgcc/config/arm


> You state that the difference between the good and bad links is that fact 
> that a different LMA/VMA relationship is used.

In the good ld file, .arm.exidx* is allocated in output section .ARM.extab
which is marked as ">FLASH", while in the bad ld file, .arm.exidx* is put in
output section .data, which is ">RAM AT> FLASH". 


I uploaded another zip file with map and list files of both builds, and a typo
correction in the ld file.


The map file of the bad build looks odd to me. As far as I understand, the
linker should allocate input to ascending addresses in the output, but for the
two parts of .init from crti.o and crtn.o, the addresses take a step backwards.


.eh_frame      0x0000000020000448        0x0
C:/ST/STM32CubeIDE_1.14.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.win32_1.1.200.202402032213/tools/bin/../lib/gcc/arm-none-eabi/10.3.1/thumb/v8-m.main+fp/hard/crtbegin.o
*(.init)
.init          0x0000000020000450        0x4
C:/ST/STM32CubeIDE_1.14.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.win32_1.1.200.202402032213/tools/bin/../lib/gcc/arm-none-eabi/10.3.1/thumb/v8-m.main+fp/hard/crti.o
               0x0000000020000450                _init
.init          0x0000000020000448        0x8
C:/ST/STM32CubeIDE_1.14.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.win32_1.1.200.202402032213/tools/bin/../lib/gcc/arm-none-eabi/10.3.1/thumb/v8-m.main+fp/hard/crtn.o
*(.fini)
.fini          0x0000000020000454        0x4
C:/ST/STM32CubeIDE_1.14.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.win32_1.1.200.202402032213/tools/bin/../lib/gcc/arm-none-eabi/10.3.1/thumb/v8-m.main+fp/hard/crti.o
               0x0000000020000454                _fini
.fini          0x0000000020000458        0x8
C:/ST/STM32CubeIDE_1.14.1/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.win32_1.1.200.202402032213/tools/bin/../lib/gcc/arm-none-eabi/10.3.1/thumb/v8-m.main+fp/hard/crtn.o

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]