Gripen
Gripen

Reputation: 131

readelf warning invalid namesz and/or descz

I have compiled a C/Cpp project with no warnings or errors. But when I use GNU readelf, I see some warnings in the output. Here’s the command I used:

readelf -a myprogram.elf

This generated a full readelf report. The relevant parts are as follows:

ELF Header:
  Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 
  Class:                             ELF32
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              EXEC (Executable file)
  Machine:                           Siemens Tricore
  Version:                           0x1
  Entry point address:               0x80019868
  Start of program headers:          52 (bytes into file)
  Start of section headers:          120676324 (bytes into file)
  Flags:                             0x200000
  Size of this header:               52 (bytes)
  Size of program headers:           32 (bytes)
  Number of program headers:         22
  Size of section headers:           40 (bytes)
  Number of section headers:         88
  Section header string table index: 85

Section Headers:
  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
  [ 0]                   NULL            00000000 000000 000000 00      0   0  0
  [ 1] .appHeader        PROGBITS        80018000 000800 000014 00   A  0   0 128
  [ 2] .applicationID    PROGBITS        80018100 000900 000038 00   A  0   0 256
  [ 3] .traptab          PROGBITS        80018200 000a00 000400 00  AX  0   0 256
  [ 4] .init             PROGBITS        80018600 000e00 000018 00  AX  0   0  8
  [73] .version.htc      NOTE            00000000 30aa5a 00098a 00      0   0  1
  [74] .comment          PROGBITS        00000000 30b3e4 00008c 01  MS  0   0  1
  [75] .debug_aranges    PROGBITS        00000000 30b470 0058f8 00      0   0  8
  [83] .version_info     NOTE            00000000 6ad65c8 4524f0 00      0   0  1
  [84] .debug_macro      PROGBITS        00000000 6f28ab8 3ed05a 00      0   0  1
  [85] .shstrtab         STRTAB          00000000 7315b12 0004d2 00      0   0  1
  [86] .symtab           SYMTAB          00000000 7316da4 0351f0 10     87 6325  4
  [87] .strtab           STRTAB          00000000 734bf94 0771c9 00      0   0  1

Symbol table '.symtab' contains 13599 entries:
    71: 50016000     0 SECTION LOCAL  DEFAULT   71 .IODriverTask
    72: 9f18d3c0     0 SECTION LOCAL  DEFAULT   72 .Core2.processCa[...]
    73: 00000000     0 SECTION LOCAL  DEFAULT   73 .version.htc
    74: 00000000     0 SECTION LOCAL  DEFAULT   74 .comment
    75: 00000000     0 SECTION LOCAL  DEFAULT   75 .debug_aranges
    82: 00000000     0 SECTION LOCAL  DEFAULT   82 .debug_ranges
    83: 00000000     0 SECTION LOCAL  DEFAULT   83 .version_info
    84: 00000000     0 SECTION LOCAL  DEFAULT   84 .debug_macro

No version information found in this file.

Displaying notes found in: .version.htc
  Owner                Data size Description
readelf: Warning: note with invalid namesz and/or descsz found at offset 0
readelf: Warning:  type: 0x6f697369, namesize: 0x29232840, descsize: 0x76655220, alignment: 4

Displaying notes found in: .version_info
  Owner                Data size Description
readelf: Warning: note with invalid namesz and/or descsz found at offset 0
readelf: Warning:  type: 0x65786520, namesize: 0x706d6f43, descsize: 0x72656c69, alignment: 4

I am having a hard time understanding what this error actually means. Something seems wrong with the .version.htc and .version_info sections. Is it possible to figure out the problem by looking at the readelf output?

Upvotes: 0

Views: 41

Answers (0)

Related Questions