Bug 1487

Summary: ELF input section may not be handled properly
Product: binutils Reporter: H.J. Lu <hjl.tools>
Component: ldAssignee: unassigned
Status: RESOLVED FIXED    
Severity: normal CC: bug-binutils, danglin
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:
Bug Depends on:    
Bug Blocks: 2464    
Attachments: A testcase

Description H.J. Lu 2005-10-16 17:34:05 UTC
If there is an ELF input section which isn't one of those special ELF section,
the output section attribute may be set incorrectly.
Comment 1 H.J. Lu 2005-10-16 17:37:03 UTC
Created attachment 714 [details]
A testcase

I got

bash-3.00$ make LD=ld
as   -o foo.o foo.s
ld -shared -o foo.so foo.o
readelf -S foo.so | grep note | awk '{print $3, $4;}' > so.out
readelf -S foo.o | grep note | awk '{print $3, $4;}' > o.out
diff -up so.out  o.out
--- so.out	2005-10-16 10:36:50.000000000 -0700
+++ o.out	2005-10-16 10:36:50.000000000 -0700
@@ -1 +1 @@
-note PROGBITS
+note NOTE
make: *** [all] Error 1
Comment 2 H.J. Lu 2005-10-21 14:42:14 UTC
*** Bug 1508 has been marked as a duplicate of this bug. ***
Comment 3 H.J. Lu 2005-10-21 14:44:40 UTC
A patch is posted at

http://sourceware.org/ml/binutils/2005-10/msg00284.html
Comment 4 dave@hiauly1.hia.nrc.ca 2005-10-22 02:43:03 UTC
Subject: Re:  ELF input section may not be handled properly

> A patch is posted at
> 
> http://sourceware.org/ml/binutils/2005-10/msg00284.html

I hit this error:

gcc -DHAVE_CONFIG_H -I. -I../../src/bfd -I. -I. -I../../src/bfd -I../../src/bfd/
../include -I../../src/bfd/../intl -I../intl -W -Wall -Wstrict-prototypes -Wmiss
ing-prototypes -Werror -g -O1 -c ../../src/bfd/libbfd.c -o libbfd.o
cc1: warnings being treated as errors
../../src/bfd/libbfd.c:1052: warning: no previous prototype for '_bfd_generic_in
it_private_section_data'

Dave
Comment 5 H.J. Lu 2005-10-22 21:06:51 UTC
You need to run "make headers" in bfd to update header files.
Comment 6 dave@hiauly1.hia.nrc.ca 2005-10-22 21:30:13 UTC
Subject: Re:  ELF input section may not be handled properly

> You need to run "make headers" in bfd to update header files.

Ok, but the patch doesn't apply anymore.

Dave
Comment 7 dave@hiauly1.hia.nrc.ca 2005-10-23 03:01:57 UTC
Subject: Re:  ELF input section may not be handled properly

> > You need to run "make headers" in bfd to update header files.
> 
> Ok, but the patch doesn't apply anymore.

Sorry, html garbage in the patch.  The patch fixes binutils/1507
and ld/1508.  Probably, it will fix ld/1509.

Dave
Comment 8 H.J. Lu 2005-10-23 15:15:28 UTC
*** Bug 1507 has been marked as a duplicate of this bug. ***
Comment 9 H.J. Lu 2005-10-23 17:22:36 UTC
*** Bug 1509 has been marked as a duplicate of this bug. ***
Comment 10 H.J. Lu 2005-10-27 16:32:08 UTC
Fixed.