Summary: | /usr/bin/ld.bfd: section .note.ABI-tag VMA [0000000000400190,00000000004001af] overlaps section .bss VMA [00000000000adc00,00000000004af3ff] | ||
---|---|---|---|
Product: | binutils | Reporter: | Martin Liska <martin.liska> |
Component: | ld | Assignee: | Alan Modra <amodra> |
Status: | RESOLVED NOTABUG | ||
Severity: | normal | CC: | matz, sam |
Priority: | P2 | ||
Version: | 2.37 | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Last reconfirmed: |
Description
Martin Liska
2021-02-08 16:17:29 UTC
-Ttext 0 is asking to place the .text section at address zero. Assuming you're playing with x86_64, the -N script starts laying out the text segment at 0x400000. So a number of sections are placed there after allowing for headers. Then we reset to address zero for .text and place a number of sections there, and since .bss is so large, its vma overlaps the first section, .note.ABI-tag. Not a bug, you asked for overlapping sections. I suspect grub2 should be using -Wl,-Ttext-segment,0. Hah, -Ttext-segment indeed. When I was looking at this ( https://bugzilla.opensuse.org/show_bug.cgi?id=1181741 ), I idly thought that it would be better if -Ttext would do something else than the traditional .text section moving (for ELF formats), without realizing that this already exists :-) (For better or worse -Ttext is used by basically everything that wants something similar like grub, but what they _actually_ want is the behaviour of -Ttext-segment) Yes, changing -Ttext was exactly what Ian and Daniel wanted a long time ago.. https://sourceware.org/pipermail/binutils/2009-January/058886.html |