define NO_DOT_IN_LABEL only in vxworks6

Message ID orimjul7gl.fsf@livre.home
State New
Headers show
Series
  • define NO_DOT_IN_LABEL only in vxworks6
Related show

Commit Message

Alexandre Oliva Feb. 25, 2020, 8:47 p.m.
There was a mistake in forward-porting and contributing some
vxworks7r2 changes, that caused a conditional to be dropped around a
couple of preprocessor directives, needed only up to vxworks6, that
change the compiler's behavior WRT introducing dollars and dots in
symbol names.

This deviates GCC's behavior from the native system compiler, in a way
that appears to have ABI implications, so we'd like to correct that,
even at this late stage in the development cycle.

Tested with x86_64-linux-gnu-x-aarch64-vxworks7r2.  Ok to install?


for  gcc/ChangeLog

	* config/vx-common.h (NO_DOLLAR_IN_LABEL, NO_DOT_IN_LABEL): Leave
	them alone on vx7.
---
 gcc/config/vx-common.h |   14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)


-- 
Alexandre Oliva, freedom fighter    he/him    https://FSFLA.org/blogs/lxo/
Free Software Evangelist              Stallman was right, but he's left :(
GNU Toolchain Engineer   The darkest places in hell are reserved for those
who maintain their neutrality in times of moral crisis. -- Dante Alighieri

Comments

Jeff Law Feb. 26, 2020, 9:52 p.m. | #1
On Tue, 2020-02-25 at 17:47 -0300, Alexandre Oliva wrote:
> There was a mistake in forward-porting and contributing some

> vxworks7r2 changes, that caused a conditional to be dropped around a

> couple of preprocessor directives, needed only up to vxworks6, that

> change the compiler's behavior WRT introducing dollars and dots in

> symbol names.

> 

> This deviates GCC's behavior from the native system compiler, in a way

> that appears to have ABI implications, so we'd like to correct that,

> even at this late stage in the development cycle.

> 

> Tested with x86_64-linux-gnu-x-aarch64-vxworks7r2.  Ok to install?

> 

> 

> for  gcc/ChangeLog

> 

> 	* config/vx-common.h (NO_DOLLAR_IN_LABEL, NO_DOT_IN_LABEL): Leave

> 	them alone on vx7.

OK
jeff
>

Patch

diff --git a/gcc/config/vx-common.h b/gcc/config/vx-common.h
index c993711..f4a1ffd 100644
--- a/gcc/config/vx-common.h
+++ b/gcc/config/vx-common.h
@@ -99,12 +99,14 @@  along with GCC; see the file COPYING3.  If not see
 
 /* ------------------------ Misc configuration bits ----------------------  */
 
-/* VxWorks cannot have dots in constructor labels, because it uses a
-   mutant variation of collect2 that generates C code instead of
-   assembly.  Thus each constructor label must be a legitimate C
-   symbol.  FIXME: Have VxWorks use real collect2 instead.  */
-#undef NO_DOLLAR_IN_LABEL
-#define NO_DOT_IN_LABEL
+#ifndef TARGET_VXWORKS7
+/* VxWorks, prior to version 7, could not have dots in constructor
+   labels, because it used a mutant variation of collect2 that
+   generates C code instead of assembly.  Thus each constructor label
+   had to be a legitimate C symbol.  */
+# undef NO_DOLLAR_IN_LABEL
+# define NO_DOT_IN_LABEL
+#endif
 
 /* Kernel mode doesn't have ctors/dtors, but RTP mode does.  */
 #define TARGET_HAVE_CTORS_DTORS false