From 573cc2e57db66165b390044338d3a4ad51f36bf8 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Fri, 8 May 2015 05:04:12 -0700 Subject: Add -mno-shared to x86 assembler On ELF target, the assembler normally generates code which can go into a shared library where non-weak symbols can be preempted. The -mno-shared option tells the assembler to generate code not for a shared library, where non-weak symbols won't be preempted. The resulting code is slightly smaller. This option mainly affects the handling of branch instructions. gas/ * config/tc-i386.c (no_shared): New. (OPTION_MNO_SHARED): Likewise. (elf_symbol_resolved_in_segment_p): Check no_shared. (md_longopts): Add mno-shared. (md_parse_option): Handle OPTION_MNO_SHARED. (md_show_usage): Add -mno-shared. * doc/c-i386.texi: Document -mno-shared. gas/testsuite/ * gas/i386/i386.exp: Run relax-4 and x86-64-relax-3. * gas/i386/relax-4.d: New file. * gas/i386/x86-64-relax-3.d: Likewise. --- gas/doc/c-i386.texi | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'gas/doc/c-i386.texi') diff --git a/gas/doc/c-i386.texi b/gas/doc/c-i386.texi index 7f0e79f..eb6790c 100644 --- a/gas/doc/c-i386.texi +++ b/gas/doc/c-i386.texi @@ -297,6 +297,16 @@ The @code{.att_syntax} and @code{.intel_syntax} directives will take precedent. This option forces the assembler to add BND prefix to all branches, even if such prefix was not explicitly specified in the source code. +@cindex @samp{-mno-shared} option, i386 +@cindex @samp{-mno-shared} option, x86-64 +@item -mno-shared +On ELF target, the assembler normally generates code which can go into a +shared library where non-weak symbols can be preempted. The +@samp{-mno-shared} option tells the assembler to generate code not for +a shared library, where non-weak symbols won't be preempted. The +resulting code is slightly smaller. This option mainly affects the +handling of branch instructions. + @cindex @samp{-mbig-obj} option, x86-64 @item -mbig-obj On x86-64 PE/COFF target this option forces the use of big object file -- cgit v1.1