[Bug gold/20114] Partial relro support for s390x gold

2018-10-23 Thread maamountk at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=20114

maamountki  changed:

   What|Removed |Added

 CC||maamountk at hotmail dot com

--- Comment #1 from maamountki  ---
Created attachment 11362
  --> https://sourceware.org/bugzilla/attachment.cgi?id=11362&action=edit
Built upon 2.31.1

Add full and partial relro support for s390x gold. Tested by the available
testsuite and some simple tests, Wider testing is still required in your side
before merging, Hope that wouldn't take much time because my instance in IBM
LinuxONE have a few days left. Thanks in advance.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/20113] Partial relro support for s390x ld

2018-10-23 Thread maamountk at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=20113

maamountki  changed:

   What|Removed |Added

 CC||maamountk at hotmail dot com

--- Comment #1 from maamountki  ---
Created attachment 11363
  --> https://sourceware.org/bugzilla/attachment.cgi?id=11363&action=edit
Built upon 2.31.1

Add full and partial relro support for s390x ld. Tested by the available
testsuite and some simple tests, Wider testing is still required in your side
before merging.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/20113] Partial relro support for s390x ld

2018-11-06 Thread maamountk at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=20113

--- Comment #3 from maamountki  ---
(In reply to Nick Clifton from comment #2)
> Also - do you have an FSF copyright assignment for the Binutils project ?

No, Actually these changes weren't meant to be merged directly into binutils
project but to be sent to IBM team in response to bounty they offered. If
that's inappropriate, You can discard this patch, Sad to see this issue
re-patched, tho. Otherwise, Let me know so I can provide set of context diffs.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/20113] Partial relro support for s390x ld

2018-11-10 Thread maamountk at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=20113

--- Comment #6 from maamountki  ---
Hi Nick,
Sorry for the delay but so far I haven't received any response from
ass...@gnu.org so It's likely to be delayed even further, Sorry again and
thanks for your patience.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/20113] Partial relro support for s390x ld

2018-12-07 Thread maamountk at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=20113

maamountki  changed:

   What|Removed |Added

  Attachment #11363|0   |1
is obsolete||

--- Comment #7 from maamountki  ---
Created attachment 11438
  --> https://sourceware.org/bugzilla/attachment.cgi?id=11438&action=edit
partial relro support for ld

The assignment is in place by now, I attached the context diffs patch.
Info about the the patch:
According to document here
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=bfd/elf32-s390.c;h=56008a13eb2aaf17927e6706126d0351f239b335;hb=0860693812fff944ab0602e72b762a4a2078da5b#l467
the first 3 words of GOT (.got.plt if exist or .got otherwise) are reserved we
can safely put them in the relro area in the partial relro case so the size of
these entries can be set to the SEPARATE_GOTPLT argument.
Since the linker default relro option is partial, most of the ld s390 tests
will fail, this patch fixed them too.
note: I just notice the full relro option of ld is working properly so this
patch actually just add partial one, Sorry for claiming that first.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gold/20114] Partial relro support for s390x gold

2018-12-07 Thread maamountk at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=20114

maamountki  changed:

   What|Removed |Added

  Attachment #11362|0   |1
is obsolete||

--- Comment #2 from maamountki  ---
Created attachment 11439
  --> https://sourceware.org/bugzilla/attachment.cgi?id=11439&action=edit
gold partial relro support for gold

Full relro support is working properly so this patch actually just add partial
one.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/20113] Partial relro support for s390x ld

2019-01-02 Thread maamountk at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=20113

--- Comment #9 from maamountki  ---
Hi Nick,
Well, It's correct but there one thing we should care about is the relocations,
Testsuite doesn't cover all the relocations types I tested a few more but not
all of them because I see the relocations are bounded properly to .got and
.got.plt sections in bfd while the linker script take care of positioning these
sections so I think it's ok btw this is not the case for gold which require me
to do a little work on relocations since the sections are positioned manually
there.

While toolchain configured as: --target=s390x-ibm-tpf I got the same testsuite 
failures without the patch applied.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/20113] Partial relro support for s390x ld

2019-03-02 Thread maamountk at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=20113

--- Comment #17 from maamountki  ---
sorry for late response.
I don't see any reason to revert the path, the three entries that my path
extend the relro segment across are documented here
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=bfd/elf32-s390.c;h=56008a13eb2aaf17927e6706126d0351f239b335;hb=0860693812fff944ab0602e72b762a4a2078da5b#l467
It's safe to do that and most platforms have done something similar to this.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/20113] Partial relro support for s390x ld

2019-03-03 Thread maamountk at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=20113

--- Comment #18 from maamountki  ---
*patch

I just noticed that SEPARATE_GOTPLT is duplicated in the 64 bit script and
partial relro support is already implemented so yes my patch should be
reverted, I'm contacting Bountysource to revert the claim submission too.
Anyway I'm not sure why you think that SEPARATE_GOTPLT must remain as 0 hence
the relro segment doesn't extend across those entries, SEPARATE_GOTPLT have
this argument for the exact reason and architectures such as x86 and aarch64
take advantage of this feature and there is a reason actually there are no harm
in making those entries non-exploitable.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gold/20114] Partial relro support for s390x gold

2019-03-21 Thread maamountk at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=20114

--- Comment #3 from maamountki  ---
This patch does not follow IBM Z scheme, I'm adjusting the patch to be
compatible with IBM Z scheme.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gold/20114] Partial relro support for s390x gold

2019-03-26 Thread maamountk at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=20114

maamountki  changed:

   What|Removed |Added

  Attachment #11439|0   |1
is obsolete||

--- Comment #4 from maamountki  ---
Created attachment 11705
  --> https://sourceware.org/bugzilla/attachment.cgi?id=11705&action=edit
Partial relro support for gold

Now it is, As Andreas Krebbel did with ld, This patch separate .got and
.got.plt sections, swap them and assign the 3 magic GOT entries at the
beginning of .got section so _GLOBAL_OFFSET_TABLE_ will point to the beginning
of all GOT entries.

Same as ld after relro support the GOT layout in gold now look like this with
this patch:

  +--+
  |got[0]: DYNAMIC   |   <--- _GLOBAL_OFFSET_TABLE_ ==
DT_PLTGOT .got
  |got[1]: link_map parm |
  |got[2]: &_dl_runtime_resolve  |
  +--+
  |  |   non-plt GOT entries
  |  |
  |  |
  +--+
  |  |   <--- .gotplt, PLT GOT entries
  |  |
  |  |
  |  |
  +--+

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gold/20114] Partial relro support for s390x gold

2019-04-29 Thread maamountk at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=20114

--- Comment #6 from maamountki  ---
(In reply to Andreas Krebbel from comment #5)
> One difference to the ld implementation is that you appear to always use the
> new got layout. ld uses the new layout only for partial relro to keep impact
> on existing stuff as small as possible.

Unfortunately gold does not provide the flexibility that ld offer, You can see
the same behavior on the other platforms.

> Have you checked that all this works with linker scripts as well. I mean
> linker scripts which have got and got.plt swapped? Will gold do the right
> thing for these variants with regard to the 3 magic entries,
> _GLOBAL_OFFSET_TABLE_, and DT_PLTGOT?

Yes I do and it does not.
.got and .got.plt must be set properly in linker srcript to get it work
otherwise a segmentation fault will be produced. I can see the same behavior on
different platform "x86_64".

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gold/20114] Partial relro support for s390x gold

2019-04-29 Thread maamountk at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=20114

--- Comment #7 from maamountki  ---
Thinking of replacing the new layout with this one

  +--+
  |.got[0]: DYNAMIC  |   <--- _GLOBAL_OFFSET_TABLE_ .got
  +--+
  |  |   <--- non-plt GOT entries
  |  |
  |  |
  +--+
  |.got.plt[0]: link_map parm|   <--- DT_PLTGOT .gotplt
  |.got.plt[1]: &_dl_runtime_resolve |
  |  |
  |  |
  +--+
  |  |   <--- PLT GOT entries
  |  |
  |  |
  |  |
  +--+

However ld and gold layouts will not be on the same track and the code will not
be as simple as the current patch, What do you think?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gold/20114] Partial relro support for s390x gold

2019-04-30 Thread maamountk at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=20114

--- Comment #10 from maamountki  ---
(In reply to Andreas Krebbel from comment #8)

> For S/390 it would mean that non of the existing linker scripts
> would continue to work with Gold after that change.

For S/390 gold does not have .got.plt at all, putting this section in linker
script make no sense and will be ignored.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gold/20114] Partial relro support for s390x gold

2019-04-30 Thread maamountk at hotmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=20114

--- Comment #12 from maamountki  ---
(In reply to Andreas Krebbel from comment #11)
> Ok. Having a linker script with just a .got continues to work with your
> patch?

Yes. My LinuxONE Community Cloud VM has been expired I can not pull the linker
script that I used, But as I remember It look like this

SECTIONS
{
  . = 0x4;
  .reginfo : { *(.reginfo) }
  .dynamic : { *(.dynamic) }
  .hash : { *(.hash) }
  .dynsym : { *(.dynsym) }
  .dynstr : { *(.dynstr) }
  .rel.dyn : { *(.rel.dyn) }

  . = 0x5;
  .text : { *(.text) }

  . = 0x6;
  .data : { *(.data) }
  HIDDEN (_gp = ALIGN (16) + 0x7ff0);
  .got : { *(.got) }
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils