From: John Marino Date: Tue, 3 Jan 2012 10:50:54 +0000 (+0100) Subject: gold linker v2.22: Fix constructor handling X-Git-Tag: v3.0.0~190 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/17078250df568635285cd6be4515d29ee8c1b72a gold linker v2.22: Fix constructor handling Starting with gold 2.22, gold looks for contructors in DT_INIT_ARRAY by default, but gcc defines them in a .ctors section. Apparently the presence of crtbegin and crtend with their .init sections are confusing gold, but not gnu ld. To combat this, a new option "--no-ctors-in-init-array" was added to emulate gnu ld behavior of looking for constructors in the .ctors section provided by gcc. This commit makes this new option the default behavior on DragonFly's gold. Without this modification, a gold-built world is unbootable! --- diff --git a/contrib/binutils-2.22/README.DRAGONFLY b/contrib/binutils-2.22/README.DRAGONFLY index c01e8dfbc2..8416e5b607 100644 --- a/contrib/binutils-2.22/README.DRAGONFLY +++ b/contrib/binutils-2.22/README.DRAGONFLY @@ -13,4 +13,5 @@ A list of files and directories removed is in README.DELETED Local modifications applied to following files: bfd/bfdver.h (new) gold/options.cc + gold/options.h ld/ldlex.l diff --git a/contrib/binutils-2.22/gold/options.h b/contrib/binutils-2.22/gold/options.h index 768df9c6eb..0cdb274fa2 100644 --- a/contrib/binutils-2.22/gold/options.h +++ b/contrib/binutils-2.22/gold/options.h @@ -680,9 +680,9 @@ class General_options N_("Output cross reference table"), N_("Do not output cross reference table")); - DEFINE_bool(ctors_in_init_array, options::TWO_DASHES, '\0', true, - N_("Use DT_INIT_ARRAY for all constructors (default)"), - N_("Handle constructors as directed by compiler")); + DEFINE_bool(ctors_in_init_array, options::TWO_DASHES, '\0', false, + N_("Use DT_INIT_ARRAY for all constructors"), + N_("Handle constructors as directed by compiler (default)")); DEFINE_bool(define_common, options::TWO_DASHES, 'd', false, N_("Define common symbols"),