Ticket #59 (closed defect)

Opened 3 years ago

Last modified 3 years ago

elf output format: section index on symbols are wrong if .text missing

Reported by: hkmaly@gmail.com Assigned to:
Priority: P1 Milestone:
Component: Core Version: unspecified
Severity: normal Keywords: .text elf section
Cc:

Description

If you create perfectly valid elf file which doesn't have section .text, all symbols in symbol table have wrong section ... including symbol _start, which means program resulting from link will be unusable. Of course, in most cases there will be NO program resulting from link, because ld segfaults on object file with references to such symbols.

example code: 1) linkable

SECTION .hkcode progbits alloc exec write align=16
_start:
global _start
  mov eax,1
  int 80h
section .data
global entr
entr db 0Ah

2) unlinkable

SECTION .hkcode progbits alloc exec write align=16
_start:
global _start
  mov eax,1
  int 80h
section data
text db 'Hello from yasm',0Ah,0
section .hkcode
    mov esi,text

Attachments

Change History

09/07/05 22:01:53 changed by peter@tortall.net

  • status changed from new to closed.
  • resolution changed.

Fixed in [1226].


Add/Change #59 (elf output format: section index on symbols are wrong if .text missing)