<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=http://email.email.llvm.org/c/eJyllE1vnDAQhn8NXEaLWMN-HThsuorUcyP1bJsB3BiMGJPs_vuOzW42idKqUhEy9jvMO88YC-XqS_XdJ2JHoBBmwma20LgJfIfwKqmH0U0eXANO_dJuvIB3QPO4qIsUs5Ntvlo9I46r1jol7YouvXKWWIfGyjaDp84QSGvdK4HxwSf6ySH4oPY8q6GXzxhegms6JOKIZ40jMx5BgjUUaWhEbRqjAc8BhbIkPyX5cRkfmR_Psh8tJuIb-MyBGWJHVxU6nHiQBP7VwQJ8qxgy1Mw0jccpIpqhvQJT5qIhO934BucjFNaxRubPnMrm1mlpk-L4nov34novS1GClmyc6UV4cabmzeca-zBNxAGS3UOyO70LKzn9IXy3Y4ZFCl73mJXcyErf6wX19lm__HjXfsIGhtbfkob-kxZHlt4azj9c6xyeIvkXsTzE7qBxpL85-X90-rTZy1jmpPSa30zrqqgPxUGmcvadmyqah8ZQp12N6TzZqvN-pEAhHvluje9mlWnX88Lal9tjNU4uHF5eGqIZ-fg8bor1_pB21b5Yi8O-3OrmUO6FQL3dlHqNZb3fbMudrlMrFVqqks1Dsjml_1_SVCIXIl-vC1FsuHDWKOTZTmihpGyKhtvHXhqbBZ_MTW06VdFSzS1xMBxkugclkWkHxBuhN97GxU9URyLslb2wDj8-_g--PktphK0i6W_5DFyR>53189</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [WebAssembly] Support objcopy --keep-global-symbols
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          sunfishcode
      </td>
    </tr>
</table>

<pre>
    It's be useful for the wasm port of objcopy to support objcopy's `--keep-global-symbols` flag. This allows it to copy an object and make all symbols *except* a list of specific exports.

For example, t.o in the example here has two global symbols, but after copying it to s.o, the symbols not listed in t.txt are local:

```
$ cat t.c
void foo(void) {}
void bar(void) {}
$ cat t.txt
foo
$ clang -c t.c
$ objcopy --keep-global-symbols t.txt t.o s.o
$ nm t.o s.o

t.o:
0000000000000010 T bar
0000000000000000 T foo

s.o:
0000000000000010 t bar
0000000000000000 T foo
```

@sbc100 
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyNklFvozAMxz8NvFhFNNDRPvDQ3TTpnm_SPSfBQG6BIBy29tufE9p1m3bTIWQSO_77ZxPlmnP90yeiIlAIC2G7WGjdDL5HeJU0wORmD64Fp_5oN53BO6BlWr2rK2Ynd_lm84w4bTrrlLQbOg_KWWI_tFZ2GTz1hkBa614JjA86UU-OQQe151UDg3zGcAgu6ZCII540Tsx4BAnWUKShCbVpjQY8BRTKkvwhyY-rfWR-PMlhspiIH-AzB2aMHV280OPMRhL4Vwcr8LViyFAL07Qe54hoxu4CTJmLgqx05Rudj1DYxBqZP3Eqi1unpU2K43sunsXlXbeiBC1ZONOr48WZhofPNfZhmYgDJNV9Uj28Cys5_yN8k2OG1RW0bjEruZGNvtUL3utv_fLnXfoJAwytvyWNwydftOx6azj_8GxzeIrkX8TyELuBRkvfKfn_VPo07NWWOSm95ZNpUxfNoTjI1BtvsU52979RHYlwUPac7B7g18db_vWE0mW2de_9RAFYPPLbGd8vKtNu4I21L9fPZppduOe8NUQL8k173BXb_SHt60ZjWcntttgLXcpSl8Wu2jdFUd21u-1WYGqlQkuBktFSU4tciJzPi2K3L--yViGvKqGFkrItWu4TB2lsFgpnbu7SuY4MaumIg-HG0i0oiUw3Il715eJ7N9e0jK2hXrsG04hcR96_PpZHLA">