diff options
| author | LemonBoy <thatlemon@gmail.com> | 2019-05-11 21:06:31 +0200 |
|---|---|---|
| committer | LemonBoy <thatlemon@gmail.com> | 2019-05-13 16:41:07 +0200 |
| commit | a038ef3570caed01815173d95089e016fab3a050 (patch) | |
| tree | 62e157b941ddff639765b58212c8668fa177753c /src/util.cpp | |
| parent | 6cf7fb1177848c2f2a20c1f4093b1e003c477911 (diff) | |
| download | zig-a038ef3570caed01815173d95089e016fab3a050.tar.gz zig-a038ef3570caed01815173d95089e016fab3a050.zip | |
Assemble asm files using CC
Stuffing all the files together and compiling the resulting blob with
the main program is a terrible idea.
Some files, namely the .S ones, must be run trough the C preprocessor
before assembling them (#2437).
Beside that the aggregate may be mis-compiled due to the presence of
some flags that affect the following code.
For example let's consider two files, a.s and b.s
a.s
```
fn1:
ret
.data
data1:
.word 0
```
b.s
```
fn2:
ret
```
Now, fn1 and fn2 will be both placed in the .text section as intended if
the two files are compiled separately. But if we merge them the `.data`
flag ends up placing fn2 in the wrong section!
This fixes a nasty crash where musl's memset ended up in the
non-executable data segment, leading to too many hours of
head-scratching.
Diffstat (limited to 'src/util.cpp')
0 files changed, 0 insertions, 0 deletions
