Questions de mémoire sous AIX

Mise à jour: 8 fevrier 2008
Version: 1.1
Author: Jean-Louis Bicquelet-Salaün
Location: http://jlbicquelet.free.fr
Copyright: (c) 2008 Jean-Louis BICQUELET-SALAÜN

Pour plus d'information au sujet de cette faq, contactez Jean-Louis BICQUELET


FAQ Revised: mercredi 18 octobre 2006 13:31:35


Table of Contents

1. commandes
2. information

1. commandes

1.1. comment savoir si un binaire est en 64 bits ?

première solution

utiliser nm suivi de -X64 (64 bits) ou -X32 (32bits) pour savoir si il contient des objets au format 64 bits.

nm -X64 ppserver
0654-210 ppserver is not valid in the current object file mode.
        Use the -X option to specify the desired object mode.

deuxième solution

utiliser file

  • si le descriptif est executable (RISC System/6000) or object module not stripped ou executable (RISC System/6000) or object module , c'est du 32 bits.
  • si le descriptif est 64-bit XCOFF executable or object module not strippedou 64-bit XCOFF executable or object module, c'est duu 64 bits.
dump -ov pmdtm_modifie

troisième solution

utiliser dump -ov

pmdtm_modifie:

                        ***Object Module Header***
# Sections      Symbol Ptr      # Symbols       Opt Hdr Len     Flags
         5      0x00000000              0                72     0x104f
Flags=( RELFLG EXEC LNNO LSYMS DYNLOAD DSA )
Timestamp = "Jul 16 02:49:49 2003"
Magic = 0x1df  (32-bit XCOFF)

                        ***Optional Header***
Tsize        Dsize       Bsize       Tstart      Dstart
0x004f61ce  0x000887ee  0x000013d4  0x10000150  0x2000031e

SNloader     SNentry     SNtext      SNtoc       SNdata
0x0004      0x0002      0x0001      0x0002      0x0002

TXTalign     DATAalign   TOC         vstamp      entry
0x0005      0x0003      0x20085944  0x0001      0x2005ff50

maxSTACK     maxDATA     SNbss       magic       modtype
0x00000000  0x40000000  0x0003      0x010b        1L


1.2. comment obtenir la table des symboles ?
nm ppserver | pg
                     f           -
.$PTRGL              T   268735808
.$SAVEF14            T   269039856
.$SAVEF15            T   269039860
.$SAVEF16            T   269039864
.$SAVEF17            T   269039868
.$SAVEF18            T   269039872
...
vsprintf             U           -
vsprintf             d   537190940           4
which.c              f           -
write                U           -
write                d   537190836           4


1.3. comment obtenir la taille de la pile et du data segment ?
dump -o ppdsweb

ppdsweb:

                        ***Object Module Header***
# Sections      Symbol Ptr      # Symbols       Opt Hdr Len     Flags
         4      0x00a0883a          75980                72     0x1002
Timestamp = 1081486625
Magic = 0x1df

                        ***Optional Header***
Tsize        Dsize       Bsize       Tstart      Dstart
0x0088dd73  0x0006f4e9  0x00002d80  0x10000150  0x20000ec3

SNloader     SNentry     SNtext      SNtoc       SNdata
0x0004      0x0002      0x0001      0x0002      0x0002

TXTalign     DATAalign   TOC         vstamp      entry
0x0005      0x0003      0x2006eb30  0x0001      0x20063b9c

maxSTACK     maxDATA     SNbss       magic       modtype
0x00000000  0x00000000  0x0003      0x010b        1L

maxDATA à 0 indique que 256 Mo sont réservés.

1.4. comment obtenir la taille occupée par chaque segment ?
size -f pmcmd
pmcmd: 186653(.text) + 43595(.data) + 8(.bss) + 103985(.loader) = 334241



1.5. comment modifier la taille d'un segment ?

Il faut utiliser ldedit.

/usr/bin/ldedit -bmaxdata:0x80000000/dsa osh



2. information

2.1. quels sont les modtype d'un fichier binaire ?

1L Single use
RE Reusable
RO Read only


2.2. quel est l'organisation d'un programme sous AIX ?

        File Organization:

        _________________________________________       INCLUDE FILE
        |_______________HEADER_DATA_____________|
        |                                       |
        |       File Header                     |       "filehdr.h"
        |.......................................|
        |                                       |
        |       Auxilliary Header Information   |       "aouthdr.h"
        |_______________________________________|
        |       ".text" section header          |       "scnhdr.h"
        |.......................................|
        |       ".data" section header          |       ''
        |.......................................|
        |       ".bss" section header           |       ''
        |.......................................|
        |       ".loader" section header        |       ''
        |.......................................|
        |       ".typchk" section header        |       ''
        |.......................................|
        |       ".debug" section header         |       ''
        |.......................................|
        |       ".except" section header        |       ''
        |.......................................|
        |       ".info" section header          |       ''
        |_______________________________________|
        |______________RAW_DATA_________________|
        |       ".text" section data            |
        |.......................................|
        |       optional ".pad" section data    |
        |               (file alignment)        |
        |.......................................|
        |       ".data" section data            |
        |.......................................|
        |       ".loader" section data          |       "loader.h"
        |.......................................|
        |       ".typchk" section data          |       "typchk.h"
        |.......................................|
        |       ".debug" section data           |       "dbug.h"
        |.......................................|
        |       ".except" section data          |       "exceptab.h"
        |.......................................|
        |       ".info" section data            |
        |_______________________________________|
        |____________RELOCATION_DATA____________|
        |                                       |
        |       ".text" section relocation data |       "reloc.h"
        |                                       |
        |.......................................|
        |                                       |
        |       ".data" section relocation data |       ''
        |                                       |
        |_______________________________________|
        |__________LINE_NUMBER_DATA_____________|
        |                                       |
        |       ".text" section line numbers    |       "linenum.h"
        |                                       |
        |_______________________________________|
        |________________SYMBOL_TABLE___________|
        |                                       |
        |       ".text", ".data" and ".bss"     |       "syms.h"
        |               section symbols         |       "storclass.h"
        |                                       |
        |_______________________________________|
        |________________STRING_TABLE___________|
        |                                       |
        |       long symbol names               |
        |_______________________________________|



2.3. Ou peut on trouver des informations sur les segments ?
dans le fichier /usr/include/xcoff.h.