Bug 16833 - ld refuses to mix ordered and unordered sections
Summary: ld refuses to mix ordered and unordered sections
Status: NEW
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: 2.24
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
Depends on:
Reported: 2014-04-11 12:44 UTC by Rainer Orth
Modified: 2020-07-17 04:24 UTC (History)
1 user (show)

See Also:
Host: i386-pc-solaris2.11
Target: i386-pc-solaris2.11
Build: i386-pc-solaris2.11
Last reconfirmed:


Note You need to log in before you can comment on or make changes to this bug.
Description Rainer Orth 2014-04-11 12:44:18 UTC
While testing a new Solaris/x86 assembler that does support cfi directives, I ran
into a link failure while bootstrapping gcc mainline with that /bin/as and gld 2.24:

/vol/gcc/bin/gld-2.24: .eh_frame has both ordered [`.eh_frame' in _muldi3_s.o] and unordered [`.eh_frame' in /usr/lib/amd64/crti.o] sections
/vol/gcc/bin/gld-2.24: final link failed: Bad value
collect2: error: ld returned 1 exit status

/bin/as sets SHF_LINK_ORDER in .eh_frame, but as you can see, the bundled crti.o
lacks that flag.

The question is: what's the basis for this refusal: I see nothing of the kind
in the current ELF gABI:


I see that this check (without the error messages) is already in the original

        [patch] Honour SHF_LINK_ORDER

but no justification either.

Why not just emit the sections with SHF_LINK_ORDER set in order and add in the
rest behind?

Comment 1 Fangrui Song 2020-07-17 04:24:16 UTC
Ah, just saw this. I just filed bug 26256 with a recent discussion.