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