xref: /titanic_50/usr/src/cmd/sgs/elfedit/modules/common/phdr.msg (revision 380789fc80376bd1573770361cb177a08c7e3524)
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 2007 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 'phdr' module
31
32@ MSG_ID_ELFEDIT_PHDR
33
34
35# Program header format
36@ MSG_ELF_PHDR		"Program header [%d]:\n"
37
38# Debug messages
39@ MSG_DEBUG_PHDR	"phdr[%d]: Program header: %s\n"
40@ MSG_DEBUG_OLDINTERPOK	"[%d: %s][%d]: value unchanged: %s\n"
41@ MSG_DEBUG_SETPHINTERP	"phdr[%d]: update PT_INTERP program header: \
42			 p_offset=%#llx,  p_size=%#llx\n"
43@ MSG_DEBUG_NEWISTR 	"[%d: %s][%d]: Write new value in .interp \
44			 section: %s\n"
45@ MSG_DEBUG_LNGISTR	"[%d: %s][%d]: New value too long (%d bytes) for \
46			 .interp section (%d bytes): %s\n"
47@ MSG_DEBUG_S_OK	"phdr[%d].%s: value unchanged: %s\n"
48@ MSG_DEBUG_S_CHG	"phdr[%d].%s: change from %s to %s\n"
49@ MSG_DEBUG_LLX_OK	"phdr[%d].%s: value unchanged: %#llx\n"
50@ MSG_DEBUG_LLX_CHG	"phdr[%d].%s: change from %#llx to %#llx\n"
51
52# Format strings
53
54@ MSG_FMT_ELF_INTERP	"Interpreter Section:  %s\n\t%s\n"
55
56
57
58# Errors
59
60@ MSG_ERR_NOINTERPPHDR	"ELF object does not have an interpreter \
61			 program header\n"
62@ MSG_ERR_NOINTERPSEC	"Unable to locate section corresponding to PT_INTERP \
63			 program header\n"
64@ MSG_ERR_NOPHDR	"No program header with specified type available: %s\n"
65
66
67# Module description
68
69@ MSG_MOD_DESC		"Program Header"
70
71
72# 1-line description strings
73
74@ MSG_DESC_DUMP		"Dump Program Header Contents"
75@ MSG_DESC_P_TYPE	"Segment type"
76@ MSG_DESC_P_OFFSET	"Offset from start of file"
77@ MSG_DESC_P_VADDR	"Virtual address of 1st byte in memory"
78@ MSG_DESC_P_PADDR	"Segment's physical address"
79@ MSG_DESC_P_FILESZ	"# of bytes in file image of segment"
80@ MSG_DESC_P_MEMSZ	"# bytes in memory image of segment"
81@ MSG_DESC_P_FLAGS	"Segment flags"
82@ MSG_DESC_P_ALIGN	"Segment alignmnent"
83@ MSG_DESC_INTERP	"Dynamic object interpreter (PT_INTERP)"
84@ MSG_DESC_DELETE	"Delete program headers"
85@ MSG_DESC_MOVE		"Move program headers"
86
87
88# Command option description strings
89
90@ MSG_OPTDESC_PHNDX	"\
91   Interpret the element argument as a program header index\n\
92   rather than as a program header type.\n"
93
94# Command argument description strings
95
96@ MSG_A1_ELEMENT	"\
97   Type of program header. The first program header with the\n\
98   specified type will be used. If the -phndx option is used,\n\
99   then element is instead an integer giving the index of the\n\
100   specified program header element.\n"
101
102@ MSG_A1_INTERP_NEWPATH	"\
103   Path of new interpreter for ELF PT_INTERP program header.\n"
104
105@ MSG_A2_P_TYPE_TYPE	"\
106   Value to set for segment type. The value can be an integer,\n\
107   or one of hte well known PT_ symbolic constant names.\n"
108
109@ MSG_A2_P_OFFSET_VALUE	"\
110   Integer value to set for program header p_offset field.\n\
111   The value of p_offset gives the offset from the beginning\n\
112   of the file at which the first byte of the segment resides.\n"
113
114@ MSG_A2_P_VADDR_ADDR	"\
115   Integer value to set for virtual address at which the first\n\
116   byte of the segment resides in memory.\n"
117
118@ MSG_A2_P_PADDR_ADDR	"\
119   Integer value to set for physical address at which the first\n\
120   byte of the segment resides in memory.\n"
121
122@ MSG_A2_P_FILESZ_SIZE	"\
123   Integer value to set for number of bytes in the file image\n\
124   of the segment, which can be zero.\n"
125
126@ MSG_A2_P_MEMSZ_SIZE	"\
127   Integer value to set for number of bytes in the memory image\n\
128   of the segment, which can be zero.\n"
129
130@ MSG_A2_P_FLAGS_VALUE "\
131   Segment flags. PF_ flag constants are accepted, as is\n\
132   any integer.\n"
133
134@ MSG_A2_P_ALIGN_ALIGN "\
135   Value to which the segment is aligned in memory, and in\n\
136   the file.\n"
137
138@ MSG_A2_DELETE_COUNT	"\
139   Number of program header elements to delete, starting\n\
140   at the specified position. This value cannot exceed the number\n\
141   of slots remaining in the header table below the specified.\n\
142   position If count is not supplied, a single element is deleted.\n"
143
144@ MSG_A2_MOVE_DST_INDEX	"\
145   Numeric index within program header to which the element(s)\n\
146   should be moved.\n"
147
148@ MSG_A3_MOVE_COUNT	"\
149   Number of program header elements to move. This value\n\
150   cannot exceed the number of slots remaining in the program\n\
151   header table below the specified position. If count is not\n\
152   supplied, a single header element is moved.\n"
153
154
155# Help strings
156
157@ MSG_HELP_DUMP	"   \
158   The phdr:dump command is used to display program headers\n\
159   using the same style used by the elfdump program.\n\
160   \n\
161   If phdr:dump is called without an argument, information for\n\
162   every program header is shown. If called with the element\n\
163   argument, the information for the program header symbol at\n\
164   that index is displayed.\n"
165
166@ MSG_HELP_P_TYPE	"   \
167   The phdr:p_type command is used to display or alter the\n\
168   segment type program header. This information is maintained\n\
169   in the p_type field of an ELF program header element.\n\
170   \n\
171   If phdr:p_type is called without arguments, the value of\n\
172   p_type for every element of the program header array is\n\
173   shown. If called with the element argument, the value of the\n\
174   program header specified is displayed. If both arguments are\n\
175   present, the p_type field of the program header at the\n\
176   specified position is set to the given value.\n"
177
178@ MSG_HELP_P_OFFSET	"   \
179   The phdr:p_offset command is used to display or alter the\n\
180   p_offset field of the specified program header.\n\
181   \n\
182   p_offset provides the offset from the beginning of the\n\
183   at which the first byte of the segment resides.\n\
184   \n\
185   If phdr:p_offset is called without arguments, the value\n\
186   of p_offset for every element in the program header array\n\
187   is shown. If called with the element argument, the value\n\
188   of the element specified is displayed. If both arguments are\n\
189   present, the p_offset field of the element at the\n\
190   specifiedindex is set to the given value.\n"
191
192@ MSG_HELP_P_VADDR	"   \
193   The phdr:p_vaddr command is used to display or alter the\n\
194   p_vaddr field of the specified program header.\n\
195   \n\
196   p_vaddr provides the virtual address at which the first byte\n\
197   of the segment resides in memory\n\
198   \n\
199   If phdr:p_vaddr is called without arguments, the value\n\
200   of p_vaddr for every element in the program header array\n\
201   is shown. If called with the element argument, the value\n\
202   of the element specified is displayed. If both arguments are\n\
203   present, the p_vaddr field of the element at the specified\n\
204   index is set to the given value.\n"
205
206@ MSG_HELP_P_PADDR	"   \
207   The phdr:p_paddr command is used to display or alter the\n\
208   p_paddr field of the specified program header.\n\
209   \n\
210   p_paddr provides the physical address at which the first\n\
211   byte of the segment resides in memory, for systems in which\n\
212   physical addressing is relevant. Because the system ignores\n\
213   physical addressing for application programs, this member\n\
214   has unspecified contents for executable files and shared\n\
215   objects.\n\
216   \n\
217   If phdr:p_paddr is called without arguments, the value\n\
218   of p_paddr for every element in the program header array\n\
219   is shown. If called with the element argument, the value\n\
220   of the element specified is displayed. If both arguments are\n\
221   present, the p_paddr field of the element at the specified\n\
222   index is set to the given value.\n"
223
224@ MSG_HELP_P_FILESZ	"   \
225   The phdr:p_filesz command is used to display or alter the\n\
226   p_filesz field of the specified program header.\n\
227   \n\
228   p_filesz contains the number of bytes in the file image\n\
229   of the segment. This value can be zero.\n\
230   \n\
231   If phdr:p_filesz is called without arguments, the value\n\
232   of p_filesz for every element in the program header array\n\
233   is shown. If called with the element argument, the value\n\
234   of the element specified is displayed. If both arguments are\n\
235   present, the p_filesz field of the element at the specified\n\
236   index is set to the given value.\n"
237
238@ MSG_HELP_P_MEMSZ	"   \
239   The phdr:p_memsz command is used to display or alter the\n\
240   p_memsz field of the specified program header.\n\
241   \n\
242   p_memsz contains the number of bytes in the memory image\n\
243   of the segment. This value can be zero.\n\
244   \n\
245   If phdr:p_memsz is called without arguments, the value\n\
246   of p_memsz for every element in the program header array\n\
247   is shown. If called with the element argument, the value\n\
248   of the element specified is displayed. If both arguments are\n\
249   present, the p_memsz field of the element at the specified\n\
250   index is set to the given value.\n"
251
252@ MSG_HELP_P_FLAGS	"   \
253   The phdr:p_flags command is used to display or alter the\n\
254   flags that are associated with the segment described by\n\
255   the program header.\n\
256   \n\
257   If phdr:p_flags is called without arguments, the value\n\
258   of p_flags for every element in the program header array\n\
259   is shown. If called with the element argument, the value of\n\
260   the program header at that index is displayed. If one or\n\
261   more value arguments are present, the following steps are\n\
262   taken:\n\
263   \n\
264   o\tAll the value arguments are OR'd together.\n\
265   \n\
266   o\tIf the -cmp option has been specified, the new value\n\
267   \tis complemented.\n\
268   \n\
269   o\tThe p_flags field of the section header is updated with\n\
270   \tthe new value. If -and is specified, the new value is\n\
271   \tAND'd against the existing value. If -or is specified,\n\
272   \tthe new value is OR'd against the existing value. If\n\
273   \tneither -and or -or are specified, the new value replaces\n\
274   \tthe existing value.\n"
275
276@ MSG_HELP_P_ALIGN	"   \
277   The phdr:p_align command is used to display or alter the\n\
278   p_align field of the specified program header.\n\
279   \n\
280   p_align is the value to which the segment is aligned in\n\
281   memory, and in the file. Values 0 and 1 mean no alignment\n\
282   is required. Otherwise, p_align should be a positive\n\
283   integral power of 2, and p_vaddr should equal p_offset,\n\
284   modulo p_align.\n\
285   \n\
286   If phdr:p_align is called without arguments, the value\n\
287   of p_align for every element in the program header array\n\
288   is shown. If called with the element argument, the value\n\
289   of the element specified is displayed. If both arguments are\n\
290   present, the p_align field of the element at the specified\n\
291   index is set to the given value.\n"
292
293@ MSG_HELP_INTERP	"   \
294   The phdr:interp command is used to display or alter the\n\
295   interpreter of the ELF object.\n\
296   \n\
297   If phdr:interp is called without arguments, the existing\n\
298   interpreter is shown. If called with the newpath argument,\n\
299   the interpreter is set to the given string, if possible.\n\
300   \n\
301   An ELF PT_INTERP program header usually references its own\n\
302   special section instead of some other string table. The ELF\n\
303   ABI says that this section must be named \".interp\". .interp\n\
304   is typically sized to just fit the original string, including\n\
305   its NULL termination. You can treat it as a string table with\n\
306   one string. If the new interpreter path is short enough to fit\n\
307   in this .interp section, phdr:interp simply replaces the old\n\
308   path with the new one.\n\
309   \n\
310   In the case where the new path is too long to fit in the .interp\n\
311   section, phdr:interp will attempt to use the dynamic string table\n\
312   instead. This is not always possible: The desired string must\n\
313   already exist in the dynamic string table, or there must be\n\
314   enough room in the reserved section at the end (DT_SUNW_STRPAD)\n\
315   for the new string to be added.\n"
316
317@ MSG_HELP_DELETE	"   \
318   The phdr:delete command is used to delete one or more elements\n\
319   in the program header. The elements following the deleted items\n\
320   move up, and the vacated elements at the end are zero filled.\n"
321
322@ MSG_HELP_MOVE	"   \
323   The phdr:move command is used to move the position of one\n\
324   or more elements in the program header array. The specified\n\
325   number of elements are moved from elt to dst_index.\n"
326
327
328@ _END_
329
330
331# Strings
332
333@ MSG_STR_EMPTY		""
334@ MSG_STR_NL		"\n"
335@ MSG_STR_ALIGN		"align"
336@ MSG_STR_ADDR		"addr"
337@ MSG_STR_COUNT		"count"
338@ MSG_STR_DST_INDEX	"dst_index"
339@ MSG_STR_ELEMENT	"element"
340@ MSG_STR_NEWPATH	"newpath"
341@ MSG_STR_SIZE		"size"
342@ MSG_STR_TYPE		"type"
343@ MSG_STR_VALUE		"value"
344@ MSG_STR_MINUS_PHNDX	"-phndx"
345
346# Format strings
347
348@ MSG_FMT_U_NL			"%u\n"
349@ MSG_FMT_X_NL			"%#x\n"
350@ MSG_FMT_LLX_NL		"%#llx\n"
351@ MSG_FMT_STRNL			"%s\n"
352
353
354
355# The following strings represent reserved words, files, pathnames and symbols.
356# Reference to this strings is via the MSG_ORIG() macro, and thus no message
357# translation is required.
358
359# ELF section names
360@ MSG_SEC_INTERP	".interp"
361
362
363# Module name
364
365@ MSG_MOD_NAME		"phdr"
366
367
368# Command names
369
370@ MSG_CMD_DUMP		"dump"
371@ MSG_CMD_P_TYPE	"p_type"
372@ MSG_CMD_P_OFFSET	"p_offset"
373@ MSG_CMD_P_VADDR	"p_vaddr"
374@ MSG_CMD_P_PADDR	"p_paddr"
375@ MSG_CMD_P_FILESZ	"p_filesz"
376@ MSG_CMD_P_MEMSZ	"p_memsz"
377@ MSG_CMD_P_FLAGS	"p_flags"
378@ MSG_CMD_P_ALIGN	"p_align"
379@ MSG_CMD_INTERP	"interp"
380@ MSG_CMD_DELETE	"delete"
381@ MSG_CMD_MOVE		"move"
382