From: Nathan Sidwell Date: Wed, 7 Nov 2007 12:10:33 +0000 (+0000) Subject: ld/ X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=abbda6d05d1dfded890bf0a05dda61e55cf22223;p=binutils-gdb.git ld/ * emulparams/vxworks.sh (OTHER_READONLY_SECTIONS, OTHER_READWRITE_SECTIONS): Add TLS sections. ld/testsuite/ * ld-vxworks/tls-1.d: New. * ld-vxworks/tls-1.s: New. --- diff --git a/ld/ChangeLog b/ld/ChangeLog index 74eacabd33d..eaf3d9d2556 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +2007-11-07 Nathan Sidwell + + * emulparams/vxworks.sh (OTHER_READONLY_SECTIONS, + OTHER_READWRITE_SECTIONS): Add TLS sections. + 2007-11-06 Kai Tietz * emultempl/pe.em: (init): Add __ImageBase symbol. diff --git a/ld/emulparams/vxworks.sh b/ld/emulparams/vxworks.sh index 6e399ea87ac..74a11ac67c0 100644 --- a/ld/emulparams/vxworks.sh +++ b/ld/emulparams/vxworks.sh @@ -22,6 +22,24 @@ FINI_START='_fini = .; FINI_END="KEEP (*(.fini\$99)); PROVIDE (${SYMPREFIX}_etext = .);" +OTHER_READONLY_SECTIONS=".tls_data ${RELOCATING-0} : {${RELOCATING+ + __wrs_rtp_tls_data_start = .; + ___wrs_rtp_tls_data_start = .;} + *(.tls_data${RELOCATING+ .tls_data.*}) + }${RELOCATING+ + __wrs_rtp_tls_data_size = . - __wrs_rtp_tls_data_start; + ___wrs_rtp_tls_data_size = . - __wrs_rtp_tls_data_start; + __wrs_rtp_tls_data_align = ALIGNOF(.tls_data); + ___wrs_rtp_tls_data_align = ALIGNOF(.tls_data);}" + +OTHER_READWRITE_SECTIONS=".tls_vars ${RELOCATING-0} : {${RELOCATING+ + __wrs_rtp_tls_vars_start = .; + ___wrs_rtp_tls_vars_start = .;} + *(.tls_vars${RELOCATING+ .tls_vars.*}) + }${RELOCATING+ + __wrs_rtp_tls_vars_size = SIZEOF(.tls_vars); + ___wrs_rtp_tls_vars_size = SIZEOF(.tls_vars);}" + ETEXT_NAME=etext_unrelocated OTHER_END_SYMBOLS="PROVIDE (${SYMPREFIX}_ehdr = ${TEXT_START_ADDR});" DATA_END_SYMBOLS=".edata : { PROVIDE (${SYMPREFIX}_edata = .); }" diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index e748cf6f806..4da2964ef46 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-11-07 Nathan Sidwell + + * ld-vxworks/tls-1.d: New. + * ld-vxworks/tls-1.s: New. + 2007-11-06 Alan Modra * ld-powerpc/tlsso.d: Update for changed got alloc order. diff --git a/ld/testsuite/ld-vxworks/tls-1.d b/ld/testsuite/ld-vxworks/tls-1.d new file mode 100644 index 00000000000..cb5e695f936 --- /dev/null +++ b/ld/testsuite/ld-vxworks/tls-1.d @@ -0,0 +1,25 @@ +# source: tls-1.s +# ld: --entry foo -q +# nm: -r + +#... +[0-9a-f]+ N __wrs_rtp_tls_vars_start +#... +0000000c A __wrs_rtp_tls_vars_size +#... +[0-9a-f]+ N __wrs_rtp_tls_data_start +#... +00000004 A __wrs_rtp_tls_data_size +#... +00000004 A __wrs_rtp_tls_data_align +#... +[0-9a-f]+ N ___wrs_rtp_tls_vars_start +#... +0000000c A ___wrs_rtp_tls_vars_size +#... +[0-9a-f]+ N ___wrs_rtp_tls_data_start +#... +00000004 A ___wrs_rtp_tls_data_size +#... +00000004 A ___wrs_rtp_tls_data_align +#pass diff --git a/ld/testsuite/ld-vxworks/tls-1.s b/ld/testsuite/ld-vxworks/tls-1.s new file mode 100644 index 00000000000..8fa97ab528c --- /dev/null +++ b/ld/testsuite/ld-vxworks/tls-1.s @@ -0,0 +1,19 @@ + .globl foo +foo: + + .section .tls_data + .p2align 2 + .type i,%object + .size i,4 +i: + .space 4 + .globl __tls__i + .section .tls_vars + .p2align 2 + .type __tls__i,%object + .size __tls__i,12 +__tls__i: + .4byte i + .4byte 0 + .4byte 4 +