This is the mail archive of the
mailing list for the binutils project.
Re: R_X86_64_COPY bug
- From: Alan Modra <amodra at gmail dot com>
- To: Fredrick Prashanth John Berchmans <fredrickprashanth at gmail dot com>
- Cc: binutils at sourceware dot org, hjl dot tools at gmail dot com, sbsiddha at gmail dot com, nasuku at yahoo dot com
- Date: Sat, 6 Apr 2013 17:43:05 +1030
- Subject: Re: R_X86_64_COPY bug
- References: <CACwgvgW5SNsXL2vND_qhgqO7RRsHwKyk+N-q5sTakeC9vwV0BA at mail dot gmail dot com>
On Fri, Apr 05, 2013 at 09:29:09PM -0700, Fredrick Prashanth John Berchmans wrote:
> Dear binutils developers,
> We are seeing a issue with copy relocation semantics in ld.
> A struct with zero length array is defined in a shared library.
> Because of copy relocation semantics, any binary linking with that
> library sees those elements as zero initialized.
> We saw this bug also on ARM with R_ARM_COPY.
This is not a bug in gas or ld. gcc is sizing the struct incorrectly.
.type test_dynamic, @object
.size test_dynamic, 4 # <===========
Australia Development Lab, IBM