From bcae43427ddb7191e82704bfb0351b43905de812 Mon Sep 17 00:00:00 2001 From: Hans-Peter Nilsson Date: Tue, 25 Nov 2008 04:10:48 +0000 Subject: [PATCH] * ld-cris/got7.s, ld-cris/init.s, ld-cris/pic-gc-72.d, ld-cris/pic-gc-72.s, ld-cris/pic-gc-73.d, ld-cris/pic-gc-73.s, ld-cris/tls-dso-x1x2-1.d, ld-cris/tls-dso-xz-1.d, ld-cris/tls-dtprelm.s, ld-cris/tls-e-20.d, ld-cris/tls-e-20a.d, ld-cris/tls-e-21.d, ld-cris/tls-e-22.d, ld-cris/tls-e-23.d, ld-cris/tls-e-66.d, ld-cris/tls-err-20x.d, ld-cris/tls-err-24.d, ld-cris/tls-err-25.d, ld-cris/tls-err-26.d, ld-cris/tls-err-27.d, ld-cris/tls-err-28.d, ld-cris/tls-err-29.d, ld-cris/tls-err-31.d, ld-cris/tls-err-33.d, ld-cris/tls-err-35.d, ld-cris/tls-err-37.d, ld-cris/tls-err-39.d, ld-cris/tls-err-40.d, ld-cris/tls-err-41.d, ld-cris/tls-err-43.d, ld-cris/tls-err-44.d, ld-cris/tls-err-45.d, ld-cris/tls-err-47.d, ld-cris/tls-err-48.d, ld-cris/tls-err-49.d, ld-cris/tls-err-51.d, ld-cris/tls-err-52.d, ld-cris/tls-err-53.d, ld-cris/tls-err-55.d, ld-cris/tls-err-55.s, ld-cris/tls-err-56.d, ld-cris/tls-err-56.s, ld-cris/tls-err-62.d, ld-cris/tls-err-62.s, ld-cris/tls-err-65.d, ld-cris/tls-err-67.d, ld-cris/tls-gc-68.d, ld-cris/tls-gc-69.d, ld-cris/tls-gc-70.d, ld-cris/tls-gc-71.d, ld-cris/tls-gc-71.s, ld-cris/tls-gc-75.d, ld-cris/tls-gc-76.d, ld-cris/tls-gc-76.s, ld-cris/tls-gd-1.d, ld-cris/tls-gd-1.s, ld-cris/tls-gd-1h.d, ld-cris/tls-gd-2.d, ld-cris/tls-gd-2.s, ld-cris/tls-gd-2h.d, ld-cris/tls-gd-3.d, ld-cris/tls-gd-3.s, ld-cris/tls-gd-3h.d, ld-cris/tls-gdgotrelm.s, ld-cris/tls-global-74.d, ld-cris/tls-gottprelm.s, ld-cris/tls-hx.s, ld-cris/tls-hx1x2.s, ld-cris/tls-ie-10.d, ld-cris/tls-ie-10.s, ld-cris/tls-ie-11.d, ld-cris/tls-ie-11.s, ld-cris/tls-ie-8.d, ld-cris/tls-ie-8.s, ld-cris/tls-ie-9.d, ld-cris/tls-ie-9.s, ld-cris/tls-ld-4.d, ld-cris/tls-ld-4.s, ld-cris/tls-ld-5.d, ld-cris/tls-ld-5.s, ld-cris/tls-ld-6.d, ld-cris/tls-ld-6.s, ld-cris/tls-ld-7.d, ld-cris/tls-ld-7.s, ld-cris/tls-ldgd-14.d, ld-cris/tls-ldgd-14.s, ld-cris/tls-ldgd-15.d, ld-cris/tls-ldgd-15.s, ld-cris/tls-ldgde-14.d, ld-cris/tls-ldgde-15.d, ld-cris/tls-ldgdex-14.d, ld-cris/tls-ldgdex-15.d, ld-cris/tls-ldgdx-14.d, ld-cris/tls-ldgdx-15.d, ld-cris/tls-le-12.d, ld-cris/tls-le-12.s, ld-cris/tls-le-12s.d, ld-cris/tls-le-12s.s, ld-cris/tls-le-13.d, ld-cris/tls-le-13.s, ld-cris/tls-le-13s.d, ld-cris/tls-le-13s.s, ld-cris/tls-legd-16.d, ld-cris/tls-legd-16.s, ld-cris/tls-legd-17.d, ld-cris/tls-legdx-16.d, ld-cris/tls-legdx-17.d, ld-cris/tls-leie-18.d, ld-cris/tls-leie-19.d, ld-cris/tls-leie-19.s, ld-cris/tls-local-54.d, ld-cris/tls-local-54.s, ld-cris/tls-local-57.d, ld-cris/tls-local-57.s, ld-cris/tls-local-58.d, ld-cris/tls-local-58.s, ld-cris/tls-local-59.d, ld-cris/tls-local-59.s, ld-cris/tls-local-60.d, ld-cris/tls-local-61.d, ld-cris/tls-local-63.d, ld-cris/tls-local-64.d, ld-cris/tls-ok-30.d, ld-cris/tls-ok-32.d, ld-cris/tls-ok-34.d, ld-cris/tls-ok-36.d, ld-cris/tls-tprelm.s, ld-cris/tls-und-38.d, ld-cris/tls-und-42.d, ld-cris/tls-und-46.d, ld-cris/tls-und-50.d, ld-cris/tls-x.s, ld-cris/tls-x1x2.s, ld-cris/tls-z.s, ld-cris/tls128.s, ld-cris/tls128g.s: New tests. --- ld/testsuite/ChangeLog | 49 ++++++++++++ ld/testsuite/ld-cris/got7.s | 21 +++++ ld/testsuite/ld-cris/init.s | 6 ++ ld/testsuite/ld-cris/pic-gc-72.d | 28 +++++++ ld/testsuite/ld-cris/pic-gc-72.s | 3 + ld/testsuite/ld-cris/pic-gc-73.d | 26 ++++++ ld/testsuite/ld-cris/pic-gc-73.s | 5 ++ ld/testsuite/ld-cris/tls-dso-x1x2-1.d | 16 ++++ ld/testsuite/ld-cris/tls-dso-xz-1.d | 18 +++++ ld/testsuite/ld-cris/tls-dtprelm.s | 26 ++++++ ld/testsuite/ld-cris/tls-e-20.d | 71 +++++++++++++++++ ld/testsuite/ld-cris/tls-e-20a.d | 110 ++++++++++++++++++++++++++ ld/testsuite/ld-cris/tls-e-21.d | 39 +++++++++ ld/testsuite/ld-cris/tls-e-22.d | 39 +++++++++ ld/testsuite/ld-cris/tls-e-23.d | 38 +++++++++ ld/testsuite/ld-cris/tls-e-66.d | 37 +++++++++ ld/testsuite/ld-cris/tls-err-20x.d | 11 +++ ld/testsuite/ld-cris/tls-err-24.d | 7 ++ ld/testsuite/ld-cris/tls-err-25.d | 7 ++ ld/testsuite/ld-cris/tls-err-26.d | 8 ++ ld/testsuite/ld-cris/tls-err-27.d | 8 ++ ld/testsuite/ld-cris/tls-err-28.d | 7 ++ ld/testsuite/ld-cris/tls-err-29.d | 7 ++ ld/testsuite/ld-cris/tls-err-31.d | 6 ++ ld/testsuite/ld-cris/tls-err-33.d | 6 ++ ld/testsuite/ld-cris/tls-err-35.d | 7 ++ ld/testsuite/ld-cris/tls-err-37.d | 7 ++ ld/testsuite/ld-cris/tls-err-39.d | 7 ++ ld/testsuite/ld-cris/tls-err-40.d | 6 ++ ld/testsuite/ld-cris/tls-err-41.d | 7 ++ ld/testsuite/ld-cris/tls-err-43.d | 7 ++ ld/testsuite/ld-cris/tls-err-44.d | 8 ++ ld/testsuite/ld-cris/tls-err-45.d | 7 ++ ld/testsuite/ld-cris/tls-err-47.d | 7 ++ ld/testsuite/ld-cris/tls-err-48.d | 6 ++ ld/testsuite/ld-cris/tls-err-49.d | 7 ++ ld/testsuite/ld-cris/tls-err-51.d | 7 ++ ld/testsuite/ld-cris/tls-err-52.d | 8 ++ ld/testsuite/ld-cris/tls-err-53.d | 7 ++ ld/testsuite/ld-cris/tls-err-55.d | 6 ++ ld/testsuite/ld-cris/tls-err-55.s | 8 ++ ld/testsuite/ld-cris/tls-err-56.d | 7 ++ ld/testsuite/ld-cris/tls-err-56.s | 9 +++ ld/testsuite/ld-cris/tls-err-62.d | 7 ++ ld/testsuite/ld-cris/tls-err-62.s | 9 +++ ld/testsuite/ld-cris/tls-err-65.d | 7 ++ ld/testsuite/ld-cris/tls-err-67.d | 9 +++ ld/testsuite/ld-cris/tls-gc-68.d | 33 ++++++++ ld/testsuite/ld-cris/tls-gc-69.d | 34 ++++++++ ld/testsuite/ld-cris/tls-gc-70.d | 34 ++++++++ ld/testsuite/ld-cris/tls-gc-71.d | 32 ++++++++ ld/testsuite/ld-cris/tls-gc-71.s | 2 + ld/testsuite/ld-cris/tls-gc-75.d | 36 +++++++++ ld/testsuite/ld-cris/tls-gc-76.d | 38 +++++++++ ld/testsuite/ld-cris/tls-gc-76.s | 23 ++++++ ld/testsuite/ld-cris/tls-gd-1.d | 54 +++++++++++++ ld/testsuite/ld-cris/tls-gd-1.s | 8 ++ ld/testsuite/ld-cris/tls-gd-1h.d | 50 ++++++++++++ ld/testsuite/ld-cris/tls-gd-2.d | 54 +++++++++++++ ld/testsuite/ld-cris/tls-gd-2.s | 9 +++ ld/testsuite/ld-cris/tls-gd-2h.d | 50 ++++++++++++ ld/testsuite/ld-cris/tls-gd-3.d | 39 +++++++++ ld/testsuite/ld-cris/tls-gd-3.s | 8 ++ ld/testsuite/ld-cris/tls-gd-3h.d | 39 +++++++++ ld/testsuite/ld-cris/tls-gdgotrelm.s | 28 +++++++ ld/testsuite/ld-cris/tls-global-74.d | 28 +++++++ ld/testsuite/ld-cris/tls-gottprelm.s | 28 +++++++ ld/testsuite/ld-cris/tls-hx.s | 8 ++ ld/testsuite/ld-cris/tls-hx1x2.s | 15 ++++ ld/testsuite/ld-cris/tls-ie-10.d | 54 +++++++++++++ ld/testsuite/ld-cris/tls-ie-10.s | 8 ++ ld/testsuite/ld-cris/tls-ie-11.d | 60 ++++++++++++++ ld/testsuite/ld-cris/tls-ie-11.s | 9 +++ ld/testsuite/ld-cris/tls-ie-8.d | 54 +++++++++++++ ld/testsuite/ld-cris/tls-ie-8.s | 8 ++ ld/testsuite/ld-cris/tls-ie-9.d | 60 ++++++++++++++ ld/testsuite/ld-cris/tls-ie-9.s | 9 +++ ld/testsuite/ld-cris/tls-ld-4.d | 50 ++++++++++++ ld/testsuite/ld-cris/tls-ld-4.s | 8 ++ ld/testsuite/ld-cris/tls-ld-5.d | 51 ++++++++++++ ld/testsuite/ld-cris/tls-ld-5.s | 10 +++ ld/testsuite/ld-cris/tls-ld-6.d | 50 ++++++++++++ ld/testsuite/ld-cris/tls-ld-6.s | 8 ++ ld/testsuite/ld-cris/tls-ld-7.d | 51 ++++++++++++ ld/testsuite/ld-cris/tls-ld-7.s | 9 +++ ld/testsuite/ld-cris/tls-ldgd-14.d | 71 +++++++++++++++++ ld/testsuite/ld-cris/tls-ldgd-14.s | 8 ++ ld/testsuite/ld-cris/tls-ldgd-15.d | 72 +++++++++++++++++ ld/testsuite/ld-cris/tls-ldgd-15.s | 9 +++ ld/testsuite/ld-cris/tls-ldgde-14.d | 61 ++++++++++++++ ld/testsuite/ld-cris/tls-ldgde-15.d | 61 ++++++++++++++ ld/testsuite/ld-cris/tls-ldgdex-14.d | 54 +++++++++++++ ld/testsuite/ld-cris/tls-ldgdex-15.d | 54 +++++++++++++ ld/testsuite/ld-cris/tls-ldgdx-14.d | 55 +++++++++++++ ld/testsuite/ld-cris/tls-ldgdx-15.d | 56 +++++++++++++ ld/testsuite/ld-cris/tls-le-12.d | 38 +++++++++ ld/testsuite/ld-cris/tls-le-12.s | 8 ++ ld/testsuite/ld-cris/tls-le-12s.d | 38 +++++++++ ld/testsuite/ld-cris/tls-le-12s.s | 8 ++ ld/testsuite/ld-cris/tls-le-13.d | 41 ++++++++++ ld/testsuite/ld-cris/tls-le-13.s | 9 +++ ld/testsuite/ld-cris/tls-le-13s.d | 40 ++++++++++ ld/testsuite/ld-cris/tls-le-13s.s | 9 +++ ld/testsuite/ld-cris/tls-legd-16.d | 59 ++++++++++++++ ld/testsuite/ld-cris/tls-legd-16.s | 8 ++ ld/testsuite/ld-cris/tls-legd-17.d | 58 ++++++++++++++ ld/testsuite/ld-cris/tls-legdx-16.d | 52 ++++++++++++ ld/testsuite/ld-cris/tls-legdx-17.d | 54 +++++++++++++ ld/testsuite/ld-cris/tls-leie-18.d | 47 +++++++++++ ld/testsuite/ld-cris/tls-leie-19.d | 58 ++++++++++++++ ld/testsuite/ld-cris/tls-leie-19.s | 8 ++ ld/testsuite/ld-cris/tls-local-54.d | 27 +++++++ ld/testsuite/ld-cris/tls-local-54.s | 3 + ld/testsuite/ld-cris/tls-local-57.d | 23 ++++++ ld/testsuite/ld-cris/tls-local-57.s | 3 + ld/testsuite/ld-cris/tls-local-58.d | 24 ++++++ ld/testsuite/ld-cris/tls-local-58.s | 4 + ld/testsuite/ld-cris/tls-local-59.d | 25 ++++++ ld/testsuite/ld-cris/tls-local-59.s | 6 ++ ld/testsuite/ld-cris/tls-local-60.d | 33 ++++++++ ld/testsuite/ld-cris/tls-local-61.d | 32 ++++++++ ld/testsuite/ld-cris/tls-local-63.d | 31 ++++++++ ld/testsuite/ld-cris/tls-local-64.d | 37 +++++++++ ld/testsuite/ld-cris/tls-ok-30.d | 29 +++++++ ld/testsuite/ld-cris/tls-ok-32.d | 23 ++++++ ld/testsuite/ld-cris/tls-ok-34.d | 28 +++++++ ld/testsuite/ld-cris/tls-ok-36.d | 16 ++++ ld/testsuite/ld-cris/tls-tprelm.s | 26 ++++++ ld/testsuite/ld-cris/tls-und-38.d | 27 +++++++ ld/testsuite/ld-cris/tls-und-42.d | 26 ++++++ ld/testsuite/ld-cris/tls-und-46.d | 27 +++++++ ld/testsuite/ld-cris/tls-und-50.d | 26 ++++++ ld/testsuite/ld-cris/tls-x.s | 7 ++ ld/testsuite/ld-cris/tls-x1x2.s | 13 +++ ld/testsuite/ld-cris/tls-z.s | 7 ++ ld/testsuite/ld-cris/tls128.s | 8 ++ ld/testsuite/ld-cris/tls128g.s | 9 +++ 137 files changed, 3464 insertions(+) create mode 100644 ld/testsuite/ld-cris/got7.s create mode 100644 ld/testsuite/ld-cris/init.s create mode 100644 ld/testsuite/ld-cris/pic-gc-72.d create mode 100644 ld/testsuite/ld-cris/pic-gc-72.s create mode 100644 ld/testsuite/ld-cris/pic-gc-73.d create mode 100644 ld/testsuite/ld-cris/pic-gc-73.s create mode 100644 ld/testsuite/ld-cris/tls-dso-x1x2-1.d create mode 100644 ld/testsuite/ld-cris/tls-dso-xz-1.d create mode 100644 ld/testsuite/ld-cris/tls-dtprelm.s create mode 100644 ld/testsuite/ld-cris/tls-e-20.d create mode 100644 ld/testsuite/ld-cris/tls-e-20a.d create mode 100644 ld/testsuite/ld-cris/tls-e-21.d create mode 100644 ld/testsuite/ld-cris/tls-e-22.d create mode 100644 ld/testsuite/ld-cris/tls-e-23.d create mode 100644 ld/testsuite/ld-cris/tls-e-66.d create mode 100644 ld/testsuite/ld-cris/tls-err-20x.d create mode 100644 ld/testsuite/ld-cris/tls-err-24.d create mode 100644 ld/testsuite/ld-cris/tls-err-25.d create mode 100644 ld/testsuite/ld-cris/tls-err-26.d create mode 100644 ld/testsuite/ld-cris/tls-err-27.d create mode 100644 ld/testsuite/ld-cris/tls-err-28.d create mode 100644 ld/testsuite/ld-cris/tls-err-29.d create mode 100644 ld/testsuite/ld-cris/tls-err-31.d create mode 100644 ld/testsuite/ld-cris/tls-err-33.d create mode 100644 ld/testsuite/ld-cris/tls-err-35.d create mode 100644 ld/testsuite/ld-cris/tls-err-37.d create mode 100644 ld/testsuite/ld-cris/tls-err-39.d create mode 100644 ld/testsuite/ld-cris/tls-err-40.d create mode 100644 ld/testsuite/ld-cris/tls-err-41.d create mode 100644 ld/testsuite/ld-cris/tls-err-43.d create mode 100644 ld/testsuite/ld-cris/tls-err-44.d create mode 100644 ld/testsuite/ld-cris/tls-err-45.d create mode 100644 ld/testsuite/ld-cris/tls-err-47.d create mode 100644 ld/testsuite/ld-cris/tls-err-48.d create mode 100644 ld/testsuite/ld-cris/tls-err-49.d create mode 100644 ld/testsuite/ld-cris/tls-err-51.d create mode 100644 ld/testsuite/ld-cris/tls-err-52.d create mode 100644 ld/testsuite/ld-cris/tls-err-53.d create mode 100644 ld/testsuite/ld-cris/tls-err-55.d create mode 100644 ld/testsuite/ld-cris/tls-err-55.s create mode 100644 ld/testsuite/ld-cris/tls-err-56.d create mode 100644 ld/testsuite/ld-cris/tls-err-56.s create mode 100644 ld/testsuite/ld-cris/tls-err-62.d create mode 100644 ld/testsuite/ld-cris/tls-err-62.s create mode 100644 ld/testsuite/ld-cris/tls-err-65.d create mode 100644 ld/testsuite/ld-cris/tls-err-67.d create mode 100644 ld/testsuite/ld-cris/tls-gc-68.d create mode 100644 ld/testsuite/ld-cris/tls-gc-69.d create mode 100644 ld/testsuite/ld-cris/tls-gc-70.d create mode 100644 ld/testsuite/ld-cris/tls-gc-71.d create mode 100644 ld/testsuite/ld-cris/tls-gc-71.s create mode 100644 ld/testsuite/ld-cris/tls-gc-75.d create mode 100644 ld/testsuite/ld-cris/tls-gc-76.d create mode 100644 ld/testsuite/ld-cris/tls-gc-76.s create mode 100644 ld/testsuite/ld-cris/tls-gd-1.d create mode 100644 ld/testsuite/ld-cris/tls-gd-1.s create mode 100644 ld/testsuite/ld-cris/tls-gd-1h.d create mode 100644 ld/testsuite/ld-cris/tls-gd-2.d create mode 100644 ld/testsuite/ld-cris/tls-gd-2.s create mode 100644 ld/testsuite/ld-cris/tls-gd-2h.d create mode 100644 ld/testsuite/ld-cris/tls-gd-3.d create mode 100644 ld/testsuite/ld-cris/tls-gd-3.s create mode 100644 ld/testsuite/ld-cris/tls-gd-3h.d create mode 100644 ld/testsuite/ld-cris/tls-gdgotrelm.s create mode 100644 ld/testsuite/ld-cris/tls-global-74.d create mode 100644 ld/testsuite/ld-cris/tls-gottprelm.s create mode 100644 ld/testsuite/ld-cris/tls-hx.s create mode 100644 ld/testsuite/ld-cris/tls-hx1x2.s create mode 100644 ld/testsuite/ld-cris/tls-ie-10.d create mode 100644 ld/testsuite/ld-cris/tls-ie-10.s create mode 100644 ld/testsuite/ld-cris/tls-ie-11.d create mode 100644 ld/testsuite/ld-cris/tls-ie-11.s create mode 100644 ld/testsuite/ld-cris/tls-ie-8.d create mode 100644 ld/testsuite/ld-cris/tls-ie-8.s create mode 100644 ld/testsuite/ld-cris/tls-ie-9.d create mode 100644 ld/testsuite/ld-cris/tls-ie-9.s create mode 100644 ld/testsuite/ld-cris/tls-ld-4.d create mode 100644 ld/testsuite/ld-cris/tls-ld-4.s create mode 100644 ld/testsuite/ld-cris/tls-ld-5.d create mode 100644 ld/testsuite/ld-cris/tls-ld-5.s create mode 100644 ld/testsuite/ld-cris/tls-ld-6.d create mode 100644 ld/testsuite/ld-cris/tls-ld-6.s create mode 100644 ld/testsuite/ld-cris/tls-ld-7.d create mode 100644 ld/testsuite/ld-cris/tls-ld-7.s create mode 100644 ld/testsuite/ld-cris/tls-ldgd-14.d create mode 100644 ld/testsuite/ld-cris/tls-ldgd-14.s create mode 100644 ld/testsuite/ld-cris/tls-ldgd-15.d create mode 100644 ld/testsuite/ld-cris/tls-ldgd-15.s create mode 100644 ld/testsuite/ld-cris/tls-ldgde-14.d create mode 100644 ld/testsuite/ld-cris/tls-ldgde-15.d create mode 100644 ld/testsuite/ld-cris/tls-ldgdex-14.d create mode 100644 ld/testsuite/ld-cris/tls-ldgdex-15.d create mode 100644 ld/testsuite/ld-cris/tls-ldgdx-14.d create mode 100644 ld/testsuite/ld-cris/tls-ldgdx-15.d create mode 100644 ld/testsuite/ld-cris/tls-le-12.d create mode 100644 ld/testsuite/ld-cris/tls-le-12.s create mode 100644 ld/testsuite/ld-cris/tls-le-12s.d create mode 100644 ld/testsuite/ld-cris/tls-le-12s.s create mode 100644 ld/testsuite/ld-cris/tls-le-13.d create mode 100644 ld/testsuite/ld-cris/tls-le-13.s create mode 100644 ld/testsuite/ld-cris/tls-le-13s.d create mode 100644 ld/testsuite/ld-cris/tls-le-13s.s create mode 100644 ld/testsuite/ld-cris/tls-legd-16.d create mode 100644 ld/testsuite/ld-cris/tls-legd-16.s create mode 100644 ld/testsuite/ld-cris/tls-legd-17.d create mode 100644 ld/testsuite/ld-cris/tls-legdx-16.d create mode 100644 ld/testsuite/ld-cris/tls-legdx-17.d create mode 100644 ld/testsuite/ld-cris/tls-leie-18.d create mode 100644 ld/testsuite/ld-cris/tls-leie-19.d create mode 100644 ld/testsuite/ld-cris/tls-leie-19.s create mode 100644 ld/testsuite/ld-cris/tls-local-54.d create mode 100644 ld/testsuite/ld-cris/tls-local-54.s create mode 100644 ld/testsuite/ld-cris/tls-local-57.d create mode 100644 ld/testsuite/ld-cris/tls-local-57.s create mode 100644 ld/testsuite/ld-cris/tls-local-58.d create mode 100644 ld/testsuite/ld-cris/tls-local-58.s create mode 100644 ld/testsuite/ld-cris/tls-local-59.d create mode 100644 ld/testsuite/ld-cris/tls-local-59.s create mode 100644 ld/testsuite/ld-cris/tls-local-60.d create mode 100644 ld/testsuite/ld-cris/tls-local-61.d create mode 100644 ld/testsuite/ld-cris/tls-local-63.d create mode 100644 ld/testsuite/ld-cris/tls-local-64.d create mode 100644 ld/testsuite/ld-cris/tls-ok-30.d create mode 100644 ld/testsuite/ld-cris/tls-ok-32.d create mode 100644 ld/testsuite/ld-cris/tls-ok-34.d create mode 100644 ld/testsuite/ld-cris/tls-ok-36.d create mode 100644 ld/testsuite/ld-cris/tls-tprelm.s create mode 100644 ld/testsuite/ld-cris/tls-und-38.d create mode 100644 ld/testsuite/ld-cris/tls-und-42.d create mode 100644 ld/testsuite/ld-cris/tls-und-46.d create mode 100644 ld/testsuite/ld-cris/tls-und-50.d create mode 100644 ld/testsuite/ld-cris/tls-x.s create mode 100644 ld/testsuite/ld-cris/tls-x1x2.s create mode 100644 ld/testsuite/ld-cris/tls-z.s create mode 100644 ld/testsuite/ld-cris/tls128.s create mode 100644 ld/testsuite/ld-cris/tls128g.s diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index bd920b13fd7..f46a7e134a9 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,5 +1,54 @@ 2008-11-25 Hans-Peter Nilsson + * ld-cris/got7.s, ld-cris/init.s, ld-cris/pic-gc-72.d, + ld-cris/pic-gc-72.s, ld-cris/pic-gc-73.d, ld-cris/pic-gc-73.s, + ld-cris/tls-dso-x1x2-1.d, ld-cris/tls-dso-xz-1.d, + ld-cris/tls-dtprelm.s, ld-cris/tls-e-20.d, ld-cris/tls-e-20a.d, + ld-cris/tls-e-21.d, ld-cris/tls-e-22.d, ld-cris/tls-e-23.d, + ld-cris/tls-e-66.d, ld-cris/tls-err-20x.d, ld-cris/tls-err-24.d, + ld-cris/tls-err-25.d, ld-cris/tls-err-26.d, ld-cris/tls-err-27.d, + ld-cris/tls-err-28.d, ld-cris/tls-err-29.d, ld-cris/tls-err-31.d, + ld-cris/tls-err-33.d, ld-cris/tls-err-35.d, ld-cris/tls-err-37.d, + ld-cris/tls-err-39.d, ld-cris/tls-err-40.d, ld-cris/tls-err-41.d, + ld-cris/tls-err-43.d, ld-cris/tls-err-44.d, ld-cris/tls-err-45.d, + ld-cris/tls-err-47.d, ld-cris/tls-err-48.d, ld-cris/tls-err-49.d, + ld-cris/tls-err-51.d, ld-cris/tls-err-52.d, ld-cris/tls-err-53.d, + ld-cris/tls-err-55.d, ld-cris/tls-err-55.s, ld-cris/tls-err-56.d, + ld-cris/tls-err-56.s, ld-cris/tls-err-62.d, ld-cris/tls-err-62.s, + ld-cris/tls-err-65.d, ld-cris/tls-err-67.d, ld-cris/tls-gc-68.d, + ld-cris/tls-gc-69.d, ld-cris/tls-gc-70.d, ld-cris/tls-gc-71.d, + ld-cris/tls-gc-71.s, ld-cris/tls-gc-75.d, ld-cris/tls-gc-76.d, + ld-cris/tls-gc-76.s, ld-cris/tls-gd-1.d, ld-cris/tls-gd-1.s, + ld-cris/tls-gd-1h.d, ld-cris/tls-gd-2.d, ld-cris/tls-gd-2.s, + ld-cris/tls-gd-2h.d, ld-cris/tls-gd-3.d, ld-cris/tls-gd-3.s, + ld-cris/tls-gd-3h.d, ld-cris/tls-gdgotrelm.s, ld-cris/tls-global-74.d, + ld-cris/tls-gottprelm.s, ld-cris/tls-hx.s, ld-cris/tls-hx1x2.s, + ld-cris/tls-ie-10.d, ld-cris/tls-ie-10.s, ld-cris/tls-ie-11.d, + ld-cris/tls-ie-11.s, ld-cris/tls-ie-8.d, ld-cris/tls-ie-8.s, + ld-cris/tls-ie-9.d, ld-cris/tls-ie-9.s, ld-cris/tls-ld-4.d, + ld-cris/tls-ld-4.s, ld-cris/tls-ld-5.d, ld-cris/tls-ld-5.s, + ld-cris/tls-ld-6.d, ld-cris/tls-ld-6.s, ld-cris/tls-ld-7.d, + ld-cris/tls-ld-7.s, ld-cris/tls-ldgd-14.d, ld-cris/tls-ldgd-14.s, + ld-cris/tls-ldgd-15.d, ld-cris/tls-ldgd-15.s, ld-cris/tls-ldgde-14.d, + ld-cris/tls-ldgde-15.d, ld-cris/tls-ldgdex-14.d, + ld-cris/tls-ldgdex-15.d, ld-cris/tls-ldgdx-14.d, + ld-cris/tls-ldgdx-15.d, ld-cris/tls-le-12.d, ld-cris/tls-le-12.s, + ld-cris/tls-le-12s.d, ld-cris/tls-le-12s.s, ld-cris/tls-le-13.d, + ld-cris/tls-le-13.s, ld-cris/tls-le-13s.d, ld-cris/tls-le-13s.s, + ld-cris/tls-legd-16.d, ld-cris/tls-legd-16.s, ld-cris/tls-legd-17.d, + ld-cris/tls-legdx-16.d, ld-cris/tls-legdx-17.d, ld-cris/tls-leie-18.d, + ld-cris/tls-leie-19.d, ld-cris/tls-leie-19.s, ld-cris/tls-local-54.d, + ld-cris/tls-local-54.s, ld-cris/tls-local-57.d, + ld-cris/tls-local-57.s, ld-cris/tls-local-58.d, + ld-cris/tls-local-58.s, ld-cris/tls-local-59.d, + ld-cris/tls-local-59.s, ld-cris/tls-local-60.d, + ld-cris/tls-local-61.d, ld-cris/tls-local-63.d, + ld-cris/tls-local-64.d, ld-cris/tls-ok-30.d, ld-cris/tls-ok-32.d, + ld-cris/tls-ok-34.d, ld-cris/tls-ok-36.d, ld-cris/tls-tprelm.s, + ld-cris/tls-und-38.d, ld-cris/tls-und-42.d, ld-cris/tls-und-46.d, + ld-cris/tls-und-50.d, ld-cris/tls-x.s, ld-cris/tls-x1x2.s, + ld-cris/tls-z.s, ld-cris/tls128.s, ld-cris/tls128g.s: New tests. + * ld-cris/start1.s: Prepend register name with $. * ld-cris/dso-1.s, ld-cris/libdso-1.d, ld-cris/libdso-11.d, diff --git a/ld/testsuite/ld-cris/got7.s b/ld/testsuite/ld-cris/got7.s new file mode 100644 index 00000000000..60ee4660809 --- /dev/null +++ b/ld/testsuite/ld-cris/got7.s @@ -0,0 +1,21 @@ +; Just something defining 7 variables @ 4 bytes and requesting GOT +; entries for each of them. + + .text + .global got7fn + .type got7fn,@function +got7fn: + .irpc n,1234567 + move.d got7var\n:GOT,$r10 + .endr +.Lfe: + .size dsofn5,.Lfe-got7fn + + .irpc n,1234567 + .data + .global got7var\n + .type got7var\n,@object + .size got7var\n,4 +got7var\n: + .dword 0 + .endr diff --git a/ld/testsuite/ld-cris/init.s b/ld/testsuite/ld-cris/init.s new file mode 100644 index 00000000000..b65ec445311 --- /dev/null +++ b/ld/testsuite/ld-cris/init.s @@ -0,0 +1,6 @@ + .global _init + .type _init,@function +_init: + nop +.Lfe3: + .size _init,.Lfe3-_init diff --git a/ld/testsuite/ld-cris/pic-gc-72.d b/ld/testsuite/ld-cris/pic-gc-72.d new file mode 100644 index 00000000000..7c30980c3b0 --- /dev/null +++ b/ld/testsuite/ld-cris/pic-gc-72.d @@ -0,0 +1,28 @@ +#source: pic-gc-72.s +#source: expdref1.s +#source: expdyn1.s +#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#ld: --shared -m crislinux --gc-sections +#objdump: -s -t -R -p -T + +# Exercise PIC relocs through changed GC sweep function. +# There should be nothing left except from expdyn1.s. + +.*: file format elf32-cris +#... +DYNAMIC RELOCATION RECORDS \(none\) + +Contents of section .hash: +#... +Contents of section .dynsym: +#... +Contents of section .dynstr: +#... +Contents of section .text: + 0188 0f050f05 .* +Contents of section .dynamic: +#... +Contents of section .got: + 21e4 8c210000 00000000 00000000 .* +Contents of section .data: + 21f0 00000000 .* diff --git a/ld/testsuite/ld-cris/pic-gc-72.s b/ld/testsuite/ld-cris/pic-gc-72.s new file mode 100644 index 00000000000..e09aa8ae092 --- /dev/null +++ b/ld/testsuite/ld-cris/pic-gc-72.s @@ -0,0 +1,3 @@ + .hidden export_1 + .include "dso-2.s" + move.w expobj:GOT16,$r10 diff --git a/ld/testsuite/ld-cris/pic-gc-73.d b/ld/testsuite/ld-cris/pic-gc-73.d new file mode 100644 index 00000000000..1ef22deb1b4 --- /dev/null +++ b/ld/testsuite/ld-cris/pic-gc-73.d @@ -0,0 +1,26 @@ +#source: pic-gc-73.s +#source: expdyn1.s +#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#ld: --shared -m crislinux --gc-sections +#objdump: -s -t -R -p -T + +# Left-over code coverage case from pic-gc-72; local symbol. + +.*: file format elf32-cris +#... +DYNAMIC RELOCATION RECORDS \(none\) + +Contents of section .hash: +#... +Contents of section .dynsym: +#... +Contents of section .dynstr: +#... +Contents of section .text: + 016e 0f050f05 .* +Contents of section .dynamic: +#... +Contents of section .got: + 21cc 74210000 00000000 00000000 .* +Contents of section .data: + 21d8 00000000 .* diff --git a/ld/testsuite/ld-cris/pic-gc-73.s b/ld/testsuite/ld-cris/pic-gc-73.s new file mode 100644 index 00000000000..6fd72dbc206 --- /dev/null +++ b/ld/testsuite/ld-cris/pic-gc-73.s @@ -0,0 +1,5 @@ + .hidden export_1 + .include "dso-2.s" +dsofn: + .type dsofn,@function + move.w expobj:GOT16,$r10 diff --git a/ld/testsuite/ld-cris/tls-dso-x1x2-1.d b/ld/testsuite/ld-cris/tls-dso-x1x2-1.d new file mode 100644 index 00000000000..b5397481aca --- /dev/null +++ b/ld/testsuite/ld-cris/tls-dso-x1x2-1.d @@ -0,0 +1,16 @@ +#source: tls-hx.s +#source: tls-x1x2.s +#as: --no-underscore --em=criself +#ld: -m crislinux --shared +#objdump: -T + +# A DSO providing the TLS variables x1 and x2. + +.*: file format elf32-cris + +DYNAMIC SYMBOL TABLE: +#... +0+8 g D \.tdata 0+4 x2 +#... +0+4 g D \.tdata 0+4 x1 +#... diff --git a/ld/testsuite/ld-cris/tls-dso-xz-1.d b/ld/testsuite/ld-cris/tls-dso-xz-1.d new file mode 100644 index 00000000000..9a33b78cc94 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-dso-xz-1.d @@ -0,0 +1,18 @@ +#source: tls128.s +#source: tls-hx1x2.s +#source: tls-x.s +#source: tls-z.s +#as: --no-underscore --em=criself +#ld: -m crislinux --shared +#objdump: -T + +# A DSO providing the TLS variables x and z. + +.*: file format elf32-cris + +DYNAMIC SYMBOL TABLE: +#... +0+88 g D \.tdata 0+4 x +#... +0+8c g D \.tdata 0+4 z +#... diff --git a/ld/testsuite/ld-cris/tls-dtprelm.s b/ld/testsuite/ld-cris/tls-dtprelm.s new file mode 100644 index 00000000000..f69724b8679 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-dtprelm.s @@ -0,0 +1,26 @@ + .text + + .ifndef r + .set r,1 + .endif + + .global tlsdsofndtprelm + .type tlsdsofndtprelm,@function + .p2align 1 +tlsdsofndtprelm: + move.w x:DTPREL16,$r10 +.Lfe: + .size tlsdsofndtprelm,.Lfe-tlsdsofndtprelm + + .globl z + .section .tdata,"awT",@progbits + .p2align 2 + .type z,@object + .size z,r +z: + .fill r,1,42 + + .type x,@object + .size x,1 +x: + .byte 42 diff --git a/ld/testsuite/ld-cris/tls-e-20.d b/ld/testsuite/ld-cris/tls-e-20.d new file mode 100644 index 00000000000..d4d4116b08f --- /dev/null +++ b/ld/testsuite/ld-cris/tls-e-20.d @@ -0,0 +1,71 @@ +#source: start1.s +#source: tls-gd-2.s --pic +#source: tls-hx.s +#source: tls-ld-6.s --pic +#source: tls-ie-10.s --pic +#source: tls-hx1x2.s --pic +#as: --no-underscore --em=criself -I$srcdir/$subdir +#ld: -m crislinux +#objdump: -d -s -h -t -r -p + +# Check that we have proper NPTL/TLS markings and GOT for an +# executable with a R_CRIS_32_GOT_GD, a R_CRIS_DTPREL and a +# R_CRIS_32_GOT_TPREL. + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+80000 paddr 0x0+80000 align 2\*\*13 + filesz 0x0+b0 memsz 0x0+b0 flags r-x + LOAD off 0x0+b0 vaddr 0x0+820b0 paddr 0x0+820b0 align 2\*\*13 + filesz 0x0+2c memsz 0x0+2c flags rw- + TLS off 0x0+b0 vaddr 0x0+820b0 paddr 0x0+820b0 align 2\*\*2 + filesz 0x0+c memsz 0x0+c flags r-- +private flags = 0: + +Sections: +Idx Name Size VMA LMA File off Algn + 0 \.text 0000001c 00080094 00080094 00000094 2\*\*1 + CONTENTS, ALLOC, LOAD, READONLY, CODE + 1 \.tdata 0000000c 000820b0 000820b0 000000b0 2\*\*2 + CONTENTS, ALLOC, LOAD, DATA, THREAD_LOCAL + 2 \.got 00000020 000820bc 000820bc 000000bc 2\*\*2 + CONTENTS, ALLOC, LOAD, DATA +SYMBOL TABLE: +0+80094 l d \.text 0+ \.text +0+820b0 l d \.tdata 0+ \.tdata +0+820bc l d \.got 0+ \.got +0+820bc l O \.got 0+ \.hidden _GLOBAL_OFFSET_TABLE_ +0+ g \.tdata 0+4 \.hidden x +0+80098 g F \.text 0+6 tlsdsofn2 +0+8 g \.tdata 0+4 \.hidden x2 +0+80094 g \.text 0+ _start +0+820dc g \*ABS\* 0+ __bss_start +0+800a0 g F \.text 0+6 tlsdsofn +0+4 g \.tdata 0+4 \.hidden x1 +0+820dc g \*ABS\* 0+ _edata +0+820e0 g \*ABS\* 0+ _end +0+800a8 g F \.text 0+6 tlsdsofn10 + +Contents of section \.text: +#... +Contents of section \.tdata: + 820b0 28000000 29000000 2a000000 .* +Contents of section \.got: + 820bc 00000000 00000000 00000000 01000000 .* + 820cc 00000000 00000000 01000000 00000000 .* + +Disassembly of section \.text: + +00080094 <_start>: + 80094: 41b2 moveq 1,\$r11 +#... +00080098 : + 80098: 6fae 1800 0000 move\.d 18 ,\$r10 +#... +000800a0 : + 800a0: 6fae 0000 0000 move\.d 0 ,\$r10 +#... +000800a8 : + 800a8: 6fae 1400 0000 move\.d 14 ,\$r10 +#... diff --git a/ld/testsuite/ld-cris/tls-e-20a.d b/ld/testsuite/ld-cris/tls-e-20a.d new file mode 100644 index 00000000000..fe4909e9d8a --- /dev/null +++ b/ld/testsuite/ld-cris/tls-e-20a.d @@ -0,0 +1,110 @@ +#source: start1.s +#source: got7.s +#source: tls128.s +#source: tls-gd-2.s +#source: tls-ld-6.s +#source: tls-ie-10.s +#source: tls-hx.s +#source: tls-hx1x2.s +#as: --no-underscore --em=criself -I$srcdir/$subdir --pic +#ld: -m crislinux +#objdump: -d -s -h -t -r -p + +# Like tls-e-20.d but with an offset for all TLS GOT entries, and an +# offset for all TLS data we care about. Offsets different for TLS +# than for GOT. + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+80000 paddr 0x0+80000 align 2\*\*13 + filesz 0x0+dc memsz 0x0+dc flags r-x + LOAD off 0x0+dc vaddr 0x0+820dc paddr 0x0+820dc align 2\*\*13 + filesz 0x0+e4 memsz 0x0+e4 flags rw- + TLS off 0x0+dc vaddr 0x0+820dc paddr 0x0+820dc align 2\*\*2 + filesz 0x0+8c memsz 0x0+8c flags r-- +private flags = 0: + +Sections: +Idx Name Size VMA LMA File off Algn + 0 \.text 0+48 0+80094 0+80094 0+94 2\*\*1 + CONTENTS, ALLOC, LOAD, READONLY, CODE + 1 \.tdata 0+8c 0+820dc 0+820dc 0+dc 2\*\*2 + CONTENTS, ALLOC, LOAD, DATA, THREAD_LOCAL + 2 \.got 0+3c 0+82168 0+82168 0+168 2\*\*2 + CONTENTS, ALLOC, LOAD, DATA + 3 \.data 0+1c 0+821a4 0+821a4 0+1a4 2\*\*0 + CONTENTS, ALLOC, LOAD, DATA +SYMBOL TABLE: +0+80094 l d \.text 0+ \.text +0+820dc l d \.tdata 0+ \.tdata +0+82168 l d \.got 0+ \.got +0+821a4 l d \.data 0+ \.data +0+ l \.tdata 0+80 tls128 +0+82168 l O \.got 0+ \.hidden _GLOBAL_OFFSET_TABLE_ +0+80 g \.tdata 0+4 \.hidden x +0+800c4 g F \.text 0+6 tlsdsofn2 +0+821b4 g O \.data 0+4 got7var5 +0+88 g \.tdata 0+4 \.hidden x2 +0+821ac g O \.data 0+4 got7var3 +0+821bc g O \.data 0+4 got7var7 +0+80098 g F \.text 0+ got7fn +0+821b8 g O \.data 0+4 got7var6 +0+80094 g \.text 0+ _start +0+821c0 g \*ABS\* 0+ __bss_start +0+821a4 g O \.data 0+4 got7var1 +0+821b0 g O \.data 0+4 got7var4 +0+800cc g F \.text 0+6 tlsdsofn +0+84 g \.tdata 0+4 \.hidden x1 +0+821c0 g \*ABS\* 0+ _edata +0+821c0 g \*ABS\* 0+ _end +0+821a8 g O \.data 0+4 got7var2 +0+800d4 g F \.text 0+6 tlsdsofn10 + +Contents of section \.text: +#... +Contents of section \.tdata: + 820dc 2f000000 00000000 00000000 00000000 .* + 820ec 00000000 00000000 00000000 00000000 .* + 820fc 00000000 00000000 00000000 00000000 .* + 8210c 00000000 00000000 00000000 00000000 .* + 8211c 00000000 00000000 00000000 00000000 .* + 8212c 00000000 00000000 00000000 00000000 .* + 8213c 00000000 00000000 00000000 00000000 .* + 8214c 00000000 00000000 00000000 00000000 .* + 8215c 28000000 29000000 2a000000 .* +Contents of section \.got: + 82168 00000000 00000000 00000000 01000000 .* + 82178 00000000 80000000 01000000 80000000 .* + 82188 b4210800 ac210800 bc210800 b8210800 .* + 82198 a4210800 b0210800 a8210800 .* +Contents of section \.data: + 821a4 00000000 00000000 00000000 00000000 .* + 821b4 00000000 00000000 00000000 .* + +Disassembly of section \.text: + +00080094 <_start>: + 80094: 41b2 moveq 1,\$r11 +#... +00080098 : + 80098: 6fae 3000 0000 move\.d 30 ,\$r10 + 8009e: 6fae 3800 0000 move\.d 38 ,\$r10 + 800a4: 6fae 2400 0000 move\.d 24 ,\$r10 + 800aa: 6fae 3400 0000 move\.d 34 ,\$r10 + 800b0: 6fae 2000 0000 move\.d 20 ,\$r10 + 800b6: 6fae 2c00 0000 move\.d 2c ,\$r10 + 800bc: 6fae 2800 0000 move\.d 28 ,\$r10 +#... + +000800c4 : + 800c4: 6fae 1800 0000 move\.d 18 ,\$r10 +#... + +000800cc : + 800cc: 6fae 8000 0000 move\.d 80 ,\$r10 +#... + +000800d4 : + 800d4: 6fae 1400 0000 move\.d 14 ,\$r10 +#... diff --git a/ld/testsuite/ld-cris/tls-e-21.d b/ld/testsuite/ld-cris/tls-e-21.d new file mode 100644 index 00000000000..fa56b9faad8 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-e-21.d @@ -0,0 +1,39 @@ +#source: start1.s +#source: tls128.s +#source: tls-gd-2.s +#source: tls-hx.s +#as: --no-underscore --em=criself --pic +#ld: -m crislinux +#objdump: -d -s -t -r -p + +# Check that we have proper NPTL/TLS markings and GOT for an +# executable with a single R_CRIS_32_GOT_GD. + +.*: file format elf32-cris + +Program Header: +#... + TLS off 0x0+a0 vaddr 0x0+820a0 paddr 0x0+820a0 align 2\*\*2 + filesz 0x0+84 memsz 0x0+84 flags r-- +private flags = 0: +#... +SYMBOL TABLE: +#... +0+80 g \.tdata 0+4 \.hidden x +#... +Contents of section \.text: +#... +Contents of section \.tdata: +#... +Contents of section \.got: + 82124 00000000 00000000 00000000 01000000 .* + 82134 80000000 .* + +Disassembly of section \.text: + +00080094 <_start>: + 80094: 41b2 moveq 1,\$r11 +#... +00080098 : + 80098: 6fae 0c00 0000 move\.d c ,\$r10 +#... diff --git a/ld/testsuite/ld-cris/tls-e-22.d b/ld/testsuite/ld-cris/tls-e-22.d new file mode 100644 index 00000000000..93ab45da7b4 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-e-22.d @@ -0,0 +1,39 @@ +#source: start1.s +#source: tls128.s +#source: tls-ld-6.s +#source: tls-hx.s +#as: --no-underscore --em=criself --pic -I$srcdir/$subdir +#ld: -m crislinux +#objdump: -d -s -t -r -p + +# Check that we have proper NPTL/TLS markings and GOT for an +# executable with a single R_CRIS_DTPREL. + +.*: file format elf32-cris + +Program Header: +#... + TLS off 0x0+a0 vaddr 0x0+820a0 paddr 0x0+820a0 align 2\*\*2 + filesz 0x0+84 memsz 0x0+84 flags r-- +private flags = 0: +#... +SYMBOL TABLE: +#... +0+80 g \.tdata 0+4 \.hidden x +#... +Contents of section \.text: +#... +Contents of section \.tdata: +#... +Contents of section \.got: + 82124 00000000 00000000 00000000 01000000 .* + 82134 00000000 .* + +Disassembly of section \.text: + +00080094 <_start>: + 80094: 41b2 moveq 1,\$r11 +#... +00080098 : + 80098: 6fae 8000 0000 move\.d 80 ,\$r10 +#... diff --git a/ld/testsuite/ld-cris/tls-e-23.d b/ld/testsuite/ld-cris/tls-e-23.d new file mode 100644 index 00000000000..3ac46399edc --- /dev/null +++ b/ld/testsuite/ld-cris/tls-e-23.d @@ -0,0 +1,38 @@ +#source: start1.s +#source: tls128.s +#source: tls-ie-10.s +#source: tls-hx.s +#as: --no-underscore --em=criself --pic -I$srcdir/$subdir +#ld: -m crislinux +#objdump: -d -s -t -r -p + +# Check that we have proper NPTL/TLS markings and GOT for an +# executable with a single R_CRIS_32_GOT_TPREL. + +.*: file format elf32-cris + +Program Header: +#... + TLS off 0x0+a0 vaddr 0x0+820a0 paddr 0x0+820a0 align 2\*\*2 + filesz 0x0+84 memsz 0x0+84 flags r-- +private flags = 0: +#... +SYMBOL TABLE: +#... +0+80 g \.tdata 0+4 \.hidden x +#... +Contents of section \.text: +#... +Contents of section \.tdata: +#... +Contents of section \.got: + 82124 00000000 00000000 00000000 80000000 .* + +Disassembly of section \.text: + +00080094 <_start>: + 80094: 41b2 moveq 1,\$r11 +#... +00080098 : + 80098: 6fae 0c00 0000 move\.d c ,\$r10 +#... diff --git a/ld/testsuite/ld-cris/tls-e-66.d b/ld/testsuite/ld-cris/tls-e-66.d new file mode 100644 index 00000000000..a073b940372 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-e-66.d @@ -0,0 +1,37 @@ +#source: start1.s +#source: tls-le-12s.s +#source: tls-z.s +#as: --no-underscore --em=criself -I$srcdir/$subdir +#ld: -m crislinux +#objdump: -d -s -t -r -p -h + +# Check that we have proper NPTL/TLS markings and no GOT for an +# executable with a single R_CRIS_16_TPREL. + +.*: file format elf32-cris + +Program Header: +#... + TLS off 0x0+9c vaddr 0x0+8209c paddr 0x0+8209c align 2\*\*2 + filesz 0x0+4 memsz 0x0+4 flags r-- +private flags = 0: +#... + 1 .tdata .* + CONTENTS.* +SYMBOL TABLE: +#... +0+ g \.tdata 0+4 z +#... +Contents of section \.text: +#... +Contents of section \.tdata: +#... + +Disassembly of section \.text: + +00080094 <_start>: + 80094: 41b2 moveq 1,\$r11 +#... +00080098 : + 80098: 5fac 0000 movu\.w 0x0,\$r10 +#... diff --git a/ld/testsuite/ld-cris/tls-err-20x.d b/ld/testsuite/ld-cris/tls-err-20x.d new file mode 100644 index 00000000000..75e3b030b98 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-err-20x.d @@ -0,0 +1,11 @@ +#source: init.s +#source: tls-ie-9.s --pic +#source: tls-ld-6.s --pic +#source: tls-ie-10.s --pic +#source: tls-hx.s --pic +#as: --no-underscore --em=criself +#ld: -m crislinux +#error: \A[^\n]*: warning: cannot find entry symbol _start; defaulting to [0-9a-f]*\n[^\n]*: In function `tlsdsofn9':\n[^\n]*: undefined reference to `x1'\n[^\n]*: In function `tlsdsofn9':\n[^n]*: undefined reference to `x2'\Z + +# Code coverage case similar to tls-e-20.d, except with an undefined +# reference. diff --git a/ld/testsuite/ld-cris/tls-err-24.d b/ld/testsuite/ld-cris/tls-err-24.d new file mode 100644 index 00000000000..e1bc88bafc1 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-err-24.d @@ -0,0 +1,7 @@ +#source: tls-le-12s.s +#source: tls-z.s +#as: --no-underscore --em=criself +#ld: --shared -m crislinux +#error: \A[^\n]*\.o, [^\n]*\n[^\n]*mixup[^\n]*\n[^\n]*Invalid operation\Z + +# Check that R_CRIS_16_TPREL in input to a DSO is flagged as an error. diff --git a/ld/testsuite/ld-cris/tls-err-25.d b/ld/testsuite/ld-cris/tls-err-25.d new file mode 100644 index 00000000000..df5ca6b9c60 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-err-25.d @@ -0,0 +1,7 @@ +#source: tls-le-12.s +#source: tls-z.s +#as: --no-underscore --em=criself +#ld: --shared -m crislinux +#error: \A[^\n]*\.o, [^\n]*\n[^\n]*mixup[^\n]*\n[^\n]*Invalid operation\Z + +# Check that R_CRIS_32_TPREL in input to a DSO is flagged as an error. diff --git a/ld/testsuite/ld-cris/tls-err-26.d b/ld/testsuite/ld-cris/tls-err-26.d new file mode 100644 index 00000000000..71ecc9bac40 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-err-26.d @@ -0,0 +1,8 @@ +#source: tls-ld-4.s +#source: tls-x.s +#as: --no-underscore --em=criself --pic +#ld: --shared -m crislinux +#error: \A[^\n]*\.o,[^\n]*mixup[^\n]*\n[^\n]*Bad value\Z + +# Check that R_CRIS_16_DTPREL on non-module-local symbol in input to a +# DSO is flagged as an error. diff --git a/ld/testsuite/ld-cris/tls-err-27.d b/ld/testsuite/ld-cris/tls-err-27.d new file mode 100644 index 00000000000..3d40b0325b3 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-err-27.d @@ -0,0 +1,8 @@ +#source: tls-ld-6.s +#source: tls-x.s +#as: --no-underscore --em=criself --pic +#ld: --shared -m crislinux +#error: \A[^\n]*\.o,[^\n]*mixup[^\n]*\n[^\n]*Bad value\Z + +# Check that R_CRIS_32_DTPREL on non-module-local symbol in input to a +# DSO is flagged as an error. diff --git a/ld/testsuite/ld-cris/tls-err-28.d b/ld/testsuite/ld-cris/tls-err-28.d new file mode 100644 index 00000000000..d7bfa9d7409 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-err-28.d @@ -0,0 +1,7 @@ +#source: tls-gd-3.s +#source: tls-x.s +#as: --no-underscore --em=criself +#ld: --shared -m crislinux +#error: \A[^\n]*\.o, [^\n]*\n[^\n]*mixup[^\n]*\n[^\n]*Invalid operation\Z + +# Check that a R_CRIS_32_GD in input to a DSO is flagged as an error. diff --git a/ld/testsuite/ld-cris/tls-err-29.d b/ld/testsuite/ld-cris/tls-err-29.d new file mode 100644 index 00000000000..1024ea8953f --- /dev/null +++ b/ld/testsuite/ld-cris/tls-err-29.d @@ -0,0 +1,7 @@ +#source: init.s +#source: tls-gdgotrelm.s --defsym r=8192 +#as: --no-underscore --em=criself --pic +#ld: --shared -m crislinux +#error: \A[^\n]*\.o: In function[^\n]*\n[^\n]*truncated[^\n]*\n[^\n]*too many[^\n]*\Z + +# Check that overflow for R_CRIS_16_GOT_GD is flagged as an error. diff --git a/ld/testsuite/ld-cris/tls-err-31.d b/ld/testsuite/ld-cris/tls-err-31.d new file mode 100644 index 00000000000..b95fa54d5c0 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-err-31.d @@ -0,0 +1,6 @@ +#source: tls-dtprelm.s --defsym r=32768 +#as: --no-underscore --em=criself --pic +#ld: --shared -m crislinux +#error: \A[^\n]*\.o: In function[^\n]*\n[^\n]*truncated[^\n]*\n[^\n]*too big[^\n]*\Z + +# Check that overflow for R_CRIS_16_DTPREL is flagged as an error. diff --git a/ld/testsuite/ld-cris/tls-err-33.d b/ld/testsuite/ld-cris/tls-err-33.d new file mode 100644 index 00000000000..6872bbd4af5 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-err-33.d @@ -0,0 +1,6 @@ +#source: tls-gottprelm.s --defsym r=8190 +#as: --no-underscore --em=criself --pic +#ld: --shared -m crislinux +#error: \A[^\n]*\.o: In function[^\n]*\n[^\n]*truncated[^\n]*\n[^\n]*too many[^\n]*\Z + +# Check that overflow for R_CRIS_16_GOT_TPREL is flagged as an error. diff --git a/ld/testsuite/ld-cris/tls-err-35.d b/ld/testsuite/ld-cris/tls-err-35.d new file mode 100644 index 00000000000..9aa7b87bba8 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-err-35.d @@ -0,0 +1,7 @@ +#source: start1.s +#source: tls-tprelm.s --defsym r=32768 +#as: --no-underscore --em=criself +#ld: -m crislinux +#error: \A[^\n]*\.o: In function[^\n]*\n[^\n]*truncated[^\n]*\n[^\n]*too big[^\n]*\Z + +# Check that overflow for R_CRIS_16_TPREL is flagged as an error. diff --git a/ld/testsuite/ld-cris/tls-err-37.d b/ld/testsuite/ld-cris/tls-err-37.d new file mode 100644 index 00000000000..e2efff171bc --- /dev/null +++ b/ld/testsuite/ld-cris/tls-err-37.d @@ -0,0 +1,7 @@ +#source: start1.s +#source: tls-gd-2.s --pic +#as: --no-underscore --em=criself +#ld: -m crislinux +#error: \A[^\n]*\.o: In function[^\n]*\n[^\n]*undefined reference[^\n]*\Z + +# Undefined reference for a R_CRIS_32_GOT_GD in an executable. diff --git a/ld/testsuite/ld-cris/tls-err-39.d b/ld/testsuite/ld-cris/tls-err-39.d new file mode 100644 index 00000000000..dab70f207fd --- /dev/null +++ b/ld/testsuite/ld-cris/tls-err-39.d @@ -0,0 +1,7 @@ +#source: start1.s +#source: tls-ld-6.s --pic +#as: --no-underscore --em=criself +#ld: -m crislinux +#error: \A[^\n]*\.o: In function[^\n]*\n[^\n]*undefined reference[^\n]*\Z + +# Undefined reference for a R_CRIS_32_DTPREL in an executable. diff --git a/ld/testsuite/ld-cris/tls-err-40.d b/ld/testsuite/ld-cris/tls-err-40.d new file mode 100644 index 00000000000..ef9a18a2065 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-err-40.d @@ -0,0 +1,6 @@ +#source: tls-ld-6.s --pic +#as: --no-underscore --em=criself +#ld: -m crislinux --shared +#error: \A[^\n]*\.o[^\n]*undefined reference[^\n]*\n[^\n]*Bad value\Z + +# Undefined reference for a R_CRIS_32_DTPREL in a DSO. diff --git a/ld/testsuite/ld-cris/tls-err-41.d b/ld/testsuite/ld-cris/tls-err-41.d new file mode 100644 index 00000000000..b751f0aaa6b --- /dev/null +++ b/ld/testsuite/ld-cris/tls-err-41.d @@ -0,0 +1,7 @@ +#source: start1.s +#source: tls-ie-10.s --pic +#as: --no-underscore --em=criself +#ld: -m crislinux +#error: \A[^\n]*\.o: In function[^\n]*\n[^\n]*undefined reference[^\n]*\Z + +# Undefined reference for a R_CRIS_32_GOT_TPREL in an executable. diff --git a/ld/testsuite/ld-cris/tls-err-43.d b/ld/testsuite/ld-cris/tls-err-43.d new file mode 100644 index 00000000000..f516c6fcbbe --- /dev/null +++ b/ld/testsuite/ld-cris/tls-err-43.d @@ -0,0 +1,7 @@ +#source: start1.s +#source: tls-le-12.s +#as: --no-underscore --em=criself +#ld: -m crislinux +#error: \A[^\n]*\.o: In function[^\n]*\n[^\n]*undefined reference[^\n]*\Z + +# Undefined reference for a R_CRIS_32_TPREL in an executable. diff --git a/ld/testsuite/ld-cris/tls-err-44.d b/ld/testsuite/ld-cris/tls-err-44.d new file mode 100644 index 00000000000..251470d82d3 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-err-44.d @@ -0,0 +1,8 @@ +#source: tls-le-12.s +#as: --no-underscore --em=criself +#ld: -m crislinux --shared +#error: \A[^\n]*\.o, [^\n]*\n[^\n]*mixup[^\n]*\n[^\n]*Invalid operation\Z + +# Undefined reference for a R_CRIS_32_TPREL in a DSO (where it's +# invalid in the first place anyway, so we should see the same +# behavior as for that test, tls-err-25.d). diff --git a/ld/testsuite/ld-cris/tls-err-45.d b/ld/testsuite/ld-cris/tls-err-45.d new file mode 100644 index 00000000000..be847baf64e --- /dev/null +++ b/ld/testsuite/ld-cris/tls-err-45.d @@ -0,0 +1,7 @@ +#source: start1.s +#source: tls-gd-1.s --pic +#as: --no-underscore --em=criself +#ld: -m crislinux +#error: \A[^\n]*\.o: In function[^\n]*\n[^\n]*undefined reference[^\n]*\Z + +# Undefined reference for a R_CRIS_16_GOT_GD in an executable. diff --git a/ld/testsuite/ld-cris/tls-err-47.d b/ld/testsuite/ld-cris/tls-err-47.d new file mode 100644 index 00000000000..d9a1a304825 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-err-47.d @@ -0,0 +1,7 @@ +#source: start1.s +#source: tls-ld-4.s --pic +#as: --no-underscore --em=criself +#ld: -m crislinux +#error: \A[^\n]*\.o: In function[^\n]*\n[^\n]*undefined reference[^\n]*\Z + +# Undefined reference for a R_CRIS_16_DTPREL in an executable. diff --git a/ld/testsuite/ld-cris/tls-err-48.d b/ld/testsuite/ld-cris/tls-err-48.d new file mode 100644 index 00000000000..9165fcd6f26 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-err-48.d @@ -0,0 +1,6 @@ +#source: tls-ld-4.s --pic +#as: --no-underscore --em=criself +#ld: -m crislinux --shared +#error: \A[^\n]*\.o[^\n]*undefined reference[^\n]*\n[^\n]*Bad value\Z + +# Undefined reference for a R_CRIS_16_DTPREL in a DSO. diff --git a/ld/testsuite/ld-cris/tls-err-49.d b/ld/testsuite/ld-cris/tls-err-49.d new file mode 100644 index 00000000000..6ff4ba5d3c8 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-err-49.d @@ -0,0 +1,7 @@ +#source: start1.s +#source: tls-ie-8.s --pic +#as: --no-underscore --em=criself +#ld: -m crislinux +#error: \A[^\n]*\.o: In function[^\n]*\n[^\n]*undefined reference[^\n]*\Z + +# Undefined reference for a R_CRIS_16_GOT_TPREL in an executable. diff --git a/ld/testsuite/ld-cris/tls-err-51.d b/ld/testsuite/ld-cris/tls-err-51.d new file mode 100644 index 00000000000..8e71cc50f0e --- /dev/null +++ b/ld/testsuite/ld-cris/tls-err-51.d @@ -0,0 +1,7 @@ +#source: start1.s +#source: tls-le-12s.s +#as: --no-underscore --em=criself +#ld: -m crislinux +#error: \A[^\n]*\.o: In function[^\n]*\n[^\n]*undefined reference[^\n]*\Z + +# Undefined reference for a R_CRIS_16_TPREL in an executable. diff --git a/ld/testsuite/ld-cris/tls-err-52.d b/ld/testsuite/ld-cris/tls-err-52.d new file mode 100644 index 00000000000..cf0bbbcd001 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-err-52.d @@ -0,0 +1,8 @@ +#source: tls-le-12s.s +#as: --no-underscore --em=criself +#ld: -m crislinux --shared +#error: \A[^\n]*\.o, [^\n]*\n[^\n]*mixup[^\n]*\n[^\n]*Invalid operation\Z + +# Undefined reference for a R_CRIS_16_TPREL in a DSO (where it's +# invalid in the first place anyway, so we should see the same +# behavior as for that test, tls-err-24.d). diff --git a/ld/testsuite/ld-cris/tls-err-53.d b/ld/testsuite/ld-cris/tls-err-53.d new file mode 100644 index 00000000000..1ae3d42312a --- /dev/null +++ b/ld/testsuite/ld-cris/tls-err-53.d @@ -0,0 +1,7 @@ +#source: start1.s +#source: tls-ld-4.s +#as: --no-underscore --em=criself --pic +#ld: -m crislinux tmpdir/tls-dso-xz-1.so +#error: \A[^\n]*\.o,[^\n]*mixup[^\n]*\n[^\n]*Bad value\Z + +# R_CRIS_16_DTPREL in executable against symbol from DSO. diff --git a/ld/testsuite/ld-cris/tls-err-55.d b/ld/testsuite/ld-cris/tls-err-55.d new file mode 100644 index 00000000000..08f77f3ebdd --- /dev/null +++ b/ld/testsuite/ld-cris/tls-err-55.d @@ -0,0 +1,6 @@ +#source: tls-err-55.s +#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#ld: --shared -m crislinux +#error: \A[^\n]*\.o[^\n]*relocation R_CRIS_32_GOT_GD with non-zero addend 42 against symbol `tls128'[^\n]*\n[^\n]*Bad value\Z + +# Check that non-zero addend on a R_CRIS_32_GOT_GD is flagged as an error. diff --git a/ld/testsuite/ld-cris/tls-err-55.s b/ld/testsuite/ld-cris/tls-err-55.s new file mode 100644 index 00000000000..aadae0ded7a --- /dev/null +++ b/ld/testsuite/ld-cris/tls-err-55.s @@ -0,0 +1,8 @@ + .text + .global tlsdsofn2 + .type tlsdsofn2,@function + .p2align 1 +tlsdsofn2: + move.d tls128+42:GDGOTREL,$r10 +.Lfe1: + .size tlsdsofn2,.Lfe1-tlsdsofn2 diff --git a/ld/testsuite/ld-cris/tls-err-56.d b/ld/testsuite/ld-cris/tls-err-56.d new file mode 100644 index 00000000000..2d592a634fc --- /dev/null +++ b/ld/testsuite/ld-cris/tls-err-56.d @@ -0,0 +1,7 @@ +#source: tls-err-56.s +#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#ld: --shared -m crislinux +#error: \A[^\n]*\.o[^\n]*relocation R_CRIS_32_GOT_GD with non-zero addend 42 against symbol `tls128'[^\n]*\n[^\n]*Bad value\Z + +# Check that non-zero addend on a R_CRIS_32_GOT_GD is flagged as an error. +# The difference to tls-err-55.d is that this one refers to a local symbol. diff --git a/ld/testsuite/ld-cris/tls-err-56.s b/ld/testsuite/ld-cris/tls-err-56.s new file mode 100644 index 00000000000..b8a0443d27d --- /dev/null +++ b/ld/testsuite/ld-cris/tls-err-56.s @@ -0,0 +1,9 @@ + .include "tls128.s" + .text + .global tlsdsofn2 + .type tlsdsofn2,@function + .p2align 1 +tlsdsofn2: + move.d tls128+42:GDGOTREL,$r10 +.Lfe1: + .size tlsdsofn2,.Lfe1-tlsdsofn2 diff --git a/ld/testsuite/ld-cris/tls-err-62.d b/ld/testsuite/ld-cris/tls-err-62.d new file mode 100644 index 00000000000..44341203555 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-err-62.d @@ -0,0 +1,7 @@ +#source: tls-err-62.s +#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#ld: --shared -m crislinux +#error: \A[^\n]*\.o[^\n]*relocation R_CRIS_32_GOT_TPREL with non-zero addend 42 against symbol `tls128'[^\n]*\n[^\n]*Bad value\Z + +# Check that non-zero addend on a R_CRIS_32_GOT_TPREL is flagged as an +# error, local symbol. diff --git a/ld/testsuite/ld-cris/tls-err-62.s b/ld/testsuite/ld-cris/tls-err-62.s new file mode 100644 index 00000000000..b378dc5a8c0 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-err-62.s @@ -0,0 +1,9 @@ + .include "tls128.s" + .text + .global tlsdsofn2 + .type tlsdsofn2,@function + .p2align 1 +tlsdsofn2: + move.d tls128+42:TPOFFGOT,$r10 +.Lfe1: + .size tlsdsofn2,.Lfe1-tlsdsofn2 diff --git a/ld/testsuite/ld-cris/tls-err-65.d b/ld/testsuite/ld-cris/tls-err-65.d new file mode 100644 index 00000000000..23c880f0a8a --- /dev/null +++ b/ld/testsuite/ld-cris/tls-err-65.d @@ -0,0 +1,7 @@ +#source: start1.s +#source: tls-le-12s.s +#as: --no-underscore --em=criself +#ld: -m crislinux tmpdir/tls-dso-xz-1.so +#error: \A[^\n]*\.o,[^\n]*mixup[^\n]*\n[^\n]*Bad value\Z + +# R_CRIS_16_TPREL in executable against symbol from DSO. diff --git a/ld/testsuite/ld-cris/tls-err-67.d b/ld/testsuite/ld-cris/tls-err-67.d new file mode 100644 index 00000000000..0a0020b1596 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-err-67.d @@ -0,0 +1,9 @@ +#source: init.s +#source: tls-gdgotrelm.s --defsym r=8203 +#as: --no-underscore --em=criself --pic +#ld: --shared -m crislinux +#error: \A[^\n]*\.o: In[^\n]*\n[^\n]*truncated[^\n]*\n[^\n]*too many[^\n]*\n[^\n]*\.o: In[^\n]*\n[^\n]*truncated[^\n]*\n[^\n]*too many[^\n]*\n[^\n]*\.o: In[^\n]*\n[^\n]*truncated[^\n]*\n[^\n]*too many[^\n]*\n[^\n]*\.o: In[^\n]*\n[^\n]*truncated[^\n]*\n[^\n]*too many[^\n]*\n[^\n]*\.o: In[^\n]*\n[^\n]*truncated[^\n]*\n[^\n]*too many[^\n]*\n[^\n]*\.o: In[^\n]*\n[^\n]*truncated[^\n]*\n[^\n]*too many[^\n]*\n[^\n]*\.o: In[^\n]*\n[^\n]*truncated[^\n]*\n[^\n]*too many[^\n]*\n[^\n]*\.o: In[^\n]*\n[^\n]*truncated[^\n]*\n[^\n]*too many[^\n]*\n[^\n]*\.o: In[^\n]*\n[^\n]*truncated[^\n]*\n[^\n]*too many[^\n]*\n[^\n]*\.o: In[^\n]*\n[^\n]*truncated[^\n]*\n[^\n]*too many[^\n]*\n[^\n]*\.o: In[^\n]*\n[^\n]*omitted[^\n]*\Z + +# Check that the error messages get the right number of appended +# explanations with default values when bailing out and omitting +# further error messages for overflows. diff --git a/ld/testsuite/ld-cris/tls-gc-68.d b/ld/testsuite/ld-cris/tls-gc-68.d new file mode 100644 index 00000000000..cfed0e5a5e9 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-gc-68.d @@ -0,0 +1,33 @@ +#source: start1.s +#source: tls-x.s +#source: tls-local-58.s +#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#ld: -m crislinux --gc-sections +#objdump: -s -t -r -p + +# An executable with a R_CRIS_32_GOT_GD and a R_CRIS_16_GOT_GD against +# the same local symbol, gc:ed. Check that we have nothing left but +# the start symbol and its code. Can't get rid of the GOT just yet. + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+80000 paddr 0x0+80000 align 2\*\*13 + filesz 0x0+78 memsz 0x0+78 flags r-x + LOAD off 0x0+78 vaddr 0x0+82078 paddr 0x0+82078 align 2\*\*13 + filesz 0x0+c memsz 0x0+c flags rw- +private flags = 0: + +SYMBOL TABLE: +0+80074 l d .text 0+ .text +0+82078 l d .got 0+ .got +0+82078 l O .got 0+ .hidden _GLOBAL_OFFSET_TABLE_ +0+80074 g .text 0+ _start +0+82084 g \*ABS\* 0+ __bss_start +0+82084 g \*ABS\* 0+ _edata +0+820a0 g \*ABS\* 0+ _end + +Contents of section .text: + 80074 41b20+ .* +Contents of section .got: + 82078 0+ 0+ 0+ .* diff --git a/ld/testsuite/ld-cris/tls-gc-69.d b/ld/testsuite/ld-cris/tls-gc-69.d new file mode 100644 index 00000000000..dd9b30a3c74 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-gc-69.d @@ -0,0 +1,34 @@ +#source: start1.s +#source: tls-x.s +#source: tls-local-59.s +#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#ld: -m crislinux --gc-sections +#objdump: -s -t -r -p + +# An executable with a R_CRIS_32_GOT_GD, a R_CRIS_16_GOT_GD, a +# R_CRIS_32_GOT_TPREL and a R_CRIS_16_GOT_TPREL against the same local +# symbol, gc:ed. Check that we have nothing left but the start symbol +# and its code. Can't get rid of the GOT just yet. + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+80000 paddr 0x0+80000 align 2\*\*13 + filesz 0x0+78 memsz 0x0+78 flags r-x + LOAD off 0x0+78 vaddr 0x0+82078 paddr 0x0+82078 align 2\*\*13 + filesz 0x0+c memsz 0x0+c flags rw- +private flags = 0: + +SYMBOL TABLE: +0+80074 l d .text 0+ .text +0+82078 l d .got 0+ .got +0+82078 l O .got 0+ .hidden _GLOBAL_OFFSET_TABLE_ +0+80074 g .text 0+ _start +0+82084 g \*ABS\* 0+ __bss_start +0+82084 g \*ABS\* 0+ _edata +0+820a0 g \*ABS\* 0+ _end + +Contents of section .text: + 80074 41b20+ .* +Contents of section .got: + 82078 0+ 0+ 0+ .* diff --git a/ld/testsuite/ld-cris/tls-gc-70.d b/ld/testsuite/ld-cris/tls-gc-70.d new file mode 100644 index 00000000000..048b7e92867 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-gc-70.d @@ -0,0 +1,34 @@ +#source: start1.s +#source: tls128.s +#source: tls-gd-3.s +#source: tls-x.s +#as: --no-underscore --em=criself +#ld: -m crislinux --gc-sections +#objdump: -s -t -r -p + +# An executable with a single R_CRIS_32_GD, with gc. Check that we +# have nothing left but the start symbol and its code. Can't get rid +# of the GOT just yet. + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+80000 paddr 0x0+80000 align 2\*\*13 + filesz 0x0+78 memsz 0x0+78 flags r-x + LOAD off 0x0+78 vaddr 0x0+82078 paddr 0x0+82078 align 2\*\*13 + filesz 0x0+c memsz 0x0+c flags rw- +private flags = 0: + +SYMBOL TABLE: +0+80074 l d .text 0+ .text +0+82078 l d .got 0+ .got +0+82078 l O .got 0+ .hidden _GLOBAL_OFFSET_TABLE_ +0+80074 g .text 0+ _start +0+82084 g \*ABS\* 0+ __bss_start +0+82084 g \*ABS\* 0+ _edata +0+820a0 g \*ABS\* 0+ _end + +Contents of section .text: + 80074 41b20+ .* +Contents of section .got: + 82078 0+ 0+ 0+ .* diff --git a/ld/testsuite/ld-cris/tls-gc-71.d b/ld/testsuite/ld-cris/tls-gc-71.d new file mode 100644 index 00000000000..3ee73fc3af7 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-gc-71.d @@ -0,0 +1,32 @@ +#source: tls-gc-71.s +#source: init.s +#source: tls128g.s +#source: tls-hx.s +#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#ld: --shared -m crislinux --gc-sections +#objdump: -s -t -R -p -T + +# DSO with a single R_CRIS_16_DTPREL against a hidden symbol, gc:ed. +# Check that we still have the other, global, TLS variable. + +.*: file format elf32-cris +#... + TLS off .* + filesz 0x0+80 memsz 0x0+80 flags r-- +#... +DYNAMIC SYMBOL TABLE: +0+18e l d .text 0+ .text +0+2194 l d .tdata 0+ .tdata +0+18e g DF .text 0+2 _init +0+2280 g D \*ABS\* 0+ __bss_start +0+ g D .tdata 0+80 tls128 +0+2280 g D \*ABS\* 0+ _edata +0+2280 g D \*ABS\* 0+ _end + +DYNAMIC RELOCATION RECORDS \(none\) +#... +Contents of section .text: + 018e 0f050000 .* +#... +Contents of section .got: + 2274 14220000 00000000 00000000 .* diff --git a/ld/testsuite/ld-cris/tls-gc-71.s b/ld/testsuite/ld-cris/tls-gc-71.s new file mode 100644 index 00000000000..a4d67980008 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-gc-71.s @@ -0,0 +1,2 @@ + .hidden tlsdsofn + .include "tls-ld-4.s" diff --git a/ld/testsuite/ld-cris/tls-gc-75.d b/ld/testsuite/ld-cris/tls-gc-75.d new file mode 100644 index 00000000000..de387dbe2d7 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-gc-75.d @@ -0,0 +1,36 @@ +#source: start1.s +#source: tls-x.s +#source: tls-gd-2.s +#source: tls-ie-10.s +#source: tls-gd-1.s +#source: tls-ie-8.s +#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#ld: -m crislinux --gc-sections +#objdump: -s -t -r -p + +# An executable with a R_CRIS_32_GOT_GD, a R_CRIS_16_GOT_GD, a +# R_CRIS_32_GOT_TPREL and a R_CRIS_16_GOT_TPREL against the same +# symbol, gc:ed. Check that we have proper NPTL/TLS markings and GOT. + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+80000 paddr 0x0+80000 align 2\*\*13 + filesz 0x0+78 memsz 0x0+78 flags r-x + LOAD off 0x0+78 vaddr 0x0+82078 paddr 0x0+82078 align 2\*\*13 + filesz 0x0+c memsz 0x0+c flags rw- +private flags = 0: + +SYMBOL TABLE: +0+80074 l d .text 0+ .text +0+82078 l d .got 0+ .got +0+82078 l O .got 0+ .hidden _GLOBAL_OFFSET_TABLE_ +0+80074 g .text 0+ _start +0+82084 g \*ABS\* 0+ __bss_start +0+82084 g \*ABS\* 0+ _edata +0+820a0 g \*ABS\* 0+ _end + +Contents of section .text: + 80074 41b20+ .* +Contents of section .got: + 82078 0+ 0+ 0+ .* diff --git a/ld/testsuite/ld-cris/tls-gc-76.d b/ld/testsuite/ld-cris/tls-gc-76.d new file mode 100644 index 00000000000..49a2dda4464 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-gc-76.d @@ -0,0 +1,38 @@ +#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#ld: -m crislinux --gc-sections -u gc76fn +#source: start1.s +#source: tls-gc-76.s +#source: tls-hx.s +#objdump: -s -t -r -p + +# Executable with a single R_CRIS_32_DTPREL, gc:ed away. +# A GOT reference through a local symbol to a variable survives gc. + + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+80000 paddr 0x0+80000 align 2\*\*13 + filesz 0x0+80 memsz 0x0+80 flags r-x + LOAD off 0x0+80 vaddr 0x0+82080 paddr 0x0+82080 align 2\*\*13 + filesz 0x0+14 memsz 0x0+14 flags rw- +private flags = 0: + +SYMBOL TABLE: +0+80074 l d .text 0+ .text +0+82080 l d .got 0+ .got +0+82090 l d .data 0+ .data +0+82090 l O .data 0+4 gc76var +0+82080 l O .got 0+ .hidden _GLOBAL_OFFSET_TABLE_ +0+80074 g .text 0+ _start +0+82094 g \*ABS\* 0+ __bss_start +0+82094 g \*ABS\* 0+ _edata +0+820a0 g \*ABS\* 0+ _end +0+80078 g F .text 0+6 gc76fn + +Contents of section .text: + 80074 41b20+ 6fae0c00 0+ .* +Contents of section .got: + 82080 0+ 0+ 0+ 90200800 .* +Contents of section .data: + 82090 0+ .* diff --git a/ld/testsuite/ld-cris/tls-gc-76.s b/ld/testsuite/ld-cris/tls-gc-76.s new file mode 100644 index 00000000000..980defd4ed5 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-gc-76.s @@ -0,0 +1,23 @@ + .text + .global gc76fn + .type gc76fn,@function +gc76fn: + move.d gc76var:GOT,$r10 +.Lfe: + .size gc76fn,.Lfe-gc76fn + + .data + .type gc76var,@object + .size gc76var,4 +gc76var: + .dword 0 + + .section .text.2,"ax" + .global tlsdsofn + .type tlsdsofn,@function + .p2align 1 +tlsdsofn: + move.d x:DTPREL,$r10 + move.d x:DTPREL,$r10 +.Lfe2: + .size tlsdsofn,.Lfe2-tlsdsofn diff --git a/ld/testsuite/ld-cris/tls-gd-1.d b/ld/testsuite/ld-cris/tls-gd-1.d new file mode 100644 index 00000000000..25de32d0f1b --- /dev/null +++ b/ld/testsuite/ld-cris/tls-gd-1.d @@ -0,0 +1,54 @@ +#as: --pic --no-underscore --em=criself +#ld: --shared -m crislinux +#source: tls-gd-1.s +#source: tls128.s +#source: tls-x.s +#objdump: -s -t -R -p -T + +# DSO with a single R_CRIS_16_GOT_GD. Check that we have proper +# NPTL/TLS markings and GOT. + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+ paddr 0x0+ align 2\*\*13 + filesz 0x0+1a0 memsz 0x0+1a0 flags r-x + LOAD off 0x0+1a0 vaddr 0x0+21a0 paddr 0x0+21a0 align 2\*\*13 + filesz 0x0+108 memsz 0x0+108 flags rw- + DYNAMIC off 0x0+224 vaddr 0x0+2224 paddr 0x0+2224 align 2\*\*2 + filesz 0x0+70 memsz 0x0+70 flags rw- + TLS off 0x0+1a0 vaddr 0x0+21a0 paddr 0x0+21a0 align 2\*\*2 + filesz 0x0+84 memsz 0x0+84 flags r-- + +Dynamic Section: + HASH 0x0+b4 + STRTAB 0x0+168 + SYMTAB 0x0+e8 + STRSZ 0x0+25 + SYMENT 0x0+10 + RELA 0x0+190 + RELASZ 0x0+c + RELAENT 0x0+c +private flags = 0: + +SYMBOL TABLE: +#... +0+80 g \.tdata 0+4 x +#... +DYNAMIC SYMBOL TABLE: +#... +0+80 g D \.tdata 0+4 x +#... + +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +0+22a0 R_CRIS_DTP x + +Contents of section \.hash: +#... +Contents of section \.text: + 019c 5fae0c00 .* +#... +Contents of section \.got: + 2294 24220+ 0+ 0+ 0+ .* + 22a4 0+ .* diff --git a/ld/testsuite/ld-cris/tls-gd-1.s b/ld/testsuite/ld-cris/tls-gd-1.s new file mode 100644 index 00000000000..cd3f0210601 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-gd-1.s @@ -0,0 +1,8 @@ + .text + .global tlsdsofn0 + .type tlsdsofn0,@function + .p2align 1 +tlsdsofn0: + move.w x:GDGOTREL16,$r10 +.Lfe: + .size tlsdsofn0,.Lfe-tlsdsofn0 diff --git a/ld/testsuite/ld-cris/tls-gd-1h.d b/ld/testsuite/ld-cris/tls-gd-1h.d new file mode 100644 index 00000000000..9e8fab38814 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-gd-1h.d @@ -0,0 +1,50 @@ +#as: --pic --no-underscore --em=criself +#ld: --shared -m crislinux +#source: tls-gd-1.s +#source: tls128g.s +#source: tls-hx.s +#objdump: -s -t -R -p + +# DSO with a single R_CRIS_16_GOT_GD against a hidden symbol. Check +# that we have proper NPTL/TLS markings and GOT. + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+ paddr 0x0+ align 2\*\*13 + filesz 0x0+1a4 memsz 0x0+1a4 flags r-x + LOAD off 0x0+1a4 vaddr 0x0+21a4 paddr 0x0+21a4 align 2\*\*13 + filesz 0x0+108 memsz 0x0+108 flags rw- + DYNAMIC off 0x0+228 vaddr 0x0+2228 paddr 0x0+2228 align 2\*\*2 + filesz 0x0+70 memsz 0x0+70 flags rw- + TLS off 0x0+1a4 vaddr 0x0+21a4 paddr 0x0+21a4 align 2\*\*2 + filesz 0x0+84 memsz 0x0+84 flags r-- + +Dynamic Section: + HASH 0x0+b4 + STRTAB 0x0+168 + SYMTAB 0x0+e8 + STRSZ 0x0+2a + SYMENT 0x0+10 + RELA 0x0+194 + RELASZ 0x0+c + RELAENT 0x0+c +private flags = 0: + +SYMBOL TABLE: +#... +0+80 l \.tdata 0+4 \.hidden x +#... + +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +0+22a4 R_CRIS_DTP \*ABS\*\+0x0+80 + +Contents of section \.hash: +#... +Contents of section \.text: + 01a0 5fae0c00 .* +#... +Contents of section \.got: + 2298 28220+ 0+ 0+ 0+ .* + 22a8 0+ .* diff --git a/ld/testsuite/ld-cris/tls-gd-2.d b/ld/testsuite/ld-cris/tls-gd-2.d new file mode 100644 index 00000000000..2f2546e6b6b --- /dev/null +++ b/ld/testsuite/ld-cris/tls-gd-2.d @@ -0,0 +1,54 @@ +#as: --pic --no-underscore --em=criself +#ld: --shared -m crislinux +#source: tls-gd-2.s +#source: tls128g.s +#source: tls-x.s +#objdump: -s -t -R -p -T + +# DSO with a single R_CRIS_32_GOT_GD. Check that we have proper +# NPTL/TLS markings and GOT. + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+ paddr 0x0+ align 2\*\*13 + filesz 0x0+1bc memsz 0x0+1bc flags r-x + LOAD off 0x0+1bc vaddr 0x0+21bc paddr 0x0+21bc align 2\*\*13 + filesz 0x0+108 memsz 0x0+108 flags rw- + DYNAMIC off 0x0+240 vaddr 0x0+2240 paddr 0x0+2240 align 2\*\*2 + filesz 0x0+70 memsz 0x0+70 flags rw- + TLS off 0x0+1bc vaddr 0x0+21bc paddr 0x0+21bc align 2\*\*2 + filesz 0x0+84 memsz 0x0+84 flags r-- + +Dynamic Section: + HASH 0x0+b4 + STRTAB 0x0+17c + SYMTAB 0x0+ec + STRSZ 0x0+2c + SYMENT 0x0+10 + RELA 0x0+1a8 + RELASZ 0x0+c + RELAENT 0x0+c +private flags = 0: + +SYMBOL TABLE: +#... +0+80 g \.tdata 0+4 x +#... +DYNAMIC SYMBOL TABLE: +#... +0+80 g D \.tdata 0+4 x +#... + +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +0+22bc R_CRIS_DTP x + +Contents of section \.hash: +#... +Contents of section \.text: + 01b4 6fae0c00 00000000 .* +#... +Contents of section \.got: + 22b0 40220+ 0+ 0+ 0+ .* + 22c0 0+ .* diff --git a/ld/testsuite/ld-cris/tls-gd-2.s b/ld/testsuite/ld-cris/tls-gd-2.s new file mode 100644 index 00000000000..07e8cf51b97 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-gd-2.s @@ -0,0 +1,9 @@ + .text + .global tlsdsofn2 + .type tlsdsofn2,@function + .p2align 1 +tlsdsofn2: + move.d x:GDGOTREL,$r10 +.Lfe2: + .size tlsdsofn2,.Lfe2-tlsdsofn2 + diff --git a/ld/testsuite/ld-cris/tls-gd-2h.d b/ld/testsuite/ld-cris/tls-gd-2h.d new file mode 100644 index 00000000000..ed2803c21a8 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-gd-2h.d @@ -0,0 +1,50 @@ +#as: --pic --no-underscore --em=criself +#ld: --shared -m crislinux +#source: tls-gd-2.s +#source: tls128g.s +#source: tls-hx.s +#objdump: -s -t -R -p + +# DSO with a single R_CRIS_32_GOT_GD against a hidden symbol. Check +# that we have proper NPTL/TLS markings and GOT. + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+ paddr 0x0+ align 2\*\*13 + filesz 0x0+1a8 memsz 0x0+1a8 flags r-x + LOAD off 0x0+1a8 vaddr 0x0+21a8 paddr 0x0+21a8 align 2\*\*13 + filesz 0x0+108 memsz 0x0+108 flags rw- + DYNAMIC off 0x0+22c vaddr 0x0+222c paddr 0x0+222c align 2\*\*2 + filesz 0x0+70 memsz 0x0+70 flags rw- + TLS off 0x0+1a8 vaddr 0x0+21a8 paddr 0x0+21a8 align 2\*\*2 + filesz 0x0+84 memsz 0x0+84 flags r-- + +Dynamic Section: + HASH 0x0+b4 + STRTAB 0x0+168 + SYMTAB 0x0+e8 + STRSZ 0x0+2a + SYMENT 0x0+10 + RELA 0x0+194 + RELASZ 0x0+c + RELAENT 0x0+c +private flags = 0: + +SYMBOL TABLE: +#... +0+80 l \.tdata 0+4 \.hidden x +#... + +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +0+22a8 R_CRIS_DTP \*ABS\*\+0x0+80 + +Contents of section \.hash: +#... +Contents of section \.text: + 01a0 6fae0c00 00000000 .* +#... +Contents of section \.got: + 229c 2c220+ 0+ 0+ 0+ .* + 22ac 0+ .* diff --git a/ld/testsuite/ld-cris/tls-gd-3.d b/ld/testsuite/ld-cris/tls-gd-3.d new file mode 100644 index 00000000000..b2de85103bc --- /dev/null +++ b/ld/testsuite/ld-cris/tls-gd-3.d @@ -0,0 +1,39 @@ +#source: start1.s +#source: tls128.s +#source: tls-gd-3.s +#source: tls-x.s +#as: --no-underscore --em=criself +#ld: -m crislinux +#objdump: -d -s -t -r -p + +# Check that we have proper NPTL/TLS markings and GOT for an +# executable with a single R_CRIS_32_GD. + +.*: file format elf32-cris + +Program Header: +#... + TLS off 0x0+a0 vaddr 0x0+820a0 paddr 0x0+820a0 align 2\*\*2 + filesz 0x0+84 memsz 0x0+84 flags r-- +private flags = 0: +#... +SYMBOL TABLE: +#... +0+80 g \.tdata 0+4 x +#... +Contents of section \.text: +#... +Contents of section \.tdata: +#... +Contents of section \.got: + 82124 00000000 00000000 00000000 01000000 .* + 82134 80000000 .* + +Disassembly of section \.text: + +00080094 <_start>: + 80094: 41b2 moveq 1,\$r11 +#... +00080098 : + 80098: 6fae 3021 0800 move\.d [^>]+>,\$r10 +#... diff --git a/ld/testsuite/ld-cris/tls-gd-3.s b/ld/testsuite/ld-cris/tls-gd-3.s new file mode 100644 index 00000000000..c427a4532b2 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-gd-3.s @@ -0,0 +1,8 @@ + .text + .global tlsfn + .type tlsfn,@function + .p2align 1 +tlsfn: + move.d x:GD,$r10 +.Lfe1: + .size tlsfn,.Lfe1-tlsfn diff --git a/ld/testsuite/ld-cris/tls-gd-3h.d b/ld/testsuite/ld-cris/tls-gd-3h.d new file mode 100644 index 00000000000..78f109da8fa --- /dev/null +++ b/ld/testsuite/ld-cris/tls-gd-3h.d @@ -0,0 +1,39 @@ +#source: start1.s +#source: tls128.s +#source: tls-gd-3.s +#source: tls-hx.s +#as: --no-underscore --em=criself +#ld: -m crislinux +#objdump: -d -s -t -r -p + +# Check that we have proper NPTL/TLS markings and GOT for an +# executable with a single R_CRIS_32_GD against a hidden symbol. + +.*: file format elf32-cris + +Program Header: +#... + TLS off 0x0+a0 vaddr 0x0+820a0 paddr 0x0+820a0 align 2\*\*2 + filesz 0x0+84 memsz 0x0+84 flags r-- +private flags = 0: +#... +SYMBOL TABLE: +#... +0+80 g \.tdata 0+4 \.hidden x +#... +Contents of section \.text: +#... +Contents of section \.tdata: +#... +Contents of section \.got: + 82124 00000000 00000000 00000000 01000000 .* + 82134 80000000 .* + +Disassembly of section \.text: + +00080094 <_start>: + 80094: 41b2 moveq 1,\$r11 +#... +00080098 : + 80098: 6fae 3021 0800 move\.d [^>]+>,\$r10 +#... diff --git a/ld/testsuite/ld-cris/tls-gdgotrelm.s b/ld/testsuite/ld-cris/tls-gdgotrelm.s new file mode 100644 index 00000000000..50310eaa9bd --- /dev/null +++ b/ld/testsuite/ld-cris/tls-gdgotrelm.s @@ -0,0 +1,28 @@ + .text + + .ifndef r + .set r,1 + .endif + + .macro doit + .global tlsdsofngdgotrelm\@ + .type tlsdsofngdgotrelm\@,@function + .p2align 1 +tlsdsofngdgotrelm\@: + move.w x\@:GDGOTREL16,$r10 +.Lfe\@: + .size tlsdsofngdgotrelm\@,.Lfe\@-tlsdsofngdgotrelm\@ + + .globl x\@ + .section .tdata,"awT",@progbits + .p2align 0 + .type x\@, @object + .size x\@, 1 +x\@: + .byte 40 + .previous + .endm + + .rept r + doit + .endr diff --git a/ld/testsuite/ld-cris/tls-global-74.d b/ld/testsuite/ld-cris/tls-global-74.d new file mode 100644 index 00000000000..964246ef8a7 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-global-74.d @@ -0,0 +1,28 @@ +#source: start1.s +#source: tls-x.s +#source: tls-gd-2.s +#source: tls-ie-10.s +#source: tls-gd-1.s +#source: tls-ie-8.s +#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#ld: -m crislinux +#objdump: -s -t -r -p + +# An executable with a R_CRIS_32_GOT_GD, a R_CRIS_16_GOT_GD, a +# R_CRIS_32_GOT_TPREL and a R_CRIS_16_GOT_TPREL against the same +# symbol. Check that we have proper NPTL/TLS markings and GOT. + +.*: file format elf32-cris + +Program Header: +#... + TLS off .* + filesz 0x0+4 memsz 0x0+4 flags r-- +#... +Contents of section .text: + 80094 41b20000 6fae1000 0+ 6fae0c0+ .* + 800a4 0+ 5fae1000 5fae0c00 .* +#... +Contents of section \.got: + 820b4 0+ 0+ 0+ 0+ .* + 820c4 010+ 0+ .* diff --git a/ld/testsuite/ld-cris/tls-gottprelm.s b/ld/testsuite/ld-cris/tls-gottprelm.s new file mode 100644 index 00000000000..2853b314fd3 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-gottprelm.s @@ -0,0 +1,28 @@ + .text + + .ifndef r + .set r,1 + .endif + + .macro doit + .global tlsdsofngottprelm\@ + .type tlsdsofngottprelm\@,@function + .p2align 1 +tlsdsofngottprelm\@: + move.w x\@:TPOFFGOT16,$r10 +.Lfe\@: + .size tlsdsofngottprelm\@,.Lfe\@-tlsdsofngottprelm\@ + + .globl x\@ + .section .tdata,"awT",@progbits + .p2align 0 + .type x\@, @object + .size x\@, 1 +x\@: + .byte 40 + .previous + .endm + + .rept r + doit + .endr diff --git a/ld/testsuite/ld-cris/tls-hx.s b/ld/testsuite/ld-cris/tls-hx.s new file mode 100644 index 00000000000..8e83164758f --- /dev/null +++ b/ld/testsuite/ld-cris/tls-hx.s @@ -0,0 +1,8 @@ + .hidden x + .globl x + .section .tdata,"awT",@progbits + .p2align 2 + .type x, @object + .size x, 4 +x: + .long 40 diff --git a/ld/testsuite/ld-cris/tls-hx1x2.s b/ld/testsuite/ld-cris/tls-hx1x2.s new file mode 100644 index 00000000000..1964504d55e --- /dev/null +++ b/ld/testsuite/ld-cris/tls-hx1x2.s @@ -0,0 +1,15 @@ + .hidden x1 + .globl x1 + .section .tdata,"awT",@progbits + .p2align 2 + .type x1, @object + .size x1, 4 +x1: + .long 41 + .hidden x2 + .globl x2 + .p2align 2 + .type x2, @object + .size x2, 4 +x2: + .long 42 diff --git a/ld/testsuite/ld-cris/tls-ie-10.d b/ld/testsuite/ld-cris/tls-ie-10.d new file mode 100644 index 00000000000..869173c343a --- /dev/null +++ b/ld/testsuite/ld-cris/tls-ie-10.d @@ -0,0 +1,54 @@ +#as: --pic --no-underscore --em=criself +#ld: --shared -m crislinux +#source: tls-ie-10.s +#source: tls128g.s +#source: tls-x.s +#objdump: -s -t -R -p -T + +# DSO with a single R_CRIS_32_GOT_TPREL. Check that we have proper +# NPTL/TLS markings and GOT. + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+ paddr 0x0+ align 2\*\*13 + filesz 0x0+1c0 memsz 0x0+1c0 flags r-x + LOAD off 0x0+1c0 vaddr 0x0+21c0 paddr 0x0+21c0 align 2\*\*13 + filesz 0x0+10c memsz 0x0+10c flags rw- + DYNAMIC off 0x0+244 vaddr 0x0+2244 paddr 0x0+2244 align 2\*\*2 + filesz 0x0+78 memsz 0x0+78 flags rw- + TLS off 0x0+1c0 vaddr 0x0+21c0 paddr 0x0+21c0 align 2\*\*2 + filesz 0x0+84 memsz 0x0+84 flags r-- + +Dynamic Section: + HASH 0x0+b4 + STRTAB 0x0+17c + SYMTAB 0x0+ec + STRSZ 0x0+2d + SYMENT 0x0+10 + RELA 0x0+1ac + RELASZ 0x0+c + RELAENT 0x0+c + FLAGS 0x0+10 +private flags = 0: + +SYMBOL TABLE: +#... +0+80 g \.tdata 0+4 x +#... +DYNAMIC SYMBOL TABLE: +#... +0+80 g D \.tdata 0+4 x +#... + +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +0+22c8 R_CRIS_32_TPREL x + +Contents of section \.hash: +#... +Contents of section \.text: + 01b8 6fae0c00 00000000 .* +#... +Contents of section \.got: + 22bc 44220+ 0+ 0+ 0+ .* diff --git a/ld/testsuite/ld-cris/tls-ie-10.s b/ld/testsuite/ld-cris/tls-ie-10.s new file mode 100644 index 00000000000..a8667cd7a55 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-ie-10.s @@ -0,0 +1,8 @@ + .text + .global tlsdsofn10 + .type tlsdsofn10,@function + .p2align 1 +tlsdsofn10: + move.d x:TPOFFGOT,$r10 +.Lfe10: + .size tlsdsofn10,.Lfe10-tlsdsofn10 diff --git a/ld/testsuite/ld-cris/tls-ie-11.d b/ld/testsuite/ld-cris/tls-ie-11.d new file mode 100644 index 00000000000..d326fbe7397 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-ie-11.d @@ -0,0 +1,60 @@ +#as: --pic --no-underscore --em=criself +#ld: --shared -m crislinux +#source: tls-ie-11.s +#source: tls128g.s +#source: tls-x1x2.s +#objdump: -s -t -R -p -T + +# DSO with two R_CRIS_32_GOT_TPREL against different symbols. Check +# that we have proper NPTL/TLS markings and GOT. + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+ paddr 0x0+ align 2\*\*13 + filesz 0x0+1e4 memsz 0x0+1e4 flags r-x + LOAD off 0x0+1e4 vaddr 0x0+21e4 paddr 0x0+21e4 align 2\*\*13 + filesz 0x0+114 memsz 0x0+114 flags rw- + DYNAMIC off 0x0+26c vaddr 0x0+226c paddr 0x0+226c align 2\*\*2 + filesz 0x0+78 memsz 0x0+78 flags rw- + TLS off 0x0+1e4 vaddr 0x0+21e4 paddr 0x0+21e4 align 2\*\*2 + filesz 0x0+88 memsz 0x0+88 flags r-- + +Dynamic Section: + HASH 0x0+b4 + STRTAB 0x0+190 + SYMTAB 0x0+f0 + STRSZ 0x0+2f + SYMENT 0x0+10 + RELA 0x0+1c0 + RELASZ 0x0+18 + RELAENT 0x0+c + FLAGS 0x0+10 +private flags = 0: + +SYMBOL TABLE: +#... +0+84 g \.tdata 0+4 x2 +#... +0+80 g \.tdata 0+4 x1 +#... +DYNAMIC SYMBOL TABLE: +#... +0+84 g D \.tdata 0+4 x2 +#... +0+80 g D \.tdata 0+4 x1 +#... + +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +0+22f0 R_CRIS_32_TPREL x2 +0+22f4 R_CRIS_32_TPREL x1 + +Contents of section \.hash: +#... +Contents of section \.text: + 01d8 6fae1000 00006fbe 0c000000 .* +#... +Contents of section \.got: + 22e4 6c220+ 0+ 0+ 0+ .* + 22f4 00000000 .* diff --git a/ld/testsuite/ld-cris/tls-ie-11.s b/ld/testsuite/ld-cris/tls-ie-11.s new file mode 100644 index 00000000000..236bdbb48b0 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-ie-11.s @@ -0,0 +1,9 @@ + .text + .global tlsdsofn + .type tlsdsofn,@function + .p2align 1 +tlsdsofn: + move.d x1:TPOFFGOT,$r10 + move.d x2:TPOFFGOT,$r11 +.Lfe11: + .size tlsdsofn,.Lfe11-tlsdsofn diff --git a/ld/testsuite/ld-cris/tls-ie-8.d b/ld/testsuite/ld-cris/tls-ie-8.d new file mode 100644 index 00000000000..3c7769b64e3 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-ie-8.d @@ -0,0 +1,54 @@ +#as: --pic --no-underscore --em=criself +#ld: --shared -m crislinux +#source: tls-ie-8.s +#source: tls128g.s +#source: tls-x.s +#objdump: -s -t -R -p -T + +# DSO with a single R_CRIS_16_GOT_TPREL. Check that we have proper +# NPTL/TLS markings and GOT. + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+ paddr 0x0+ align 2\*\*13 + filesz 0x0+1b8 memsz 0x0+1b8 flags r-x + LOAD off 0x0+1b8 vaddr 0x0+21b8 paddr 0x0+21b8 align 2\*\*13 + filesz 0x0+10c memsz 0x0+10c flags rw- + DYNAMIC off 0x0+23c vaddr 0x0+223c paddr 0x0+223c align 2\*\*2 + filesz 0x0+78 memsz 0x0+78 flags rw- + TLS off 0x0+1b8 vaddr 0x0+21b8 paddr 0x0+21b8 align 2\*\*2 + filesz 0x0+84 memsz 0x0+84 flags r-- + +Dynamic Section: + HASH 0x0+b4 + STRTAB 0x0+17c + SYMTAB 0x0+ec + STRSZ 0x0+2b + SYMENT 0x0+10 + RELA 0x0+1a8 + RELASZ 0x0+c + RELAENT 0x0+c + FLAGS 0x0+10 +private flags = 0: + +SYMBOL TABLE: +#... +0+80 g \.tdata 0+4 x +#... +DYNAMIC SYMBOL TABLE: +#... +0+80 g D \.tdata 0+4 x +#... + +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +0+22c0 R_CRIS_32_TPREL x + +Contents of section \.hash: +#... +Contents of section \.text: + 01b4 5fae0c00 .* +#... +Contents of section \.got: + 22b4 3c220+ 0+ 0+ 0+ .* diff --git a/ld/testsuite/ld-cris/tls-ie-8.s b/ld/testsuite/ld-cris/tls-ie-8.s new file mode 100644 index 00000000000..ed95939a885 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-ie-8.s @@ -0,0 +1,8 @@ + .text + .global tlsdsofn + .type tlsdsofn,@function + .p2align 1 +tlsdsofn: + move.w x:TPOFFGOT16,$r10 +.Lfe8: + .size tlsdsofn,.Lfe8-tlsdsofn diff --git a/ld/testsuite/ld-cris/tls-ie-9.d b/ld/testsuite/ld-cris/tls-ie-9.d new file mode 100644 index 00000000000..673ae4fee86 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-ie-9.d @@ -0,0 +1,60 @@ +#as: --pic --no-underscore --em=criself +#ld: --shared -m crislinux +#source: tls-ie-9.s +#source: tls128g.s +#source: tls-x1x2.s +#objdump: -s -t -R -p -T + +# DSO with two R_CRIS_16_GOT_TPREL against different symbols. Check +# that we have proper NPTL/TLS markings and GOT. + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+ paddr 0x0+ align 2\*\*13 + filesz 0x0+1e0 memsz 0x0+1e0 flags r-x + LOAD off 0x0+1e0 vaddr 0x0+21e0 paddr 0x0+21e0 align 2\*\*13 + filesz 0x0+114 memsz 0x0+114 flags rw- + DYNAMIC off 0x0+268 vaddr 0x0+2268 paddr 0x0+2268 align 2\*\*2 + filesz 0x0+78 memsz 0x0+78 flags rw- + TLS off 0x0+1e0 vaddr 0x0+21e0 paddr 0x0+21e0 align 2\*\*2 + filesz 0x0+88 memsz 0x0+88 flags r-- + +Dynamic Section: + HASH 0x0+b4 + STRTAB 0x0+190 + SYMTAB 0x0+f0 + STRSZ 0x0+30 + SYMENT 0x0+10 + RELA 0x0+1c0 + RELASZ 0x0+18 + RELAENT 0x0+c + FLAGS 0x0+10 +private flags = 0: + +SYMBOL TABLE: +#... +0+84 g \.tdata 0+4 x2 +#... +0+80 g \.tdata 0+4 x1 +#... +DYNAMIC SYMBOL TABLE: +#... +0+84 g D \.tdata 0+4 x2 +#... +0+80 g D \.tdata 0+4 x1 +#... + +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +0+22ec R_CRIS_32_TPREL x2 +0+22f0 R_CRIS_32_TPREL x1 + +Contents of section \.hash: +#... +Contents of section \.text: + 01d8 5fae1000 5fbe0c00 .* +#... +Contents of section \.got: + 22e0 68220+ 0+ 0+ 0+ .* + 22f0 00000000 .* diff --git a/ld/testsuite/ld-cris/tls-ie-9.s b/ld/testsuite/ld-cris/tls-ie-9.s new file mode 100644 index 00000000000..69cecd7f623 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-ie-9.s @@ -0,0 +1,9 @@ + .text + .global tlsdsofn9 + .type tlsdsofn9,@function + .p2align 1 +tlsdsofn9: + move.w x1:TPOFFGOT16,$r10 + move.w x2:TPOFFGOT16,$r11 +.Lfe9: + .size tlsdsofn9,.Lfe9-tlsdsofn9 diff --git a/ld/testsuite/ld-cris/tls-ld-4.d b/ld/testsuite/ld-cris/tls-ld-4.d new file mode 100644 index 00000000000..b87d1d48c71 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-ld-4.d @@ -0,0 +1,50 @@ +#as: --pic --no-underscore --em=criself +#ld: --shared -m crislinux +#source: tls-ld-4.s +#source: tls128g.s +#source: tls-hx.s +#objdump: -s -t -R -p + +# DSO with a single R_CRIS_16_DTPREL against a hidden symbol. Check +# that we have proper NPTL/TLS markings and GOT. + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+ paddr 0x0+ align 2\*\*13 + filesz 0x0+1a4 memsz 0x0+1a4 flags r-x + LOAD off 0x0+1a4 vaddr 0x0+21a4 paddr 0x0+21a4 align 2\*\*13 + filesz 0x0+108 memsz 0x0+108 flags rw- + DYNAMIC off 0x0+228 vaddr 0x0+2228 paddr 0x0+2228 align 2\*\*2 + filesz 0x0+70 memsz 0x0+70 flags rw- + TLS off 0x0+1a4 vaddr 0x0+21a4 paddr 0x0+21a4 align 2\*\*2 + filesz 0x0+84 memsz 0x0+84 flags r-- + +Dynamic Section: + HASH 0x0+b4 + STRTAB 0x0+168 + SYMTAB 0x0+e8 + STRSZ 0x0+29 + SYMENT 0x0+10 + RELA 0x0+194 + RELASZ 0x0+c + RELAENT 0x0+c +private flags = 0: + +SYMBOL TABLE: +#... +0+80 l \.tdata 0+4 \.hidden x +#... + +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +0+22a4 R_CRIS_DTPMOD \*ABS\* + +Contents of section \.hash: +#... +Contents of section \.text: + 01a0 5fae8000 .* +#... +Contents of section \.got: + 2298 28220+ 0+ 0+ 0+ .* + 22a8 0+ .* diff --git a/ld/testsuite/ld-cris/tls-ld-4.s b/ld/testsuite/ld-cris/tls-ld-4.s new file mode 100644 index 00000000000..7990689884b --- /dev/null +++ b/ld/testsuite/ld-cris/tls-ld-4.s @@ -0,0 +1,8 @@ + .text + .global tlsdsofn + .type tlsdsofn,@function + .p2align 1 +tlsdsofn: + move.w x:DTPREL16,$r10 +.Lfe1: + .size tlsdsofn,.Lfe1-tlsdsofn diff --git a/ld/testsuite/ld-cris/tls-ld-5.d b/ld/testsuite/ld-cris/tls-ld-5.d new file mode 100644 index 00000000000..756f1b0570d --- /dev/null +++ b/ld/testsuite/ld-cris/tls-ld-5.d @@ -0,0 +1,51 @@ +#as: --pic --no-underscore --em=criself +#ld: --shared -m crislinux +#source: tls-ld-5.s +#source: tls128g.s +#source: tls-hx1x2.s +#objdump: -s -t -R -p + +# DSO with two R_CRIS_16_DTPRELs against different hidden symbols. +# Check that we have proper NPTL/TLS markings and GOT. + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+ paddr 0x0+ align 2\*\*13 + filesz 0x0+1a8 memsz 0x0+1a8 flags r-x + LOAD off 0x0+1a8 vaddr 0x0+21a8 paddr 0x0+21a8 align 2\*\*13 + filesz 0x0+10c memsz 0x0+10c flags rw- + DYNAMIC off 0x0+230 vaddr 0x0+2230 paddr 0x0+2230 align 2\*\*2 + filesz 0x0+70 memsz 0x0+70 flags rw- + TLS off 0x0+1a8 vaddr 0x0+21a8 paddr 0x0+21a8 align 2\*\*2 + filesz 0x0+88 memsz 0x0+88 flags r-- + +Dynamic Section: + HASH 0x0+b4 + STRTAB 0x0+168 + SYMTAB 0x0+e8 + STRSZ 0x0+29 + SYMENT 0x0+10 + RELA 0x0+194 + RELASZ 0x0+c + RELAENT 0x0+c +private flags = 0: + +SYMBOL TABLE: +#... +0+84 l \.tdata 0+4 \.hidden x2 +0+80 l \.tdata 0+4 \.hidden x1 +#... + +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +0+22ac R_CRIS_DTPMOD \*ABS\* + +Contents of section \.hash: +#... +Contents of section \.text: + 01a0 5fae8000 5fbe8400 .* +#... +Contents of section \.got: + 22a0 30220+ 0+ 0+ 0+ .* + 22b0 0+ .* diff --git a/ld/testsuite/ld-cris/tls-ld-5.s b/ld/testsuite/ld-cris/tls-ld-5.s new file mode 100644 index 00000000000..910a79db456 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-ld-5.s @@ -0,0 +1,10 @@ + .text + .global tlsdsofn + .type tlsdsofn,@function + .p2align 1 +tlsdsofn: + move.w x1:DTPREL16,$r10 + move.w x2:DTPREL16,$r11 +.Lfe5: + .size tlsdsofn,.Lfe5-tlsdsofn + diff --git a/ld/testsuite/ld-cris/tls-ld-6.d b/ld/testsuite/ld-cris/tls-ld-6.d new file mode 100644 index 00000000000..b178ad4c713 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-ld-6.d @@ -0,0 +1,50 @@ +#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#ld: --shared -m crislinux +#source: tls128g.s +#source: tls-ld-6.s +#source: tls-hx.s +#objdump: -s -t -R -p + +# DSO with a single R_CRIS_32_DTPREL against a hidden symbol. Check +# that we have proper NPTL/TLS markings and GOT. + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+ paddr 0x0+ align 2\*\*13 + filesz 0x0+1a8 memsz 0x0+1a8 flags r-x + LOAD off 0x0+1a8 vaddr 0x0+21a8 paddr 0x0+21a8 align 2\*\*13 + filesz 0x0+108 memsz 0x0+108 flags rw- + DYNAMIC off 0x0+22c vaddr 0x0+222c paddr 0x0+222c align 2\*\*2 + filesz 0x0+70 memsz 0x0+70 flags rw- + TLS off 0x0+1a8 vaddr 0x0+21a8 paddr 0x0+21a8 align 2\*\*2 + filesz 0x0+84 memsz 0x0+84 flags r-- + +Dynamic Section: + HASH 0x0+b4 + STRTAB 0x0+168 + SYMTAB 0x0+e8 + STRSZ 0x0+29 + SYMENT 0x0+10 + RELA 0x0+194 + RELASZ 0x0+c + RELAENT 0x0+c +private flags = 0: + +SYMBOL TABLE: +#... +0+80 l \.tdata 0+4 \.hidden x +#... + +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +0+22a8 R_CRIS_DTPMOD \*ABS\* + +Contents of section \.hash: +#... +Contents of section \.text: + 01a0 6fae8000 00000000 .* +#... +Contents of section \.got: + 229c 2c220+ 0+ 0+ 0+ .* + 22ac 0+ .* diff --git a/ld/testsuite/ld-cris/tls-ld-6.s b/ld/testsuite/ld-cris/tls-ld-6.s new file mode 100644 index 00000000000..d0a98f6814e --- /dev/null +++ b/ld/testsuite/ld-cris/tls-ld-6.s @@ -0,0 +1,8 @@ + .text + .global tlsdsofn + .type tlsdsofn,@function + .p2align 1 +tlsdsofn: + move.d x:DTPREL,$r10 +.Lfe6: + .size tlsdsofn,.Lfe6-tlsdsofn diff --git a/ld/testsuite/ld-cris/tls-ld-7.d b/ld/testsuite/ld-cris/tls-ld-7.d new file mode 100644 index 00000000000..92fcb8842d8 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-ld-7.d @@ -0,0 +1,51 @@ +#as: --pic --no-underscore --em=criself +#ld: --shared -m crislinux +#source: tls-ld-7.s +#source: tls128g.s +#source: tls-hx1x2.s +#objdump: -s -t -R -p + +# DSO with two R_CRIS_32_DTPRELs against different hidden symbols. +# Check that we have proper NPTL/TLS markings and GOT. + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+ paddr 0x0+ align 2\*\*13 + filesz 0x0+1ac memsz 0x0+1ac flags r-x + LOAD off 0x0+1ac vaddr 0x0+21ac paddr 0x0+21ac align 2\*\*13 + filesz 0x0+10c memsz 0x0+10c flags rw- + DYNAMIC off 0x0+234 vaddr 0x0+2234 paddr 0x0+2234 align 2\*\*2 + filesz 0x0+70 memsz 0x0+70 flags rw- + TLS off 0x0+1ac vaddr 0x0+21ac paddr 0x0+21ac align 2\*\*2 + filesz 0x0+88 memsz 0x0+88 flags r-- + +Dynamic Section: + HASH 0x0+b4 + STRTAB 0x0+168 + SYMTAB 0x0+e8 + STRSZ 0x0+29 + SYMENT 0x0+10 + RELA 0x0+194 + RELASZ 0x0+c + RELAENT 0x0+c +private flags = 0: + +SYMBOL TABLE: +#... +0+84 l \.tdata 0+4 \.hidden x2 +0+80 l \.tdata 0+4 \.hidden x1 +#... + +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +0+22b0 R_CRIS_DTPMOD \*ABS\* + +Contents of section \.hash: +#... +Contents of section \.text: + 01a0 6fae80+ 0+6fbe 840+ .* +#... +Contents of section \.got: + 22a4 34220+ 0+ 0+ 0+ .* + 22b4 0+ .* diff --git a/ld/testsuite/ld-cris/tls-ld-7.s b/ld/testsuite/ld-cris/tls-ld-7.s new file mode 100644 index 00000000000..c64c1db0861 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-ld-7.s @@ -0,0 +1,9 @@ + .text + .global tlsdsofn + .type tlsdsofn,@function + .p2align 1 +tlsdsofn: + move.d x1:DTPREL,$r10 + move.d x2:DTPREL,$r11 +.Lfe7: + .size tlsdsofn,.Lfe7-tlsdsofn diff --git a/ld/testsuite/ld-cris/tls-ldgd-14.d b/ld/testsuite/ld-cris/tls-ldgd-14.d new file mode 100644 index 00000000000..3b101ada395 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-ldgd-14.d @@ -0,0 +1,71 @@ +#source: tls128g.s +#source: tls-ld-5.s +#source: tls-gd-1.s +#source: tls-ldgd-14.s +#source: tls-x.s +#source: tls-z.s +#source: tls-hx1x2.s +#as: --pic --no-underscore --em=criself +#ld: --shared -m crislinux +#objdump: -s -t -R -p -T + +# Check that we have proper NPTL/TLS markings and GOT for two +# R_CRIS_16_GOT_GD and two R_CRIS_16_DTPRELs against different +# variables in a DSO. + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+ paddr 0x0+ align 2\*\*13 + filesz 0x0+230 memsz 0x0+230 flags r-x + LOAD off 0x0+230 vaddr 0x0+2230 paddr 0x0+2230 align 2\*\*13 + filesz 0x0+124 memsz 0x0+124 flags rw- + DYNAMIC off 0x0+2c0 vaddr 0x0+22c0 paddr 0x0+22c0 align 2\*\*2 + filesz 0x0+70 memsz 0x0+70 flags rw- + TLS off 0x0+230 vaddr 0x0+2230 paddr 0x0+2230 align 2\*\*2 + filesz 0x0+90 memsz 0x0+90 flags r-- + +Dynamic Section: + HASH 0x0+b4 + STRTAB 0x0+1b8 + SYMTAB 0x0+f8 + STRSZ 0x0+42 + SYMENT 0x0+10 + RELA 0x0+1fc + RELASZ 0x0+24 + RELAENT 0x0+c +private flags = 0: + +SYMBOL TABLE: +#... +0+8c l \.tdata 0+4 \.hidden x2 +#... +0+88 l \.tdata 0+4 \.hidden x1 +#... +0+80 g \.tdata 0+4 x +#... +0+84 g \.tdata 0+4 z +#... +DYNAMIC SYMBOL TABLE: +#... +0+80 g D \.tdata 0+4 x +#... +0+84 g D \.tdata 0+4 z +#... + +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +0+233c R_CRIS_DTPMOD \*ABS\* +0+2344 R_CRIS_DTP x +0+234c R_CRIS_DTP z + +Contents of section \.hash: +#... +Contents of section \.text: + 0220 5fae8800 5fbe8c00 5fae1400 5fae1c00 .* +Contents of section .tdata: +#... +Contents of section \.got: + 2330 c0220+ 0+ 0+ 0+ .* + 2340 0+ 0+ 0+ 0+ .* + 2350 0+ .* diff --git a/ld/testsuite/ld-cris/tls-ldgd-14.s b/ld/testsuite/ld-cris/tls-ldgd-14.s new file mode 100644 index 00000000000..3de8f87390e --- /dev/null +++ b/ld/testsuite/ld-cris/tls-ldgd-14.s @@ -0,0 +1,8 @@ + .text + .global tlsdsofn14 + .type tlsdsofn14,@function + .p2align 1 +tlsdsofn14: + move.w z:GDGOTREL16,$r10 +.Lfe14: + .size tlsdsofn14,.Lfe14-tlsdsofn14 diff --git a/ld/testsuite/ld-cris/tls-ldgd-15.d b/ld/testsuite/ld-cris/tls-ldgd-15.d new file mode 100644 index 00000000000..84d033f7d4f --- /dev/null +++ b/ld/testsuite/ld-cris/tls-ldgd-15.d @@ -0,0 +1,72 @@ +#source: tls128g.s +#source: tls-ld-7.s +#source: tls-gd-2.s +#source: tls-ldgd-15.s +#source: tls-x.s +#source: tls-z.s +#source: tls-hx1x2.s +#as: --pic --no-underscore --em=criself +#ld: --shared -m crislinux +#objdump: -s -t -R -p -T + +# Check that we have proper NPTL/TLS markings and GOT for two +# R_CRIS_32_GOT_GD and two R_CRIS_32_DTPRELs against different +# variables in a DSO. + +.*: file format elf32-cris + +Program Header: + LOAD off 0x0+ vaddr 0x0+ paddr 0x0+ align 2\*\*13 + filesz 0x0+23c memsz 0x0+23c flags r-x + LOAD off 0x0+23c vaddr 0x0+223c paddr 0x0+223c align 2\*\*13 + filesz 0x0+124 memsz 0x0+124 flags rw- + DYNAMIC off 0x0+2cc vaddr 0x0+22cc paddr 0x0+22cc align 2\*\*2 + filesz 0x0+70 memsz 0x0+70 flags rw- + TLS off 0x0+23c vaddr 0x0+223c paddr 0x0+223c align 2\*\*2 + filesz 0x0+90 memsz 0x0+90 flags r-- + +Dynamic Section: + HASH 0x0+b4 + STRTAB 0x0+1b8 + SYMTAB 0x0+f8 + STRSZ 0x0+42 + SYMENT 0x0+10 + RELA 0x0+1fc + RELASZ 0x0+24 + RELAENT 0x0+c +private flags = 0: + +SYMBOL TABLE: +#... +0+8c l \.tdata 0+4 \.hidden x2 +#... +0+88 l \.tdata 0+4 \.hidden x1 +#... +0+80 g \.tdata 0+4 x +#... +0+84 g \.tdata 0+4 z +#... +DYNAMIC SYMBOL TABLE: +#... +0+80 g D \.tdata 0+4 x +#... +0+84 g D \.tdata 0+4 z +#... + +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +0+2348 R_CRIS_DTPMOD \*ABS\* +0+2350 R_CRIS_DTP x +0+2358 R_CRIS_DTP z + +Contents of section \.hash: +#... +Contents of section \.text: + 0220 6fae8800 00006fbe 8c000000 6fae1400 .* + 0230 0+ 6fae1c00 0+ .* +Contents of section .tdata: +#... +Contents of section \.got: + 233c cc220+ 0+ 0+ 0+ .* + 234c 0+ 0+ 0+ 0+ .* + 235c 0+ .* diff --git a/ld/testsuite/ld-cris/tls-ldgd-15.s b/ld/testsuite/ld-cris/tls-ldgd-15.s new file mode 100644 index 00000000000..2b552434d46 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-ldgd-15.s @@ -0,0 +1,9 @@ + .text + .global tlsdsofn14 + .type tlsdsofn14,@function + .p2align 1 +tlsdsofn14: + move.d z:GDGOTREL,$r10 +.Lfe15: + .size tlsdsofn14,.Lfe15-tlsdsofn14 + diff --git a/ld/testsuite/ld-cris/tls-ldgde-14.d b/ld/testsuite/ld-cris/tls-ldgde-14.d new file mode 100644 index 00000000000..87f73be7bb2 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-ldgde-14.d @@ -0,0 +1,61 @@ +#source: start1.s +#source: tls128.s +#source: tls-ld-5.s +#source: tls-gd-1.s +#source: tls-ldgd-14.s +#source: tls-x.s +#source: tls-z.s +#source: tls-hx1x2.s +#as: --pic --no-underscore --em=criself +#ld: -m crislinux +#objdump: -d -s -h -t -r -p + +# Check that we have proper NPTL/TLS markings and GOT for two +# R_CRIS_16_GOT_GD and two R_CRIS_16_DTPRELs against different +# variables, for an executable. + +.*: file format elf32-cris + +Program Header: +#... + TLS off 0x0+a8 vaddr 0x0+820a8 paddr 0x0+820a8 align 2\*\*2 + filesz 0x0+90 memsz 0x0+90 flags r-- +private flags = 0: +#... + 1 .tdata .* + CONTENTS.* + 2 .got .* + CONTENTS.* +SYMBOL TABLE: +#... +0+80 g \.tdata 0+4 x +#... +0+8c g .tdata 00000004 \.hidden x2 +#... +0+84 g \.tdata 0+4 z +#... +0+88 g .tdata 00000004 \.hidden x1 +#... +Contents of section \.text: +#... +Contents of section \.tdata: +#... +Contents of section \.got: + 82138 00000000 00000000 00000000 01000000 .* + 82148 00000000 01000000 80000000 01000000 .* + 82158 84000000 .* + +Disassembly of section \.text: + +00080094 <_start>: + 80094: 41b2 moveq 1,\$r11 +#... +00080098 : + 80098: 5fae 8800 move\.w 0x88,\$r10 + 8009c: 5fbe 8c00 move\.w 0x8c,\$r11 + +000800a0 : + 800a0: 5fae 1400 move\.w 0x14,\$r10 + +000800a4 : + 800a4: 5fae 1c00 move\.w 0x1c,\$r10 diff --git a/ld/testsuite/ld-cris/tls-ldgde-15.d b/ld/testsuite/ld-cris/tls-ldgde-15.d new file mode 100644 index 00000000000..ae563654d20 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-ldgde-15.d @@ -0,0 +1,61 @@ +#source: start1.s +#source: tls128.s +#source: tls-ld-7.s +#source: tls-gd-2.s +#source: tls-ldgd-15.s +#source: tls-x.s +#source: tls-z.s +#source: tls-hx1x2.s +#as: --pic --no-underscore --em=criself +#ld: -m crislinux +#objdump: -d -s -h -t -r -p + +# Check that we have proper NPTL/TLS markings and GOT for two +# R_CRIS_32_GOT_GD and two R_CRIS_32_DTPRELs against different +# variables, for an executable. + +.*: file format elf32-cris + +Program Header: +#... + TLS off 0x0+b4 vaddr 0x0+820b4 paddr 0x0+820b4 align 2\*\*2 + filesz 0x0+90 memsz 0x0+90 flags r-- +private flags = 0: +#... + 1 .tdata .* + CONTENTS.* + 2 .got .* + CONTENTS.* +SYMBOL TABLE: +#... +0+80 g \.tdata 0+4 x +#... +0+8c g .tdata 00000004 \.hidden x2 +#... +0+84 g \.tdata 0+4 z +#... +0+88 g .tdata 00000004 \.hidden x1 +#... +Contents of section \.text: +#... +Contents of section \.tdata: +#... +Contents of section \.got: + 82144 00000000 00000000 00000000 01000000 .* + 82154 00000000 01000000 80000000 01000000 .* + 82164 84000000 .* + +Disassembly of section \.text: + +00080094 <_start>: + 80094: 41b2 moveq 1,\$r11 +#... +00080098 : + 80098: 6fae 8800 0000 move.d 88 ,\$r10 + 8009e: 6fbe 8c00 0000 move.d 8c ,\$r11 +000800a4 : + 800a4: 6fae 1400 0000 move.d 14 ,\$r10 +#... +000800ac : + 800ac: 6fae 1c00 0000 move.d 1c ,\$r10 +#... diff --git a/ld/testsuite/ld-cris/tls-ldgdex-14.d b/ld/testsuite/ld-cris/tls-ldgdex-14.d new file mode 100644 index 00000000000..83d94a77eba --- /dev/null +++ b/ld/testsuite/ld-cris/tls-ldgdex-14.d @@ -0,0 +1,54 @@ +#source: start1.s +#source: tls128.s +#source: tls-ld-5.s +#source: tls-gd-1.s +#source: tls-ldgd-14.s +#source: tls-hx1x2.s +#as: --pic --no-underscore --em=criself +#ld: -m crislinux tmpdir/tls-dso-xz-1.so +#objdump: -s -h -t -T -R -r -p + +# Check that we have proper NPTL/TLS markings and GOT for two +# R_CRIS_16_GOT_GD and two R_CRIS_16_DTPRELs against different +# variables, for an executable, GD symbols defined elsewhere. + +.*: file format elf32-cris + +Program Header: +#... + TLS off .* + filesz 0x0+88 memsz 0x0+88 flags r-- + +Dynamic Section: + NEEDED tmpdir/tls-dso-xz-1.so +#... +private flags = 0: +#... + 8 .got .* + CONTENTS.* +SYMBOL TABLE: +#... +0+ \*UND\* 0+ x +#... +0+ \*UND\* 0+ z +#... +DYNAMIC SYMBOL TABLE: +0+ D \*UND\* 0+ x +0+ D \*UND\* 0+ z +#... +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +0008230c R_CRIS_DTP x +00082314 R_CRIS_DTP z + +Contents of section .interp: +#... +Contents of section \.text: + 801dc 41b20000 5fae8000 5fbe8400 5fae1400 .* + 801ec 5fae1c00 .* +Contents of section \.tdata: +#... +Contents of section \.got: + 822f8 78220800 0+ 0+ 010+ .* + 82308 0+ 0+ 0+ 0+ .* + 82318 0+ .* diff --git a/ld/testsuite/ld-cris/tls-ldgdex-15.d b/ld/testsuite/ld-cris/tls-ldgdex-15.d new file mode 100644 index 00000000000..fca739bf79c --- /dev/null +++ b/ld/testsuite/ld-cris/tls-ldgdex-15.d @@ -0,0 +1,54 @@ +#source: start1.s +#source: tls128.s +#source: tls-ld-7.s +#source: tls-gd-2.s +#source: tls-ldgd-15.s +#source: tls-hx1x2.s +#as: --pic --no-underscore --em=criself +#ld: -m crislinux tmpdir/tls-dso-xz-1.so +#objdump: -s -h -t -T -R -r -p + +# Check that we have proper NPTL/TLS markings and GOT for two +# R_CRIS_32_GOT_GD and two R_CRIS_32_DTPRELs against different +# variables, for an executable, GD symbols defined elsewhere. + +.*: file format elf32-cris + +Program Header: +#... + TLS off .* + filesz 0x0+88 memsz 0x0+88 flags r-- + +Dynamic Section: + NEEDED tmpdir/tls-dso-xz-1.so +#... +private flags = 0: +#... + 8 .got .* + CONTENTS.* +SYMBOL TABLE: +#... +0+ \*UND\* 0+ x +#... +0+ \*UND\* 0+ z +#... +DYNAMIC SYMBOL TABLE: +0+ D \*UND\* 0+ x +0+ D \*UND\* 0+ z +#... +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +00082318 R_CRIS_DTP x +00082320 R_CRIS_DTP z + +Contents of section \.interp: +#... +Contents of section \.text: + 801dc 41b20000 6fae8000 00006fbe 84000000 .* + 801ec 6fae1400 00000000 6fae1c00 00000000 .* +Contents of section \.tdata: +#... +Contents of section \.got: + 82304 84220800 0+ 0+ 010+ .* + 82314 0+ 0+ 0+ 0+ .* + 82324 0+ .* diff --git a/ld/testsuite/ld-cris/tls-ldgdx-14.d b/ld/testsuite/ld-cris/tls-ldgdx-14.d new file mode 100644 index 00000000000..53fde9c96f8 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-ldgdx-14.d @@ -0,0 +1,55 @@ +#source: tls128.s +#source: tls-ld-5.s +#source: tls-gd-1.s +#source: tls-ldgd-14.s +#source: tls-hx1x2.s +#as: --pic --no-underscore --em=criself +#ld: --shared -m crislinux tmpdir/tls-dso-xz-1.so +#objdump: -s -h -t -T -R -r -p + +# Check that we have proper NPTL/TLS markings and GOT for two +# R_CRIS_16_GOT_GD and two R_CRIS_16_DTPRELs against different +# variables in a DSO, GD symbols defined elsewhere. + +.*: file format elf32-cris + +Program Header: +#... + TLS off .* + filesz 0x0+88 memsz 0x0+88 flags r-- + +Dynamic Section: + NEEDED tmpdir/tls-dso-xz-1.so +#... +private flags = 0: +#... + 7 .got .* + CONTENTS.* +SYMBOL TABLE: +#... +0+ \*UND\* 0+ x +#... +0+ \*UND\* 0+ z +#... +DYNAMIC SYMBOL TABLE: +#... +0+ D \*UND\* 0+ x +#... +0+ D \*UND\* 0+ z +#... +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +00002338 R_CRIS_DTPMOD \*ABS\* +00002340 R_CRIS_DTP x +00002348 R_CRIS_DTP z + +Contents of section \.hash: +#... +Contents of section \.text: + 021c 5fae8000 5fbe8400 5fae1400 5fae1c00 .* +Contents of section .tdata: +#... +Contents of section \.got: + 232c b4220+ 0+ 0+ 0+ .* + 233c 0+ 0+ 0+ 0+ .* + 234c 0+ .* diff --git a/ld/testsuite/ld-cris/tls-ldgdx-15.d b/ld/testsuite/ld-cris/tls-ldgdx-15.d new file mode 100644 index 00000000000..8b0af3f7361 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-ldgdx-15.d @@ -0,0 +1,56 @@ +#source: tls128.s +#source: tls-ld-7.s +#source: tls-gd-2.s +#source: tls-ldgd-15.s +#source: tls-hx1x2.s +#as: --pic --no-underscore --em=criself +#ld: --shared -m crislinux tmpdir/tls-dso-xz-1.so +#objdump: -s -h -t -T -R -r -p + +# Check that we have proper NPTL/TLS markings and GOT for two +# R_CRIS_32_GOT_GD and two R_CRIS_32_DTPRELs against different +# variables in a DSO, GD symbols defined elsewhere. + +.*: file format elf32-cris + +Program Header: +#... + TLS off .* + filesz 0x0+88 memsz 0x0+88 flags r-- + +Dynamic Section: + NEEDED tmpdir/tls-dso-xz-1.so +#... +private flags = 0: +#... + 7 .got .* + CONTENTS.* +SYMBOL TABLE: +#... +0+ \*UND\* 0+ x +#... +0+ \*UND\* 0+ z +#... +DYNAMIC SYMBOL TABLE: +#... +0+ D \*UND\* 0+ x +#... +0+ D \*UND\* 0+ z +#... +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +00002344 R_CRIS_DTPMOD \*ABS\* +0000234c R_CRIS_DTP x +00002354 R_CRIS_DTP z + +Contents of section \.hash: +#... +Contents of section \.text: + 021c 6fae8000 00006fbe 84000000 6fae1400 .* + 022c 0+ 6fae1c00 0+ .* +Contents of section .tdata: +#... +Contents of section \.got: + 2338 c0220+ 0+ 0+ 0+ .* + 2348 0+ 0+ 0+ 0+ .* + 2358 0+ .* diff --git a/ld/testsuite/ld-cris/tls-le-12.d b/ld/testsuite/ld-cris/tls-le-12.d new file mode 100644 index 00000000000..cc4025a27b1 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-le-12.d @@ -0,0 +1,38 @@ +#source: start1.s +#source: tls128.s +#source: tls-le-12.s +#source: tls-z.s +#as: --no-underscore --em=criself -I$srcdir/$subdir +#ld: -m crislinux +#objdump: -d -s -t -r -p -h + +# Check that we have proper NPTL/TLS markings and no GOT for an +# executable with a single R_CRIS_32_TPREL. + +.*: file format elf32-cris + +Program Header: +#... + TLS off 0x0+a0 vaddr 0x0+820a0 paddr 0x0+820a0 align 2\*\*2 + filesz 0x0+84 memsz 0x0+84 flags r-- +private flags = 0: +#... + 1 .tdata .* + CONTENTS.* +SYMBOL TABLE: +#... +0+80 g \.tdata 0+4 z +#... +Contents of section \.text: +#... +Contents of section \.tdata: +#... + +Disassembly of section \.text: + +00080094 <_start>: + 80094: 41b2 moveq 1,\$r11 +#... +00080098 : + 80098: 6fae 8000 0000 move\.d 80 ,\$r10 +#... diff --git a/ld/testsuite/ld-cris/tls-le-12.s b/ld/testsuite/ld-cris/tls-le-12.s new file mode 100644 index 00000000000..18974ef9d21 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-le-12.s @@ -0,0 +1,8 @@ + .text + .global tlsfn12 + .type tlsfn12,@function + .p2align 1 +tlsfn12: + move.d z:TPOFF,$r10 +.Lfe12: + .size tlsfn12,.Lfe12-tlsfn12 diff --git a/ld/testsuite/ld-cris/tls-le-12s.d b/ld/testsuite/ld-cris/tls-le-12s.d new file mode 100644 index 00000000000..8b9fb8ff60c --- /dev/null +++ b/ld/testsuite/ld-cris/tls-le-12s.d @@ -0,0 +1,38 @@ +#source: start1.s +#source: tls128.s +#source: tls-le-12s.s +#source: tls-z.s +#as: --no-underscore --em=criself -I$srcdir/$subdir +#ld: -m crislinux +#objdump: -d -s -t -r -p -h + +# Check that we have proper NPTL/TLS markings and no GOT for an +# executable with a single R_CRIS_16_TPREL. + +.*: file format elf32-cris + +Program Header: +#... + TLS off 0x0+9c vaddr 0x0+8209c paddr 0x0+8209c align 2\*\*2 + filesz 0x0+84 memsz 0x0+84 flags r-- +private flags = 0: +#... + 1 .tdata .* + CONTENTS.* +SYMBOL TABLE: +#... +0+80 g \.tdata 0+4 z +#... +Contents of section \.text: +#... +Contents of section \.tdata: +#... + +Disassembly of section \.text: + +00080094 <_start>: + 80094: 41b2 moveq 1,\$r11 +#... +00080098 : + 80098: 5fac 8000 movu\.w 0x80,\$r10 +#... diff --git a/ld/testsuite/ld-cris/tls-le-12s.s b/ld/testsuite/ld-cris/tls-le-12s.s new file mode 100644 index 00000000000..8edcbf66894 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-le-12s.s @@ -0,0 +1,8 @@ + .text + .global tlsfn12 + .type tlsfn12,@function + .p2align 1 +tlsfn12: + movu.w z:TPOFF16,$r10 +.Lfe12: + .size tlsfn12,.Lfe12-tlsfn12 diff --git a/ld/testsuite/ld-cris/tls-le-13.d b/ld/testsuite/ld-cris/tls-le-13.d new file mode 100644 index 00000000000..0589eb349bc --- /dev/null +++ b/ld/testsuite/ld-cris/tls-le-13.d @@ -0,0 +1,41 @@ +#source: start1.s +#source: tls128.s +#source: tls-le-13.s +#source: tls-x1x2.s +#as: --no-underscore --em=criself -I$srcdir/$subdir +#ld: -m crislinux +#objdump: -d -s -t -r -p -h + +# Check that we have proper NPTL/TLS markings and GOT for an +# executable with a single R_CRIS_32_TPREL. + +.*: file format elf32-cris + +Program Header: +#... + TLS off 0x0+a4 vaddr 0x0+820a4 paddr 0x0+820a4 align 2\*\*2 + filesz 0x0+88 memsz 0x0+88 flags r-- +private flags = 0: +#... + 1 .tdata .* + CONTENTS.* +SYMBOL TABLE: +#... +0+84 g \.tdata 0+4 x2 +#... +0+80 g \.tdata 0+4 x1 +#... +Contents of section \.text: +#... +Contents of section \.tdata: +#... + +Disassembly of section \.text: + +00080094 <_start>: + 80094: 41b2 moveq 1,\$r11 +#... +00080098 : + 80098: 6fae 8000 0000 move\.d 80 ,\$r10 + 8009e: 6fae 8400 0000 move\.d 84 ,\$r10 +#... diff --git a/ld/testsuite/ld-cris/tls-le-13.s b/ld/testsuite/ld-cris/tls-le-13.s new file mode 100644 index 00000000000..a1183ead1c9 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-le-13.s @@ -0,0 +1,9 @@ + .text + .global tlsfn13 + .type tlsfn13,@function + .p2align 1 +tlsfn13: + move.d x1:TPOFF,$r10 + move.d x2:TPOFF,$r10 +.Lfe13: + .size tlsfn13,.Lfe13-tlsfn13 diff --git a/ld/testsuite/ld-cris/tls-le-13s.d b/ld/testsuite/ld-cris/tls-le-13s.d new file mode 100644 index 00000000000..601ad225f24 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-le-13s.d @@ -0,0 +1,40 @@ +#source: start1.s +#source: tls128.s +#source: tls-le-13s.s +#source: tls-x1x2.s +#as: --no-underscore --em=criself -I$srcdir/$subdir +#ld: -m crislinux +#objdump: -d -s -t -r -p -h + +# Check that we have proper NPTL/TLS markings and GOT for an +# executable with two R_CRIS_16_TPREL, different symbols. + +.*: file format elf32-cris + +Program Header: +#... + TLS off 0x0+a0 vaddr 0x0+820a0 paddr 0x0+820a0 align 2\*\*2 + filesz 0x0+88 memsz 0x0+88 flags r-- +private flags = 0: +#... + 1 .tdata .* + CONTENTS.* +SYMBOL TABLE: +#... +0+84 g \.tdata 0+4 x2 +#... +0+80 g \.tdata 0+4 x1 +#... +Contents of section \.text: +#... +Contents of section \.tdata: +#... + +Disassembly of section \.text: + +00080094 <_start>: + 80094: 41b2 moveq 1,\$r11 +#... +00080098 : + 80098: 5fae 8000 move\.w 0x80,\$r10 + 8009c: 5fae 8400 move\.w 0x84,\$r10 diff --git a/ld/testsuite/ld-cris/tls-le-13s.s b/ld/testsuite/ld-cris/tls-le-13s.s new file mode 100644 index 00000000000..09e4966330a --- /dev/null +++ b/ld/testsuite/ld-cris/tls-le-13s.s @@ -0,0 +1,9 @@ + .text + .global tlsfn13 + .type tlsfn13,@function + .p2align 1 +tlsfn13: + move.w x1:TPOFF16,$r10 + move.w x2:TPOFF16,$r10 +.Lfe13s: + .size tlsfn13,.Lfe13s-tlsfn13 diff --git a/ld/testsuite/ld-cris/tls-legd-16.d b/ld/testsuite/ld-cris/tls-legd-16.d new file mode 100644 index 00000000000..652504205b2 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-legd-16.d @@ -0,0 +1,59 @@ +#source: start1.s +#source: tls128.s +#source: tls-le-13.s +#source: tls-gd-3.s +#source: tls-legd-16.s +#source: tls-x.s +#source: tls-z.s +#source: tls-x1x2.s +#as: --no-underscore --em=criself +#ld: -m crislinux +#objdump: -d -s -h -t -r -p + +# Check that we have proper NPTL/TLS markings and GOT for an +# executable with two R_CRIS_32_TPREL and two R_CRIS_32_GD, different +# symbols. + +.*: file format elf32-cris + +Program Header: +#... + TLS off 0x0+b4 vaddr 0x0+820b4 paddr 0x0+820b4 align 2\*\*2 + filesz 0x0+90 memsz 0x0+90 flags r-- +private flags = 0: + +#... + 2 .got .* + CONTENTS.* +SYMBOL TABLE: +#... +0+80 g \.tdata 0+4 x +#... +0+8c g \.tdata 0+4 x2 +#... +0+84 g \.tdata 0+4 z +#... +0+88 g \.tdata 0+4 x1 +#... +Contents of section \.text: +#... +Contents of section \.got: + 82144 0+ 0+ 0+ 010+ .* + 82154 80+ 010+ 840+ .* + +Disassembly of section \.text: + +00080094 <_start>: + 80094: 41b2 moveq 1,\$r11 +#... +00080098 : + 80098: 6fae 8800 0000 move.d 88 ,\$r10 + 8009e: 6fae 8c00 0000 move.d 8c ,\$r10 + +000800a4 : + 800a4: 6fae 5021 0800 move.d 82150 <_GLOBAL_OFFSET_TABLE_\+0xc>,\$r10 +#... + +000800ac : + 800ac: 6fae 5821 0800 move.d 82158 <_GLOBAL_OFFSET_TABLE_\+0x14>,\$r10 +#... diff --git a/ld/testsuite/ld-cris/tls-legd-16.s b/ld/testsuite/ld-cris/tls-legd-16.s new file mode 100644 index 00000000000..37160823f33 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-legd-16.s @@ -0,0 +1,8 @@ + .text + .global tlsfn16 + .type tlsfn15,@function + .p2align 1 +tlsfn16: + move.d z:GD,$r10 +.Lfe16: + .size tlsfn16,.Lfe16-tlsfn16 diff --git a/ld/testsuite/ld-cris/tls-legd-17.d b/ld/testsuite/ld-cris/tls-legd-17.d new file mode 100644 index 00000000000..328d1fd5238 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-legd-17.d @@ -0,0 +1,58 @@ +#source: start1.s +#source: tls128.s +#source: tls-le-13s.s +#source: tls-gd-2.s --pic +#source: tls-ldgd-14.s --pic +#source: tls-x.s +#source: tls-z.s +#source: tls-x1x2.s +#as: --no-underscore --em=criself +#ld: -m crislinux +#objdump: -d -s -h -t -r -p + +# Check that we have proper NPTL/TLS markings and GOT for an +# executable with two R_CRIS_16_TPREL a R_CRIS_32_GOT_GD and a +# R_CRIS_16_GOT_GD, different symbols. + +.*: file format elf32-cris + +Program Header: +#... + TLS off 0x0+ac vaddr 0x0+820ac paddr 0x0+820ac align 2\*\*2 + filesz 0x0+90 memsz 0x0+90 flags r-- +private flags = 0: + +#... + 2 .got .* + CONTENTS.* +SYMBOL TABLE: +#... +0+80 g \.tdata 0+4 x +#... +0+8c g \.tdata 0+4 x2 +#... +0+84 g \.tdata 0+4 z +#... +0+88 g \.tdata 0+4 x1 +#... +Contents of section \.text: +#... +Contents of section \.got: + 8213c 0+ 0+ 0+ 010+ .* + 8214c 80+ 010+ 840+ .* + +Disassembly of section \.text: + +00080094 <_start>: + 80094: 41b2 moveq 1,\$r11 +#... +00080098 : + 80098: 5fae 8800 move.w 0x88,\$r10 + 8009c: 5fae 8c00 move.w 0x8c,\$r10 + +000800a0 : + 800a0: 6fae 0c00 0000 move.d c ,\$r10 +#... + +000800a8 : + 800a8: 5fae 1400 move.w 0x14,\$r10 diff --git a/ld/testsuite/ld-cris/tls-legdx-16.d b/ld/testsuite/ld-cris/tls-legdx-16.d new file mode 100644 index 00000000000..8ce4280cef2 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-legdx-16.d @@ -0,0 +1,52 @@ +#source: start1.s +#source: tls128.s +#source: tls-le-13.s +#source: tls-gd-3.s +#source: tls-legd-16.s +#source: tls-x1x2.s +#as: --no-underscore --em=criself +#ld: -m crislinux tmpdir/tls-dso-xz-1.so +#objdump: -s -h -t -T -R -r -p + +# Check that we have proper NPTL/TLS markings and GOT for an +# executable with two R_CRIS_32_TPREL and two R_CRIS_32_GD, different +# symbols, GD symbols defined elsewhere. + +.*: file format elf32-cris + +Program Header: +#... + TLS off .* + filesz 0x0+88 memsz 0x0+88 flags r-- +Dynamic Section: + NEEDED tmpdir/tls-dso-xz-1.so +#... +private flags = 0: + +#... + 8 .got .* + CONTENTS.* +SYMBOL TABLE: +#... +0+ \*UND\* 0+ x +#... +0+ \*UND\* 0+ z +#... +DYNAMIC SYMBOL TABLE: +0+ D \*UND\* 0+ x +0+ D \*UND\* 0+ z +#... +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +00082310 R_CRIS_DTP x +00082318 R_CRIS_DTP z + +Contents of section .interp: +#... +Contents of section \.text: + 801dc 41b20000 6fae8000 00006fae 84000000 .* + 801ec 6fae1023 08000000 6fae1823 08000000 .* +#... +Contents of section \.got: + 82304 84220800 0+ 0+ 0+ .* + 82314 0+ 0+ 0+ .* diff --git a/ld/testsuite/ld-cris/tls-legdx-17.d b/ld/testsuite/ld-cris/tls-legdx-17.d new file mode 100644 index 00000000000..5a76604f7b4 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-legdx-17.d @@ -0,0 +1,54 @@ +#source: start1.s +#source: tls128.s +#source: tls-le-13s.s +#source: tls-gd-2.s --pic +#source: tls-ldgd-14.s --pic +#source: tls-x1x2.s +#as: --no-underscore --em=criself +#ld: -m crislinux tmpdir/tls-dso-xz-1.so +#objdump: -s -h -t -T -R -r -p + +# Check that we have proper NPTL/TLS markings and GOT for an +# executable with two R_CRIS_16_TPREL a R_CRIS_32_GOT_GD and a +# R_CRIS_16_GOT_GD, different symbols, GD symbols defined elsewhere. + +.*: file format elf32-cris + +Program Header: +#... + TLS off .* + filesz 0x0+88 memsz 0x0+88 flags r-- +Dynamic Section: + NEEDED tmpdir/tls-dso-xz-1.so +#... +private flags = 0: + +#... + 8 .got .* + CONTENTS.* +SYMBOL TABLE: +#... +0+ \*UND\* 0+ x +#... +0+ \*UND\* 0+ z +#... +DYNAMIC SYMBOL TABLE: +#... +0+ D \*UND\* 0+ x +#... +0+ D \*UND\* 0+ z +#... +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +00082308 R_CRIS_DTP x +00082310 R_CRIS_DTP z + +Contents of section .interp: +#... +Contents of section \.text: + 801dc 41b20000 5fae8000 5fae8400 6fae0c00 .* + 801ec 00000000 5fae1400 .* +#... +Contents of section \.got: + 822fc 7c220800 0+ 0+ 0+ .* + 8230c 0+ 0+ 0+ .* diff --git a/ld/testsuite/ld-cris/tls-leie-18.d b/ld/testsuite/ld-cris/tls-leie-18.d new file mode 100644 index 00000000000..e4d1601d1ab --- /dev/null +++ b/ld/testsuite/ld-cris/tls-leie-18.d @@ -0,0 +1,47 @@ +#source: start1.s +#source: tls128.s +#source: tls-le-13s.s +#source: tls-ie-9.s --pic +#source: tls-x1x2.s +#as: --no-underscore --em=criself +#ld: -m crislinux +#objdump: -d -s -h -t -r -p + +# Check that we have proper NPTL/TLS markings and GOT for an +# executable with two R_CRIS_16_TPREL and two R_CRIS_16_GOT_TPREL, no +# same reloc to same symbol; two different symbols. + +.*: file format elf32-cris + +Program Header: +#... + TLS off 0x0+a8 vaddr 0x0+820a8 paddr 0x0+820a8 align 2\*\*2 + filesz 0x0+88 memsz 0x0+88 flags r-- +private flags = 0: +#... + 2 .got .* + CONTENTS.* +SYMBOL TABLE: +#... +0+84 g \.tdata 0+4 x2 +#... +0+80 g \.tdata 0+4 x1 +#... +Contents of section \.text: +#... +Contents of section \.got: + 82130 0+ 0+ 0+ 840+ .* + 82140 80+ .... + +Disassembly of section \.text: + +00080094 <_start>: + 80094: 41b2 moveq 1,\$r11 +#... +00080098 : + 80098: 5fae 8000 move.w 0x80,\$r10 + 8009c: 5fae 8400 move.w 0x84,\$r10 + +000800a0 : + 800a0: 5fae 1000 move.w 0x10,\$r10 + 800a4: 5fbe 0c00 move.w 0xc,\$r11 diff --git a/ld/testsuite/ld-cris/tls-leie-19.d b/ld/testsuite/ld-cris/tls-leie-19.d new file mode 100644 index 00000000000..f294b77b9ba --- /dev/null +++ b/ld/testsuite/ld-cris/tls-leie-19.d @@ -0,0 +1,58 @@ +#source: start1.s +#source: tls128.s +#source: tls-leie-19.s +#source: tls-le-12.s +#source: tls-ie-11.s --pic +#source: tls-hx1x2.s +#source: tls-x.s +#source: tls-z.s +#as: --no-underscore --em=criself +#ld: -m crislinux +#objdump: -d -s -h -t -r -p + +# Check that we have proper NPTL/TLS markings and GOT for an +# executable with two R_CRIS_32_TPREL and two R_CRIS_32_GOT_TPREL, +# four different symbols. + +.*: file format elf32-cris + +Program Header: +#... + TLS off 0x0+b4 vaddr 0x0+820b4 paddr 0x0+820b4 align 2\*\*2 + filesz 0x0+90 memsz 0x0+90 flags r-- +private flags = 0: +#... + 2 .got .* + CONTENTS.* +SYMBOL TABLE: +#... +0+88 g .tdata 0+4 x +#... +0+84 g \.tdata 0+4 \.hidden x2 +#... +0+8c g .tdata 0+4 z +#... +0+80 g \.tdata 0+4 \.hidden x1 +#... +Contents of section \.text: +#... +Contents of section \.got: + 82144 0+ 0+ 0+ 840+ .* + 82154 80+ .* + +Disassembly of section \.text: + +00080094 <_start>: + 80094: 41b2 moveq 1,\$r11 +#... +00080098 : + 80098: 6fae 8800 0000 move.d 88 ,\$r10 +#... + +000800a0 : + 800a0: 6fae 8c00 0000 move.d 8c ,\$r10 +#... + +000800a8 : + 800a8: 6fae 1000 0000 move.d 10 ,\$r10 + 800ae: 6fbe 0c00 0000 move.d c ,\$r11 diff --git a/ld/testsuite/ld-cris/tls-leie-19.s b/ld/testsuite/ld-cris/tls-leie-19.s new file mode 100644 index 00000000000..a3a65ce1c4b --- /dev/null +++ b/ld/testsuite/ld-cris/tls-leie-19.s @@ -0,0 +1,8 @@ + .text + .global tlsfn19 + .type tlsfn19,@function + .p2align 1 +tlsfn19: + move.d x:TPOFF,$r10 +.Lfe19: + .size tlsfn19,.Lfe19-tlsfn19 diff --git a/ld/testsuite/ld-cris/tls-local-54.d b/ld/testsuite/ld-cris/tls-local-54.d new file mode 100644 index 00000000000..7c0deb6ac28 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-local-54.d @@ -0,0 +1,27 @@ +#source: tls-local-54.s +#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#ld: --shared -m crislinux +#objdump: -s -t -R -p -T + +# A DSO with a R_CRIS_32_GOT_GD against a local symbol. +# Check that we have proper NPTL/TLS markings and GOT. + +.*: file format elf32-cris + +Program Header: +#... + TLS off .* + filesz 0x00000080 memsz 0x00000080 flags r-- +#... +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +00002288 R_CRIS_DTP \*ABS\*\+0x0000002a + +Contents of section .hash: +#... +Contents of section \.text: + 0184 6fae0c00 00000000 .* +#... +Contents of section \.got: + 227c 0c220000 0+ 0+ 0+ .* + 228c 0+ .* diff --git a/ld/testsuite/ld-cris/tls-local-54.s b/ld/testsuite/ld-cris/tls-local-54.s new file mode 100644 index 00000000000..2bbe7562045 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-local-54.s @@ -0,0 +1,3 @@ + .include "tls-gd-2.s" + .include "tls128.s" + .set x, tls128+42 diff --git a/ld/testsuite/ld-cris/tls-local-57.d b/ld/testsuite/ld-cris/tls-local-57.d new file mode 100644 index 00000000000..03899a7ec09 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-local-57.d @@ -0,0 +1,23 @@ +#source: start1.s +#source: tls-x.s +#source: tls-local-57.s +#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#ld: -m crislinux +#objdump: -s -t -r -p + +# An executable with a R_CRIS_32_GOT_GD against a local symbol. +# Check that we have proper NPTL/TLS markings and GOT. + +.*: file format elf32-cris + +Program Header: +#... + TLS off .* + filesz 0x00000084 memsz 0x00000084 flags r-- +#... +Contents of section .text: + 80094 41b20000 6fae0c00 0+ .* +#... +Contents of section \.got: + 82124 0+ 0+ 0+ 010+ .* + 82134 040+ .* diff --git a/ld/testsuite/ld-cris/tls-local-57.s b/ld/testsuite/ld-cris/tls-local-57.s new file mode 100644 index 00000000000..7c524fc1447 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-local-57.s @@ -0,0 +1,3 @@ + .include "tls128.s" + .set x,tls128 + .include "tls-gd-2.s" diff --git a/ld/testsuite/ld-cris/tls-local-58.d b/ld/testsuite/ld-cris/tls-local-58.d new file mode 100644 index 00000000000..2f68a88f317 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-local-58.d @@ -0,0 +1,24 @@ +#source: start1.s +#source: tls-x.s +#source: tls-local-58.s +#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#ld: -m crislinux +#objdump: -s -t -r -p + +# An executable with a R_CRIS_32_GOT_GD and a R_CRIS_16_GOT_GD against +# the same local symbol. Check that we have proper NPTL/TLS markings +# and GOT. + +.*: file format elf32-cris + +Program Header: +#... + TLS off .* + filesz 0x00000084 memsz 0x00000084 flags r-- +#... +Contents of section .text: + 80094 41b20000 6fae0c00 00005fae 0c000000 .* +#... +Contents of section \.got: + 82128 0+ 0+ 0+ 010+ .* + 82138 040+ .* diff --git a/ld/testsuite/ld-cris/tls-local-58.s b/ld/testsuite/ld-cris/tls-local-58.s new file mode 100644 index 00000000000..ceb2f693f69 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-local-58.s @@ -0,0 +1,4 @@ + .include "tls128.s" + .set x,tls128 + .include "tls-gd-2.s" + .include "tls-gd-1.s" diff --git a/ld/testsuite/ld-cris/tls-local-59.d b/ld/testsuite/ld-cris/tls-local-59.d new file mode 100644 index 00000000000..fd033e45203 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-local-59.d @@ -0,0 +1,25 @@ +#source: start1.s +#source: tls-x.s +#source: tls-local-59.s +#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#ld: -m crislinux +#objdump: -s -t -r -p + +# An executable with a R_CRIS_32_GOT_GD, a R_CRIS_16_GOT_GD, a +# R_CRIS_32_GOT_TPREL and a R_CRIS_16_GOT_TPREL against the same local +# symbol. Check that we have proper NPTL/TLS markings and GOT. + +.*: file format elf32-cris + +Program Header: +#... + TLS off .* + filesz 0x00000084 memsz 0x00000084 flags r-- +#... +Contents of section .text: + 80094 41b20000 6fae1000 00006fae 0c000000 .* + 800a4 5fae1000 5fae0c00 .* +#... +Contents of section \.got: + 82130 0+ 0+ 0+ 040+ .* + 82140 010+ 040+ .* diff --git a/ld/testsuite/ld-cris/tls-local-59.s b/ld/testsuite/ld-cris/tls-local-59.s new file mode 100644 index 00000000000..9a0d4e456f6 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-local-59.s @@ -0,0 +1,6 @@ + .include "tls128.s" + .set x,tls128 + .include "tls-gd-2.s" + .include "tls-ie-10.s" + .include "tls-gd-1.s" + .include "tls-ie-8.s" diff --git a/ld/testsuite/ld-cris/tls-local-60.d b/ld/testsuite/ld-cris/tls-local-60.d new file mode 100644 index 00000000000..958a29655f9 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-local-60.d @@ -0,0 +1,33 @@ +#source: tls-x.s +#source: tls-local-59.s +#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#ld: -m crislinux --shared +#objdump: -s -t -r -p -R -T + +# A DSO with a R_CRIS_32_GOT_GD, a R_CRIS_16_GOT_GD, a +# R_CRIS_32_GOT_TPREL and a R_CRIS_16_GOT_TPREL against the same local +# symbol. Check that we have proper NPTL/TLS markings and GOT. + +.*: file format elf32-cris + +Program Header: +#... + TLS off .* + filesz 0x00000084 memsz 0x00000084 flags r-- +#... + FLAGS 0x00000010 +#... +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +0000231c R_CRIS_32_TPREL \*ABS\*\+0x0+4 +00002320 R_CRIS_DTP \*ABS\*\+0x0+4 + +Contents of section \.hash: +#... +Contents of section \.text: + 0200 6fae1000 00006fae 0c000000 5fae1000 .* + 0210 5fae0c00 .* +#... +Contents of section \.got: + 2310 98220+ 0+ 0+ 040+ .* + 2320 0+ 0+ .* diff --git a/ld/testsuite/ld-cris/tls-local-61.d b/ld/testsuite/ld-cris/tls-local-61.d new file mode 100644 index 00000000000..bfa4a25c1e1 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-local-61.d @@ -0,0 +1,32 @@ +#source: tls-local-59.s +#as: --pic --no-underscore --em=criself -I$srcdir/$subdir +#ld: -m crislinux --shared +#objdump: -s -t -r -p -R -T + +# A DSO with a R_CRIS_32_GOT_GD, a R_CRIS_16_GOT_GD, a +# R_CRIS_32_GOT_TPREL and a R_CRIS_16_GOT_TPREL against the same local +# symbol. Check that we have proper NPTL/TLS markings and GOT. + +.*: file format elf32-cris + +Program Header: +#... + TLS off .* + filesz 0x00000080 memsz 0x00000080 flags r-- +#... + FLAGS 0x00000010 +#... +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +00002304 R_CRIS_32_TPREL \*ABS\* +00002308 R_CRIS_DTP \*ABS\* + +Contents of section \.hash: +#... +Contents of section \.text: + 01ec 6fae1000 00006fae 0c000000 5fae1000 .* + 01fc 5fae0c00 .* +#... +Contents of section \.got: + 22f8 80220+ 0+ 0+ 0+ .* + 2308 0+ 0+ .* diff --git a/ld/testsuite/ld-cris/tls-local-63.d b/ld/testsuite/ld-cris/tls-local-63.d new file mode 100644 index 00000000000..f6f0bdb9336 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-local-63.d @@ -0,0 +1,31 @@ +#source: tls-ie-8.s --pic +#source: tls-hx.s +#as: --no-underscore --em=criself +#ld: -m crislinux --shared +#readelf: -a -x 6 -x 8 -x 5 + +# A R_CRIS_16_GOT_TPREL in a DSO against a hidden symbol. Make sure +# the relocation, GOT, .text and .tdata have the right contents. + +#... +Relocation section '.rela.dyn' at offset 0x.* contains 1 entries: + Offset Info Type Sym.Value Sym. Name \+ Addend +00002210 0000001c R_CRIS_32_TPREL[ ]+00+ + +There are no unwind sections in this file. + +Symbol table '.dynsym' contains 7 entries: + Num: Value Size Type Bind Vis Ndx Name +#... +Symbol table '.symtab' contains 16 entries: +#... + .: 00000000 4 TLS LOCAL HIDDEN 6 x +#... +Hex dump of section '.text': + 0x00000184 5fae0c00 .* +#... +Hex dump of section '.tdata': + 0x00002188 280+ .* +#... +Hex dump of section '.got': + 0x0+2204 8c210000 0+ 0+ 0+ .* diff --git a/ld/testsuite/ld-cris/tls-local-64.d b/ld/testsuite/ld-cris/tls-local-64.d new file mode 100644 index 00000000000..9fb3019ad5e --- /dev/null +++ b/ld/testsuite/ld-cris/tls-local-64.d @@ -0,0 +1,37 @@ +#source: tls-ie-8.s --pic +#source: tls128.s +#source: tls-hx.s +#as: --no-underscore --em=criself +#ld: -m crislinux --shared +#readelf: -a -x 6 -x 8 -x 5 + +# A R_CRIS_16_GOT_TPREL in a DSO against a hidden symbol, at an offset +# into .data. Make sure the relocation, GOT, .text and .tdata have +# the right contents. + +#... +Relocation section '.rela.dyn' at offset 0x.* contains 1 entries: + Offset Info Type Sym.Value Sym. Name \+ Addend +00002290 0000001c R_CRIS_32_TPREL[ ]+0+80 + +There are no unwind sections in this file. + +Symbol table '.dynsym' contains 7 entries: + Num: Value Size Type Bind Vis Ndx Name +#... +Symbol table '.symtab' contains 17 entries: +#... + ..: 00000080 4 TLS LOCAL HIDDEN 6 x +#... +Hex dump of section '.text': + 0x00000184 5fae0c00 .* +#... +Hex dump of section '.tdata': + 0x00002188 2f0+ 0+ 0+ 0+ .* + 0x00002198 0+ 0+ 0+ 0+ .* +#... + 0x000021f8 0+ 0+ 0+ 0+ .* + 0x00002208 280+ .* +#... +Hex dump of section '.got': + 0x0+2284 0c220000 0+ 0+ 80+ .* diff --git a/ld/testsuite/ld-cris/tls-ok-30.d b/ld/testsuite/ld-cris/tls-ok-30.d new file mode 100644 index 00000000000..94ed19441aa --- /dev/null +++ b/ld/testsuite/ld-cris/tls-ok-30.d @@ -0,0 +1,29 @@ +#source: tls-gdgotrelm.s --defsym r=8191 +#as: --no-underscore --em=criself --pic +#ld: --shared -m crislinux +#objdump: -s -j .got -R + +# Verify that the first and last R_CRIS_16_GOT_GD entries are ok just +# below the limit, in a DSO. Beware, the order here is quite random, +# supposedly depending on symbol hashes. + +.*: file format elf32-cris + +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +000b3910 R_CRIS_DTP x2814 +#... +000b8350 R_CRIS_DTP x8190 +#... +000c1308 R_CRIS_DTP x0 +#... +000c3900 R_CRIS_DTP x1345 + +Contents of section .got: + b3904 94380b00 00000000 00000000 00000000 .* + b3914 00000000 00000000 00000000 00000000 .* +#... + c38e4 00000000 00000000 00000000 00000000 .* + c38f4 00000000 00000000 00000000 00000000 .* + c3904 00000000 .* +#PASS diff --git a/ld/testsuite/ld-cris/tls-ok-32.d b/ld/testsuite/ld-cris/tls-ok-32.d new file mode 100644 index 00000000000..8042e2887e3 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-ok-32.d @@ -0,0 +1,23 @@ +#source: tls-dtprelm.s --defsym r=32767 +#as: --no-underscore --em=criself --pic +#ld: --shared -m crislinux +#objdump: -s -j .got -j .text -j .tdata -R + +# Check that a R_CRIS_16_DTPREL just below the theoretical limit +# works, in a DSO. + +.*: file format elf32-cris + +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +0000a220 R_CRIS_DTPMOD \*ABS\* + +Contents of section \.text: + 01a0 5faeff7f .* +Contents of section \.tdata: + 21a4 2a2a2a2a 2a2a2a2a 2a2a2a2a 2a2a2a2a .* +#... + a194 2a2a2a2a 2a2a2a2a 2a2a2a2a 2a2a2a2a .* +Contents of section \.got: + a214 a4a10000 00000000 00000000 00000000 .* + a224 00000000 .* diff --git a/ld/testsuite/ld-cris/tls-ok-34.d b/ld/testsuite/ld-cris/tls-ok-34.d new file mode 100644 index 00000000000..f534c993d2f --- /dev/null +++ b/ld/testsuite/ld-cris/tls-ok-34.d @@ -0,0 +1,28 @@ +#source: tls-gottprelm.s --defsym r=8189 +#as: --no-underscore --em=criself --pic +#ld: --shared -m crislinux +#objdump: -s -j .got -R + +# Check that a R_CRIS_16_DTPREL just below the theoretical limit +# works. Verify that the first and last R_CRIS_16_GOT_TPREL entries +# are ok, in a DSO. Beware, the order here is quite random, +# supposedly depending on symbol hashes. + +.*: file format elf32-cris + +DYNAMIC RELOCATION RECORDS +OFFSET TYPE VALUE +000b3870 R_CRIS_32_TPREL x2814 +#... +000b485c R_CRIS_32_TPREL x8188 +#... +000ba564 R_CRIS_32_TPREL x0 +#... +000bb860 R_CRIS_32_TPREL x1345 + +Contents of section .got: + b3864 ec370b00 00000000 00000000 00000000 .* + b3874 00000000 00000000 00000000 00000000 .* +#... + bb844 00000000 00000000 00000000 00000000 .* + bb854 00000000 00000000 00000000 00000000 .* diff --git a/ld/testsuite/ld-cris/tls-ok-36.d b/ld/testsuite/ld-cris/tls-ok-36.d new file mode 100644 index 00000000000..506f7c900f1 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-ok-36.d @@ -0,0 +1,16 @@ +#source: start1.s +#source: tls-tprelm.s --defsym r=32767 +#as: --no-underscore --em=criself +#ld: -m crislinux +#objdump: -s -j .got -j .text -j .tdata + +# Check that a R_CRIS_16_TPREL just below the theoretical limit works. + +.*: file format elf32-cris + +Contents of section \.text: + 80094 41b20000 5faeff7f .* +Contents of section \.tdata: + 8209c 2a2a2a2a 2a2a2a2a 2a2a2a2a 2a2a2a2a .* +#... + 8a08c 2a2a2a2a 2a2a2a2a 2a2a2a2a 2a2a2a2a .* diff --git a/ld/testsuite/ld-cris/tls-tprelm.s b/ld/testsuite/ld-cris/tls-tprelm.s new file mode 100644 index 00000000000..7d03ddd026c --- /dev/null +++ b/ld/testsuite/ld-cris/tls-tprelm.s @@ -0,0 +1,26 @@ + .text + + .ifndef r + .set r,1 + .endif + + .global tlsfntprelm + .type tlsfntprelm,@function + .p2align 1 +tlsfntprelm: + move.w x:TPOFF16,$r10 +.Lfe: + .size tlsfntprelm,.Lfe-tlsfntprelm + + .globl z + .section .tdata,"awT",@progbits + .p2align 2 + .type z,@object + .size z,r +z: + .fill r,1,42 + + .type x,@object + .size x,1 +x: + .byte 42 diff --git a/ld/testsuite/ld-cris/tls-und-38.d b/ld/testsuite/ld-cris/tls-und-38.d new file mode 100644 index 00000000000..e4df56fe374 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-und-38.d @@ -0,0 +1,27 @@ +#source: tls-gd-2.s --pic +#as: --no-underscore --em=criself +#ld: -m crislinux --shared +#readelf: -a -x 7 + +# Undefined reference for a R_CRIS_32_GOT_GD in a DSO. Not an error; +# it's ok for a DSO to have undefined references upon creation for +# global symbols that can be overridden. Just make sure GOT, dynsyms +# and dynrelocs look right. + +#... +Relocation section '.rela.dyn' at offset 0x.* contains 1 entries: + Offset Info Type Sym.Value Sym. Name \+ Addend +000021ec 00000217 R_CRIS_DTP 00000000 x \+ 0 + +There are no unwind sections in this file. + +Symbol table '.dynsym' contains . entries: + Num: Value Size Type Bind Vis Ndx Name +#... + [0-9]: 00000000 0 TLS GLOBAL DEFAULT UND x +#... +Symbol table '.symtab' contains .. entries: +#... +Hex dump of section '.got': + 0x0+21e0 70210000 00000000 00000000 00000000 .* + 0x0+21f0 00000000 .* diff --git a/ld/testsuite/ld-cris/tls-und-42.d b/ld/testsuite/ld-cris/tls-und-42.d new file mode 100644 index 00000000000..b2fba409b22 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-und-42.d @@ -0,0 +1,26 @@ +#source: tls-ie-10.s --pic +#as: --no-underscore --em=criself +#ld: -m crislinux --shared +#readelf: -a -x 7 + +# Undefined reference for a R_CRIS_32_GOT_TPREL in a DSO. Not an +# error; it's ok for a DSO to have undefined references upon creation +# for global symbols that can be overridden. Just make sure GOT, +# dynsyms and dynrelocs look right. + +#... +Relocation section '.rela.dyn' at offset 0x.* contains 1 entries: + Offset Info Type Sym.Value Sym. Name \+ Addend +000021f4 0000021c R_CRIS_32_TPREL 0+ x \+ 0 + +There are no unwind sections in this file. + +Symbol table '.dynsym' contains . entries: + Num: Value Size Type Bind Vis Ndx Name +#... + [0-9]: 00000000 0 TLS GLOBAL DEFAULT UND x +#... +Symbol table '.symtab' contains .. entries: +#... +Hex dump of section '.got': + 0x0+21e8 70210000 00000000 00000000 00000000 .* diff --git a/ld/testsuite/ld-cris/tls-und-46.d b/ld/testsuite/ld-cris/tls-und-46.d new file mode 100644 index 00000000000..8da45b3f23f --- /dev/null +++ b/ld/testsuite/ld-cris/tls-und-46.d @@ -0,0 +1,27 @@ +#source: tls-gd-1.s --pic +#as: --no-underscore --em=criself +#ld: -m crislinux --shared +#readelf: -a -x 7 + +# Undefined reference for a R_CRIS_16_GOT_GD in a DSO. Not an error; +# it's ok for a DSO to have undefined references upon creation for +# global symbols that can be overridden. Just make sure GOT, dynsyms +# and dynrelocs look right. + +#... +Relocation section '.rela.dyn' at offset 0x.* contains 1 entries: + Offset Info Type Sym.Value Sym. Name \+ Addend +000021e8 00000217 R_CRIS_DTP 00000000 x \+ 0 + +There are no unwind sections in this file. + +Symbol table '.dynsym' contains . entries: + Num: Value Size Type Bind Vis Ndx Name +#... + [0-9]: 00000000 0 TLS GLOBAL DEFAULT UND x +#... +Symbol table '.symtab' contains .. entries: +#... +Hex dump of section '.got': + 0x0+21dc 6c210000 00000000 00000000 00000000 .* + 0x0+21ec 00000000 .* diff --git a/ld/testsuite/ld-cris/tls-und-50.d b/ld/testsuite/ld-cris/tls-und-50.d new file mode 100644 index 00000000000..417e7a980b3 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-und-50.d @@ -0,0 +1,26 @@ +#source: tls-ie-8.s --pic +#as: --no-underscore --em=criself +#ld: -m crislinux --shared +#readelf: -a -x 7 + +# Undefined reference for a R_CRIS_16_GOT_TPREL in a DSO. Not an +# error; it's ok for a DSO to have undefined references upon creation +# for global symbols that can be overridden. Just make sure GOT, +# dynsyms and dynrelocs look right. + +#... +Relocation section '.rela.dyn' at offset 0x.* contains 1 entries: + Offset Info Type Sym.Value Sym. Name \+ Addend +000021ec 0000021c R_CRIS_32_TPREL 0+ x \+ 0 + +There are no unwind sections in this file. + +Symbol table '.dynsym' contains . entries: + Num: Value Size Type Bind Vis Ndx Name +#... + [0-9]: 00000000 0 TLS GLOBAL DEFAULT UND x +#... +Symbol table '.symtab' contains .. entries: +#... +Hex dump of section '.got': + 0x0+21e0 68210000 00000000 00000000 00000000 .* diff --git a/ld/testsuite/ld-cris/tls-x.s b/ld/testsuite/ld-cris/tls-x.s new file mode 100644 index 00000000000..504377ad26c --- /dev/null +++ b/ld/testsuite/ld-cris/tls-x.s @@ -0,0 +1,7 @@ + .globl x + .section .tdata,"awT",@progbits + .p2align 2 + .type x, @object + .size x, 4 +x: + .long 40 diff --git a/ld/testsuite/ld-cris/tls-x1x2.s b/ld/testsuite/ld-cris/tls-x1x2.s new file mode 100644 index 00000000000..fd5d349fb84 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-x1x2.s @@ -0,0 +1,13 @@ + .globl x1 + .section .tdata,"awT",@progbits + .p2align 2 + .type x1, @object + .size x1, 4 +x1: + .long 41 + .globl x2 + .p2align 2 + .type x2, @object + .size x2, 4 +x2: + .long 42 diff --git a/ld/testsuite/ld-cris/tls-z.s b/ld/testsuite/ld-cris/tls-z.s new file mode 100644 index 00000000000..25d97cd0750 --- /dev/null +++ b/ld/testsuite/ld-cris/tls-z.s @@ -0,0 +1,7 @@ + .globl z + .section .tdata,"awT",@progbits + .p2align 2 + .type z, @object + .size z, 4 +z: + .long 42 diff --git a/ld/testsuite/ld-cris/tls128.s b/ld/testsuite/ld-cris/tls128.s new file mode 100644 index 00000000000..71d6b844109 --- /dev/null +++ b/ld/testsuite/ld-cris/tls128.s @@ -0,0 +1,8 @@ +; Just something allocating 128 bytes TLS data. + .section .tdata,"awT",@progbits + .p2align 2 + .type tls128, @object +tls128: + .long 47 + .fill 124,1,0 + .size tls128, 128 diff --git a/ld/testsuite/ld-cris/tls128g.s b/ld/testsuite/ld-cris/tls128g.s new file mode 100644 index 00000000000..766b7d96247 --- /dev/null +++ b/ld/testsuite/ld-cris/tls128g.s @@ -0,0 +1,9 @@ +; Just something allocating 128 bytes TLS data, with the symbol being global. + .section .tdata,"awT",@progbits + .p2align 2 + .global tls128 + .type tls128, @object +tls128: + .long 47 + .fill 124,1,0 + .size tls128, 128 -- 2.30.2