https://llvm.org/bugs/show_bug.cgi?id=30494

            Bug ID: 30494
           Summary: -fuse-init-array has no effect (-triple
                    x86_64-unknown-freebsd10.3)
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedb...@nondot.org
          Reporter: ema...@freebsd.org
                CC: llvm-bugs@lists.llvm.org
    Classification: Unclassified

Clang HEAD on FreeBSD 10.3/amd64.
The sample global constructor used here is at
https://github.com/emaste/snippets/blob/master/global_constructor.cc

% bin/clang-4.0 -v -c -fuse-init-array global_constructor.cc

...
 "/tank/emaste/src/llvm/build-nodebug/bin/clang-4.0" -cc1 -triple
x86_64-unknown-freebsd10.3 -emit-obj -mrelax-all -disable-free -main-file-name
global_constructor.cc -mrelocation-model static -mthread-model posix
-mdisable-fp-elim -masm-verbose -mconstructor-aliases -munwind-tables
-fuse-init-array -target-cpu x86-64 -v -dwarf-column-info
-debug-info-kind=standalone -dwarf-version=2 -debugger-tuning=gdb
-coverage-notes-file /tank/emaste/src/snippets/global_constructor.gcno
-resource-dir /tank/emaste/src/llvm/build-nodebug/bin/../lib/clang/4.0.0
-internal-isystem /usr/include/c++/v1 -fdeprecated-macro
-fdebug-compilation-dir /tank/emaste/src/snippets -ferror-limit 19
-fmessage-length 149 -fobjc-runtime=gnustep -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -o global_constructor.o -x c++
global_constructor.cc
...

The resulting object file still uses .ctors:

% readelf -S global_constructor.o | egrep -A1 'init|fini|ctor|dtor'             
  [ 9] .ctors            PROGBITS         0000000000000000  000000d8
       0000000000000008  0000000000000000  WA       0     0     8
  [10] .rela.ctors       RELA             0000000000000000  00000370
       0000000000000018  0000000000000018          15     9     8

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to