PDP-11 bug fix

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

PDP-11 bug fix

Lars Brinkhoff
Hello,

I originally submitted the PDP-11 target in 2001.  I can't relly
remember, but possibly I guessed the target page size to be 256.
As https://sourceware.org/bugzilla/show_bug.cgi?id=20694 explains,
a better value would be 8192.  Here's a patch:

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 75099e9..178ee7b 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,7 @@
+2020-01-15  Lars Brinkhoff  <[hidden email]>
+
+ * pdp11.c (TARGET_PAGE_SIZE): Set to 8192.
+
 2020-01-14  Alan Modra  <[hidden email]>
 
  * som.c (som_bfd_count_ar_symbols): Error when file position
diff --git a/bfd/pdp11.c b/bfd/pdp11.c
index 7b9c67e..1ab3033 100644
--- a/bfd/pdp11.c
+++ b/bfd/pdp11.c
@@ -37,7 +37,7 @@
 #define ARCH_SIZE 16
 #undef TARGET_IS_BIG_ENDIAN_P
 
-#define TARGET_PAGE_SIZE 256
+#define TARGET_PAGE_SIZE 8192
 #define SEGMENT__SIZE TARGET_PAGE_SIZE
 
 #define DEFAULT_ARCH bfd_arch_pdp11
diff --git a/ld/ChangeLog b/ld/ChangeLog
index ee68a8c..eca87ce 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,7 @@
+2020-01-15  Lars Brinkhoff <[hidden email]>
+
+ * temulparams/pdp11.sh (TARGET_PAGE_SIZE): Set to 8192.
+
 2020-01-14  Lili Cui <[hidden email]>
 
  * testsuite/ld-i386/align-branch-1.d: Updated for i686-pc-elf.
diff --git a/ld/emulparams/pdp11.sh b/ld/emulparams/pdp11.sh
index aaf955a..9b6bbbb 100644
--- a/ld/emulparams/pdp11.sh
+++ b/ld/emulparams/pdp11.sh
@@ -1,5 +1,5 @@
 SCRIPT_NAME=aout
 OUTPUT_FORMAT="a.out-pdp11"
 TEXT_START_ADDR=0
-TARGET_PAGE_SIZE=256
+TARGET_PAGE_SIZE=8192
 ARCH=pdp11
Reply | Threaded
Open this post in threaded view
|

Re: PDP-11 bug fix

Nick Clifton
Hi Lars,

> + * pdp11.c (TARGET_PAGE_SIZE): Set to 8192.

> + * temulparams/pdp11.sh (TARGET_PAGE_SIZE): Set to 8192.

Approved and applied.

Cheers
  Nick


Reply | Threaded
Open this post in threaded view
|

Re: PDP-11 bug fix

Paul Koning-6
In reply to this post by Lars Brinkhoff


> On Jan 15, 2020, at 2:32 AM, Lars Brinkhoff <[hidden email]> wrote:
>
> Hello,
>
> I originally submitted the PDP-11 target in 2001.  I can't relly
> remember, but possibly I guessed the target page size to be 256.
> As https://sourceware.org/bugzilla/show_bug.cgi?id=20694 explains,
> a better value would be 8192.  Here's a patch:
> ...

256 is clearly not the best value, but the question is whether it should be 64 or 8192.  64 would make sense since that is the start address and length modulus.

        paul

Reply | Threaded
Open this post in threaded view
|

Re: PDP-11 bug fix

Lars Brinkhoff-2
Paul Koning writes:
>> https://sourceware.org/bugzilla/show_bug.cgi?id=20694
>
> 256 is clearly not the best value, but the question is whether it
> should be 64 or 8192.  64 would make sense since that is the start
> address and length modulus.

The Unix V6 linker aligns sections to 8192 boundaries; setting the
PDP-11 page size to this value makes GNU ld do the same thing.  See the
Bugzilla issue.