- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- find compilation flags from a shared library
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2010 08:37 PM
12-13-2010 08:37 PM
There are many situations where we are required to find out the compilation flags used while creating a library. I tried using elfdump, but it does not show information regarding this.
Anyone has any idea how to find this out?
Also, how to find out if a shared library contains debugging information or not. Any specific command or trick? One trick I used is to open it in gdb and use the list command and if this shows the file name, the library contains debugging information. Any other trick?
Solved! Go to Solution.
- Tags:
- elfdump
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2010 09:46 PM
12-13-2010 09:46 PM
SolutionDid you use "elfdump -dc"?
>how to find out if a shared library contains debugging information or not.
elfdump -dc or footprints(1) will show it.
Or you can use "elfdump -S -h" and look for the real debug sections:
.debug_info .debug_macinfo .objdebug_*
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2010 10:03 PM
12-13-2010 10:03 PM
Re: find compilation flags from a shared library
elfdump output is:
elfdump -S -h libmpr_events.so | grep "debug"
39 PBIT 0000000000000000 000000000095aa68 0005a0a1 .objdebug_type
40 PBIT 0000000000000000 00000000009b4b09 0010024b .objdebug_file
41 PBIT 0000000000000000 0000000000ab4d54 00007f71 .objdebug_const
43 PBIT 0000000000000000 0000000000af5cd0 004fe49f .debug_line
44 PBIT 0000000000000000 0000000000ff416f 00130dd5 .debug_actual
45 PBIT 0000000000000000 0000000001124f44 00033630 .debug_procs_abbrev
46 PBIT 0000000000000000 0000000001158574 001a000b .debug_procs_info
and footprints gives:
footprints libmpr_dd.so | less
...
version [A.06.25.01/ANSI C++ 1]
architecture [ipf64 1]
-O [01 1]
PBO [off 1]
-g [1 1]
debugopt [+O1 1]
+Ointeger_overflow [moderate 1]
+Olit [all 1]
-ansi_for_scope [on 1]
-fpeval [float 1]
-inline [1 1]
-koenig_lookup [on 1]
-link_type [dynamic 1]
...
Although it seems it is compiled with debug information (-g), still when debugging, it is unable to load any information. See one of the core stack:
(gdb) where
#0 0xc00000000b890cb0:0 in adj::pe_base::EventBaseData::serialize (
No.Identifier_47=0x9fffffff7b0fff40, this=0x9fffffffa9d26aa8,
i_pBuffer=0x9fffffffa77000fb "410118298330", i_bufferLength=1365)
at /jphome/jp/ccjp/mb_ccjp/bb/gapebase/v75_0_S2P1D/entities/src/EventBase.cpp:163
#1 0xc00000000b895f60:0 in adj::pe_base::EventBase::serialize (
No.Identifier_51=0x9fffffff7b0fff40, this=0x9fffffffa9d26aa0,
o_pBuffer=0x9fffffffa77000fb "410118298330", i_bufferLength=1365)
at /jphome/jp/ccjp/mb_ccjp/bb/gapebase/v75_0_S2P1D/entities/src/EventBase.cpp:121
#2 0xc00000001766d500:0 in mapper::eventTypes::GPRSV1::serialize(char*,unsigned long)+0x70 ()
from /prdtc5/inf/aimsys/prdtc5/abp_home/custom/spbin/lib/libmpr_events.so
#3 0xc00000001112d960:0 in adj::rr_utils::RRSession::addEvent (
this=0x60000000cce35880, i_pEvent=0x9fffffffa9d26aa0)
at /jphome/jp/ccjp/mb_ccjp/bb/gesrrutils/v75_0_S2P1D/session/src/RRSession.cpp:376
For frame #2, which is present in the library I am interested in, I am not getting much information like I get for other frames. I tried using sharedlib and share command inside gdb to load symbols from libmpr_events.so, but to no avail.
Any pointers?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2010 10:19 PM
12-13-2010 10:19 PM
Re: find compilation flags from a shared library
These are also present in the Minimal Line Table.
The objdebug_* sections indicate the debug info is left in the object files, +objdebug, the default.
>-g [1 1]
One file with -g.
>For frame #2, which is present in the library I am interested in, I am not getting much info
Did you get a message saying it couldn't find the object file?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2010 10:44 PM
12-13-2010 10:44 PM
Re: find compilation flags from a shared library
(gdb) up
warning:
ERROR: Use the "objectdir" command to specify the search
path for objectfile events1.o.
If NOT specified will behave as a non -g compiled binary.
I am trying to get all the object files to this machine and try debugging again.
BTW, when I looked at the elfdump as well as footprints output, it seems that we are not getting any information about -DXXX flags. Is there a way to find them as well?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2010 11:10 PM
12-13-2010 11:10 PM
Re: find compilation flags from a shared library
No, these are deliberately removed and as being not all that useful in triaging user problems by the Response Center and taking up too much space.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2010 11:13 PM
12-13-2010 11:13 PM
Re: find compilation flags from a shared library
If it is too inconvenient to do that, you can compile and/or link with +noobjdebug.
This will bloat your load modules.
- Tags:
- objdebug