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 or sections with the SHF_STRINGS section flag set are allowed.\n\ 87 If -any is set, then the specified section is used without\n\ 88 checking its section type, and will be treated as if it is a\n\ 89 string table. This can be used to examine sections that are\n\ 90 known to be in string table format even though they are not\n\ 91 properly marked as such (i.e. SHT_PROGBITS).\n" 92 93@ MSG_OPTDESC_END "\ 94 Zero to the end of the string table. The count argument\n\ 95 cannot be used in conjunction with -end.\n". 96 97@ MSG_OPTDESC_NOTERM "\ 98 Do not write the null termination for the new string into\n\ 99 the string table. This option cannot be used with the final\n\ 100 position in the string table. Attempts to do so will result\n\ 101 in an error.\n". 102 103@ MSG_OPTDESC_SHNAM "\ 104 Use the string table found in the ELF section with the\n\ 105 specified name. If this is a string table section, it\n\ 106 is used directly. If it is a section that has an associated\n\ 107 symbol table or string table via its sh_link field, then the\n\ 108 associated string table is used.\n" 109 110@ MSG_OPTDESC_SHNDX "\ 111 Use the string table found in the ELF section with the\n\ 112 specified index. If this is a string table section, it\n\ 113 is used directly. If it is a section that has an associated\n\ 114 symbol table or string table via its sh_link field, then the\n\ 115 associated string table is used.\n" 116 117@ MSG_OPTDESC_SHTYP "\ 118 Locate the first section in the ELF object with the\n\ 119 given section type, and use the string table associated\n\ 120 with it. If this is a string table section, it is used\n\ 121 directly. If it is a section that has an associated\n\ 122 symbol table or string table via its sh_link field, then the\n\ 123 associated string table is used.\n" 124 125@ MSG_OPTDESC_STRNDX "\ 126 The string argument supplies a numeric index into the\n\ 127 string table instead of the string value.\n". 128 129 130# Command argument descriptions 131 132@ MSG_A1_STRING "String to locate in string table section.\n" 133 134@ MSG_A1_NEWSTRING "\ 135 New string to insert in string table section\n\ 136 if not already present.\n" 137 138@ MSG_A2_NEWSTRING "\ 139 New string to overwrite previous value.\n" 140 141@ MSG_A2_COUNT "\ 142 Number of null bytes to write at specified offset.\n" 143 144 145 146# Help strings 147 148@ MSG_HELP_DUMP " \ 149 The str:dump command is used to display information\n\ 150 from a string table section.\n\ 151 \n\ 152 By default, the string table referenced by the e_shstrndx field\n\ 153 of the ELF header is used. The -shnam, -shndx, or -shndx options\n\ 154 can be used to select a different string table.\n\ 155 \n\ 156 If str:dump is called without arguments, every string in the\n\ 157 string table is shown. If called with the string argument,\n\ 158 the information for that string is displayed.\n\ 159 \n\ 160 The strings are displayed within double quotes. These quotes are\n\ 161 not part of the actual string, and serve to visually delimit the\n\ 162 actual string. Printable characters are shown as themselves, while\n\ 163 non-printable characters are shown using the same notation used\n\ 164 by the C programming language for literal string constants:\n\ 165 \n\ 166 \t\\a\talert (bell)\n\ 167 \t\\b\tbackspace\n\ 168 \t\\f\tform feed\n\ 169 \t\\n\tnewline\n\ 170 \t\\r\treturn\n\ 171 \t\\t\thorizontal tab\n\ 172 \t\\v\tvertical tab\n\ 173 \t\\\\\tbackslash\n\ 174 \t\\'\tsingle quote\n\ 175 \t\\\"\tdouble quote\n\ 176 \t\\ooo\tAn octal constant, where ooo is one to three\n\ 177 \t\t\toctal digits (0..7)\n" 178 179@ MSG_HELP_SET " \ 180 The str:set command is used to display or alter the existing\n\ 181 contents of the string table section.\n\ 182 \n\ 183 By default, the string table referenced by the e_shstrndx field\n\ 184 of the ELF header is used. The -shnam, -shndx, or -shndx options\n\ 185 can be used to select a different string table.\n\ 186 \n\ 187 The string table offset is normally determined by looking\n\ 188 for the specified string in the table and using its offset.\n\ 189 Alternatively, the -strndx option can be used to specify an\n\ 190 offset directly.\n\ 191 \n\ 192 If the new-string argument is not present, the current string\n\ 193 at the given offset is shown. If new-string is present, it\n\ 194 is used to overwrite the contents of the string table at\n\ 195 the specified offset. The new string can have any length, as\n\ 196 long as it will fit in the existing size of the string table.\n\ 197 A terminating null character is always included in the string,\n\ 198 unless the -noterm option is specified. However, -noterm cannot\n\ 199 be used for the final byte of the string table, which must\n\ 200 always be NULL.\n\ 201 \n\ 202 Note:\n\ 203 \n\ 204 o\tIf new-string is longer than the existing string at\n\ 205 \tthe specified offset, it will overwrite the start of\n\ 206 \tthe following string in the string table. Any reference to\n\ 207 \tthat following string in the ELF file will then refer to\n\ 208 \tthe tail of the new-string.\n\ 209 \n\ 210 o\tELF files may have other dependencies upon the existing\n\ 211 \tname of an item. Changing the string for such a name to\n\ 212 \ta different value can create problems for the object and\n\ 213 \teven render it unusable.\n\ 214 \n\ 215 o\tThe dynamic string table (.dynstr) may have an unused area\n\ 216 \tat the end, reserved for adding new strings to the table.\n\ 217 \tIn this case, the dynamic section will contain a DT_SUNW_STRPAD\n\ 218 \tvalue giving the size of the unused space. If str:set is used\n\ 219 \tto modify the contents of the unused space, it will adjust\n\ 220 \tthe existing value of DT_SUNW_STRPAD to reflect the space used.\n" 221 222@ MSG_HELP_ADD " \ 223 The str:add command examines the specified string table to\n\ 224 determine if it contains the given string. If the string\n\ 225 does not exist, str:add will add it to the end, if possible.\n\ 226 \n\ 227 By default, the string table referenced by the e_shstrndx field\n\ 228 of the ELF header is used. The -shnam, -shndx, or -shndx options\n\ 229 can be used to select a different string table.\n\ 230 \n\ 231 It is only possible to add a new string to a string table\n\ 232 if the string table in question is the dynamic string table\n\ 233 (.dynstr), and if that string table has reserved space at\n\ 234 the end, indicated by a DT_SUNW_STRPAD entry in the dynamic\n\ 235 section.\n" 236 237@ MSG_HELP_ZERO " \ 238 The str:zero command is used to set a portion of the specified\n\ 239 string table to NULL (0) byte values.\n\ 240 \n\ 241 By default, the string table referenced by the e_shstrndx field\n\ 242 of the ELF header is used. The -shnam, -shndx, or -shndx options\n\ 243 can be used to select a different string table.\n\ 244 \n\ 245 The string table offset is normally determined by looking\n\ 246 for the specified string in the table and using its offset.\n\ 247 Alternatively, the -strndx option can be used to specify an\n\ 248 offset directly.\n\ 249 \n\ 250 The number of bytes to zero are determined as follows:\n\ 251 \n\ 252 o\tIf the -end option is specified, all bytes between the\n\ 253 \tstarting offset and the end of the string table are zeroed.\n\ 254 \n\ 255 o\tIf the count argument is present, the number of bytes\n\ 256 \tspecified are zeroed.\n\ 257 \n\ 258 o\tIf neither -end nor count are present, all bytes of the\n\ 259 \texisting string at the given offset are zeroed, up to the\n\ 260 \texisting null termination.\n\ 261 \n\ 262 The count argument and -end option are mutually exclusive. Only\n\ 263 one of these can be used in a given call to str:zero.\n\ 264 \n\ 265 Note:\n\ 266 \n\ 267 o\tELF files may have other dependencies upon the existing\n\ 268 \tname of an item. Changing the string for such a name to\n\ 269 \ta different value can create problems for the object and\n\ 270 \teven render it unusable.\n\ 271 \n\ 272 o\tThe dynamic string table (.dynstr) may have an unused area\n\ 273 \tat the end, reserved for adding new strings to the table.\n\ 274 \tIn this case, the dynamic section will contain a\n\ 275 \tDT_SUNW_STRPAD value giving the size of the unused space.\n\ 276 \tstr:zero does not alter DT_SUNW_STRPAD, or otherwise attempt\n\ 277 \tto \"reclaim\" space zeroed at the end of the string table.\n" 278 279 280 281@ _END_ 282 283 284# The following strings represent reserved words, files, pathnames and symbols. 285# Reference to this strings is via the MSG_ORIG() macro, and thus no message 286# translation is required. 287 288 289# Miscellaneous clutter 290@ MSG_STR_EMPTY "" 291@ MSG_STR_MINUS_ANY "-any" 292@ MSG_STR_MINUS_END "-end" 293@ MSG_STR_MINUS_NOTERM "-noterm" 294@ MSG_STR_MINUS_SHNAM "-shnam" 295@ MSG_STR_MINUS_SHNDX "-shndx" 296@ MSG_STR_MINUS_SHTYP "-shtyp" 297@ MSG_STR_MINUS_STRNDX "-strndx" 298@ MSG_STR_COUNT "count" 299@ MSG_STR_INDEX "index" 300@ MSG_STR_NAME "name" 301@ MSG_STR_NEWSTRING "new-string" 302@ MSG_STR_STRING "string" 303@ MSG_STR_TYPE "type" 304@ MSG_STR_DQUOTE "\"" 305@ MSG_STR_DQUOTENL "\"\n" 306 307 308# Format strings 309 310@ MSG_FMT_STRNL "%s\n" 311@ MSG_FMT_INDEX "[%lld]" 312@ MSG_FMT_INDEXRANGE "[%lld-%lld]" 313@ MSG_FMT_DUMPENTRY "%15s " 314 315 316# Module name 317 318@ MSG_MOD_NAME "str" 319 320 321# Command names 322 323@ MSG_CMD_DUMP "dump" 324@ MSG_CMD_SET "set" 325@ MSG_CMD_ADD "add" 326@ MSG_CMD_ZERO "zero" 327