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