[cfe-dev] Silly: why I don't see effect of -fstack-size-section?
Renat Idrisov via cfe-dev
cfe-dev at lists.llvm.org
Fri Jul 17 17:42:59 PDT 2020
Hi All,
I have the following piece of code:
```
#include <stdio.h>
int abc(void) {
char a[4];
a[0] = 0;
printf("%c", a[0]);
return 0;
}
```
I do:
$ /usr/local/Cellar/llvm/10.0.0_3/bin/clang stack.c -c -fstack-size-section
$ ls -la stack.o
-rw-r--r-- 1 renat staff 760 Jul 17 15:31 stack.o
$ /usr/local/Cellar/llvm/10.0.0_3/bin/clang stack.c -c
-fno-stack-size-section
$ ls -la stack.o
-rw-r--r-- 1 renat staff 760 Jul 17 15:32 stack.o
also if I try to find the section, I don't see it (with
-fstack-size-section)
$ objdump -s stack.o
stack.o: file format Mach-O 64-bit x86-64
Contents of section __text:
0000 554889e5 4883ec10 c645fc00 0fbe75fc UH..H....E....u.
0010 488d3d14 000000b0 00e80000 000031c9 H.=...........1.
0020 8945f889 c84883c4 105dc3 .E...H...].
Contents of section __cstring:
002b 256300 %c.
Contents of section __compact_unwind:
0030 00000000 00000000 2b000000 00000001 ........+.......
0040 00000000 00000000 00000000 00000000 ................
Contents of section __eh_frame:
0050 14000000 00000000 017a5200 01781001 .........zR..x..
0060 100c0708 90010000 24000000 1c000000 ........$.......
0070 90ffffff ffffffff 2b000000 00000000 ........+.......
0080 00410e10 8602430d 06000000 00000000 .A....C.........
What am I missing?
Thank you!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20200717/944bbd9f/attachment.html>
More information about the cfe-dev
mailing list