This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: nm dying on stripped .so's


> On Jan 12, 2017, at 3:11 AM, Andreas Schwab <schwab@linux-m68k.org> wrote:
> 
> On Jan 11 2017, Philip Prindeville <philipp_subx@redfish-solutions.com> wrote:
> 
>> Is there a patch to allow it to not choke on a stripped .so?
> 
> Please try readelf -Ds.
> 
> Andreas.
> 


I tried that: it works, thanks.  Attaching the output.

I’m confused why “readelf” considers the file sound, but “nm” doesn’t.  Can “nm” be made a little more forgiving?

$ readelf -Ds libevent.so


Symbol table for image:
  Num Buc:    Value          Size   Type   Bind Vis      Ndx Name
   64   1: 0000000000000000     0 FUNC    WEAK   DEFAULT UND __register_frame_info
   20   1: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT UND call_user_function
   56   2: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT UND php_sockets_le_socket
    8   2: 0000000000000000     0 FUNC    GLOBAL DEFAULT UND event_base_loop
    2   2: 0000000000000000     0 FUNC    GLOBAL DEFAULT UND bufferevent_free
   29   3: 0000000000000000     0 FUNC    GLOBAL DEFAULT UND bufferevent_priority_set
   26   4: 0000000000000000     0 FUNC    GLOBAL DEFAULT UND bufferevent_base_set
   32   5: 0000000000000000     0 FUNC    WEAK   DEFAULT UND __deregister_frame_info
    5   5: 0000000000000000     0 FUNC    GLOBAL DEFAULT UND event_base_new
   70   7: 0000000000000000     0 FUNC    GLOBAL DEFAULT UND event_set
   62   8: 0000000000000000     0 FUNC    GLOBAL DEFAULT UND event_del
   59  10: 00000000002070c8     0 NOTYPE  GLOBAL DEFAULT bad _edata
   38  10: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT UND php_error_docref0
   31  10: 0000000000000000     0 NOTYPE  WEAK   DEFAULT UND _ITM_registerTMCloneTable
   27  11: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT UND php_file_le_stream
   19  11: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT UND _zend_list_delete
   58  14: 0000000000000000     0 FUNC    GLOBAL DEFAULT UND event_base_priority_init
   11  15: 0000000000000000     0 FUNC    GLOBAL DEFAULT UND bufferevent_new
    9  15: 0000000000000000     0 FUNC    GLOBAL DEFAULT UND event_reinit
   21  17: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT UND zend_list_insert
   10  17: 0000000000000000     0 FUNC    GLOBAL DEFAULT UND bufferevent_enable
   33  19: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT UND php_info_print_table_star
   16  22: 0000000000000000     0 FUNC    GLOBAL DEFAULT UND event_get_version
   30  23: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT UND _zend_list_addref
   44  24: 0000000000000000     0 NOTYPE  WEAK   DEFAULT UND _ITM_deregisterTMCloneTab
   22  24: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT UND ap_php_snprintf
   63  26: 0000000000000000     0 FUNC    GLOBAL DEFAULT UND event_pending
   42  26: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT UND php_info_print_table_row
   24  26: 0000000000002520     1 FUNC    GLOBAL DEFAULT bad _init
    3  26: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT UND _zval_ptr_dtor
   48  28: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT UND _emalloc
   60  29: 0000000000207140     0 NOTYPE  GLOBAL DEFAULT bad _end
   12  29: 0000000000000000     0 FUNC    GLOBAL DEFAULT UND event_base_loopbreak
    7  29: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT UND zend_register_long_consta
   34  31: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT UND _estrndup
   25  31: 0000000000000000     0 FUNC    GLOBAL DEFAULT UND bufferevent_setwatermark
   65  32: 0000000000000000     0 FUNC    GLOBAL DEFAULT UND bufferevent_disable
   55  33: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT UND php_info_print_table_head
   41  34: 0000000000000000     0 FUNC    GLOBAL DEFAULT UND bufferevent_write
   57  35: 0000000000000000     0 FUNC    GLOBAL DEFAULT UND bufferevent_setfd
   52  35: 0000000000205ea0  1024 OBJECT  GLOBAL DEFAULT bad libevent_functions
   68  36: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT UND _ecalloc
   47  36: 0000000000000000     0 FUNC    GLOBAL DEFAULT UND bufferevent_settimeout
   17  36: 0000000000000000     0 FUNC    WEAK   DEFAULT UND __cxa_finalize
    6  36: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT UND zend_is_callable
   54  38: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT UND _php_stream_cast
   66  40: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT UND executor_globals
   28  41: 000000000000467e     8 FUNC    GLOBAL DEFAULT bad get_module
   18  43: 0000000000000000     0 FUNC    GLOBAL DEFAULT UND bufferevent_read
   35  44: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT UND _safe_emalloc
   39  46: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT UND zend_fetch_resource
   45  49: 00000000002070c8     0 NOTYPE  GLOBAL DEFAULT bad __bss_start
   43  50: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT UND zend_register_list_destru
   13  50: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT UND _zval_dtor_func
   53  51: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT UND php_info_print_table_end
   36  51: 0000000000000000     0 FUNC    GLOBAL DEFAULT UND event_priority_set
   67  52: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT UND zval_used_for_init
   61  53: 0000000000000000     0 FUNC    GLOBAL DEFAULT UND event_base_loopexit
   14  54: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT UND convert_to_long
   69  55: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT UND zval_add_ref
   37  57: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT UND _efree
   46  58: 0000000000000000     0 FUNC    GLOBAL DEFAULT UND event_add
   15  59: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT UND _zval_copy_ctor_func
    4  59: 0000000000000000     0 FUNC    GLOBAL DEFAULT UND event_base_free
   51  61: 00000000000046a8     1 FUNC    GLOBAL DEFAULT bad _fini
   50  63: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT UND compiler_globals
   49  64: 0000000000000000     0 FUNC    GLOBAL DEFAULT UND event_base_set
   23  64: 0000000000000000     0 FUNC    GLOBAL DEFAULT UND __stack_chk_fail
   40  65: 0000000000207020   168 OBJECT  GLOBAL DEFAULT bad libevent_module_entry
   71  66: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT UND zend_parse_parameters


$ 

Also, in the “Ndx” column, why are some symbols marked “bad”?

This is 2.25-1 in a cross-compilation environment, i.e. building on Ubuntu 14.4 (sigh) for a 4.4.14 linux distro, and using gcc-5.3.0 and MUSL-1.1.16.

Thanks,

-Philip



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]