/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Set bits in the DT_FLAGS_1 member of the .dynamic section of an object.
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <errno.h>
#include <libelf.h>
#include <gelf.h>
#include <string.h>
#include <fcntl.h>
#include <libgen.h>
#include <unistd.h>
#include <util.h>
/*
* These are here because we can't be sure (yet) that the build machine has a
* on the build machine, so we have to use its headers (rather than the ones
* in $ROOT which will, by definition, be up to date). These #defines can be
* removed when we're sure that all build machines have recent copies of
*/
#ifndef DF_1_IGNMULDEF
#endif
#ifndef DF_1_NOKSYMS
#endif
struct dtflagval {
char *fv_name;
};
{ "DF_1_IGNMULDEF", DF_1_IGNMULDEF },
{ "DF_1_NOKSYMS", DF_1_NOKSYMS },
{ NULL }
};
const char *progname;
static void
usage(void)
{
exit(2);
}
static void
{
(void) elf_version(EV_CURRENT);
elfdie("gelf_shdr");
elfdie("elf_getdata");
for (i = 0; i < nent; i++) {
elfdie("gelf_getdyn");
elfdie("gelf_update_dyn");
break;
}
}
if (i == nent) {
die("%s's .dynamic section doesn't have a DT_FLAGS_1 "
"field\n", ifile);
}
}
static ulong_t
{
char *arg;
int i;
}
}
return (flval);
}
int
{
int c;
switch (c) {
case 'f':
usage();
break;
default:
usage();
}
}
usage();
return (0);
}