Go to file
Michael Matz 670c91c0c5 Fix PR30358, performance with --sort-section
since af31506c we only use the binary tree when section sorting is
required.  While its unbalanced and hence can degrade to a linear list
it should otherwise have been equivalent to the old code relying on
insertion sort.  Unfortunately it was not.  The old code directly used
lang_add_section to populate the sorted list, the new code first
populates the tree and only then does lang_add_section on the sorted
result.

In the testcase we have very many linkonce section groups, and hence
lang_add_section won't actually insert anything for most of them.  That
limited the to-be-sorted list length previously.  The tree-sorting code
OTOH first created a tree of all candidates sections, including those
that wouldn't be inserted by lang_add_section, hence increasing the size
of the sorting problem.  In the testcase the chain length went from
about 1500 to 106000, and in the degenerated case (as in the testcase)
that goes in quadratically.

This splits out most of the early-out code from lang_add_section to its
own function and uses the latter to avoid inserting into the tree.  This
refactoring slightly changes the order of early-out tests (the ones
based on section flags is now done last, and only in lang_add_section).
The new function is not a pure predicate: it can give warnings and it
might change output_section, like the old early-out code did.  I have
also added a skip-warning case in the first discard case, whose
non-existence seemed to have been an oversight.

	PR 30358
	* ldlang.c (wont_add_section_p): Split out from ...
	(lang_add_section): ... here.
	(output_section_callback_sort): Use wont_add_section_p to not
	always add sections to the sort tree.
2023-04-27 16:15:26 +02:00
bfd Automatic date update in version.in 2023-04-27 00:00:31 +00:00
binutils binutils runtest $CC 2023-04-26 10:32:07 +09:30
config
contrib
cpu
elfcpp
etc
gas RISC-V: Support XVentanaCondOps extension 2023-04-26 14:09:34 -06:00
gdb gdb/doc: extend the documentation of the jump command 2023-04-27 13:59:30 +01:00
gdbserver
gdbsupport
gnulib
gold MIPS: support mips*64 as CPU and gnuabi64 as ABI 2023-04-23 14:32:43 +08:00
gprof Updated Hungarian translation for the gprof directory 2023-04-19 10:37:33 +01:00
gprofng gprofng: 30360 Seg. Fault when application uses std::thread 2023-04-17 13:01:38 -07:00
include RISC-V: Support XVentanaCondOps extension 2023-04-26 14:09:34 -06:00
intl
ld Fix PR30358, performance with --sort-section 2023-04-27 16:15:26 +02:00
libbacktrace
libctf
libdecnumber
libiberty
libsframe libsframe: minor formatting fixes in sframe_encoder_write_fre 2023-04-19 14:38:18 -07:00
opcodes RISC-V: Support XVentanaCondOps extension 2023-04-26 14:09:34 -06:00
readline
sim sim: bpf: update to new BPF relocations 2023-04-26 19:22:14 +02:00
texinfo
zlib
.cvsignore
.editorconfig
.gitattributes
.gitignore
ar-lib
ChangeLog Add a SECURITY.txt file describing the GNU Binutils' project's stance on security related bugs. 2023-04-20 16:52:11 +01:00
compile
config-ml.in
config.guess
config.rpath
config.sub
configure
configure.ac
COPYING
COPYING3
COPYING3.LIB
COPYING.LIB
COPYING.LIBGLOSS
COPYING.NEWLIB
depcomp
djunpack.bat
install-sh
libtool.m4
lt~obsolete.m4
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
MAINTAINERS
Makefile.def
Makefile.in
Makefile.tpl
makefile.vms
missing
mkdep
mkinstalldirs
move-if-change
multilib.am
README
README-maintainer-mode
SECURITY.txt Add a SECURITY.txt file describing the GNU Binutils' project's stance on security related bugs. 2023-04-20 16:52:11 +01:00
setup.com
src-release.sh Add a SECURITY.txt file describing the GNU Binutils' project's stance on security related bugs. 2023-04-20 16:52:11 +01:00
symlink-tree
test-driver
ylwrap

		   README for GNU development tools

This directory contains various GNU compilers, assemblers, linkers, 
debuggers, etc., plus their support routines, definitions, and documentation.

If you are receiving this as part of a GDB release, see the file gdb/README.
If with a binutils release, see binutils/README;  if with a libg++ release,
see libg++/README, etc.  That'll give you info about this
package -- supported targets, how to use it, how to report bugs, etc.

It is now possible to automatically configure and build a variety of
tools with one command.  To build all of the tools contained herein,
run the ``configure'' script here, e.g.:

	./configure 
	make

To install them (by default in /usr/local/bin, /usr/local/lib, etc),
then do:
	make install

(If the configure script can't determine your type of computer, give it
the name as an argument, for instance ``./configure sun4''.  You can
use the script ``config.sub'' to test whether a name is recognized; if
it is, config.sub translates it to a triplet specifying CPU, vendor,
and OS.)

If you have more than one compiler on your system, it is often best to
explicitly set CC in the environment before running configure, and to
also set CC when running make.  For example (assuming sh/bash/ksh):

	CC=gcc ./configure
	make

A similar example using csh:

	setenv CC gcc
	./configure
	make

Much of the code and documentation enclosed is copyright by
the Free Software Foundation, Inc.  See the file COPYING or
COPYING.LIB in the various directories, for a description of the
GNU General Public License terms under which you can copy the files.

REPORTING BUGS: Again, see gdb/README, binutils/README, etc., for info
on where and how to report problems.