Bug 16178 - Sort reloc_class_ifunc doesn't work
Summary: Sort reloc_class_ifunc doesn't work
Status: NEW
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: 2.25
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-16 00:18 UTC by H.J. Lu
Modified: 2013-11-16 00:55 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
A patch (1.17 KB, patch)
2013-11-16 00:55 UTC, H.J. Lu
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2013-11-16 00:18:30 UTC
reloc_class_ifunc is added to put the IRELATIVE relocations
at the end of dynamic relocation table.  There are 2
problems:

1. elf_link_sort_relocs is called with

  if (dynamic && info->combreloc && dynobj != NULL) 
    relativecount = elf_link_sort_relocs (abfd, info, &reldyn);

If -z comreloc isn't used, sorting is off.

2. elf_link_sort_relocs only deals with .rel.dyn and .rela.dyn.
But some backends put IRELATIVE relocations in .rel.plt or
.rela.plt, regardless if -z comreloc is used.  So reloc_class_ifunc
does nothing.
Comment 1 H.J. Lu 2013-11-16 00:55:44 UTC
Created attachment 7283 [details]
A patch

Don't know if it works.