• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
gdb and DATA before TEXT segment
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gdb and DATA before TEXT segment


  • Subject: gdb and DATA before TEXT segment
  • From: boga <email@hidden>
  • Date: Thu, 11 Nov 2004 06:33:53 +0100

I'm asking the MachO experts if it is illegal for an application to have the 'DATA' segment before the 'TEXT'?!

CodeWarrior has a linker flag 'DATA segment before TEXT segment' to work around the 'relocation offset is out of range limitation'.
The problem is that gdb gives a fatal error when debugging such executable:
> macosx-nat-dyld-process.c:297: internal-error: assertion failure in function
> "library_offset": e->dyld_addr == ((e->image_addr + e->dyld_slide) & 0xffffffff)


From the gdb source the e->image_addr initialized something like:
> asection *text_sect = bfd_get_section_by_name (e->abfd, "LC_SEGMENT.__TEXT");
> e->image_addr = bfd_section_vma (e->abfd, text_sect);


To reproduce the problem download:
http://homepage.mac.com/boga/DataBeforeText.zip

gdb helloword_d
(gdb)r
(gdb)sharedlibrary remove-symbol-file all
(gdb)sharedlibrary add-symbol-file all
(gdb)sharedlibrary add-symbol-file all

/SourceCache/gdb/gdb-330.1/src/gdb/macosx/macosx-nat-dyld-process.c: 297: internal-error: assertion failure in function
"library_offset": e->dyld_addr == ((e->image_addr + e->dyld_slide) & 0xffffffff)


This bug makes us impossible to debug our app unless we recompile gdb with removing the bogus fatal_assert.

Regards,
Miklós


_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Prev by Date: Re: My strange problems
  • Next by Date: Re: My strange problems
  • Previous by thread: Re: My strange problems
  • Next by thread: Developing on OSX 10.1
  • Index(es):
    • Date
    • Thread