public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Show Symbol Table for OMF (.obj)?
@ 2016-05-16 19:11 Benjamin Cao
  2016-05-16 19:35 ` Mark Geisert
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Benjamin Cao @ 2016-05-16 19:11 UTC (permalink / raw)
  To: cygwin

Hi,

I am curious to know if there is a command that will display a symbol table for *.obj files. It seems as if commands such as "nm" or "objdump" do not do this. I get "File format not recognized".

If there is a way to get it to work with nm or objdump, I am all ears. Or if there is a different command to satisfy this, that would be helpful as well.

Thanks,
Ben Cao

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Show Symbol Table for OMF (.obj)?
  2016-05-16 19:11 Show Symbol Table for OMF (.obj)? Benjamin Cao
@ 2016-05-16 19:35 ` Mark Geisert
  2016-05-16 19:42 ` Warren Young
  2016-05-16 20:05 ` Yaakov Selkowitz
  2 siblings, 0 replies; 5+ messages in thread
From: Mark Geisert @ 2016-05-16 19:35 UTC (permalink / raw)
  To: cygwin

Benjamin Cao writes:
> I am curious to know if there is a command that will display a symbol 
table for *.obj files. It seems as if
> commands such as "nm" or "objdump" do not do this. I get "File format 
not recognized".
> 
> If there is a way to get it to work with nm or objdump, I am all ears. 
Or if there is a different command to satisfy
> this, that would be helpful as well.

Both nm and objdump are capable of displaying symbol tables.  The error 
message you're getting means you need to explicitly specify
"--target=BFDNAME" with BFDNAME matching the .obj file's format.

The formats we typically see are pe-i386 and pei-i386 for x86 object and 
image, and pe-x86-64 and pei-x86-64 for x86_64 object and image, 
respectively.

'nm --help' and 'objdump --help' show the supported targets.

..mark


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Show Symbol Table for OMF (.obj)?
  2016-05-16 19:11 Show Symbol Table for OMF (.obj)? Benjamin Cao
  2016-05-16 19:35 ` Mark Geisert
@ 2016-05-16 19:42 ` Warren Young
  2016-05-16 20:05 ` Yaakov Selkowitz
  2 siblings, 0 replies; 5+ messages in thread
From: Warren Young @ 2016-05-16 19:42 UTC (permalink / raw)
  To: The Cygwin Mailing List

On May 16, 2016, at 1:10 PM, Benjamin Cao <becao@progress.com> wrote:
> 
> I am curious to know if there is a command that will display a symbol table for *.obj files. It seems as if commands such as "nm" or "objdump" do not do this. I get "File format not recognized”.

nm *is* the right tool, but only for file types it knows about.

You should only expect a platform’s native nm to support the native executable types of the platform it runs on.  In the case of Cygwin, that’s various flavors of COFF and PE.  OMF is an entirely different format.

Cygwin’s nm happens to also support ELF for some reason, but that is yet a third object format.

Assuming libbfd knows OMF, you could rebuild your own OMF cross-development toolchain.  Then *its* nm would be the right tool for the job.

  https://en.wikipedia.org/wiki/Binary_File_Descriptor_library
--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Show Symbol Table for OMF (.obj)?
  2016-05-16 19:11 Show Symbol Table for OMF (.obj)? Benjamin Cao
  2016-05-16 19:35 ` Mark Geisert
  2016-05-16 19:42 ` Warren Young
@ 2016-05-16 20:05 ` Yaakov Selkowitz
  2016-05-19 20:29   ` Hans-Bernhard Bröker
  2 siblings, 1 reply; 5+ messages in thread
From: Yaakov Selkowitz @ 2016-05-16 20:05 UTC (permalink / raw)
  To: cygwin

On 2016-05-16 14:10, Benjamin Cao wrote:
> I am curious to know if there is a command that will display a symbol table for
> *.obj files. It seems as if commands such as "nm" or "objdump" do not do this.
> I get "File format not recognized".

You may want to try i586-pc-msdosdjgpp-{nm,objdump} from the 
djgpp-binutils package.

-- 
Yaakov

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Show Symbol Table for OMF (.obj)?
  2016-05-16 20:05 ` Yaakov Selkowitz
@ 2016-05-19 20:29   ` Hans-Bernhard Bröker
  0 siblings, 0 replies; 5+ messages in thread
From: Hans-Bernhard Bröker @ 2016-05-19 20:29 UTC (permalink / raw)
  To: cygwin

Am 16.05.2016 um 22:05 schrieb Yaakov Selkowitz:
> On 2016-05-16 14:10, Benjamin Cao wrote:
>> I am curious to know if there is a command that will display a symbol
>> table for
>> *.obj files. It seems as if commands such as "nm" or "objdump" do not
>> do this.
>> I get "File format not recognized".

> You may want to try i586-pc-msdosdjgpp-{nm,objdump} from the
> djgpp-binutils package.

That won't help, because DJGPP uses COFF, not OMF.

Actually, I don't think binutils ever supported OMF.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-05-19 20:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-16 19:11 Show Symbol Table for OMF (.obj)? Benjamin Cao
2016-05-16 19:35 ` Mark Geisert
2016-05-16 19:42 ` Warren Young
2016-05-16 20:05 ` Yaakov Selkowitz
2016-05-19 20:29   ` Hans-Bernhard Bröker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).