[Bug ld/10629] New: GNU ld (GNU Binutils) 2.20.51.20090910 cores

2009-09-11 Thread george dot tovrea at baesystems dot com
System:

uname -m = IP35
uname -r = 6.5
uname -s = IRIX64
uname -v = 07010238
/usr/bin/uname -p = mips

>g++ --version
g++ (GCC) 4.3.0
>file /home/users/tovrea/local/sgi6/bin/g++
/home/users/tovrea/local/sgi6/bin/g++:  ELF N32 MSB mips-3 dynamic executable 
(not stripped) MIPS - version 1

>ld --version
GNU ld (GNU Binutils) 2.20.51.20090910
>file  /home/users/tovrea/local/sgi6/bin/ld
/home/users/tovrea/local/sgi6/bin/ld:   ELF N32 MSB mips-3 dynamic executable 
(not stripped) MIPS - version 1

Simple Sample:
simple.cc:

int main()
{ return 0;}

compile command:
g++ -c -o simple.o simple.cc

link command:
ld  -L/home/users/tovrea/local/sgi6/lib -o simple simple.o -lxerces-c

where
/home/users/tovrea/local/sgi6/lib/libxerces-c.so -> libxerces-c.so.28.0
and
file /home/users/tovrea/local/sgi6/lib/libxerces-c.so
/home/users/tovrea/local/sgi6/lib/libxerces-c.so:   ELF N32 MSB mips-3 
dynamic lib MIPS - version 1

Problem:
>ld  -L/home/users/tovrea/local/sgi6/lib -o simple simple.o -lxerces-c
ld: BFD (GNU Binutils) 2.20.51.20090910 assertion fail elfxx-mips.c:6965
Segmentation fault (core dumped)
dbx /home/users/tovrea/local/sgi6/bin/ld core
dbx version 7.3.5 (92898_Aug07 MR) Aug  7 2003 14:15:31
Core from signal SIGSEGV: Segmentation violation
(dbx) where
>  0 _bfd_generic_link_add_one_symbol(info = , abfd = , name 
= , flags = , section = , value = , string 
= , copy = , collect = , hashp = ) 
["/home/users/tovrea/BINUTILS/binutils-2.20.51/bfd/linker.c":1294, 0x100491e4]
   1 _bfd_mips_elf_create_dynamic_sections(abfd = , info = ) 
["/home/users/tovrea/BINUTILS/binutils-2.20.51/bfd/elfxx-mips.c":7101, 
0x10068914]
   2 _bfd_elf_link_create_dynamic_sections(abfd = , info = ) 
["/home/users/tovrea/BINUTILS/binutils-2.20.51/bfd/elflink.c":6975, 0x100889cc]
   3 elf_add_dt_needed_tag(abfd = , info = , soname = 
, do_it = ) ["/home/users/tovrea/BINUTILS/binutils-
2.20.51/bfd/elflink.c":7035, 0x10088b14]
   4 bfd_elf_link_add_symbols(abfd = , info = ) 
["/home/users/tovrea/BINUTILS/binutils-2.20.51/bfd/elflink.c":7656, 0x10092bf4]
   5 load_symbols(entry = , place = ) 
["/home/users/tovrea/BINUTILS/binutils-2.20.51/ld/ldlang.c":4315, 0x10019834]
   6 open_input_bfds(s = , force = ) 
["/home/users/tovrea/BINUTILS/binutils-2.20.51/ld/ldlang.c":4315, 0x1001a484]
   7 lang_process() ["/home/users/tovrea/BINUTILS/binutils-
2.20.51/ld/ldlang.c":4315, 0x1001bc80]
   8 main(argc = , argv = ) 
["/home/users/tovrea/BINUTILS/binutils-2.20.51/ld/./ldmain.c":895, 0x10020f44]
   9 __start() ["/xlv55/kudzu-
apr12/work/irix/lib/libc/libc_n32_M3/csu/crt1text.s":177, 0x10008d28]

-- 
   Summary: GNU ld (GNU Binutils) 2.20.51.20090910 cores
   Product: binutils
   Version: 2.21 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: ld
AssignedTo: unassigned at sources dot redhat dot com
ReportedBy: george dot tovrea at baesystems dot com
CC: bug-binutils at gnu dot org


http://sourceware.org/bugzilla/show_bug.cgi?id=10629

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/10630] New: Linker generates hidden local symbols

2009-09-11 Thread hjl dot tools at gmail dot com
h...@gnu-6 hidden-5]$ cat foo.c
void
__attribute__ ((visibility ("hidden")))
hidden ()
{
}

void (*foo) () = hidden;
[...@gnu-6 hidden-5]$ cat libfoo.map 
{
global:
 *;
local:
 hidden;
};
[...@gnu-6 hidden-5]$ make
gcc -B./ -O -g -fPIC -c foo.c
./ld -shared -o libfoo.so --version-script libfoo.map foo.o
readelf -s libfoo.so | grep hidden
18: 0218 2 FUNCLOCAL  HIDDEN5 hidden

There is no need to generate HIDDEN visibility for local symbols

-- 
   Summary: Linker generates hidden local symbols
   Product: binutils
   Version: 2.21 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: ld
AssignedTo: unassigned at sources dot redhat dot com
ReportedBy: hjl dot tools at gmail dot com
CC: bug-binutils at gnu dot org


http://sourceware.org/bugzilla/show_bug.cgi?id=10630

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/10630] Linker generates hidden local symbols

2009-09-11 Thread hjl dot tools at gmail dot com

--- Additional Comments From hjl dot tools at gmail dot com  2009-09-11 
19:57 ---
A patch is posted at

http://sourceware.org/ml/binutils/2009-09/msg00339.html

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=10630

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/10634] New: ld -r leaves gaps in output

2009-09-11 Thread davek at gcc dot gnu dot org
Reported at http://cygwin.com/ml/cygwin/2009-09/msg00264.html

Testcase:

$ cat segm.c
void text() { __asm__(".space 104"); }
char   data[256] = "DATA";
const char rdata[16] = "RDATA";


$ gcc -c segm.c


cygwin-1.5:
$ cygcheck -f /bin/ld
binutils-20080624-2


$ ld -r -o segm-r5.o segm.o


cygwin-1.7:
$ cygcheck -f /bin/ld
binutils-2.19.51-1


$ ld -r -o segm-r7.o segm.o


$ size segm.o segm-*.o
  textdata bss dec hex filename
   128 256   0 384 180 segm.o
   128 256   0 384 180 segm-r5.o
   512 384 4001296 510 segm-r7.o



$ objdump -s segm-r*.o

segm-r5.o: file format pe-i386

Contents of section .text:
 5589e500     U...
...
0060   005d c3909090  ...]
Contents of section .data:
0080 44415441     DATA
...
0170      
Contents of section .rdata:
0180 52444154 4100    RDATA...


segm-r7.o: file format pe-i386

Contents of section .text:
 5589e500     U...
...
0060   005d c3909090  ...]
Contents of section .data:
      
...
0080 44415441     DATA
...
0170      
Contents of section .rdata:
      
...
0180 52444154 4100    RDATA...

-- 
   Summary: ld -r leaves gaps in output
   Product: binutils
   Version: 2.21 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: binutils
AssignedTo: davek at gcc dot gnu dot org
ReportedBy: davek at gcc dot gnu dot org
CC: bug-binutils at gnu dot org
 GCC build triplet: i686-pc-cygwin
  GCC host triplet: i686-pc-cygwin
GCC target triplet: i686-pc-cygwin


http://sourceware.org/bugzilla/show_bug.cgi?id=10634

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/10634] ld -r leaves gaps in output

2009-09-11 Thread davek at gcc dot gnu dot org


-- 
   What|Removed |Added

 Status|NEW |ASSIGNED


http://sourceware.org/bugzilla/show_bug.cgi?id=10634

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/10634] ld -r leaves gaps in output

2009-09-11 Thread davek at gcc dot gnu dot org

--- Additional Comments From davek at gcc dot gnu dot org  2009-09-12 00:54 
---
Looking at the map files is also informative:

 with 20080624 binutils:

Memory Configuration

Name Origin Length Attributes
*default*0x 0x

Linker script and memory map

LOAD segm.o

.text   0x   0x70
 *(.text)
 .text  0x   0x70 segm.o
0xtext
 *(.glue_7t)
 *(.glue_7)

.data   0x0080  0x100
 *(.data)
 .data  0x0080  0x100 segm.o
0x0080data
 *(.data2)
 *(.jcr)

.rdata  0x0180   0x10
 *(.rdata)
 .rdata 0x0180   0x10 segm.o
0x0180rdata
 *(.rdata_runtime_pseudo_reloc)

.pdata
 *(.pdata)

.bss0x01900x0
 *(.bss)
 .bss   0x01900x0 segm.o
 *(COMMON)

 with current binutils:

Memory Configuration

Name Origin Length Attributes
*default*0x 0x

Linker script and memory map

LOAD segm.o

.text   0x   0x70
 *(.text)
 .text  0x   0x70 segm.o
0xtext
 *(.glue_7t)
 *(.glue_7)

.data   0x  0x180
 *(.data)
 .data  0x0080  0x100 segm.o
0x0080data
 *(.data2)
 *(.jcr)

.rdata  0x  0x190
 *(.rdata)
 .rdata 0x0180   0x10 segm.o
0x0180rdata
 *(.rdata_runtime_pseudo_reloc)

.eh_frame
 *(.eh_frame)

.pdata
 *(.pdata)

.bss0x  0x190
 *(.bss)
 .bss   0x01900x0 segm.o
 *(COMMON)

 

With current binutils it looks like the location counter is resetting to zero at
the start of each section and then padding to the address where the contents are
supposed to start.


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=10634

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/10634] ld -r leaves gaps in output / overlapping sections

2009-09-11 Thread davek at gcc dot gnu dot org


-- 
   What|Removed |Added

Summary|ld -r leaves gaps in output |ld -r leaves gaps in output
   ||/  overlapping sections


http://sourceware.org/bugzilla/show_bug.cgi?id=10634

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils