xref: /titanic_51/usr/src/cmd/sgs/elfedit/modules/common/str.msg (revision 98157a7002f4f2cf7978f3084ca5577f0a1d72b2)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License (the "License").
6# You may not use this file except in compliance with the License.
7#
8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9# or http://www.opensolaris.org/os/licensing.
10# See the License for the specific language governing permissions
11# and limitations under the License.
12#
13# When distributing Covered Code, include this CDDL HEADER in each
14# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15# If applicable, add the following below this CDDL HEADER, with the
16# fields enclosed by brackets "[]" replaced with your own identifying
17# information: Portions Copyright [yyyy] [name of copyright owner]
18#
19# CDDL HEADER END
20#
21
22#
23# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27
28@ _START_
29
30# Message file for elfedit 'str' module
31
32@ MSG_ID_ELFEDIT_STR
33
34
35# Format strings
36@ MSG_FMT_STRTAB	"String Table Section:  %s\n"
37@ MSG_FMT_DYNSTRPAD	"Dynamic String Table Padding \
38			 Region: [%d-%d] (%d bytes)\n"
39@ MSG_FMT_DUMPTITLE	"          index    value\n"
40
41# Debug messages
42
43@ MSG_DEBUG_S_OK	"[%d: %s][%d]: value unchanged: %s\n"
44@ MSG_DEBUG_S_CHG	"[%d: %s][%d]: change from %.*s to %s\n"
45@ MSG_DEBUG_Z_OK	"[%d: %s][%d]: value unchanged\n"
46@ MSG_DEBUG_Z_CHG	"[%d: %s][%d]: inserted %d NULL bytes\n"
47@ MSG_DEBUG_CHGSTR0	"[%d: %s][%d]: ELF warning: element [0] is expected \
48			 to contain a NULL (0) byte, and should not be \
49			 altered: %s\n"
50@ MSG_DEBUG_BADSTRPAD	"[%d: %s]: DT_SUNW_STRPAD value (%#llx) is larger \
51			 than string table section (%#llx), and will be \
52			 ignored\n"
53@ MSG_DEBUG_ADDDYNSTR	"[%d: %s][%d]: Using %d/%d bytes from reserved area \
54			 to add string: %s\n"
55@ MSG_DEBUG_LONGSTR	"[%d: %s][%d]: ELF warning: new string is longer \
56			 than previous value (%d > %d), and will overwrite \
57			 the beginning of the following item\n"
58
59# Errors
60
61@ MSG_ERR_STRNOTFND	"[%d: %s]: String table does not contain string: %s\n"
62@ MSG_ERR_NOFIT		"[%d: %s][%d]: New value would extend past end \
63			 of string table: %s\n"
64@ MSG_ERR_FINALNULL	"[%d: %s][%d]: New value would set final byte of \
65			 string table to non-NULL value: %s\n"
66
67
68
69# Module description
70
71@ MSG_MOD_DESC		"String Table Section"
72
73
74# 1-line description strings
75
76@ MSG_DESC_DUMP		"Dump String Table Section"
77@ MSG_DESC_SET		"Alter Existing String Table Contents"
78@ MSG_DESC_ADD		"Add New String to String Table"
79@ MSG_DESC_ZERO		"Zero String Table Region"
80
81
82# Command option description strings
83
84@ MSG_OPTDESC_ANY		"\
85   Normally, only string table sections (section type SHT_STRTAB)\n\
86   are allowed. If -any is set, then the specified section is\n\
87   used without checking its section type, and will be treated as\n\
88   if it is a string table. This can be used to examine sections\n\
89   that are known to be in string table format (i.e. SHT_PROGBITS).\n"
90
91@ MSG_OPTDESC_END		"\
92   Zero to the end of the string table. The count argument\n\
93   cannot be used in conjunction with -end.\n".
94
95@ MSG_OPTDESC_NOTERM		"\
96   Do not write the null termination for the new string into\n\
97   the string table. This option cannot be used with the final\n\
98   position in the string table. Attempts to do so will result\n\
99   in an error.\n".
100
101@ MSG_OPTDESC_SHNAM		"\
102   Use the string table found in the ELF section with the\n\
103   specified name. If this is a string table section, it\n\
104   is used directly. If it is a section that has an associated\n\
105   symbol table or string table via its sh_link field, then the\n\
106   associated string table is used.\n"
107
108@ MSG_OPTDESC_SHNDX		"\
109   Use the string table found in the ELF section with the\n\
110   specified index. If this is a string table section, it\n\
111   is used directly. If it is a section that has an associated\n\
112   symbol table or string table via its sh_link field, then the\n\
113   associated string table is used.\n"
114
115@ MSG_OPTDESC_SHTYP		"\
116   Locate the first section in the ELF object with the\n\
117   given section type, and use the string table associated\n\
118   with it. If this is a string table section, it is used\n\
119   directly. If it is a section that has an associated\n\
120   symbol table or string table via its sh_link field, then the\n\
121   associated string table is used.\n"
122
123@ MSG_OPTDESC_STRNDX		"\
124   The string argument supplies a numeric index into the\n\
125   string table instead of the string value.\n".
126
127
128# Command argument descriptions
129
130@ MSG_A1_STRING		"String to locate in string table section.\n"
131
132@ MSG_A1_NEWSTRING	"\
133   New string to insert in string table section\n\
134   if not already present.\n"
135
136@ MSG_A2_NEWSTRING	"\
137   New string to overwrite previous value.\n"
138
139@ MSG_A2_COUNT	"\
140   Number of null bytes to write at specified offset.\n"
141
142
143
144# Help strings
145
146@ MSG_HELP_DUMP	"   \
147   The str:dump command is used to display information\n\
148   from a string table section.\n\
149   \n\
150   By default, the string table referenced by the e_shstrndx field\n\
151   of the ELF header is used. The -shnam, -shndx, or -shndx options\n\
152   can be used to select a different string table.\n\
153   \n\
154   If str:dump is called without arguments, every string in the\n\
155   string table is shown. If called with the string argument,\n\
156   the information for that string is displayed.\n\
157   \n\
158   The strings are displayed within double quotes. These quotes are\n\
159   not part of the actual string, and serve to visually delimit the\n\
160   actual string. Printable characters are shown as themselves, while\n\
161   non-printable characters are shown using the same notation used\n\
162   by the C programming language for literal string constants:\n\
163   \n\
164   \t\\a\talert (bell)\n\
165   \t\\b\tbackspace\n\
166   \t\\f\tform feed\n\
167   \t\\n\tnewline\n\
168   \t\\r\treturn\n\
169   \t\\t\thorizontal tab\n\
170   \t\\v\tvertical tab\n\
171   \t\\\\\tbackslash\n\
172   \t\\'\tsingle quote\n\
173   \t\\\"\tdouble quote\n\
174   \t\\ooo\tAn octal constant, where ooo is one to three\n\
175   \t\t\toctal digits (0..7)\n"
176
177@ MSG_HELP_SET	"   \
178   The str:set command is used to display or alter the existing\n\
179   contents of the string table section.\n\
180   \n\
181   By default, the string table referenced by the e_shstrndx field\n\
182   of the ELF header is used. The -shnam, -shndx, or -shndx options\n\
183   can be used to select a different string table.\n\
184   \n\
185   The string table offset is normally determined by looking\n\
186   for the specified string in the table and using its offset.\n\
187   Alternatively, the -strndx option can be used to specify an\n\
188   offset directly.\n\
189   \n\
190   If the new-string argument is not present, the current string\n\
191   at the given offset is shown. If new-string is present, it\n\
192   is used to overwrite the contents of the string table at\n\
193   the specified offset. The new string can have any length, as\n\
194   long as it will fit in the existing size of the string table.\n\
195   A terminating null character is always included in the string,\n\
196   unless the -noterm option is specified. However, -noterm cannot\n\
197   be used for the final byte of the string table, which must\n\
198   always be NULL.\n\
199   \n\
200   Note:\n\
201   \n\
202   o\tIf new-string is longer than the existing string at\n\
203   \tthe specified offset, it will overwrite the start of\n\
204   \tthe following string in the string table. Any reference to\n\
205   \tthat following string in the ELF file will then refer to\n\
206   \tthe tail of the new-string.\n\
207   \n\
208   o\tELF files may have other dependencies upon the existing\n\
209   \tname of an item. Changing the string for such a name to\n\
210   \ta different value can create problems for the object and\n\
211   \teven render it unusable.\n\
212   \n\
213   o\tThe dynamic string table (.dynstr) may have an unused area\n\
214   \tat the end, reserved for adding new strings to the table.\n\
215   \tIn this case, the dynamic section will contain a DT_SUNW_STRPAD\n\
216   \tvalue giving the size of the unused space. If str:set is used\n\
217   \tto modify the contents of the unused space, it will adjust\n\
218   \tthe existing value of DT_SUNW_STRPAD to reflect the space used.\n"
219
220@ MSG_HELP_ADD	"   \
221   The str:add command examines the specified string table to\n\
222   determine if it contains the given string. If the string\n\
223   does not exist, str:add will add it to the end, if possible.\n\
224   \n\
225   By default, the string table referenced by the e_shstrndx field\n\
226   of the ELF header is used. The -shnam, -shndx, or -shndx options\n\
227   can be used to select a different string table.\n\
228   \n\
229   It is only possible to add a new string to a string table\n\
230   if the string table in question is the dynamic string table\n\
231   (.dynstr), and if that string table has reserved space at\n\
232   the end, indicated by a DT_SUNW_STRPAD entry in the dynamic\n\
233   section.\n"
234
235@ MSG_HELP_ZERO	"   \
236   The str:zero command is used to set a portion of the specified\n\
237   string table to NULL (0) byte values.\n\
238   \n\
239   By default, the string table referenced by the e_shstrndx field\n\
240   of the ELF header is used. The -shnam, -shndx, or -shndx options\n\
241   can be used to select a different string table.\n\
242   \n\
243   The string table offset is normally determined by looking\n\
244   for the specified string in the table and using its offset.\n\
245   Alternatively, the -strndx option can be used to specify an\n\
246   offset directly.\n\
247   \n\
248   The number of bytes to zero are determined as follows:\n\
249   \n\
250   o\tIf the -end option is specified, all bytes between the\n\
251   \tstarting offset and the end of the string table are zeroed.\n\
252   \n\
253   o\tIf the count argument is present, the number of bytes\n\
254   \tspecified are zeroed.\n\
255   \n\
256   o\tIf neither -end nor count are present, all bytes of the\n\
257   \texisting string at the given offset are zeroed, up to the\n\
258   \texisting null termination.\n\
259   \n\
260   The count argument and -end option are mutually exclusive. Only\n\
261   one of these can be used in a given call to str:zero.\n\
262   \n\
263   Note:\n\
264   \n\
265   o\tELF files may have other dependencies upon the existing\n\
266   \tname of an item. Changing the string for such a name to\n\
267   \ta different value can create problems for the object and\n\
268   \teven render it unusable.\n\
269   \n\
270   o\tThe dynamic string table (.dynstr) may have an unused area\n\
271   \tat the end, reserved for adding new strings to the table.\n\
272   \tIn this case, the dynamic section will contain a\n\
273   \tDT_SUNW_STRPAD value giving the size of the unused space.\n\
274   \tstr:zero does not alter DT_SUNW_STRPAD, or otherwise attempt\n\
275   \tto \"reclaim\" space zeroed at the end of the string table.\n"
276
277
278
279@ _END_
280
281
282# The following strings represent reserved words, files, pathnames and symbols.
283# Reference to this strings is via the MSG_ORIG() macro, and thus no message
284# translation is required.
285
286
287# Miscellaneous clutter
288@ MSG_STR_EMPTY			""
289@ MSG_STR_MINUS_ANY		"-any"
290@ MSG_STR_MINUS_END		"-end"
291@ MSG_STR_MINUS_NOTERM		"-noterm"
292@ MSG_STR_MINUS_SHNAM		"-shnam"
293@ MSG_STR_MINUS_SHNDX		"-shndx"
294@ MSG_STR_MINUS_SHTYP		"-shtyp"
295@ MSG_STR_MINUS_STRNDX		"-strndx"
296@ MSG_STR_COUNT			"count"
297@ MSG_STR_INDEX			"index"
298@ MSG_STR_NAME			"name"
299@ MSG_STR_NEWSTRING		"new-string"
300@ MSG_STR_STRING		"string"
301@ MSG_STR_TYPE			"type"
302@ MSG_STR_DQUOTE		"\""
303@ MSG_STR_DQUOTENL		"\"\n"
304
305
306# Format strings
307
308@ MSG_FMT_STRNL			"%s\n"
309@ MSG_FMT_INDEX			"[%lld]"
310@ MSG_FMT_INDEXRANGE		"[%lld-%lld]"
311@ MSG_FMT_DUMPENTRY		"%15s  "
312@ MSG_FMT_WORDVAL		"%u"
313
314
315# Module name
316
317@ MSG_MOD_NAME		"str"
318
319
320# Command names
321
322@ MSG_CMD_DUMP		"dump"
323@ MSG_CMD_SET		"set"
324@ MSG_CMD_ADD		"add"
325@ MSG_CMD_ZERO		"zero"
326