On Tue, 2008-09-16 at 23:15 +0200, Johannes Berg wrote: > On Tue, 2008-09-16 at 23:11 +0200, Johannes Berg wrote: > > > > 83 for (cmd = &__start___cmd; cmd < &__stop___cmd; cmd++) { > > > (gdb) p __start___cmd > > > $1 = {section = 0x0, name = 0x403d02 "info", args = 0x0, cmd = NL80211_CMD_GET_WIPHY, > > > nl_msg_flags = 0, idby = CIB_PHY, handler = 0x402403 <handle_info>} > > > (gdb) p *(&__start___cmd + 1) > > > $2 = {section = 0x0, name = 0x0, args = 0x0, cmd = 4209927, nl_msg_flags = 0, idby = CIB_NONE, > > > handler = 0x30000000001} > > > (gdb) > > > > > > That means, __start___cmd points to "info". The next command has no > > > name (and appears to be a complete mess). The clever section trick > > > doesn't seem to work properly. > > Hmm. can you send the output of > > nm iw | grep __cmd I recompiled iw with optimization, so the addresses may be different. $ nm iw | grep __cmd 0000000000403d40 r __cmd_handle_infoNL80211_CMD_GET_WIPHYCIB_NONE 0000000000403d80 r __cmd_handle_infoNL80211_CMD_GET_WIPHYCIB_PHY 0000000000403f00 r __cmd_handle_interface_addNL80211_CMD_NEW_INTERFACECIB_NETDEV 0000000000403f40 r __cmd_handle_interface_addNL80211_CMD_NEW_INTERFACECIB_PHY 0000000000403ec0 r __cmd_handle_interface_delNL80211_CMD_DEL_INTERFACECIB_NETDEV 0000000000403e80 r __cmd_handle_interface_infoNL80211_CMD_GET_INTERFACECIB_NETDEV 0000000000403e00 r __cmd_handle_interface_meshidNL80211_CMD_SET_INTERFACECIB_NETDEV 0000000000403e40 r __cmd_handle_interface_setNL80211_CMD_SET_INTERFACECIB_NETDEV 0000000000404080 r __cmd_handle_mpath_dumpNL80211_CMD_GET_MPATHCIB_NETDEV 0000000000404140 r __cmd_handle_mpath_getNL80211_CMD_DEL_MPATHCIB_NETDEV 0000000000404180 r __cmd_handle_mpath_getNL80211_CMD_GET_MPATHCIB_NETDEV 0000000000404100 r __cmd_handle_mpath_setNL80211_CMD_NEW_MPATHCIB_NETDEV 00000000004040c0 r __cmd_handle_mpath_setNL80211_CMD_SET_MPATHCIB_NETDEV 0000000000403dc0 r __cmd_handle_nameNL80211_CMD_SET_WIPHYCIB_PHY 00000000004041c0 r __cmd_handle_reg_setNL80211_CMD_REQ_SET_REGCIB_NONE 0000000000403f80 r __cmd_handle_station_dumpNL80211_CMD_GET_STATIONCIB_NETDEV 0000000000404000 r __cmd_handle_station_getNL80211_CMD_DEL_STATIONCIB_NETDEV 0000000000404040 r __cmd_handle_station_getNL80211_CMD_GET_STATIONCIB_NETDEV 0000000000403fc0 r __cmd_handle_station_setNL80211_CMD_SET_STATIONCIB_NETDEV 0000000000403d40 A __start___cmd 00000000004041f0 A __stop___cmd > objdump -h iw > (only the __cmd section part is fine) 15 __cmd 000004b0 0000000000403d40 0000000000403d40 00003d40 2**5 CONTENTS, ALLOC, LOAD, READONLY, DATA > and > objdump -j __cmd -s iw $ objdump -j __cmd -s iw iw: file format elf64-x86-64 Contents of section __cmd: 403d40 00000000 00000000 75384000 00000000 ........u8@..... 403d50 00000000 00000000 01000000 00030000 ................ 403d60 00000000 00000000 c01d4000 00000000 ..........@..... 403d70 00000000 00000000 00000000 00000000 ................ 403d80 00000000 00000000 7a384000 00000000 ........z8@..... 403d90 00000000 00000000 01000000 00000000 ................ 403da0 01000000 00000000 c01d4000 00000000 ..........@..... 403db0 00000000 00000000 00000000 00000000 ................ 403dc0 88384000 00000000 8c384000 00000000 .8@......8@..... 403dd0 91384000 00000000 02000000 00000000 .8@............. 403de0 01000000 00000000 50224000 00000000 ........P"@..... 403df0 00000000 00000000 00000000 00000000 ................ 403e00 88384000 00000000 65394000 00000000 .8@.....e9@..... 403e10 6c394000 00000000 06000000 00000000 l9@............. 403e20 02000000 00000000 c0224000 00000000 ........."@..... 403e30 00000000 00000000 00000000 00000000 ................ 403e40 88384000 00000000 ac384000 00000000 .8@......8@..... 403e50 75394000 00000000 06000000 00000000 u9@............. 403e60 02000000 00000000 a0264000 00000000 .........&@..... 403e70 00000000 00000000 00000000 00000000 ................ 403e80 00000000 00000000 7a384000 00000000 ........z8@..... 403e90 00000000 00000000 05000000 00000000 ................ 403ea0 02000000 00000000 c0254000 00000000 .........%@..... 403eb0 00000000 00000000 00000000 00000000 ................ 403ec0 00000000 00000000 82394000 00000000 .........9@..... 403ed0 00000000 00000000 08000000 00000000 ................ 403ee0 02000000 00000000 b0224000 00000000 ........."@..... 403ef0 00000000 00000000 00000000 00000000 ................ 403f00 86394000 00000000 90394000 00000000 .9@......9@..... 403f10 98394000 00000000 07000000 00000000 .9@............. 403f20 02000000 00000000 20234000 00000000 ........ #@..... 403f30 00000000 00000000 00000000 00000000 ................ 403f40 86394000 00000000 90394000 00000000 .9@......9@..... 403f50 98394000 00000000 07000000 00000000 .9@............. 403f60 01000000 00000000 20234000 00000000 ........ #@..... 403f70 00000000 00000000 00000000 00000000 ................ 403f80 c3384000 00000000 933a4000 00000000 .8@......:@..... 403f90 00000000 00000000 11000000 00030000 ................ 403fa0 02000000 00000000 e0284000 00000000 .........(@..... 403fb0 00000000 00000000 00000000 00000000 ................ 403fc0 c3384000 00000000 88384000 00000000 .8@......8@..... 403fd0 d83a4000 00000000 12000000 00000000 .:@............. 403fe0 02000000 00000000 502c4000 00000000 ........P,@..... 403ff0 00000000 00000000 00000000 00000000 ................ 404000 c3384000 00000000 82394000 00000000 .8@......9@..... 404010 983a4000 00000000 14000000 00000000 .:@............. 404020 02000000 00000000 20284000 00000000 ........ (@..... 404030 00000000 00000000 00000000 00000000 ................ 404040 c3384000 00000000 a63a4000 00000000 .8@......:@..... 404050 983a4000 00000000 11000000 00000000 .:@............. 404060 02000000 00000000 20284000 00000000 ........ (@..... 404070 00000000 00000000 00000000 00000000 ................ 404080 2e3c4000 00000000 933a4000 00000000 .<@......:@..... 404090 00000000 00000000 15000000 00030000 ................ 4040a0 02000000 00000000 d02f4000 00000000 ........./@..... 4040b0 00000000 00000000 00000000 00000000 ................ 4040c0 2e3c4000 00000000 88384000 00000000 .<@......8@..... 4040d0 603c4000 00000000 16000000 00000000 `<@............. 4040e0 02000000 00000000 20324000 00000000 ........ 2@..... 4040f0 00000000 00000000 00000000 00000000 ................ 404100 2e3c4000 00000000 343c4000 00000000 .<@.....4<@..... 404110 603c4000 00000000 17000000 00000000 `<@............. 404120 02000000 00000000 20324000 00000000 ........ 2@..... 404130 00000000 00000000 00000000 00000000 ................ 404140 2e3c4000 00000000 82394000 00000000 .<@......9@..... 404150 983a4000 00000000 18000000 00000000 .:@............. 404160 02000000 00000000 102f4000 00000000 ........./@..... 404170 00000000 00000000 00000000 00000000 ................ 404180 2e3c4000 00000000 a63a4000 00000000 .<@......:@..... 404190 983a4000 00000000 15000000 00000000 .:@............. 4041a0 02000000 00000000 102f4000 00000000 ........./@..... 4041b0 00000000 00000000 00000000 00000000 ................ 4041c0 0d3d4000 00000000 88384000 00000000 .=@......8@..... 4041d0 113d4000 00000000 1b000000 00000000 .=@............. 4041e0 00000000 00000000 80334000 00000000 .........3@..... -- Regards, Pavel Roskin -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html