[Bug binutils/4716] New: --strip-unneeded strips too much with relocatable ELF objects from fpc/nasm

2007-06-30 Thread vapier at gentoo dot org
relocatable ELF objects generated by fpc (the free pascal compiler) dont seem to
play well with `strip --strip-unneeded` ... i'm wondering if this is a bug in
strip or in fpc (it not generating enough ELF information), but i think it's a
bug in strip ;)

for example, in the attached object produced by fpc, there is a global symbol
THREADVARLIST_SYSCALL which is culled after being processed with 
--strip-unneeded

similar behavior can be seen with yasm/nasm when generating objects without
DWARF debug code ... for example:
$ cat test.asm
GLOBAL _foo:function
_foo:
ret;
$ yasm -f elf test.asm -o test.o
$ readelf -s test.o | grep foo
 3:  0 FUNCGLOBAL DEFAULT4 _foo
$ strip --strip-unneeded test.o
$ readelf -s test.o | grep foo

$ yasm -g dwarf2 -f elf test.asm -o test.o
$ readelf -s test.o | grep foo
 7:  0 FUNCGLOBAL DEFAULT4 _foo
$ strip --strip-unneeded test.o
$ readelf -s test.o | grep foo
 2:  0 FUNCGLOBAL DEFAULT1 _foo

-- 
   Summary: --strip-unneeded strips too much with relocatable ELF
objects from fpc/nasm
   Product: binutils
   Version: 2.18 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: binutils
AssignedTo: unassigned at sources dot redhat dot com
ReportedBy: vapier at gentoo dot org
CC: bug-binutils at gnu dot org,toolchain at gentoo dot org
  GCC host triplet: i686-linux-gnu


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

--- 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/4716] --strip-unneeded strips too much with relocatable ELF objects from fpc/nasm

2007-06-30 Thread vapier at gentoo dot org

--- Additional Comments From vapier at gentoo dot org  2007-06-30 14:25 
---
Created an attachment (id=1906)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=1906&action=view)
syscall.o object from fpc


-- 


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

--- 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/4716] --strip-unneeded strips too much with relocatable ELF objects from fpc/nasm

2007-06-30 Thread vapier at gentoo dot org

--- Additional Comments From vapier at gentoo dot org  2007-06-30 14:33 
---
binutils 2.16.1, 2.17, 2.17.50.0.17, and current CVS HEAD all exhibit the same
behavior for me

-- 


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

--- 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/4712] BFD: section .data1/.bss can't be allocated in segment 0

2007-06-30 Thread amodra at bigpond dot net dot au

--- Additional Comments From amodra at bigpond dot net dot au  2007-07-01 
05:37 ---
I think http://sourceware.org/ml/binutils/2006-12/msg00165.html should also be
adjusting lma.

Index: bfd/elf.c
===
RCS file: /cvs/src/src/bfd/elf.c,v
retrieving revision 1.394
diff -u -p -r1.394 elf.c
--- bfd/elf.c   29 Jun 2007 16:29:15 -  1.394
+++ bfd/elf.c   1 Jul 2007 05:08:52 -
@@ -4373,7 +4373,7 @@ assign_file_positions_for_load_sections 
   else if (m->count == 0)
p->p_paddr = 0;
   else
-   p->p_paddr = m->sections[0]->lma;
+   p->p_paddr = m->sections[0]->lma - m->p_vaddr_offset;
 
   if (p->p_type == PT_LOAD
  && (abfd->flags & D_PAGED) != 0)

At least, doing so allows strip to process these funky files.

-- 


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

--- 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