aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2019-10-14 13:49:34 +1030
committerAlan Modra <amodra@gmail.com>2019-10-14 16:47:13 +1030
commit8c1c5e5de46f415bbdeabb3cad3fd1383f5fb995 (patch)
treef8065506654e5d7d4329be4629e253e8692ecfa3 /gdb
parentdcea6a95d78370c8b4ac3c0033d9f15aaabf31bf (diff)
downloadbinutils-8c1c5e5de46f415bbdeabb3cad3fd1383f5fb995.zip
binutils-8c1c5e5de46f415bbdeabb3cad3fd1383f5fb995.tar.gz
binutils-8c1c5e5de46f415bbdeabb3cad3fd1383f5fb995.tar.bz2
qsort: SHF_LINK_ORDER section sort
The linker SHF_LINK_ORDER section sorting had a number of defects. 1) The ordering was by VMA, which won't work with overlays. LMA is better. 2) Zero size sections can result in two sections at the same LMA/VMA. When only one of the two sections at the same LMA is zero size, that one must be first. 3) Warnings given by elf_get_linked_section_vma won't ever be emitted since elf_object_p warns and excludes objects with zero sh_link on a SHF_LINK_ORDER section. 4) Section offset was adjusted down rather than up by section alignment, possibly creating overlapping sections. 5) Finding the linked section did so the hard way, rather than simply using elf_linked_to_section. * elflink.c (elf_get_linked_section_vma): Delete. (compare_link_order): Use elf_linked_to_section and sort by lma, size, and id. (elf_fixup_link_order): Use size_t variables where appropriate. Make use of elf_linked_to_section. Formatting. Properly align sections.
Diffstat (limited to 'gdb')
0 files changed, 0 insertions, 0 deletions