GAS LISTING /tmp/cchyVqnG.s page 1 1 .file "virtual-diamond.cpp" 2 .text 3 .Ltext0: 4 .align 2 5 .globl _ZNK10bottomBase11getBaseDataEv 7 _ZNK10bottomBase11getBaseDataEv: 8 .LFB19: 9 .file 1 "virtual-diamond.cpp" 1:virtual-diamond.cpp **** #include <stdio.h> 2:virtual-diamond.cpp **** 3:virtual-diamond.cpp **** class bottomBase { 4:virtual-diamond.cpp **** int baseData; 5:virtual-diamond.cpp **** public: 6:virtual-diamond.cpp **** virtual int getBaseData() const; 7:virtual-diamond.cpp **** }; 8:virtual-diamond.cpp **** 9:virtual-diamond.cpp **** class baseA : public virtual bottomBase { 10:virtual-diamond.cpp **** int dataA; 11:virtual-diamond.cpp **** public: 12:virtual-diamond.cpp **** void setDataA(int a); 13:virtual-diamond.cpp **** virtual int getDataA() const; 14:virtual-diamond.cpp **** }; 15:virtual-diamond.cpp **** 16:virtual-diamond.cpp **** class baseB : public virtual bottomBase { 17:virtual-diamond.cpp **** int dataB; 18:virtual-diamond.cpp **** public: 19:virtual-diamond.cpp **** void setDataB(int b); 20:virtual-diamond.cpp **** virtual int getDataB() const; 21:virtual-diamond.cpp **** }; 22:virtual-diamond.cpp **** 23:virtual-diamond.cpp **** class subBoth : public baseA, public baseB { 24:virtual-diamond.cpp **** public: 25:virtual-diamond.cpp **** virtual int getSum() const; 26:virtual-diamond.cpp **** // Overrise get data methods for fun. 27:virtual-diamond.cpp **** virtual int getDataA() const; 28:virtual-diamond.cpp **** virtual int getDataB() const; 29:virtual-diamond.cpp **** 30:virtual-diamond.cpp **** // Override getBaseData; 31:virtual-diamond.cpp **** virtual int getBaseData() const; 32:virtual-diamond.cpp **** }; 33:virtual-diamond.cpp **** 34:virtual-diamond.cpp **** int bottomBase::getBaseData() const { 10 .loc 1 34 0 11 .cfi_startproc 12 .LVL0: 35:virtual-diamond.cpp **** return baseData; 13 .loc 1 35 0 14 0000 8B4708 movl 8(%rdi), %eax 36:virtual-diamond.cpp **** } 15 .loc 1 36 0 16 0003 C3 ret 17 .cfi_endproc 18 .LFE19: 20 .align 2 21 .globl _ZNK5baseA8getDataAEv 23 _ZNK5baseA8getDataAEv: 24 .LFB21: GAS LISTING /tmp/cchyVqnG.s page 2 37:virtual-diamond.cpp **** 38:virtual-diamond.cpp **** void baseA::setDataA(int a) { 39:virtual-diamond.cpp **** dataA = a; 40:virtual-diamond.cpp **** } 41:virtual-diamond.cpp **** int baseA::getDataA() const { 25 .loc 1 41 0 26 .cfi_startproc 27 .LVL1: 42:virtual-diamond.cpp **** return dataA; 28 .loc 1 42 0 29 0004 8B4708 movl 8(%rdi), %eax 43:virtual-diamond.cpp **** } 30 .loc 1 43 0 31 0007 C3 ret 32 .cfi_endproc 33 .LFE21: 35 .align 2 36 .globl _ZNK5baseB8getDataBEv 38 _ZNK5baseB8getDataBEv: 39 .LFB23: 44:virtual-diamond.cpp **** 45:virtual-diamond.cpp **** void baseB::setDataB(int b) { 46:virtual-diamond.cpp **** dataB = b; 47:virtual-diamond.cpp **** } 48:virtual-diamond.cpp **** int baseB::getDataB() const { 40 .loc 1 48 0 41 .cfi_startproc 42 .LVL2: 49:virtual-diamond.cpp **** return dataB; 43 .loc 1 49 0 44 0008 8B4708 movl 8(%rdi), %eax 50:virtual-diamond.cpp **** } 45 .loc 1 50 0 46 000b C3 ret 47 .cfi_endproc 48 .LFE23: 50 .align 2 51 .globl _ZNK7subBoth6getSumEv 53 _ZNK7subBoth6getSumEv: 54 .LFB24: 51:virtual-diamond.cpp **** 52:virtual-diamond.cpp **** int subBoth::getSum() const { 55 .loc 1 52 0 56 .cfi_startproc 57 .LVL3: 58 000c 55 pushq %rbp 59 .cfi_def_cfa_offset 16 60 .cfi_offset 6, -16 61 000d 53 pushq %rbx 62 .cfi_def_cfa_offset 24 63 .cfi_offset 3, -24 64 000e 4883EC08 subq $8, %rsp 65 .cfi_def_cfa_offset 32 66 0012 4889FB movq %rdi, %rbx 67 .LVL4: 68 .LBB11: 53:virtual-diamond.cpp **** int total = 0; GAS LISTING /tmp/cchyVqnG.s page 3 54:virtual-diamond.cpp **** total += getDataA(); 69 .loc 1 54 0 70 0015 488B07 movq (%rdi), %rax 71 0018 FF10 call *(%rax) 72 .LVL5: 73 001a 89C5 movl %eax, %ebp 74 .LVL6: 55:virtual-diamond.cpp **** total += getDataB(); 75 .loc 1 55 0 76 001c 488B03 movq (%rbx), %rax 77 .LVL7: 78 001f 4889DF movq %rbx, %rdi 79 0022 FF5010 call *16(%rax) 80 .LVL8: 81 0025 01E8 addl %ebp, %eax 82 .LVL9: 83 .LBE11: 56:virtual-diamond.cpp **** return total; 57:virtual-diamond.cpp **** } 84 .loc 1 57 0 85 0027 4883C408 addq $8, %rsp 86 .cfi_def_cfa_offset 24 87 002b 5B popq %rbx 88 .cfi_def_cfa_offset 16 89 .LVL10: 90 002c 5D popq %rbp 91 .cfi_def_cfa_offset 8 92 002d C3 ret 93 .cfi_endproc 94 .LFE24: 96 .section .rodata.str1.1,"aMS",@progbits,1 97 .LC0: 98 0000 63616C6C .string "calling getDataA()\n" 98 696E6720 98 67657444 98 61746141 98 28290A00 99 .text 100 .align 2 101 .globl _ZNK7subBoth8getDataAEv 103 _ZNK7subBoth8getDataAEv: 104 .LFB25: 58:virtual-diamond.cpp **** 59:virtual-diamond.cpp **** int subBoth::getDataA() const { 105 .loc 1 59 0 106 .cfi_startproc 107 .LVL11: 108 002e 53 pushq %rbx 109 .cfi_def_cfa_offset 16 110 .cfi_offset 3, -16 111 002f 4889FB movq %rdi, %rbx 112 .LVL12: 113 .LBB12: 114 .LBB13: 115 .file 2 "/usr/include/x86_64-linux-gnu/bits/stdio2.h" 1:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** /* Checking macros for stdio functions. 2:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** Copyright (C) 2004-2014 Free Software Foundation, Inc. GAS LISTING /tmp/cchyVqnG.s page 4 3:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** This file is part of the GNU C Library. 4:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** 5:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** The GNU C Library is free software; you can redistribute it and/or 6:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** modify it under the terms of the GNU Lesser General Public 7:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** License as published by the Free Software Foundation; either 8:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** version 2.1 of the License, or (at your option) any later version. 9:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** 10:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** The GNU C Library is distributed in the hope that it will be useful, 11:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** but WITHOUT ANY WARRANTY; without even the implied warranty of 12:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** Lesser General Public License for more details. 14:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** 15:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** You should have received a copy of the GNU Lesser General Public 16:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** License along with the GNU C Library; if not, see 17:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** <http://www.gnu.org/licenses/>. */ 18:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** 19:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** #ifndef _STDIO_H 20:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** # error "Never include <bits/stdio2.h> directly; use <stdio.h> instead." 21:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** #endif 22:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** 23:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** extern int __sprintf_chk (char *__restrict __s, int __flag, size_t __slen, 24:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** const char *__restrict __format, ...) __THROW; 25:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** extern int __vsprintf_chk (char *__restrict __s, int __flag, size_t __slen, 26:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** const char *__restrict __format, 27:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** _G_va_list __ap) __THROW; 28:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** 29:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** #ifdef __va_arg_pack 30:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** __fortify_function int 31:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** __NTH (sprintf (char *__restrict __s, const char *__restrict __fmt, ...)) 32:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** { 33:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1, 34:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** __bos (__s), __fmt, __va_arg_pack ()); 35:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** } 36:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** #elif !defined __cplusplus 37:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** # define sprintf(str, ...) \ 38:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** __builtin___sprintf_chk (str, __USE_FORTIFY_LEVEL - 1, __bos (str), \ 39:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** __VA_ARGS__) 40:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** #endif 41:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** 42:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** __fortify_function int 43:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** __NTH (vsprintf (char *__restrict __s, const char *__restrict __fmt, 44:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** _G_va_list __ap)) 45:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** { 46:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** return __builtin___vsprintf_chk (__s, __USE_FORTIFY_LEVEL - 1, 47:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** __bos (__s), __fmt, __ap); 48:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** } 49:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** 50:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** #if defined __USE_BSD || defined __USE_ISOC99 || defined __USE_UNIX98 51:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** 52:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** extern int __snprintf_chk (char *__restrict __s, size_t __n, int __flag, 53:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** size_t __slen, const char *__restrict __format, 54:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** ...) __THROW; 55:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** extern int __vsnprintf_chk (char *__restrict __s, size_t __n, int __flag, 56:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** size_t __slen, const char *__restrict __format, 57:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** _G_va_list __ap) __THROW; 58:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** 59:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** # ifdef __va_arg_pack GAS LISTING /tmp/cchyVqnG.s page 5 60:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** __fortify_function int 61:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** __NTH (snprintf (char *__restrict __s, size_t __n, 62:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** const char *__restrict __fmt, ...)) 63:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** { 64:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, 65:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** __bos (__s), __fmt, __va_arg_pack ()); 66:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** } 67:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** # elif !defined __cplusplus 68:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** # define snprintf(str, len, ...) \ 69:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** __builtin___snprintf_chk (str, len, __USE_FORTIFY_LEVEL - 1, __bos (str), \ 70:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** __VA_ARGS__) 71:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** # endif 72:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** 73:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** __fortify_function int 74:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** __NTH (vsnprintf (char *__restrict __s, size_t __n, 75:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** const char *__restrict __fmt, _G_va_list __ap)) 76:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** { 77:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** return __builtin___vsnprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, 78:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** __bos (__s), __fmt, __ap); 79:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** } 80:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** 81:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** #endif 82:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** 83:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** #if __USE_FORTIFY_LEVEL > 1 84:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** 85:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** extern int __fprintf_chk (FILE *__restrict __stream, int __flag, 86:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** const char *__restrict __format, ...); 87:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** extern int __printf_chk (int __flag, const char *__restrict __format, ...); 88:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** extern int __vfprintf_chk (FILE *__restrict __stream, int __flag, 89:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** const char *__restrict __format, _G_va_list __ap); 90:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** extern int __vprintf_chk (int __flag, const char *__restrict __format, 91:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** _G_va_list __ap); 92:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** 93:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** # ifdef __va_arg_pack 94:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** __fortify_function int 95:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** fprintf (FILE *__restrict __stream, const char *__restrict __fmt, ...) 96:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** { 97:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** return __fprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt, 98:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** __va_arg_pack ()); 99:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** } 100:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** 101:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** __fortify_function int 102:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** printf (const char *__restrict __fmt, ...) 103:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** { 104:/usr/include/x86_64-linux-gnu/bits/stdio2.h **** return __printf_chk (__USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ()); 116 .loc 2 104 0 117 0032 BE000000 movl $.LC0, %esi 117 00 118 0037 BF010000 movl $1, %edi 118 00 119 .LVL13: 120 003c B8000000 movl $0, %eax 120 00 121 0041 E8000000 call __printf_chk 121 00 122 .LVL14: 123 .LBE13: GAS LISTING /tmp/cchyVqnG.s page 6 124 .LBE12: 60:virtual-diamond.cpp **** printf("calling getDataA()\n"); 61:virtual-diamond.cpp **** return baseA::getDataA(); 125 .loc 1 61 0 126 0046 4889DF movq %rbx, %rdi 127 0049 E8000000 call _ZNK5baseA8getDataAEv 127 00 128 .LVL15: 62:virtual-diamond.cpp **** } 129 .loc 1 62 0 130 004e 5B popq %rbx 131 .cfi_def_cfa_offset 8 132 .LVL16: 133 004f C3 ret 134 .cfi_endproc 135 .LFE25: 137 .section .rodata.str1.1 138 .LC1: 139 0014 63616C6C .string "calling getDataB()\n" 139 696E6720 139 67657444 139 61746142 139 28290A00 140 .text 141 .align 2 142 .globl _ZNK7subBoth8getDataBEv 144 _ZNK7subBoth8getDataBEv: 145 .LFB26: 63:virtual-diamond.cpp **** 64:virtual-diamond.cpp **** int subBoth::getDataB() const { 146 .loc 1 64 0 147 .cfi_startproc 148 .LVL17: 149 0050 53 pushq %rbx 150 .cfi_def_cfa_offset 16 151 .cfi_offset 3, -16 152 0051 4889FB movq %rdi, %rbx 153 .LVL18: 154 .LBB14: 155 .LBB15: 156 .loc 2 104 0 157 0054 BE000000 movl $.LC1, %esi 157 00 158 0059 BF010000 movl $1, %edi 158 00 159 .LVL19: 160 005e B8000000 movl $0, %eax 160 00 161 0063 E8000000 call __printf_chk 161 00 162 .LVL20: 163 .LBE15: 164 .LBE14: 65:virtual-diamond.cpp **** printf("calling getDataB()\n"); 66:virtual-diamond.cpp **** return baseB::getDataB(); 165 .loc 1 66 0 166 0068 488D7B10 leaq 16(%rbx), %rdi GAS LISTING /tmp/cchyVqnG.s page 7 167 006c E8000000 call _ZNK5baseB8getDataBEv 167 00 168 .LVL21: 67:virtual-diamond.cpp **** } 169 .loc 1 67 0 170 0071 5B popq %rbx 171 .cfi_def_cfa_offset 8 172 .LVL22: 173 0072 C3 ret 174 .cfi_endproc 175 .LFE26: 177 .set .LTHUNK0,_ZNK7subBoth8getDataBEv 178 .globl _ZThn16_NK7subBoth8getDataBEv 180 _ZThn16_NK7subBoth8getDataBEv: 181 .LFB41: 28:virtual-diamond.cpp **** 182 .loc 1 28 0 183 .cfi_startproc 184 0073 4883EF10 subq $16, %rdi 185 0077 EBD7 jmp .LTHUNK0 186 .cfi_endproc 187 .LFE41: 189 .section .rodata.str1.1 190 .LC2: 191 0028 63616C6C .string "calling getBaseData()\n" 191 696E6720 191 67657442 191 61736544 191 61746128 192 .text 193 0079 90 .align 2 194 .globl _ZNK7subBoth11getBaseDataEv 196 _ZNK7subBoth11getBaseDataEv: 197 .LFB27: 68:virtual-diamond.cpp **** 69:virtual-diamond.cpp **** int subBoth::getBaseData() const { 198 .loc 1 69 0 199 .cfi_startproc 200 .LVL23: 201 007a 53 pushq %rbx 202 .cfi_def_cfa_offset 16 203 .cfi_offset 3, -16 204 007b 4889FB movq %rdi, %rbx 205 .LVL24: 206 .LBB16: 207 .LBB17: 208 .loc 2 104 0 209 007e BE000000 movl $.LC2, %esi 209 00 210 0083 BF010000 movl $1, %edi 210 00 211 .LVL25: 212 0088 B8000000 movl $0, %eax 212 00 213 008d E8000000 call __printf_chk 213 00 214 .LVL26: GAS LISTING /tmp/cchyVqnG.s page 8 215 .LBE17: 216 .LBE16: 70:virtual-diamond.cpp **** printf("calling getBaseData()\n"); 71:virtual-diamond.cpp **** return bottomBase::getBaseData(); 217 .loc 1 71 0 218 0092 488B03 movq (%rbx), %rax 219 0095 480358E8 addq -24(%rax), %rbx 220 .LVL27: 221 0099 4889DF movq %rbx, %rdi 222 009c E8000000 call _ZNK10bottomBase11getBaseDataEv 222 00 223 .LVL28: 72:virtual-diamond.cpp **** } 224 .loc 1 72 0 225 00a1 5B popq %rbx 226 .cfi_def_cfa_offset 8 227 00a2 C3 ret 228 .cfi_endproc 229 .LFE27: 231 .set .LTHUNK1,_ZNK7subBoth11getBaseDataEv 232 .globl _ZTv0_n24_NK7subBoth11getBaseDataEv 234 _ZTv0_n24_NK7subBoth11getBaseDataEv: 235 .LFB42: 31:virtual-diamond.cpp **** }; 236 .loc 1 31 0 237 .cfi_startproc 238 00a3 4C8B17 movq (%rdi), %r10 239 00a6 49037AE8 addq -24(%r10), %rdi 240 00aa EBCE jmp .LTHUNK1 241 .cfi_endproc 242 .LFE42: 244 .align 2 245 .globl _ZN5baseA8setDataAEi 247 _ZN5baseA8setDataAEi: 248 .LFB20: 38:virtual-diamond.cpp **** dataA = a; 249 .loc 1 38 0 250 .cfi_startproc 251 .LVL29: 39:virtual-diamond.cpp **** } 252 .loc 1 39 0 253 00ac 897708 movl %esi, 8(%rdi) 254 00af C3 ret 255 .cfi_endproc 256 .LFE20: 258 .align 2 259 .globl _ZN5baseB8setDataBEi 261 _ZN5baseB8setDataBEi: 262 .LFB22: 45:virtual-diamond.cpp **** dataB = b; 263 .loc 1 45 0 264 .cfi_startproc 265 .LVL30: 46:virtual-diamond.cpp **** } 266 .loc 1 46 0 267 00b0 897708 movl %esi, 8(%rdi) 268 00b3 C3 ret GAS LISTING /tmp/cchyVqnG.s page 9 269 .cfi_endproc 270 .LFE22: 272 .section .text._ZN10bottomBaseC2Ev,"axG",@progbits,_ZN10bottomBaseC5Ev,comdat 273 .align 2 274 .weak _ZN10bottomBaseC2Ev 276 _ZN10bottomBaseC2Ev: 277 .LFB31: 3:virtual-diamond.cpp **** virtual int getBaseData() const; 278 .loc 1 3 0 279 .cfi_startproc 280 .LVL31: 281 .LBB18: 3:virtual-diamond.cpp **** virtual int getBaseData() const; 282 .loc 1 3 0 283 0000 48C70700 movq $_ZTV10bottomBase+16, (%rdi) 283 000000 284 0007 C3 ret 285 .LBE18: 286 .cfi_endproc 287 .LFE31: 289 .weak _ZN10bottomBaseC1Ev 290 .set _ZN10bottomBaseC1Ev,_ZN10bottomBaseC2Ev 291 .section .text._ZN5baseAC2Ev,"axG",@progbits,_ZN5baseAC2Ev,comdat 292 .align 2 293 .weak _ZN5baseAC2Ev 295 _ZN5baseAC2Ev: 296 .LFB34: 9:virtual-diamond.cpp **** int dataA; 297 .loc 1 9 0 298 .cfi_startproc 299 .LVL32: 300 .LBB19: 9:virtual-diamond.cpp **** int dataA; 301 .loc 1 9 0 302 0000 488B06 movq (%rsi), %rax 303 0003 488907 movq %rax, (%rdi) 304 0006 488B5608 movq 8(%rsi), %rdx 305 000a 488B40E8 movq -24(%rax), %rax 306 000e 48891407 movq %rdx, (%rdi,%rax) 307 0012 C3 ret 308 .LBE19: 309 .cfi_endproc 310 .LFE34: 312 .section .text._ZN5baseBC2Ev,"axG",@progbits,_ZN5baseBC2Ev,comdat 313 .align 2 314 .weak _ZN5baseBC2Ev 316 _ZN5baseBC2Ev: 317 .LFB37: 16:virtual-diamond.cpp **** int dataB; 318 .loc 1 16 0 319 .cfi_startproc 320 .LVL33: 321 .LBB20: 16:virtual-diamond.cpp **** int dataB; 322 .loc 1 16 0 323 0000 488B06 movq (%rsi), %rax 324 0003 488907 movq %rax, (%rdi) GAS LISTING /tmp/cchyVqnG.s page 10 325 0006 488B5608 movq 8(%rsi), %rdx 326 000a 488B40E8 movq -24(%rax), %rax 327 000e 48891407 movq %rdx, (%rdi,%rax) 328 0012 C3 ret 329 .LBE20: 330 .cfi_endproc 331 .LFE37: 333 .section .text._ZN7subBothC1Ev,"axG",@progbits,_ZN7subBothC1Ev,comdat 334 .align 2 335 .weak _ZN7subBothC1Ev 337 _ZN7subBothC1Ev: 338 .LFB40: 23:virtual-diamond.cpp **** public: 339 .loc 1 23 0 340 .cfi_startproc 341 .LVL34: 342 0000 53 pushq %rbx 343 .cfi_def_cfa_offset 16 344 .cfi_offset 3, -16 345 0001 4889FB movq %rdi, %rbx 346 .LBB21: 23:virtual-diamond.cpp **** public: 347 .loc 1 23 0 348 0004 488D7F20 leaq 32(%rdi), %rdi 349 .LVL35: 350 0008 E8000000 call _ZN10bottomBaseC2Ev 350 00 351 .LVL36: 352 000d BE000000 movl $_ZTT7subBoth+8, %esi 352 00 353 0012 4889DF movq %rbx, %rdi 354 0015 E8000000 call _ZN5baseAC2Ev 354 00 355 .LVL37: 356 001a 488D7B10 leaq 16(%rbx), %rdi 357 001e BE000000 movl $_ZTT7subBoth+24, %esi 357 00 358 0023 E8000000 call _ZN5baseBC2Ev 358 00 359 .LVL38: 360 0028 48C70300 movq $_ZTV7subBoth+24, (%rbx) 360 000000 361 002f 48C74320 movq $_ZTV7subBoth+112, 32(%rbx) 361 00000000 362 0037 48C74310 movq $_ZTV7subBoth+80, 16(%rbx) 362 00000000 363 .LBE21: 364 003f 5B popq %rbx 365 .cfi_def_cfa_offset 8 366 .LVL39: 367 0040 C3 ret 368 .cfi_endproc 369 .LFE40: 371 .section .rodata.str1.1 372 .LC3: 373 003f 76697274 .string "virtualDiamond %d %d" 373 75616C44 GAS LISTING /tmp/cchyVqnG.s page 11 373 69616D6F 373 6E642025 373 64202564 374 .text 375 .globl _Z14virtualDiamondv 377 _Z14virtualDiamondv: 378 .LFB28: 73:virtual-diamond.cpp **** 74:virtual-diamond.cpp **** 75:virtual-diamond.cpp **** void virtualDiamond() { 379 .loc 1 75 0 380 .cfi_startproc 381 00b4 55 pushq %rbp 382 .cfi_def_cfa_offset 16 383 .cfi_offset 6, -16 384 00b5 53 pushq %rbx 385 .cfi_def_cfa_offset 24 386 .cfi_offset 3, -24 387 00b6 4883EC08 subq $8, %rsp 388 .cfi_def_cfa_offset 32 389 .LBB22: 76:virtual-diamond.cpp **** subBoth *sb = new subBoth; 390 .loc 1 76 0 391 00ba BF300000 movl $48, %edi 391 00 392 00bf E8000000 call _Znwm 392 00 393 .LVL40: 394 00c4 4889C3 movq %rax, %rbx 395 00c7 4889C7 movq %rax, %rdi 396 00ca E8000000 call _ZN7subBothC1Ev 396 00 397 .LVL41: 77:virtual-diamond.cpp **** 78:virtual-diamond.cpp **** int i = sb->getSum(); 398 .loc 1 78 0 399 00cf 488B03 movq (%rbx), %rax 400 00d2 4889DF movq %rbx, %rdi 401 00d5 FF5008 call *8(%rax) 402 .LVL42: 403 00d8 89C5 movl %eax, %ebp 404 .LVL43: 79:virtual-diamond.cpp **** 80:virtual-diamond.cpp **** baseA *ba = sb; 81:virtual-diamond.cpp **** 82:virtual-diamond.cpp **** ba->setDataA(12); 405 .loc 1 82 0 406 00da BE0C0000 movl $12, %esi 406 00 407 00df 4889DF movq %rbx, %rdi 408 00e2 E8000000 call _ZN5baseA8setDataAEi 408 00 409 .LVL44: 83:virtual-diamond.cpp **** ba->getDataA(); 410 .loc 1 83 0 411 00e7 488B03 movq (%rbx), %rax 412 00ea 4889DF movq %rbx, %rdi GAS LISTING /tmp/cchyVqnG.s page 12 413 00ed FF10 call *(%rax) 414 .LVL45: 84:virtual-diamond.cpp **** 85:virtual-diamond.cpp **** baseB *bb = sb; 415 .loc 1 85 0 416 00ef 488D5310 leaq 16(%rbx), %rdx 417 00f3 4885DB testq %rbx, %rbx 418 00f6 B8000000 movl $0, %eax 418 00 419 00fb 480F45C2 cmovne %rdx, %rax 420 00ff 4889C3 movq %rax, %rbx 421 .LVL46: 86:virtual-diamond.cpp **** 87:virtual-diamond.cpp **** bb->setDataB(13); 422 .loc 1 87 0 423 0102 BE0D0000 movl $13, %esi 423 00 424 0107 4889C7 movq %rax, %rdi 425 010a E8000000 call _ZN5baseB8setDataBEi 425 00 426 .LVL47: 88:virtual-diamond.cpp **** int j = bb->getDataB(); 427 .loc 1 88 0 428 010f 488B03 movq (%rbx), %rax 429 0112 4889DF movq %rbx, %rdi 430 0115 FF10 call *(%rax) 431 .LVL48: 432 .LBB23: 433 .LBB24: 434 .loc 2 104 0 435 0117 89C1 movl %eax, %ecx 436 0119 89EA movl %ebp, %edx 437 011b BE000000 movl $.LC3, %esi 437 00 438 0120 BF010000 movl $1, %edi 438 00 439 0125 B8000000 movl $0, %eax 439 00 440 .LVL49: 441 012a E8000000 call __printf_chk 441 00 442 .LVL50: 443 .LBE24: 444 .LBE23: 445 .LBE22: 89:virtual-diamond.cpp **** 90:virtual-diamond.cpp **** printf("virtualDiamond %d %d", i, j); 91:virtual-diamond.cpp **** } 446 .loc 1 91 0 447 012f 4883C408 addq $8, %rsp 448 .cfi_def_cfa_offset 24 449 0133 5B popq %rbx 450 .cfi_def_cfa_offset 16 451 .LVL51: 452 0134 5D popq %rbp 453 .cfi_def_cfa_offset 8 454 .LVL52: GAS LISTING /tmp/cchyVqnG.s page 13 455 0135 C3 ret 456 .cfi_endproc 457 .LFE28: 459 .weak _ZTS10bottomBase 460 .section .rodata._ZTS10bottomBase,"aG",@progbits,_ZTS10bottomBase,comdat 463 _ZTS10bottomBase: 464 0000 3130626F .string "10bottomBase" 464 74746F6D 464 42617365 464 00 465 .weak _ZTI10bottomBase 466 .section .rodata._ZTI10bottomBase,"aG",@progbits,_ZTI10bottomBase,comdat 467 .align 16 470 _ZTI10bottomBase: 471 0000 00000000 .quad _ZTVN10__cxxabiv117__class_type_infoE+16 471 00000000 472 0008 00000000 .quad _ZTS10bottomBase 472 00000000 473 .weak _ZTS5baseA 474 .section .rodata._ZTS5baseA,"aG",@progbits,_ZTS5baseA,comdat 477 _ZTS5baseA: 478 0000 35626173 .string "5baseA" 478 654100 479 .weak _ZTI5baseA 480 .section .rodata._ZTI5baseA,"aG",@progbits,_ZTI5baseA,comdat 481 .align 32 484 _ZTI5baseA: 485 0000 00000000 .quad _ZTVN10__cxxabiv121__vmi_class_type_infoE+16 485 00000000 486 0008 00000000 .quad _ZTS5baseA 486 00000000 487 0010 00000000 .long 0 488 0014 01000000 .long 1 489 0018 00000000 .quad _ZTI10bottomBase 489 00000000 490 0020 03E8FFFF .quad -6141 490 FFFFFFFF 491 .weak _ZTS5baseB 492 .section .rodata._ZTS5baseB,"aG",@progbits,_ZTS5baseB,comdat 495 _ZTS5baseB: 496 0000 35626173 .string "5baseB" 496 654200 497 .weak _ZTI5baseB 498 .section .rodata._ZTI5baseB,"aG",@progbits,_ZTI5baseB,comdat 499 .align 32 502 _ZTI5baseB: 503 0000 00000000 .quad _ZTVN10__cxxabiv121__vmi_class_type_infoE+16 503 00000000 504 0008 00000000 .quad _ZTS5baseB 504 00000000 505 0010 00000000 .long 0 506 0014 01000000 .long 1 507 0018 00000000 .quad _ZTI10bottomBase 507 00000000 508 0020 03E8FFFF .quad -6141 508 FFFFFFFF 509 .weak _ZTS7subBoth GAS LISTING /tmp/cchyVqnG.s page 14 510 .section .rodata._ZTS7subBoth,"aG",@progbits,_ZTS7subBoth,comdat 513 _ZTS7subBoth: 514 0000 37737562 .string "7subBoth" 514 426F7468 514 00 515 .weak _ZTI7subBoth 516 .section .rodata._ZTI7subBoth,"aG",@progbits,_ZTI7subBoth,comdat 517 .align 32 520 _ZTI7subBoth: 521 0000 00000000 .quad _ZTVN10__cxxabiv121__vmi_class_type_infoE+16 521 00000000 522 0008 00000000 .quad _ZTS7subBoth 522 00000000 523 0010 02000000 .long 2 524 0014 02000000 .long 2 525 0018 00000000 .quad _ZTI5baseA 525 00000000 526 0020 02000000 .quad 2 526 00000000 527 0028 00000000 .quad _ZTI5baseB 527 00000000 528 0030 02100000 .quad 4098 528 00000000 529 .weak _ZTV10bottomBase 530 .section .rodata._ZTV10bottomBase,"aG",@progbits,_ZTV10bottomBase,comdat 531 .align 16 534 _ZTV10bottomBase: 535 0000 00000000 .quad 0 535 00000000 536 0008 00000000 .quad _ZTI10bottomBase 536 00000000 537 0010 00000000 .quad _ZNK10bottomBase11getBaseDataEv 537 00000000 538 .weak _ZTT5baseA 539 .section .rodata._ZTT5baseA,"aG",@progbits,_ZTV5baseA,comdat 540 .align 16 543 _ZTT5baseA: 544 0000 00000000 .quad _ZTV5baseA+24 544 00000000 545 0008 00000000 .quad _ZTV5baseA+56 545 00000000 546 .weak _ZTV5baseA 547 .section .rodata._ZTV5baseA,"aG",@progbits,_ZTV5baseA,comdat 548 .align 32 551 _ZTV5baseA: 552 0000 10000000 .quad 16 552 00000000 553 0008 00000000 .quad 0 553 00000000 554 0010 00000000 .quad _ZTI5baseA 554 00000000 555 0018 00000000 .quad _ZNK5baseA8getDataAEv 555 00000000 556 0020 00000000 .quad 0 556 00000000 557 0028 F0FFFFFF .quad -16 557 FFFFFFFF GAS LISTING /tmp/cchyVqnG.s page 15 558 0030 00000000 .quad _ZTI5baseA 558 00000000 559 0038 00000000 .quad _ZNK10bottomBase11getBaseDataEv 559 00000000 560 .weak _ZTT5baseB 561 .section .rodata._ZTT5baseB,"aG",@progbits,_ZTV5baseB,comdat 562 .align 16 565 _ZTT5baseB: 566 0000 00000000 .quad _ZTV5baseB+24 566 00000000 567 0008 00000000 .quad _ZTV5baseB+56 567 00000000 568 .weak _ZTV5baseB 569 .section .rodata._ZTV5baseB,"aG",@progbits,_ZTV5baseB,comdat 570 .align 32 573 _ZTV5baseB: 574 0000 10000000 .quad 16 574 00000000 575 0008 00000000 .quad 0 575 00000000 576 0010 00000000 .quad _ZTI5baseB 576 00000000 577 0018 00000000 .quad _ZNK5baseB8getDataBEv 577 00000000 578 0020 00000000 .quad 0 578 00000000 579 0028 F0FFFFFF .quad -16 579 FFFFFFFF 580 0030 00000000 .quad _ZTI5baseB 580 00000000 581 0038 00000000 .quad _ZNK10bottomBase11getBaseDataEv 581 00000000 582 .hidden _ZTC7subBoth16_5baseB 583 .weak _ZTC7subBoth16_5baseB 584 .section .rodata._ZTC7subBoth16_5baseB,"aG",@progbits,_ZTV7subBoth,comdat 585 .align 32 588 _ZTC7subBoth16_5baseB: 589 0000 10000000 .quad 16 589 00000000 590 0008 00000000 .quad 0 590 00000000 591 0010 00000000 .quad _ZTI5baseB 591 00000000 592 0018 00000000 .quad _ZNK5baseB8getDataBEv 592 00000000 593 0020 00000000 .quad 0 593 00000000 594 0028 F0FFFFFF .quad -16 594 FFFFFFFF 595 0030 00000000 .quad _ZTI5baseB 595 00000000 596 0038 00000000 .quad _ZNK10bottomBase11getBaseDataEv 596 00000000 597 .hidden _ZTC7subBoth0_5baseA 598 .weak _ZTC7subBoth0_5baseA 599 .section .rodata._ZTC7subBoth0_5baseA,"aG",@progbits,_ZTV7subBoth,comdat 600 .align 32 GAS LISTING /tmp/cchyVqnG.s page 16 603 _ZTC7subBoth0_5baseA: 604 0000 20000000 .quad 32 604 00000000 605 0008 00000000 .quad 0 605 00000000 606 0010 00000000 .quad _ZTI5baseA 606 00000000 607 0018 00000000 .quad _ZNK5baseA8getDataAEv 607 00000000 608 0020 00000000 .quad 0 608 00000000 609 0028 E0FFFFFF .quad -32 609 FFFFFFFF 610 0030 00000000 .quad _ZTI5baseA 610 00000000 611 0038 00000000 .quad _ZNK10bottomBase11getBaseDataEv 611 00000000 612 .weak _ZTT7subBoth 613 .section .rodata._ZTT7subBoth,"aG",@progbits,_ZTV7subBoth,comdat 614 .align 32 617 _ZTT7subBoth: 618 0000 00000000 .quad _ZTV7subBoth+24 618 00000000 619 0008 00000000 .quad _ZTC7subBoth0_5baseA+24 619 00000000 620 0010 00000000 .quad _ZTC7subBoth0_5baseA+56 620 00000000 621 0018 00000000 .quad _ZTC7subBoth16_5baseB+24 621 00000000 622 0020 00000000 .quad _ZTC7subBoth16_5baseB+56 622 00000000 623 0028 00000000 .quad _ZTV7subBoth+112 623 00000000 624 0030 00000000 .quad _ZTV7subBoth+80 624 00000000 625 .weak _ZTV7subBoth 626 .section .rodata._ZTV7subBoth,"aG",@progbits,_ZTV7subBoth,comdat 627 .align 32 630 _ZTV7subBoth: 631 0000 20000000 .quad 32 631 00000000 632 0008 00000000 .quad 0 632 00000000 633 0010 00000000 .quad _ZTI7subBoth 633 00000000 634 0018 00000000 .quad _ZNK7subBoth8getDataAEv 634 00000000 635 0020 00000000 .quad _ZNK7subBoth6getSumEv 635 00000000 636 0028 00000000 .quad _ZNK7subBoth8getDataBEv 636 00000000 637 0030 00000000 .quad _ZNK7subBoth11getBaseDataEv 637 00000000 638 0038 10000000 .quad 16 638 00000000 639 0040 F0FFFFFF .quad -16 639 FFFFFFFF GAS LISTING /tmp/cchyVqnG.s page 17 640 0048 00000000 .quad _ZTI7subBoth 640 00000000 641 0050 00000000 .quad _ZThn16_NK7subBoth8getDataBEv 641 00000000 642 0058 E0FFFFFF .quad -32 642 FFFFFFFF 643 0060 E0FFFFFF .quad -32 643 FFFFFFFF 644 0068 00000000 .quad _ZTI7subBoth 644 00000000 645 0070 00000000 .quad _ZTv0_n24_NK7subBoth11getBaseDataEv 645 00000000 646 .text 647 .Letext0: GAS LISTING /tmp/cchyVqnG.s page 18 DEFINED SYMBOLS *ABS*:0000000000000000 virtual-diamond.cpp /tmp/cchyVqnG.s:7 .text:0000000000000000 _ZNK10bottomBase11getBaseDataEv /tmp/cchyVqnG.s:23 .text:0000000000000004 _ZNK5baseA8getDataAEv /tmp/cchyVqnG.s:38 .text:0000000000000008 _ZNK5baseB8getDataBEv /tmp/cchyVqnG.s:53 .text:000000000000000c _ZNK7subBoth6getSumEv /tmp/cchyVqnG.s:103 .text:000000000000002e _ZNK7subBoth8getDataAEv /tmp/cchyVqnG.s:144 .text:0000000000000050 _ZNK7subBoth8getDataBEv /tmp/cchyVqnG.s:180 .text:0000000000000073 _ZThn16_NK7subBoth8getDataBEv /tmp/cchyVqnG.s:196 .text:000000000000007a _ZNK7subBoth11getBaseDataEv /tmp/cchyVqnG.s:234 .text:00000000000000a3 _ZTv0_n24_NK7subBoth11getBaseDataEv /tmp/cchyVqnG.s:247 .text:00000000000000ac _ZN5baseA8setDataAEi /tmp/cchyVqnG.s:261 .text:00000000000000b0 _ZN5baseB8setDataBEi /tmp/cchyVqnG.s:276 .text._ZN10bottomBaseC2Ev:0000000000000000 _ZN10bottomBaseC2Ev /tmp/cchyVqnG.s:534 .rodata._ZTV10bottomBase:0000000000000000 _ZTV10bottomBase /tmp/cchyVqnG.s:276 .text._ZN10bottomBaseC2Ev:0000000000000000 _ZN10bottomBaseC1Ev /tmp/cchyVqnG.s:295 .text._ZN5baseAC2Ev:0000000000000000 _ZN5baseAC2Ev /tmp/cchyVqnG.s:316 .text._ZN5baseBC2Ev:0000000000000000 _ZN5baseBC2Ev /tmp/cchyVqnG.s:337 .text._ZN7subBothC1Ev:0000000000000000 _ZN7subBothC1Ev /tmp/cchyVqnG.s:617 .rodata._ZTT7subBoth:0000000000000000 _ZTT7subBoth /tmp/cchyVqnG.s:630 .rodata._ZTV7subBoth:0000000000000000 _ZTV7subBoth /tmp/cchyVqnG.s:377 .text:00000000000000b4 _Z14virtualDiamondv /tmp/cchyVqnG.s:463 .rodata._ZTS10bottomBase:0000000000000000 _ZTS10bottomBase /tmp/cchyVqnG.s:470 .rodata._ZTI10bottomBase:0000000000000000 _ZTI10bottomBase /tmp/cchyVqnG.s:477 .rodata._ZTS5baseA:0000000000000000 _ZTS5baseA /tmp/cchyVqnG.s:484 .rodata._ZTI5baseA:0000000000000000 _ZTI5baseA /tmp/cchyVqnG.s:495 .rodata._ZTS5baseB:0000000000000000 _ZTS5baseB /tmp/cchyVqnG.s:502 .rodata._ZTI5baseB:0000000000000000 _ZTI5baseB /tmp/cchyVqnG.s:513 .rodata._ZTS7subBoth:0000000000000000 _ZTS7subBoth /tmp/cchyVqnG.s:520 .rodata._ZTI7subBoth:0000000000000000 _ZTI7subBoth /tmp/cchyVqnG.s:543 .rodata._ZTT5baseA:0000000000000000 _ZTT5baseA /tmp/cchyVqnG.s:551 .rodata._ZTV5baseA:0000000000000000 _ZTV5baseA /tmp/cchyVqnG.s:565 .rodata._ZTT5baseB:0000000000000000 _ZTT5baseB /tmp/cchyVqnG.s:573 .rodata._ZTV5baseB:0000000000000000 _ZTV5baseB /tmp/cchyVqnG.s:588 .rodata._ZTC7subBoth16_5baseB:0000000000000000 _ZTC7subBoth16_5baseB /tmp/cchyVqnG.s:603 .rodata._ZTC7subBoth0_5baseA:0000000000000000 _ZTC7subBoth0_5baseA .group:0000000000000000 _ZN10bottomBaseC5Ev UNDEFINED SYMBOLS __printf_chk _Znwm _ZTVN10__cxxabiv117__class_type_infoE _ZTVN10__cxxabiv121__vmi_class_type_infoE