summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2011-12-29 22:15:18 +0000
committerjilles <jilles@FreeBSD.org>2011-12-29 22:15:18 +0000
commit792fdc63c101fa0058ae95c852d3f279ae782302 (patch)
tree7ac45ab6bc8ed41ba4550ccf88027974bfcd571b /lib
parentd93f743cd1a3949bc8e094e928da15ed5851f707 (diff)
downloadFreeBSD-src-792fdc63c101fa0058ae95c852d3f279ae782302.zip
FreeBSD-src-792fdc63c101fa0058ae95c852d3f279ae782302.tar.gz
libc: Eliminate some relative relocations in file flags table.
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/gen/strtofflags.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/lib/libc/gen/strtofflags.c b/lib/libc/gen/strtofflags.c
index 12db2b4..596ef7b 100644
--- a/lib/libc/gen/strtofflags.c
+++ b/lib/libc/gen/strtofflags.c
@@ -41,35 +41,35 @@ __FBSDID("$FreeBSD$");
#include <string.h>
#include <unistd.h>
+#define longestflaglen 12
static struct {
- char *name;
+ char name[longestflaglen + 1];
+ char invert;
u_long flag;
- int invert;
-} mapping[] = {
+} const mapping[] = {
/* shorter names per flag first, all prefixed by "no" */
- { "nosappnd", SF_APPEND, 0 },
- { "nosappend", SF_APPEND, 0 },
- { "noarch", SF_ARCHIVED, 0 },
- { "noarchived", SF_ARCHIVED, 0 },
- { "noschg", SF_IMMUTABLE, 0 },
- { "noschange", SF_IMMUTABLE, 0 },
- { "nosimmutable", SF_IMMUTABLE, 0 },
- { "nosunlnk", SF_NOUNLINK, 0 },
- { "nosunlink", SF_NOUNLINK, 0 },
+ { "nosappnd", 0, SF_APPEND },
+ { "nosappend", 0, SF_APPEND },
+ { "noarch", 0, SF_ARCHIVED },
+ { "noarchived", 0, SF_ARCHIVED },
+ { "noschg", 0, SF_IMMUTABLE },
+ { "noschange", 0, SF_IMMUTABLE },
+ { "nosimmutable", 0, SF_IMMUTABLE },
+ { "nosunlnk", 0, SF_NOUNLINK },
+ { "nosunlink", 0, SF_NOUNLINK },
#ifdef SF_SNAPSHOT
- { "nosnapshot", SF_SNAPSHOT, 0 },
+ { "nosnapshot", 0, SF_SNAPSHOT },
#endif
- { "nouappnd", UF_APPEND, 0 },
- { "nouappend", UF_APPEND, 0 },
- { "nouchg", UF_IMMUTABLE, 0 },
- { "nouchange", UF_IMMUTABLE, 0 },
- { "nouimmutable", UF_IMMUTABLE, 0 },
- { "nodump", UF_NODUMP, 1 },
- { "noopaque", UF_OPAQUE, 0 },
- { "nouunlnk", UF_NOUNLINK, 0 },
- { "nouunlink", UF_NOUNLINK, 0 }
+ { "nouappnd", 0, UF_APPEND },
+ { "nouappend", 0, UF_APPEND },
+ { "nouchg", 0, UF_IMMUTABLE },
+ { "nouchange", 0, UF_IMMUTABLE },
+ { "nouimmutable", 0, UF_IMMUTABLE },
+ { "nodump", 1, UF_NODUMP },
+ { "noopaque", 0, UF_OPAQUE },
+ { "nouunlnk", 0, UF_NOUNLINK },
+ { "nouunlink", 0, UF_NOUNLINK }
};
-#define longestflaglen 12
#define nmappings (sizeof(mapping) / sizeof(mapping[0]))
/*
OpenPOWER on IntegriCloud