Better HN
topnewbestaskshowjobs
Log inSign up

CueXXIII

1 karma · joined Aug 10, 2023 (3y ago) · 1 submissions

Submissions

comment 3y ago · link · parent

Doesn't work, it prints nothing (on gcc (Debian 13.2.0-1) 13.2.0).

Although I found that gcc seems to be configured with -pie per default, so this compilation works:

  $ gcc -Wall -fno-PIE -no-pie main.c -o main
  mainf.c:1:11: warning: ‘main’ is usually a function [-Wmain]
      1 | const int main[] __attribute__((section(".text"))) = {
        |           ^~~~
  /tmp/ccq0adwj.s: Assembler messages:
  /tmp/ccq0adwj.s:4: Warning: ignoring changed section attributes for .text