This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [RFC PATCH, binutils, ELF 9/11] Add support for creating import libraries
- From: Alan Modra <amodra at gmail dot com>
- To: Thomas Preudhomme <thomas dot preudhomme at foss dot arm dot com>
- Cc: Nick Clifton <nickc at redhat dot com>, "Richard Earnshaw (lists)" <Richard dot Earnshaw at arm dot com>, binutils at sourceware dot org
- Date: Mon, 18 Jul 2016 20:01:08 +0930
- Subject: Re: [RFC PATCH, binutils, ELF 9/11] Add support for creating import libraries
- Authentication-results: sourceware.org; auth=none
- References: <005201d13d58$0d5314a0$27f93de0$@foss.arm.com> <4238174.utMsidehWI@e108577-lin> <20160716133852.GN1256@bubble.grove.modra.org> <20406296.IDmVSFSBlq@e108577-lin>
On Mon, Jul 18, 2016 at 09:04:02AM +0100, Thomas Preudhomme wrote:
> Oh wow, I feel real bad now. I did test on x86 and ARM, I guess it wasn't
> enough. So the problem is .bss which I should replace by .section .bss. Now
> there is also the issue of the default linker script.
Yes, and some targets don't like -Tdata at the address you chose, so
you need at least the attached. There are other issues too.
- The testsuite needs modifying to exclude some targets. Not all ELF
targets use elflink.c:bfd_elf_final_link. There are some that instead
use _bfd_generic_final_link. (See elfxx-target.h)
- Missing bfd_set_error on "no symbol found for import library" error
path.
- mipstx39-elf segfault.
diff --git a/ld/testsuite/ld-elf/elf.exp b/ld/testsuite/ld-elf/elf.exp
index 832f313..7220813 100644
--- a/ld/testsuite/ld-elf/elf.exp
+++ b/ld/testsuite/ld-elf/elf.exp
@@ -145,7 +145,7 @@ run_ld_link_tests {
{{ld empty-implib.out}}
"implib"}
{"Generate import library"
- "-Tdata=0x1000 --out-implib=tmpdir/implib.lib" ""
+ "--out-implib=tmpdir/implib.lib" ""
""
{implib.s}
{{readelf {-s tmpdir/implib.lib} implib.rd}}
diff --git a/ld/testsuite/ld-elf/empty-implib.out b/ld/testsuite/ld-elf/empty-implib.out
index b123064..cc6a9f4 100644
--- a/ld/testsuite/ld-elf/empty-implib.out
+++ b/ld/testsuite/ld-elf/empty-implib.out
@@ -1,2 +1,3 @@
.*: .*: no symbol found for import library
.*: .*: failed to generate import library
+#...
diff --git a/ld/testsuite/ld-elf/implib.rd b/ld/testsuite/ld-elf/implib.rd
index 9f854a5..6835f39 100644
--- a/ld/testsuite/ld-elf/implib.rd
+++ b/ld/testsuite/ld-elf/implib.rd
@@ -1,10 +1,10 @@
-File: tmpdir/implib.lib
+File: tmpdir/implib\.lib
-Symbol table '.symtab' contains 3 entries:
- Num: Value +Size Type Bind Vis Ndx Name
- 0: [0-9a-f]+ 0 NOTYPE LOCAL DEFAULT UND
- 1: 0+100[0-3] 1 OBJECT GLOBAL DEFAULT ABS exported1
- 2: 0+100[0-3] 1 OBJECT GLOBAL DEFAULT ABS exported2
+Symbol table '\.symtab' contains 3 entries:
+ +Num: +Value +Size Type +Bind +Vis +Ndx Name
+ +0: [0-9a-f]+ +0 NOTYPE +LOCAL +DEFAULT +UND
+ +1: [0-9a-f]+ +1 OBJECT +GLOBAL DEFAULT +ABS exported1
+ +2: [0-9a-f]+ +1 OBJECT +GLOBAL DEFAULT +ABS exported2
File: tmpdir/implib
diff --git a/ld/testsuite/ld-elf/implib.s b/ld/testsuite/ld-elf/implib.s
index a86a940..e4d527b 100644
--- a/ld/testsuite/ld-elf/implib.s
+++ b/ld/testsuite/ld-elf/implib.s
@@ -1,5 +1,4 @@
.ifndef NO_GLOBAL
- .bss
.comm exported1,1
.data
@@ -10,7 +9,7 @@ exported2:
.byte 21
.endif
- .bss
+ .section ".bss", "aw", %nobits
not_exported1:
.space 1
.size not_exported1, 1
--
Alan Modra
Australia Development Lab, IBM