This is what that alignment 4->16 should have fixed.
I will play with constructors and destructors some more.
Giovanni
linking troubles with STM32F platforms Topic is solved
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: linking troubles with STM32F platforms
I found that -falign-functions=16 in Makefile is probably the trigger, it enforces alignment in VMA but not in LMA, adjusting alignment in .ld files just hides the problem.
Could you try to remove that option in Makefile and see if it fixes the problem for you?
Giovanni
Could you try to remove that option in Makefile and see if it fixes the problem for you?
Giovanni
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: linking troubles with STM32F platforms
Perhaps I found a solution to the problem or, at least, a problem.
Could you try using this rule in rules_code.ld?
It is a new keyword not present in the old documentation I was looking at.
Giovanni
Could you try using this rule in rules_code.ld?
Code: Select all
.text : ALIGN_WITH_INPUT
{
__text_base = .;
*(.text)
*(.text.*)
*(.glue_7t)
*(.glue_7)
*(.gcc*)
__text_end = .;
} > TEXT_FLASH AT > TEXT_FLASH_LMA
It is a new keyword not present in the old documentation I was looking at.
Giovanni
Re: linking troubles with STM32F platforms
Hi,
the ALIGN_WITH_INPUT did the trick. It fixes the problem:
Thx,
Helmut
the ALIGN_WITH_INPUT did the trick. It fixes the problem:
Code: Select all
diff -y good.readelf bad.readelf | less
Code: Select all
Program Headers: Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSi Type Offset VirtAddr PhysAddr FileSiz MemSi
LOAD 0x010000 0x00200000 0x08000000 0x09e68 0x09e | LOAD 0x010000 0x00200000 0x08000000 0x00208 0x002
LOAD 0x019e68 0x08009e68 0x08009e68 0x02784 0x027 | LOAD 0x010220 0x00200220 0x08000208 0x09c48 0x09c
LOAD 0x020000 0x20020000 0x0800c5ec 0x000dc 0x000 | LOAD 0x029e50 0x08009e50 0x08009e50 0x02784 0x027
LOAD 0x030000 0x20000000 0x20000000 0x00000 0x02e | LOAD 0x030000 0x20020000 0x0800c5d4 0x000dc 0x000
LOAD 0x0200dc 0x200200dc 0x200200dc 0x00000 0x5ff | LOAD 0x040000 0x20000000 0x20000000 0x00000 0x02e
> LOAD 0x0300dc 0x200200dc 0x200200dc 0x00000 0x5ff
Thx,
Helmut
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: linking troubles with STM32F platforms
Thanks for confirming, I will commit this fix to all active branches.
Giovanni
Giovanni
Who is online
Users browsing this forum: No registered users and 33 guests