This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[BFD PATCH] Re: File truncation in objcopy for hppa2.0w-hp-hpux11.11 in binutils-2.13.1
- From: sdowning at fame dot com (Stuart F. Downing)
- To: binutils at sources dot redhat dot com
- Date: 21 May 2003 15:59:25 -0400
- Subject: [BFD PATCH] Re: File truncation in objcopy for hppa2.0w-hp-hpux11.11 in binutils-2.13.1
- References: <200305211805.h4LI5go2016930@hiauly1.hia.nrc.ca>
"John David Anglin" <dave@hiauly1.hia.nrc.ca> writes:
> > /* And these first appeared in hpux10. */
> > #ifndef R_SHORT_PCREL_MODE
> > #define NO_PCREL_MODES
> > #define R_SHORT_PCREL_MODE 0x3e
> > #endif
> >
> > #ifndef R_LONG_PCREL_MODE
> > #define R_LONG_PCREL_MODE 0x3f
> > #endif
>
> Ooops, we don't need to define these twice. Just define define
> PA_2_0 in som.h before the a.out.h include, and see if that fixes your
> problem.
Well, putting -DPA_2_0 in configure.host "fixed" my problem. Now the
question is what is right for bfd.
> The NO_PCREL_MODES define is a hack.
Yowsa.
> The generation of these two relocs should depend on code level. At
> the moment, it's not entirely clear whether HP ld on a PA 1.X
> machine will link PA 2.0 code. However, it's possible that it was
> built with PA_2_0 defined and will support the relocs.
So if I leave the hack in, but define PA_2_0 before a.out.h, then when
built on a 1.X host, if reloc.h doesn't contain the PA_2_0 conditional
code, then we won't generate these relocs.
I think that makes sense.
Patch enclosed. Built and tested successfully on my problem case.
--
Stuart Downing
Index: src/bfd/ChangeLog
===================================================================
RCS file: /cvs/src/src/bfd/ChangeLog,v
retrieving revision 1.1598.2.41
diff -u -r1.1598.2.41 ChangeLog
--- src/bfd/ChangeLog 7 Nov 2002 22:30:54 -0000 1.1598.2.41
+++ src/bfd/ChangeLog 21 May 2003 19:48:23 -0000
@@ -1,3 +1,7 @@
+2003-05-21 Stuart F. Downing <sdowning@fame.com>
+
+ * som.h: Define PA_2_0 before including a.out.h
+
2002-11-07 Daniel Jacobowitz <drow@mvista.com>
* configure.in: Bump version and set is_release.
Index: src/bfd/som.h
===================================================================
RCS file: /cvs/src/src/bfd/som.h,v
retrieving revision 1.5
diff -u -r1.5 som.h
--- src/bfd/som.h 10 Oct 2001 12:08:29 -0000 1.5
+++ src/bfd/som.h 21 May 2003 19:48:23 -0000
@@ -27,6 +27,9 @@
#include "libhppa.h"
+/* Enable PA2.0 if available */
+#define PA_2_0
+
#include <a.out.h>
#include <lst.h>
#include <ar.h>