This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
-Bgroup and -z defs
- To: binutils at sourceware dot cygnus dot com
- Subject: -Bgroup and -z defs
- From: Ulrich Drepper <drepper at redhat dot com>
- Date: 16 Sep 2000 17:10:12 -0700
- Reply-To: drepper at cygnus dot com (Ulrich Drepper)
I'd like to commit the appended patch which implements the -Bgroup and
the -z defs option the Solaris linker knows about. -Bgroup introduces
something new (which is trivially to implement) and -z defs is an
alias for --no-undefined.
--
---------------. ,-. 1325 Chesapeake Terrace
Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA
Red Hat `--' drepper at redhat.com `------------------------
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2000-09-15 Ulrich Drepper <drepper@redhat.com>
* emultempl/elf32.em (OPTION_GROUP): Define.
(longopts): Add BGroup.
(gld_${EMULATION_NAME}_parse_args): Handle -Bgroup and -z defs.
Index: ld/emultempl/elf32.em
===================================================================
RCS file: /cvs/src/src/ld/emultempl/elf32.em,v
retrieving revision 1.35
diff -u -d -u -p -r1.35 elf32.em
--- elf32.em 2000/09/07 09:09:19 1.35
+++ elf32.em 2000/09/17 00:03:11
@@ -1317,6 +1317,7 @@ cat >>e${EMULATION_NAME}.c <<EOF
#define OPTION_DISABLE_NEW_DTAGS (400)
#define OPTION_ENABLE_NEW_DTAGS (OPTION_DISABLE_NEW_DTAGS + 1)
+#define OPTION_GROUP (OPTION_ENABLE_NEW_DTAGS + 1)
static struct option longopts[] =
{
@@ -1330,6 +1331,8 @@ cat >>e${EMULATION_NAME}.c <<EOF
{"disable-new-dtags", no_argument, NULL, OPTION_DISABLE_NEW_DTAGS},
{"enable-new-dtags", no_argument, NULL, OPTION_ENABLE_NEW_DTAGS},
{"enable-new-dtags", no_argument, NULL, OPTION_ENABLE_NEW_DTAGS},
+ {"Bgroup", no_argument, NULL, OPTION_GROUP},
+ {"Bgroup", no_argument, NULL, OPTION_GROUP},
EOF
fi
@@ -1388,6 +1391,12 @@ cat >>e${EMULATION_NAME}.c <<EOF
link_info.new_dtags = true;
break;
+ case OPTION_GROUP:
+ link_info.flags_1 |= (bfd_vma) DF_1_GROUP;
+ /* Groups must be self-contained. */
+ link_info.no_undefined = true;
+ break;
+
case 'z':
if (strcmp (optarg, "initfirst") == 0)
link_info.flags_1 |= (bfd_vma) DF_1_INITFIRST;
@@ -1413,6 +1422,8 @@ cat >>e${EMULATION_NAME}.c <<EOF
link_info.flags |= (bfd_vma) DF_ORIGIN;
link_info.flags_1 |= (bfd_vma) DF_1_ORIGIN;
}
+ else if (strcmp (optarg, "defs") == 0)
+ link_info.no_undefined = true;
/* What about the other Solaris -z options? FIXME. */
break;
EOF