[lld] r293674 - Port r293519 and r293529.

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 1 13:41:23 PST 2017


It looks like the change that we are missing on the branch is r292161. If I
patch that change into the branch the basic-mips.s test passes but a number
of other tests fail. Probably the right thing to do at this point is to
update the test expectation, as the change does not appear to affect the
correctness of the output.

>From the commit message, r292161 does itself look like a bug fix, so we may
want it on the branch anyway, but it isn't clear how important/feasible it
is. Simon, any thoughts?

Peter

On Wed, Feb 1, 2017 at 9:44 AM, Hans Wennborg <hans at chromium.org> wrote:

> I think this might have broken the tests:
>
>
> FAIL: lld :: ELF/basic-mips.s (192 of 1016)
> ******************** TEST 'lld :: ELF/basic-mips.s' FAILED
> ********************
> Script:
> --
> /work/llvm-4.0/build.release/./bin/llvm-mc -filetype=obj
> -triple=mipsel-unknown-linux
> /usr/local/google/work/llvm-4.0/lld.src/test/ELF/basic-mips.s -o
> /usr/local/google/work/llvm-4.0/build.release/tools/lld/test
> /ELF/Output/basic-mips.s.tmp.o
> /work/llvm-4.0/build.release/./bin/ld.lld --full-shutdown
> /usr/local/google/work/llvm-4.0/build.release/tools/lld/test
> /ELF/Output/basic-mips.s.tmp.o
> -o /usr/local/google/work/llvm-4.0/build.release/tools/lld/test
> /ELF/Output/basic-mips.s.tmp.exe
> /work/llvm-4.0/build.release/./bin/llvm-readobj -file-headers
> -sections -program-headers -symbols
> /usr/local/google/work/llvm-4.0/build.release/tools/lld/test
> /ELF/Output/basic-mips.s.tmp.exe
>    | /work/llvm-4.0/build.release/./bin/FileCheck
> /usr/local/google/work/llvm-4.0/lld.src/test/ELF/basic-mips.s
> --
> Exit Code: 1
>
> Command Output (stderr):
> --
> /usr/local/google/work/llvm-4.0/lld.src/test/ELF/basic-mips.s:300:15:
> error: expected string not found in input
> # CHECK-NEXT: MemSize: 65536
>               ^
> <stdin>:292:2: note: scanning from here
>  MemSize: 4096
>  ^
>
>
> I suppose the test just needs to be updated, but I can't see where
> this happened on trunk.
>
> Should we just update the test, or is there some fix that needs to be
> merged?
>
> Thanks,
> Hans
>
>
>
> On Tue, Jan 31, 2017 at 10:38 AM, Peter Collingbourne via llvm-commits
> <llvm-commits at lists.llvm.org> wrote:
> > Author: pcc
> > Date: Tue Jan 31 12:38:56 2017
> > New Revision: 293674
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=293674&view=rev
> > Log:
> > Port r293519 and r293529.
> >
> > r293519:
> >     ELF: Align RELRO to the target page size rather than the max page
> size.
> >
> >     If no bss sections appear after the relro segment, the loader will
> round
> >     the r/w segment size to the target's page size. Align the relro size
> in the
> >     same way to ensure that it does not extend past the end of the
> program's
> >     own memory region.
> >
> >     Differential Revision: https://reviews.llvm.org/D29242
> >
> > r293529:
> >     Add missing aarch64 requirement.
> >
> > Added:
> >     lld/branches/release_40/test/ELF/aarch64-relro.s
> > Modified:
> >     lld/branches/release_40/ELF/Writer.cpp
> >
> > Modified: lld/branches/release_40/ELF/Writer.cpp
> > URL: http://llvm.org/viewvc/llvm-project/lld/branches/release_40/
> ELF/Writer.cpp?rev=293674&r1=293673&r2=293674&view=diff
> > ============================================================
> ==================
> > --- lld/branches/release_40/ELF/Writer.cpp (original)
> > +++ lld/branches/release_40/ELF/Writer.cpp Tue Jan 31 12:38:56 2017
> > @@ -1462,7 +1462,7 @@ template <class ELFT> void Writer<ELFT>:
> >        // The glibc dynamic loader rounds the size down, so we need to
> round up
> >        // to protect the last page. This is a no-op on FreeBSD which
> always
> >        // rounds up.
> > -      P.p_memsz = alignTo(P.p_memsz, Config->MaxPageSize);
> > +      P.p_memsz = alignTo(P.p_memsz, Target->PageSize);
> >      }
> >
> >      // The TLS pointer goes after PT_TLS. At least glibc will align it,
> >
> > Added: lld/branches/release_40/test/ELF/aarch64-relro.s
> > URL: http://llvm.org/viewvc/llvm-project/lld/branches/release_40/
> test/ELF/aarch64-relro.s?rev=293674&view=auto
> > ============================================================
> ==================
> > --- lld/branches/release_40/test/ELF/aarch64-relro.s (added)
> > +++ lld/branches/release_40/test/ELF/aarch64-relro.s Tue Jan 31
> 12:38:56 2017
> > @@ -0,0 +1,14 @@
> > +# REQUIRES: aarch64
> > +# RUN: llvm-mc -filetype=obj -triple=aarch64-unknown-freebsd %s -o %t
> > +# RUN: ld.lld %t -o %t2
> > +# RUN: llvm-readobj -program-headers %t2 | FileCheck %s
> > +
> > +# CHECK:      Type: PT_GNU_RELRO
> > +# CHECK-NEXT: Offset:
> > +# CHECK-NEXT: VirtualAddress:
> > +# CHECK-NEXT: PhysicalAddress:
> > +# CHECK-NEXT: FileSize:
> > +# CHECK-NEXT: MemSize: 4096
> > +
> > +.section .data.rel.ro,"aw",%progbits
> > +.byte 1
> >
> >
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>



-- 
-- 
Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170201/48fce68f/attachment.html>


More information about the llvm-commits mailing list