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