diff options
author | Ori Bernstein <ori@eigenstate.org> | 2016-03-05 16:34:19 -0800 |
---|---|---|
committer | Ori Bernstein <ori@eigenstate.org> | 2016-03-05 16:36:31 -0800 |
commit | f280df62936ff48565f8c83bf609726a6af9a690 (patch) | |
tree | 8d914e93f53d58cd2765a3e9f186d686f6d68489 /6 | |
parent | 81c19d1a4fb393758ce2f08c63f8511ada5bc413 (diff) | |
download | mc-f280df62936ff48565f8c83bf609726a6af9a690.tar.gz |
Add comdat support.
Start of work for deduping symbols.
Diffstat (limited to '6')
-rw-r--r-- | 6/asm.h | 1 | ||||
-rw-r--r-- | 6/gengas.c | 3 |
2 files changed, 4 insertions, 0 deletions
@@ -74,6 +74,7 @@ struct Blob { size_t align; char *lbl; /* may be null */ char isglobl; + char iscomdat; union { uint64_t npad; uint64_t ival; @@ -304,6 +304,8 @@ static void writeblob(FILE *fd, Blob *b) if (!b) return; if (b->lbl) { + if (b->iscomdat) + fprintf(fd, ".section .text.%s%s,\"axG\",%s%s,comdat\n", Symprefix, b->lbl, Symprefix, b->lbl); if (b->isglobl) fprintf(fd, ".globl %s%s\n", Symprefix, b->lbl); fprintf(fd, "%s%s:\n", Symprefix, b->lbl); @@ -356,6 +358,7 @@ static void gentype(FILE *fd, Type *ty) ty->isemitted = 1; b = tydescblob(ty); + b->iscomdat = 1; writeblob(fd, b); blobfree(b); } |