From c6a8f6e0ed6e27fff6f17d373d628fe3cce49345 Mon Sep 17 00:00:00 2001 From: Bernd Schmidt Date: Thu, 5 May 2011 16:05:19 +0000 Subject: bfd/ * elf32-tic6x.c (elf32_tic6x_final_link): New function. (elf32_tic6x_merge_attributes): Do not warn for PID or PIC mismatch. Choose the lower of the two values. (bfd_elf32_bfd_final_link): New macro. ld/testsuite/ * ld-tic6x/shared-nopic.d: New test. * ld-tic6x/shared-nopid.d: New test. * ld-tic6x/attr-pid-21.d: Don't expect a warning; check readelf output instead. * ld-tic6x/attr-pid-12.d: Likewise. * ld-tic6x/attr-pic-01.d: Likewise. * ld-tic6x/attr-pic-10.d: Likewise. * ld-tic6x/attr-pid-01.d: Likewise. * ld-tic6x/attr-pid-10.d: Likewise. * ld-tic6x/attr-pid-02.d: Likewise. * ld-tic6x/attr-pid-20.d: Likewise. * ld-tic6x/got-reloc-inrange.d: Pass -mpic and -mpid options to gas. --- ld/testsuite/ld-tic6x/attr-pic-01.d | 6 +++++- ld/testsuite/ld-tic6x/attr-pic-10.d | 6 +++++- ld/testsuite/ld-tic6x/attr-pid-01.d | 7 ++++++- ld/testsuite/ld-tic6x/attr-pid-02.d | 7 ++++++- ld/testsuite/ld-tic6x/attr-pid-10.d | 7 ++++++- ld/testsuite/ld-tic6x/attr-pid-12.d | 8 +++++++- ld/testsuite/ld-tic6x/attr-pid-20.d | 6 +++++- ld/testsuite/ld-tic6x/attr-pid-21.d | 7 ++++++- ld/testsuite/ld-tic6x/got-reloc-inrange.d | 2 +- ld/testsuite/ld-tic6x/shared-nopic.d | 5 +++++ ld/testsuite/ld-tic6x/shared-nopid.d | 5 +++++ 11 files changed, 57 insertions(+), 9 deletions(-) create mode 100644 ld/testsuite/ld-tic6x/shared-nopic.d create mode 100644 ld/testsuite/ld-tic6x/shared-nopid.d (limited to 'ld/testsuite/ld-tic6x') diff --git a/ld/testsuite/ld-tic6x/attr-pic-01.d b/ld/testsuite/ld-tic6x/attr-pic-01.d index a04713f..91fb599 100644 --- a/ld/testsuite/ld-tic6x/attr-pic-01.d +++ b/ld/testsuite/ld-tic6x/attr-pic-01.d @@ -3,4 +3,8 @@ #ld: -r -melf32_tic6x_le #source: attr-pic-0.s #source: attr-pic-1.s -#warning: .*differ in position-dependence of code addressing +#readelf: -A + +Attribute Section: c6xabi +File Attributes + Tag_ISA: C674x diff --git a/ld/testsuite/ld-tic6x/attr-pic-10.d b/ld/testsuite/ld-tic6x/attr-pic-10.d index bc781c4..ff52a7a 100644 --- a/ld/testsuite/ld-tic6x/attr-pic-10.d +++ b/ld/testsuite/ld-tic6x/attr-pic-10.d @@ -3,4 +3,8 @@ #ld: -r -melf32_tic6x_le #source: attr-pic-1.s #source: attr-pic-0.s -#warning: .*differ in position-dependence of code addressing +#readelf: -A + +Attribute Section: c6xabi +File Attributes + Tag_ISA: C674x diff --git a/ld/testsuite/ld-tic6x/attr-pid-01.d b/ld/testsuite/ld-tic6x/attr-pid-01.d index 5c32e15..a5449dc 100644 --- a/ld/testsuite/ld-tic6x/attr-pid-01.d +++ b/ld/testsuite/ld-tic6x/attr-pid-01.d @@ -3,4 +3,9 @@ #ld: -r -melf32_tic6x_le #source: attr-pid-0.s #source: attr-pid-1.s -#warning: .*differ in position-dependence of data addressing +#readelf: -A + +Attribute Section: c6xabi +File Attributes + Tag_ISA: C674x + diff --git a/ld/testsuite/ld-tic6x/attr-pid-02.d b/ld/testsuite/ld-tic6x/attr-pid-02.d index d155b56..2a7bfd1 100644 --- a/ld/testsuite/ld-tic6x/attr-pid-02.d +++ b/ld/testsuite/ld-tic6x/attr-pid-02.d @@ -3,4 +3,9 @@ #ld: -r -melf32_tic6x_le #source: attr-pid-0.s #source: attr-pid-2.s -#warning: .*differ in position-dependence of data addressing +#readelf: -A + +Attribute Section: c6xabi +File Attributes + Tag_ISA: C674x + diff --git a/ld/testsuite/ld-tic6x/attr-pid-10.d b/ld/testsuite/ld-tic6x/attr-pid-10.d index edb8a65..a421d40 100644 --- a/ld/testsuite/ld-tic6x/attr-pid-10.d +++ b/ld/testsuite/ld-tic6x/attr-pid-10.d @@ -3,4 +3,9 @@ #ld: -r -melf32_tic6x_le #source: attr-pid-1.s #source: attr-pid-0.s -#warning: .*differ in position-dependence of data addressing +#readelf: -A + +Attribute Section: c6xabi +File Attributes + Tag_ISA: C674x + diff --git a/ld/testsuite/ld-tic6x/attr-pid-12.d b/ld/testsuite/ld-tic6x/attr-pid-12.d index 138ae88..af7a765 100644 --- a/ld/testsuite/ld-tic6x/attr-pid-12.d +++ b/ld/testsuite/ld-tic6x/attr-pid-12.d @@ -3,4 +3,10 @@ #ld: -r -melf32_tic6x_le #source: attr-pid-1.s #source: attr-pid-2.s -#warning: .*differ in position-dependence of data addressing +#readelf: -A + +Attribute Section: c6xabi +File Attributes + Tag_ISA: C674x + Tag_ABI_PID: Data addressing position-independent, GOT near DP + diff --git a/ld/testsuite/ld-tic6x/attr-pid-20.d b/ld/testsuite/ld-tic6x/attr-pid-20.d index ce319bd..e2cd0bc 100644 --- a/ld/testsuite/ld-tic6x/attr-pid-20.d +++ b/ld/testsuite/ld-tic6x/attr-pid-20.d @@ -3,4 +3,8 @@ #ld: -r -melf32_tic6x_le #source: attr-pid-2.s #source: attr-pid-0.s -#warning: .*differ in position-dependence of data addressing +#readelf: -A + +Attribute Section: c6xabi +File Attributes + Tag_ISA: C674x diff --git a/ld/testsuite/ld-tic6x/attr-pid-21.d b/ld/testsuite/ld-tic6x/attr-pid-21.d index 7097db6..c0f71df 100644 --- a/ld/testsuite/ld-tic6x/attr-pid-21.d +++ b/ld/testsuite/ld-tic6x/attr-pid-21.d @@ -3,4 +3,9 @@ #ld: -r -melf32_tic6x_le #source: attr-pid-2.s #source: attr-pid-1.s -#warning: .*differ in position-dependence of data addressing +#readelf: -A + +Attribute Section: c6xabi +File Attributes + Tag_ISA: C674x + Tag_ABI_PID: Data addressing position-independent, GOT near DP diff --git a/ld/testsuite/ld-tic6x/got-reloc-inrange.d b/ld/testsuite/ld-tic6x/got-reloc-inrange.d index e4fed04..4260444 100644 --- a/ld/testsuite/ld-tic6x/got-reloc-inrange.d +++ b/ld/testsuite/ld-tic6x/got-reloc-inrange.d @@ -1,5 +1,5 @@ #name: C6X GOT relocations, no overflow -#as: -mlittle-endian -mdsbt +#as: -mlittle-endian -mdsbt -mpic -mpid=near #ld: -melf32_tic6x_le -Tdsbt-inrange.ld --dsbt-index 4 -shared #source: got-reloc-global.s #objdump: -dr diff --git a/ld/testsuite/ld-tic6x/shared-nopic.d b/ld/testsuite/ld-tic6x/shared-nopic.d new file mode 100644 index 0000000..8748f10 --- /dev/null +++ b/ld/testsuite/ld-tic6x/shared-nopic.d @@ -0,0 +1,5 @@ +#name: C6X shared library without PIC code +#as: -mlittle-endian -mdsbt -mpid=near +#ld: -melf32_tic6x_le -Tdsbt-inrange.ld --dsbt-index 4 -shared +#source: got-reloc-global.s +#warning: non-PIC code diff --git a/ld/testsuite/ld-tic6x/shared-nopid.d b/ld/testsuite/ld-tic6x/shared-nopid.d new file mode 100644 index 0000000..7f366f3 --- /dev/null +++ b/ld/testsuite/ld-tic6x/shared-nopid.d @@ -0,0 +1,5 @@ +#name: C6X shared library without PIC code +#as: -mlittle-endian -mdsbt -mpic +#ld: -melf32_tic6x_le -Tdsbt-inrange.ld --dsbt-index 4 -shared +#source: got-reloc-global.s +#warning: non-PID code -- cgit v1.1