This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
FR-V FDPIC protected improvements and undefweak bug fix
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: binutils at sources dot redhat dot com
- Date: 14 Feb 2004 02:28:21 -0200
- Subject: FR-V FDPIC protected improvements and undefweak bug fix
- Organization: Red Hat Global Engineering Services Compiler Team
We used to consider an undefweak symbol as binding locally. Oops. My
thinko. Fixed in the patch below.
While at that, I figured I could do a slightly better job at
R_FRV_FUNCDESC relocations pointing to protected symbols. Even though
we do need an R_FRV_FUNCDESC dynamic relocation to get the dynamic
loader to create a single function descriptor to represent the
function's address both within the shared library and in other modules
that might bind to the library's definition, we can get the relocation
to not require dynamic binding, since the dynamic loader creates the
function descriptor for the symbol's address, so we might as well
decay the relocation to use section+offset.
This patch introduces these two changes, and adjust the testsuite
accordingly.
Ok to install?
Index: bfd/ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
* elf32-frv.c (FRV_SYM_LOCAL): Weak undefined doesn't imply local.
(_frv_emit_got_relocs_plt_entries): Decay relocation to protected
function's descriptor to symbol+offset, and map local undefweak
symbol to NULL function descriptor.
(elf32_frv_relocate_section): Likewise.
Index: bfd/elf32-frv.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-frv.c,v
retrieving revision 1.12
diff -u -p -r1.12 elf32-frv.c
--- bfd/elf32-frv.c 30 Jan 2004 21:11:37 -0000 1.12
+++ bfd/elf32-frv.c 14 Feb 2004 03:56:31 -0000
@@ -659,7 +659,6 @@ frv_elf_link_hash_table_create (bfd *abf
#define FRV_SYM_LOCAL(INFO, H) \
(_bfd_elf_symbol_refs_local_p ((H), (INFO), 1) \
|| ! elf_hash_table (INFO)->dynamic_sections_created \
- || (H)->root.type == bfd_link_hash_undefweak \
|| (/* The condition below is an ugly hack to get .scommon data to
be regarded as local. For some reason the
ELF_LINK_HASH_DEF_REGULAR bit is not set on such common
@@ -1029,47 +1028,60 @@ _frv_emit_got_relocs_plt_entries (struct
if (entry->fdgot_entry)
{
int reloc, idx;
- bfd_vma ad;
+ bfd_vma ad = 0;
- /* If the symbol is dynamic and there may be dynamic symbol
- resolution because we are or are linked with a shared
- library, emit a FUNCDESC relocation such that the dynamic
- linker will allocate the function descriptor. */
- if (entry->symndx == -1 && ! FRV_FUNCDESC_LOCAL (info, entry->d.h))
+ if (! (entry->symndx == -1
+ && entry->d.h->root.type == bfd_link_hash_undefweak
+ && FRV_SYM_LOCAL (info, entry->d.h)))
{
- reloc = R_FRV_FUNCDESC;
- idx = dynindx;
- ad = addend;
- if (ad)
- return FALSE;
- }
- else
- {
- /* Otherwise, we know we have a private function descriptor,
- so reference it directly. */
- if (elf_hash_table (info)->dynamic_sections_created)
- BFD_ASSERT (entry->privfd);
- reloc = R_FRV_32;
- idx = elf_section_data (frv_got_section (info)->output_section)
- ->dynindx;
- ad = frv_got_section (info)->output_offset +
- frv_got_initial_offset (info) + entry->fd_entry;
- }
-
- /* If there is room for dynamic symbol resolution, emit the
- dynamic relocation. However, if we're linking an executable
- at a fixed location, we won't have emitted a dynamic symbol
- entry for the got section, so idx will be zero, which means
- we can and should compute the address of the private
- descriptor ourselves. */
- if (info->executable && !info->pie
- && (entry->symndx != -1 || FRV_FUNCDESC_LOCAL (info, entry->d.h)))
- {
- if (entry->symndx == -1
- && entry->d.h->root.type == bfd_link_hash_undefweak)
- ad = 0;
+ /* If the symbol is dynamic and there may be dynamic symbol
+ resolution because we are, or are linked with, a shared
+ library, emit a FUNCDESC relocation such that the dynamic
+ linker will allocate the function descriptor. If the
+ symbol needs a non-local function descriptor but binds
+ locally (e.g., its visibility is protected, emit a
+ dynamic relocation decayed to section+offset. */
+ if (entry->symndx == -1 && ! FRV_FUNCDESC_LOCAL (info, entry->d.h)
+ && FRV_SYM_LOCAL (info, entry->d.h))
+ {
+ reloc = R_FRV_FUNCDESC;
+ idx = elf_section_data (entry->d.h->root.u.def.section
+ ->output_section)->dynindx;
+ ad = entry->d.h->root.u.def.section->output_offset
+ + entry->d.h->root.u.def.value;
+ }
+ else if (entry->symndx == -1
+ && ! FRV_FUNCDESC_LOCAL (info, entry->d.h))
+ {
+ reloc = R_FRV_FUNCDESC;
+ idx = dynindx;
+ ad = addend;
+ if (ad)
+ return FALSE;
+ }
else
{
+ /* Otherwise, we know we have a private function descriptor,
+ so reference it directly. */
+ if (elf_hash_table (info)->dynamic_sections_created)
+ BFD_ASSERT (entry->privfd);
+ reloc = R_FRV_32;
+ idx = elf_section_data (frv_got_section (info)
+ ->output_section)->dynindx;
+ ad = frv_got_section (info)->output_offset
+ + frv_got_initial_offset (info) + entry->fd_entry;
+ }
+
+ /* If there is room for dynamic symbol resolution, emit the
+ dynamic relocation. However, if we're linking an
+ executable at a fixed location, we won't have emitted a
+ dynamic symbol entry for the got section, so idx will be
+ zero, which means we can and should compute the address
+ of the private descriptor ourselves. */
+ if (info->executable && !info->pie
+ && (entry->symndx != -1
+ || FRV_FUNCDESC_LOCAL (info, entry->d.h)))
+ {
ad += frv_got_section (info)->output_section->vma;
_frv_add_rofixup (output_bfd, frv_gotfixup_section (info),
frv_got_section (info)->output_section->vma
@@ -1077,17 +1089,17 @@ _frv_emit_got_relocs_plt_entries (struct
+ frv_got_initial_offset (info)
+ entry->fdgot_entry);
}
+ else
+ _frv_add_dyn_reloc (output_bfd, frv_gotrel_section (info),
+ _bfd_elf_section_offset
+ (output_bfd, info,
+ frv_got_section (info),
+ frv_got_initial_offset (info)
+ + entry->fdgot_entry)
+ + frv_got_section (info)->output_section->vma
+ + frv_got_section (info)->output_offset,
+ reloc, idx, ad);
}
- else
- _frv_add_dyn_reloc (output_bfd, frv_gotrel_section (info),
- _bfd_elf_section_offset
- (output_bfd, info,
- frv_got_section (info),
- frv_got_initial_offset (info)
- + entry->fdgot_entry)
- + frv_got_section (info)->output_section->vma
- + frv_got_section (info)->output_offset,
- reloc, idx, ad);
bfd_put_32 (output_bfd, ad,
frv_got_section (info)->contents
@@ -2005,88 +2017,102 @@ elf32_frv_relocate_section (output_bfd,
int dynindx;
bfd_vma addend = rel->r_addend;
- /* If the symbol is dynamic and there may be dynamic
- symbol resolution because we are or are linked with a
- shared library, emit a FUNCDESC relocation such that
- the dynamic linker will allocate the function
- descriptor. */
- if (h && ! FRV_FUNCDESC_LOCAL (info, h))
+ if (! (h && h->root.type == bfd_link_hash_undefweak
+ && FRV_SYM_LOCAL (info, h)))
{
- if (addend)
+ /* If the symbol is dynamic and there may be dynamic
+ symbol resolution because we are or are linked with a
+ shared library, emit a FUNCDESC relocation such that
+ the dynamic linker will allocate the function
+ descriptor. If the symbol needs a non-local function
+ descriptor but binds locally (e.g., its visibility is
+ protected, emit a dynamic relocation decayed to
+ section+offset. */
+ if (h && ! FRV_FUNCDESC_LOCAL (info, h)
+ && FRV_SYM_LOCAL (info, h))
{
- info->callbacks->warning
- (info, _("R_FRV_FUNCDESC references dynamic symbol with nonzero addend"),
- name, input_bfd, input_section, rel->r_offset);
- return FALSE;
+ dynindx = elf_section_data (h->root.u.def.section
+ ->output_section)->dynindx;
+ addend += h->root.u.def.section->output_offset
+ + h->root.u.def.value;
+ }
+ else if (h && ! FRV_FUNCDESC_LOCAL (info, h))
+ {
+ if (addend)
+ {
+ info->callbacks->warning
+ (info, _("R_FRV_FUNCDESC references dynamic symbol with nonzero addend"),
+ name, input_bfd, input_section, rel->r_offset);
+ return FALSE;
+ }
+ dynindx = h->dynindx;
+ }
+ else
+ {
+ /* Otherwise, we know we have a private function
+ descriptor, so reference it directly. */
+ BFD_ASSERT (picrel->privfd);
+ r_type = R_FRV_32;
+ dynindx = elf_section_data (frv_got_section (info)
+ ->output_section)->dynindx;
+ addend = frv_got_section (info)->output_offset
+ + frv_got_initial_offset (info)
+ + picrel->fd_entry;
}
- dynindx = h->dynindx;
- }
- else
- {
- /* Otherwise, we know we have a private function
- descriptor, so reference it directly. */
- BFD_ASSERT (picrel->privfd);
- r_type = R_FRV_32;
- dynindx = elf_section_data (frv_got_section
- (info)->output_section)->dynindx;
- addend = frv_got_section (info)->output_offset
- + frv_got_initial_offset (info)
- + picrel->fd_entry;
- }
- /* If there is room for dynamic symbol resolution, emit
- the dynamic relocation. However, if we're linking an
- executable at a fixed location, we won't have emitted a
- dynamic symbol entry for the got section, so idx will
- be zero, which means we can and should compute the
- address of the private descriptor ourselves. */
- if (info->executable && !info->pie
- && (!h || FRV_FUNCDESC_LOCAL (info, h)))
- {
- addend += frv_got_section (info)->output_section->vma;
- if ((bfd_get_section_flags (output_bfd,
- input_section->output_section)
- & (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD))
+ /* If there is room for dynamic symbol resolution, emit
+ the dynamic relocation. However, if we're linking an
+ executable at a fixed location, we won't have emitted a
+ dynamic symbol entry for the got section, so idx will
+ be zero, which means we can and should compute the
+ address of the private descriptor ourselves. */
+ if (info->executable && !info->pie
+ && (!h || FRV_FUNCDESC_LOCAL (info, h)))
+ {
+ addend += frv_got_section (info)->output_section->vma;
+ if ((bfd_get_section_flags (output_bfd,
+ input_section->output_section)
+ & (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD))
+ {
+ if (_frv_osec_readonly_p (output_bfd,
+ input_section->output_section))
+ {
+ info->callbacks->warning
+ (info,
+ _("cannot emit fixups in read-only section"),
+ name, input_bfd, input_section, rel->r_offset);
+ return FALSE;
+ }
+ _frv_add_rofixup (output_bfd,
+ frv_gotfixup_section (info),
+ _bfd_elf_section_offset
+ (output_bfd, info,
+ input_section, rel->r_offset)
+ + input_section->output_section->vma
+ + input_section->output_offset);
+ }
+ }
+ else if ((bfd_get_section_flags (output_bfd,
+ input_section->output_section)
+ & (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD))
{
if (_frv_osec_readonly_p (output_bfd,
input_section->output_section))
{
info->callbacks->warning
(info,
- _("cannot emit fixups in read-only section"),
+ _("cannot emit dynamic relocations in read-only section"),
name, input_bfd, input_section, rel->r_offset);
return FALSE;
}
- if (! h || h->root.type != bfd_link_hash_undefweak)
- _frv_add_rofixup (output_bfd,
- frv_gotfixup_section (info),
+ _frv_add_dyn_reloc (output_bfd, frv_gotrel_section (info),
_bfd_elf_section_offset
(output_bfd, info,
input_section, rel->r_offset)
+ input_section->output_section->vma
- + input_section->output_offset);
- }
- }
- else if ((bfd_get_section_flags (output_bfd,
- input_section->output_section)
- & (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD))
- {
- if (_frv_osec_readonly_p (output_bfd,
- input_section->output_section))
- {
- info->callbacks->warning
- (info,
- _("cannot emit dynamic relocations in read-only section"),
- name, input_bfd, input_section, rel->r_offset);
- return FALSE;
+ + input_section->output_offset,
+ r_type, dynindx, addend);
}
- _frv_add_dyn_reloc (output_bfd, frv_gotrel_section (info),
- _bfd_elf_section_offset
- (output_bfd, info,
- input_section, rel->r_offset)
- + input_section->output_section->vma
- + input_section->output_offset,
- r_type, dynindx, addend);
}
/* We want the addend in-place because dynamic
Index: ld/testsuite/ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
* ld-frv/fdpic-pie-2.d: Adjust for decay of FUNCDESC relocs that
bind locally.
* ld-frv/fdpic-pie-8.d: Likewise.
* ld-frv/fdpic-shared-4.d: Likewise.
* ld-frv/fdpic-pie-6-fail.d: Renamed from...
* ld-frv/fdpic-pie-6.d: New test.
* ld-frv/fdpic-shared-6-fail.d: Renamed from...
* ld-frv/fdpic-shared-6.d: New test.
* ld-frv/fdpic6.ldv: New.
* ld-frv/fdpic-static-6.d: Adjust test name.
* ld-frv/fdpic-pie-8-fail.d: Removed.
* ld-frv/fdpic.exp: Run new tests.
Index: ld/testsuite/ld-frv/fdpic-pie-2.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-frv/fdpic-pie-2.d,v
retrieving revision 1.1
diff -u -p -r1.1 fdpic-pie-2.d
--- ld/testsuite/ld-frv/fdpic-pie-2.d 6 Jan 2004 19:19:31 -0000 1.1
+++ ld/testsuite/ld-frv/fdpic-pie-2.d 14 Feb 2004 03:56:31 -0000
@@ -37,8 +37,8 @@ Disassembly of section \.data:
10630: R_FRV_32 \.data
00010634 <GD0>:
- 10634: 00 00 00 00 add\.p gr0,gr0,gr0
- 10634: R_FRV_FUNCDESC GFb
+ 10634: 00 00 00 04 add\.p gr0,gr4,gr0
+ 10634: R_FRV_FUNCDESC \.text
10638: 00 00 00 04 add\.p gr0,gr4,gr0
10638: R_FRV_32 \.text
Disassembly of section \.got:
@@ -56,12 +56,14 @@ Disassembly of section \.got:
000106d0 <_GLOBAL_OFFSET_TABLE_>:
\.\.\.
- 106dc: R_FRV_FUNCDESC GF4
+ 106dc: 00 00 00 04 add\.p gr0,gr4,gr0
+ 106dc: R_FRV_FUNCDESC \.text
106e0: 00 00 00 04 add\.p gr0,gr4,gr0
106e0: R_FRV_32 \.text
- \.\.\.
- 106e4: R_FRV_FUNCDESC GF6
- 106e8: R_FRV_FUNCDESC GF5
+ 106e4: 00 00 00 04 add\.p gr0,gr4,gr0
+ 106e4: R_FRV_FUNCDESC \.text
+ 106e8: 00 00 00 04 add\.p gr0,gr4,gr0
+ 106e8: R_FRV_FUNCDESC \.text
106ec: 00 00 00 04 add\.p gr0,gr4,gr0
106ec: R_FRV_32 \.data
106f0: 00 00 00 04 add\.p gr0,gr4,gr0
Index: ld/testsuite/ld-frv/fdpic-pie-6-fail.d
===================================================================
RCS file: ld/testsuite/ld-frv/fdpic-pie-6-fail.d
diff -N ld/testsuite/ld-frv/fdpic-pie-6-fail.d
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ ld/testsuite/ld-frv/fdpic-pie-6-fail.d 14 Feb 2004 03:56:31 -0000
@@ -0,0 +1,6 @@
+#name: FRV uClinux PIC relocs to undefined symbols, pie linking
+#source: fdpic6.s
+#objdump: -DR -j .text -j .data -j .got -j .plt
+#as: -mfdpic
+#ld: -pie
+#error: different segments
Index: ld/testsuite/ld-frv/fdpic-pie-6.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-frv/fdpic-pie-6.d,v
retrieving revision 1.1
diff -u -p -r1.1 fdpic-pie-6.d
--- ld/testsuite/ld-frv/fdpic-pie-6.d 6 Jan 2004 19:19:31 -0000 1.1
+++ ld/testsuite/ld-frv/fdpic-pie-6.d 14 Feb 2004 03:56:31 -0000
@@ -1,6 +1,74 @@
-#name: FRV uClinux PIC relocs to undefined symbols, pie linking
+#name: FRV uClinux PIC relocs to weak undefined symbols, pie linking
#source: fdpic6.s
#objdump: -DR -j .text -j .data -j .got -j .plt
#as: -mfdpic
-#ld: -pie
-#error: different segments
+#ld: -pie --defsym WD1=D6
+
+.*: file format elf.*frv.*
+
+Disassembly of section \.plt:
+
+000005a8 <\.plt>:
+ 5a8: 00 00 00 08 add\.p gr0,gr8,gr0
+ 5ac: c0 1a 00 06 bra 5c4 <F6-0x10>
+ 5b0: 00 00 00 00 add\.p gr0,gr0,gr0
+ 5b4: c0 1a 00 04 bra 5c4 <F6-0x10>
+ 5b8: 00 00 00 10 add\.p gr0,gr16,gr0
+ 5bc: c0 1a 00 02 bra 5c4 <F6-0x10>
+ 5c0: 00 00 00 18 add\.p gr0,gr24,gr0
+ 5c4: 88 08 f1 40 ldd @\(gr15,gr0\),gr4
+ 5c8: 80 30 40 00 jmpl @\(gr4,gr0\)
+ 5cc: 9c cc ff f0 lddi @\(gr15,-16\),gr14
+ 5d0: 80 30 e0 00 jmpl @\(gr14,gr0\)
+Disassembly of section \.text:
+
+000005d4 <F6>:
+ 5d4: fe 3f ff fe call 5cc <F6-0x8>
+ 5d8: 80 40 f0 0c addi gr15,12,gr0
+ 5dc: 80 fc 00 24 setlos 0x24,gr0
+ 5e0: 80 f4 00 20 setlo 0x20,gr0
+ 5e4: 80 f8 00 00 sethi hi\(0x0\),gr0
+ 5e8: 80 40 f0 10 addi gr15,16,gr0
+ 5ec: 80 fc 00 18 setlos 0x18,gr0
+ 5f0: 80 f4 00 1c setlo 0x1c,gr0
+ 5f4: 80 f8 00 00 sethi hi\(0x0\),gr0
+ 5f8: 80 40 ff f8 addi gr15,-8,gr0
+ 5fc: 80 fc ff e8 setlos 0xffffffe8,gr0
+ 600: 80 f4 ff e0 setlo 0xffe0,gr0
+ 604: 80 f8 ff ff sethi 0xffff,gr0
+ 608: 80 f4 ff 44 setlo 0xff44,gr0
+ 60c: 80 f8 ff ff sethi 0xffff,gr0
+ 610: 80 f4 00 14 setlo 0x14,gr0
+ 614: 80 f8 00 00 sethi hi\(0x0\),gr0
+Disassembly of section \.data:
+
+0001062c <D6>:
+ \.\.\.
+ 1062c: R_FRV_32 WD0
+ 10630: R_FRV_FUNCDESC WFb
+ 10634: R_FRV_32 WFb
+Disassembly of section \.got:
+
+000106c8 <_GLOBAL_OFFSET_TABLE_-0x20>:
+ 106c8: 00 00 05 c4 subxcc\.p gr0,gr4,gr0,icc1
+ 106c8: R_FRV_FUNCDESC_VALUE WF9
+ 106cc: 00 00 00 02 add\.p gr0,fp,gr0
+ 106d0: 00 00 05 bc subx\.p gr0,gr60,gr0,icc1
+ 106d0: R_FRV_FUNCDESC_VALUE WF8
+ 106d4: 00 00 00 02 add\.p gr0,fp,gr0
+ 106d8: 00 00 05 b4 subx\.p gr0,gr52,gr0,icc1
+ 106d8: R_FRV_FUNCDESC_VALUE WF0
+ 106dc: 00 00 00 02 add\.p gr0,fp,gr0
+ 106e0: 00 00 05 ac subx\.p gr0,gr44,gr0,icc1
+ 106e0: R_FRV_FUNCDESC_VALUE WF7
+ 106e4: 00 00 00 02 add\.p gr0,fp,gr0
+
+000106e8 <_GLOBAL_OFFSET_TABLE_>:
+ \.\.\.
+ 106f4: R_FRV_32 WF1
+ 106f8: R_FRV_FUNCDESC WF4
+ 106fc: R_FRV_32 WD2
+ 10700: R_FRV_FUNCDESC WF5
+ 10704: R_FRV_FUNCDESC WF6
+ 10708: R_FRV_32 WF3
+ 1070c: R_FRV_32 WF2
Index: ld/testsuite/ld-frv/fdpic-pie-8-fail.d
===================================================================
RCS file: ld/testsuite/ld-frv/fdpic-pie-8-fail.d
diff -N ld/testsuite/ld-frv/fdpic-pie-8-fail.d
--- ld/testsuite/ld-frv/fdpic-pie-8-fail.d 6 Jan 2004 19:19:31 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,6 +0,0 @@
-#name: FRV uClinux PIC relocs to global symbols with addends, failing pie linking
-#source: fdpic8.s
-#objdump: -DR -j .text -j .data -j .got -j .plt
-#as: -mfdpic
-#ld: -pie
-#error: nonzero addend
Index: ld/testsuite/ld-frv/fdpic-pie-8.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-frv/fdpic-pie-8.d,v
retrieving revision 1.1
diff -u -p -r1.1 fdpic-pie-8.d
--- ld/testsuite/ld-frv/fdpic-pie-8.d 6 Jan 2004 19:19:31 -0000 1.1
+++ ld/testsuite/ld-frv/fdpic-pie-8.d 14 Feb 2004 03:56:31 -0000
@@ -2,83 +2,71 @@
#source: fdpic8.s
#objdump: -DR -j .text -j .data -j .got -j .plt
#as: -mfdpic
-#ld: -pie --version-script fdpic8min.ldv
+#ld: -pie
.*: file format elf.*frv.*
Disassembly of section \.text:
-00000498 <F8>:
- 498: 80 3c 00 02 call 4a0 <GF1\+0x4>
+000005d0 <F8>:
+ 5d0: 80 3c 00 02 call 5d8 <GF0\+0x4>
-0000049c <GF1>:
- 49c: 80 40 f0 10 addi gr15,16,gr0
- 4a0: 80 fc 00 14 setlos 0x14,gr0
- 4a4: 80 f4 00 24 setlo 0x24,gr0
- 4a8: 80 f8 00 00 sethi hi\(0x0\),gr0
- 4ac: 80 40 f0 0c addi gr15,12,gr0
- 4b0: 80 fc 00 1c setlos 0x1c,gr0
- 4b4: 80 f4 00 18 setlo 0x18,gr0
- 4b8: 80 f8 00 00 sethi hi\(0x0\),gr0
- 4bc: 80 40 ff f8 addi gr15,-8,gr0
- 4c0: 80 fc ff f0 setlos 0xfffffff0,gr0
- 4c4: 80 f4 ff c8 setlo 0xffc8,gr0
- 4c8: 80 f8 ff ff sethi 0xffff,gr0
- 4cc: 80 40 ff 48 addi gr15,-184,gr0
- 4d0: 80 fc ff 48 setlos 0xffffff48,gr0
- 4d4: 80 f4 ff 48 setlo 0xff48,gr0
- 4d8: 80 f8 ff ff sethi 0xffff,gr0
- 4dc: 80 f4 00 20 setlo 0x20,gr0
- 4e0: 80 f8 00 00 sethi hi\(0x0\),gr0
+000005d4 <GF0>:
+ 5d4: 80 40 f0 10 addi gr15,16,gr0
+ 5d8: 80 fc 00 14 setlos 0x14,gr0
+ 5dc: 80 f4 00 24 setlo 0x24,gr0
+ 5e0: 80 f8 00 00 sethi hi\(0x0\),gr0
+ 5e4: 80 40 f0 0c addi gr15,12,gr0
+ 5e8: 80 fc 00 1c setlos 0x1c,gr0
+ 5ec: 80 f4 00 18 setlo 0x18,gr0
+ 5f0: 80 f8 00 00 sethi hi\(0x0\),gr0
+ 5f4: 80 40 ff f8 addi gr15,-8,gr0
+ 5f8: 80 fc ff f0 setlos 0xfffffff0,gr0
+ 5fc: 80 f4 ff e8 setlo 0xffe8,gr0
+ 600: 80 f8 ff ff sethi 0xffff,gr0
+ 604: 80 40 ff 68 addi gr15,-152,gr0
+ 608: 80 fc ff 68 setlos 0xffffff68,gr0
+ 60c: 80 f4 ff 68 setlo 0xff68,gr0
+ 610: 80 f8 ff ff sethi 0xffff,gr0
+ 614: 80 f4 00 20 setlo 0x20,gr0
+ 618: 80 f8 00 00 sethi hi\(0x0\),gr0
Disassembly of section \.data:
-000104f8 <D8>:
- 104f8: 00 00 00 08 add\.p gr0,gr8,gr0
- 104f8: R_FRV_32 \.data
-
-000104fc <GD0>:
- 104fc: 00 00 00 10 add\.p gr0,gr16,gr0
- 104fc: R_FRV_32 \.got
- 10500: 00 00 00 08 add\.p gr0,gr8,gr0
- 10500: R_FRV_32 \.text
+00010630 <D8>:
+ 10630: 00 00 00 08 add\.p gr0,gr8,gr0
+ 10630: R_FRV_32 \.data
+
+00010634 <GD0>:
+ 10634: 00 00 00 08 add\.p gr0,gr8,gr0
+ 10634: R_FRV_FUNCDESC \.text
+ 10638: 00 00 00 08 add\.p gr0,gr8,gr0
+ 10638: R_FRV_32 \.text
Disassembly of section \.got:
-00010580 <_GLOBAL_OFFSET_TABLE_-0x38>:
- 10580: 00 00 00 08 add\.p gr0,gr8,gr0
- 10580: R_FRV_FUNCDESC_VALUE \.text
- 10584: 00 00 00 02 add\.p gr0,fp,gr0
- 10588: 00 00 00 08 add\.p gr0,gr8,gr0
- 10588: R_FRV_FUNCDESC_VALUE \.text
- 1058c: 00 00 00 02 add\.p gr0,fp,gr0
- 10590: 00 00 00 08 add\.p gr0,gr8,gr0
- 10590: R_FRV_FUNCDESC_VALUE \.text
- 10594: 00 00 00 02 add\.p gr0,fp,gr0
- 10598: 00 00 00 08 add\.p gr0,gr8,gr0
- 10598: R_FRV_FUNCDESC_VALUE \.text
- 1059c: 00 00 00 02 add\.p gr0,fp,gr0
- 105a0: 00 00 00 08 add\.p gr0,gr8,gr0
- 105a0: R_FRV_FUNCDESC_VALUE \.text
- 105a4: 00 00 00 02 add\.p gr0,fp,gr0
- 105a8: 00 00 00 08 add\.p gr0,gr8,gr0
- 105a8: R_FRV_FUNCDESC_VALUE \.text
- 105ac: 00 00 00 02 add\.p gr0,fp,gr0
- 105b0: 00 00 00 08 add\.p gr0,gr8,gr0
- 105b0: R_FRV_FUNCDESC_VALUE \.text
- 105b4: 00 00 00 02 add\.p gr0,fp,gr0
+000106b8 <_GLOBAL_OFFSET_TABLE_-0x18>:
+ 106b8: 00 00 00 08 add\.p gr0,gr8,gr0
+ 106b8: R_FRV_FUNCDESC_VALUE \.text
+ 106bc: 00 00 00 02 add\.p gr0,fp,gr0
+ 106c0: 00 00 00 08 add\.p gr0,gr8,gr0
+ 106c0: R_FRV_FUNCDESC_VALUE \.text
+ 106c4: 00 00 00 02 add\.p gr0,fp,gr0
+ 106c8: 00 00 00 08 add\.p gr0,gr8,gr0
+ 106c8: R_FRV_FUNCDESC_VALUE \.text
+ 106cc: 00 00 00 02 add\.p gr0,fp,gr0
-000105b8 <_GLOBAL_OFFSET_TABLE_>:
+000106d0 <_GLOBAL_OFFSET_TABLE_>:
\.\.\.
- 105c4: 00 00 00 08 add\.p gr0,gr8,gr0
- 105c4: R_FRV_32 \.got
- 105c8: 00 00 00 08 add\.p gr0,gr8,gr0
- 105c8: R_FRV_32 \.text
- 105cc: 00 00 00 08 add\.p gr0,gr8,gr0
- 105cc: R_FRV_32 \.text
- 105d0: 00 00 00 20 add\.p gr0,gr32,gr0
- 105d0: R_FRV_32 \.got
- 105d4: 00 00 00 18 add\.p gr0,gr24,gr0
- 105d4: R_FRV_32 \.got
- 105d8: 00 00 00 08 add\.p gr0,gr8,gr0
- 105d8: R_FRV_32 \.data
- 105dc: 00 00 00 08 add\.p gr0,gr8,gr0
- 105dc: R_FRV_32 \.text
+ 106dc: 00 00 00 04 add\.p gr0,gr4,gr0
+ 106dc: R_FRV_FUNCDESC \.text
+ 106e0: 00 00 00 08 add\.p gr0,gr8,gr0
+ 106e0: R_FRV_32 \.text
+ 106e4: 00 00 00 08 add\.p gr0,gr8,gr0
+ 106e4: R_FRV_32 \.text
+ 106e8: 00 00 00 04 add\.p gr0,gr4,gr0
+ 106e8: R_FRV_FUNCDESC \.text
+ 106ec: 00 00 00 04 add\.p gr0,gr4,gr0
+ 106ec: R_FRV_FUNCDESC \.text
+ 106f0: 00 00 00 08 add\.p gr0,gr8,gr0
+ 106f0: R_FRV_32 \.data
+ 106f4: 00 00 00 08 add\.p gr0,gr8,gr0
+ 106f4: R_FRV_32 \.text
Index: ld/testsuite/ld-frv/fdpic-shared-4.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-frv/fdpic-shared-4.d,v
retrieving revision 1.1
diff -u -p -r1.1 fdpic-shared-4.d
--- ld/testsuite/ld-frv/fdpic-shared-4.d 6 Jan 2004 19:19:31 -0000 1.1
+++ ld/testsuite/ld-frv/fdpic-shared-4.d 14 Feb 2004 03:56:31 -0000
@@ -37,8 +37,8 @@ Disassembly of section \.data:
10654: R_FRV_32 \.data
00010658 <PD0>:
- 10658: 00 00 00 00 add\.p gr0,gr0,gr0
- 10658: R_FRV_FUNCDESC PFb
+ 10658: 00 00 00 04 add\.p gr0,gr4,gr0
+ 10658: R_FRV_FUNCDESC \.text
1065c: 00 00 00 04 add\.p gr0,gr4,gr0
1065c: R_FRV_32 \.text
Disassembly of section \.got:
@@ -56,16 +56,17 @@ Disassembly of section \.got:
000106f0 <_GLOBAL_OFFSET_TABLE_>:
\.\.\.
- 106fc: R_FRV_FUNCDESC PF4
+ 106fc: 00 00 00 04 add\.p gr0,gr4,gr0
+ 106fc: R_FRV_FUNCDESC \.text
10700: 00 00 00 04 add\.p gr0,gr4,gr0
10700: R_FRV_32 \.text
10704: 00 00 00 04 add\.p gr0,gr4,gr0
10704: R_FRV_32 \.data
- 10708: 00 00 00 00 add\.p gr0,gr0,gr0
- 10708: R_FRV_FUNCDESC PF6
+ 10708: 00 00 00 04 add\.p gr0,gr4,gr0
+ 10708: R_FRV_FUNCDESC \.text
1070c: 00 00 00 04 add\.p gr0,gr4,gr0
1070c: R_FRV_32 \.text
10710: 00 00 00 04 add\.p gr0,gr4,gr0
10710: R_FRV_32 \.text
- 10714: 00 00 00 00 add\.p gr0,gr0,gr0
- 10714: R_FRV_FUNCDESC PF5
+ 10714: 00 00 00 04 add\.p gr0,gr4,gr0
+ 10714: R_FRV_FUNCDESC \.text
Index: ld/testsuite/ld-frv/fdpic-shared-6-fail.d
===================================================================
RCS file: ld/testsuite/ld-frv/fdpic-shared-6-fail.d
diff -N ld/testsuite/ld-frv/fdpic-shared-6-fail.d
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ ld/testsuite/ld-frv/fdpic-shared-6-fail.d 14 Feb 2004 03:56:32 -0000
@@ -0,0 +1,6 @@
+#name: FRV uClinux PIC relocs to undefined symbols, shared linking
+#source: fdpic6.s
+#objdump: -DR -j .text -j .data -j .got -j .plt
+#as: -mfdpic
+#ld: -shared
+#error: different segments
Index: ld/testsuite/ld-frv/fdpic-shared-6.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-frv/fdpic-shared-6.d,v
retrieving revision 1.1
diff -u -p -r1.1 fdpic-shared-6.d
--- ld/testsuite/ld-frv/fdpic-shared-6.d 6 Jan 2004 19:19:31 -0000 1.1
+++ ld/testsuite/ld-frv/fdpic-shared-6.d 14 Feb 2004 03:56:32 -0000
@@ -1,6 +1,74 @@
-#name: FRV uClinux PIC relocs to undefined symbols, shared linking
+#name: FRV uClinux PIC relocs to weak undefined symbols, shared linking
#source: fdpic6.s
#objdump: -DR -j .text -j .data -j .got -j .plt
#as: -mfdpic
-#ld: -shared
-#error: different segments
+#ld: -shared --defsym WD1=D6 --version-script fdpic6.ldv
+
+.*: file format elf.*frv.*
+
+Disassembly of section \.plt:
+
+0000041c <\.plt>:
+ 41c: 00 00 00 08 add\.p gr0,gr8,gr0
+ 420: c0 1a 00 06 bra 438 <F6-0x10>
+ 424: 00 00 00 00 add\.p gr0,gr0,gr0
+ 428: c0 1a 00 04 bra 438 <F6-0x10>
+ 42c: 00 00 00 10 add\.p gr0,gr16,gr0
+ 430: c0 1a 00 02 bra 438 <F6-0x10>
+ 434: 00 00 00 18 add\.p gr0,gr24,gr0
+ 438: 88 08 f1 40 ldd @\(gr15,gr0\),gr4
+ 43c: 80 30 40 00 jmpl @\(gr4,gr0\)
+ 440: 9c cc ff f0 lddi @\(gr15,-16\),gr14
+ 444: 80 30 e0 00 jmpl @\(gr14,gr0\)
+Disassembly of section \.text:
+
+00000448 <F6>:
+ 448: fe 3f ff fe call 440 <F6-0x8>
+ 44c: 80 40 f0 0c addi gr15,12,gr0
+ 450: 80 fc 00 24 setlos 0x24,gr0
+ 454: 80 f4 00 20 setlo 0x20,gr0
+ 458: 80 f8 00 00 sethi hi\(0x0\),gr0
+ 45c: 80 40 f0 10 addi gr15,16,gr0
+ 460: 80 fc 00 18 setlos 0x18,gr0
+ 464: 80 f4 00 1c setlo 0x1c,gr0
+ 468: 80 f8 00 00 sethi hi\(0x0\),gr0
+ 46c: 80 40 ff f8 addi gr15,-8,gr0
+ 470: 80 fc ff e8 setlos 0xffffffe8,gr0
+ 474: 80 f4 ff e0 setlo 0xffe0,gr0
+ 478: 80 f8 ff ff sethi 0xffff,gr0
+ 47c: 80 f4 ff 40 setlo 0xff40,gr0
+ 480: 80 f8 ff ff sethi 0xffff,gr0
+ 484: 80 f4 00 14 setlo 0x14,gr0
+ 488: 80 f8 00 00 sethi hi\(0x0\),gr0
+Disassembly of section \.data:
+
+00010490 <D6>:
+ \.\.\.
+ 10490: R_FRV_32 WD0
+ 10494: R_FRV_FUNCDESC WFb
+ 10498: R_FRV_32 WFb
+Disassembly of section \.got:
+
+00010530 <_GLOBAL_OFFSET_TABLE_-0x20>:
+ 10530: 00 00 04 38 \*unknown\*
+ 10530: R_FRV_FUNCDESC_VALUE WF9
+ 10534: 00 00 00 00 add\.p gr0,gr0,gr0
+ 10538: 00 00 04 30 \*unknown\*
+ 10538: R_FRV_FUNCDESC_VALUE WF8
+ 1053c: 00 00 00 00 add\.p gr0,gr0,gr0
+ 10540: 00 00 04 28 \*unknown\*
+ 10540: R_FRV_FUNCDESC_VALUE WF0
+ 10544: 00 00 00 00 add\.p gr0,gr0,gr0
+ 10548: 00 00 04 20 \*unknown\*
+ 10548: R_FRV_FUNCDESC_VALUE WF7
+ 1054c: 00 00 00 00 add\.p gr0,gr0,gr0
+
+00010550 <_GLOBAL_OFFSET_TABLE_>:
+ \.\.\.
+ 1055c: R_FRV_32 WF1
+ 10560: R_FRV_FUNCDESC WF4
+ 10564: R_FRV_32 WD2
+ 10568: R_FRV_FUNCDESC WF5
+ 1056c: R_FRV_FUNCDESC WF6
+ 10570: R_FRV_32 WF3
+ 10574: R_FRV_32 WF2
Index: ld/testsuite/ld-frv/fdpic-static-6.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-frv/fdpic-static-6.d,v
retrieving revision 1.1
diff -u -p -r1.1 fdpic-static-6.d
--- ld/testsuite/ld-frv/fdpic-static-6.d 6 Jan 2004 19:19:31 -0000 1.1
+++ ld/testsuite/ld-frv/fdpic-static-6.d 14 Feb 2004 03:56:32 -0000
@@ -1,4 +1,4 @@
-#name: FRV uClinux PIC relocs to undefined symbols, static linking
+#name: FRV uClinux PIC relocs to weak undefined symbols, static linking
#source: fdpic6.s
#objdump: -D
#as: -mfdpic
Index: ld/testsuite/ld-frv/fdpic.exp
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-frv/fdpic.exp,v
retrieving revision 1.1
diff -u -p -r1.1 fdpic.exp
--- ld/testsuite/ld-frv/fdpic.exp 6 Jan 2004 19:19:31 -0000 1.1
+++ ld/testsuite/ld-frv/fdpic.exp 14 Feb 2004 03:56:32 -0000
@@ -42,7 +42,9 @@ run_dump_test "fdpic-pie-5"
run_dump_test "fdpic-shared-5"
run_dump_test "fdpic-static-6"
+run_dump_test "fdpic-pie-6-fail"
run_dump_test "fdpic-pie-6"
+run_dump_test "fdpic-shared-6-fail"
run_dump_test "fdpic-shared-6"
run_dump_test "fdpic-static-7"
@@ -50,7 +52,6 @@ run_dump_test "fdpic-pie-7"
run_dump_test "fdpic-shared-7"
run_dump_test "fdpic-static-8"
-run_dump_test "fdpic-pie-8-fail"
run_dump_test "fdpic-pie-8"
run_dump_test "fdpic-shared-8-fail"
run_dump_test "fdpic-shared-8"
Index: ld/testsuite/ld-frv/fdpic6.ldv
===================================================================
RCS file: ld/testsuite/ld-frv/fdpic6.ldv
diff -N ld/testsuite/ld-frv/fdpic6.ldv
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ ld/testsuite/ld-frv/fdpic6.ldv 14 Feb 2004 03:56:32 -0000
@@ -0,0 +1 @@
+{ global: _start; F6; D6; WF*; local: *; };
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Happy GNU Year! oliva@{lsd.ic.unicamp.br, gnu.org}
Red Hat GCC Developer aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist Professional serial bug killer