diff --git a/lld/MachO/Driver.cpp b/lld/MachO/Driver.cpp --- a/lld/MachO/Driver.cpp +++ b/lld/MachO/Driver.cpp @@ -577,7 +577,7 @@ // FIXME: CommonSymbol should store isReferencedDynamically, noDeadStrip // and pass them on here. replaceSymbol( - sym, sym->getName(), common->getFile(), isec, /*value=*/0, /*size=*/0, + sym, sym->getName(), common->getFile(), isec, /*value=*/0, common->size, /*isWeakDef=*/false, /*isExternal=*/true, common->privateExtern, /*includeInSymtab=*/true, /*isThumb=*/false, /*isReferencedDynamically=*/false, /*noDeadStrip=*/false); diff --git a/lld/test/MachO/dead-strip.s b/lld/test/MachO/dead-strip.s --- a/lld/test/MachO/dead-strip.s +++ b/lld/test/MachO/dead-strip.s @@ -48,7 +48,7 @@ # MAP: _main # MAP-LABEL: Dead Stripped Symbols -# MAP: <> 0x00000000 [ 1] _unref_com +# MAP: <> 0x00000001 [ 1] _unref_com # MAP: <> 0x00000008 [ 1] _unref_data # MAP: <> 0x00000006 [ 1] _unref_extern # MAP: <> 0x00000001 [ 1] _unref_local diff --git a/lld/test/MachO/map-file.s b/lld/test/MachO/map-file.s --- a/lld/test/MachO/map-file.s +++ b/lld/test/MachO/map-file.s @@ -40,7 +40,7 @@ # CHECK-NEXT: # Address Size File Name # CHECK-NEXT: 0x[[#%X,MAIN]] 0x00000001 [ 1] _main # CHECK-NEXT: 0x[[#%X,FOO]] 0x00000000 [ 2] _foo -# CHECK-NEXT: 0x[[#%X,NUMBER]] 0x00000000 [ 1] _number +# CHECK-NEXT: 0x[[#%X,NUMBER]] 0x00000001 [ 1] _number # RUN: %lld -map %t/c-string-literal-map %t/c-string-literal.o -o %t/c-string-literal-out # RUN: FileCheck --check-prefix=CSTRING %s < %t/c-string-literal-map