[lld] r250739 - [OutputSection] Set the symbolic bit in DT_FLAGS and not DT_FLAGS_1.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 19 17:42:52 PDT 2015


Can we stop using Flags variable for DT_FLAGS (not for DT_FLAGS_1)?

On Mon, Oct 19, 2015 at 5:39 PM, Davide Italiano <davide at freebsd.org> wrote:

> On Mon, Oct 19, 2015 at 4:38 PM, Rui Ueyama <ruiu at google.com> wrote:
> > On Mon, Oct 19, 2015 at 2:34 PM, Davide Italiano via llvm-commits
> > <llvm-commits at lists.llvm.org> wrote:
> >>
> >> Author: davide
> >> Date: Mon Oct 19 16:34:00 2015
> >> New Revision: 250739
> >>
> >> URL: http://llvm.org/viewvc/llvm-project?rev=250739&view=rev
> >> Log:
> >> [OutputSection] Set the symbolic bit in DT_FLAGS and not DT_FLAGS_1.
> >>
> >> The two names are similar enough that they might lead to confusion.
> >> The output of readobj clarifies but I missed it when I originally
> >> committed this. Found while linking FreeBSD userland with lld.
> >>
> >> Modified:
> >>     lld/trunk/ELF/OutputSections.cpp
> >>     lld/trunk/test/elf2/dt_flags.s
> >>
> >> Modified: lld/trunk/ELF/OutputSections.cpp
> >> URL:
> >>
> http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.cpp?rev=250739&r1=250738&r2=250739&view=diff
> >>
> >>
> ==============================================================================
> >> --- lld/trunk/ELF/OutputSections.cpp (original)
> >> +++ lld/trunk/ELF/OutputSections.cpp Mon Oct 19 16:34:00 2015
> >> @@ -369,6 +369,9 @@ template <class ELFT> void DynamicSectio
> >>    uint32_t Flags = 0;
> >>    if (Config->Bsymbolic)
> >>      Flags |= DF_SYMBOLIC;
> >> +  if (Flags)
> >> +    WriteVal(DT_FLAGS, Flags);
> >> +  Flags = 0;
> >>    if (Config->ZNow)
> >>      Flags |= DF_1_NOW;
> >
> >
> > This code is now equivalent to:
> >
> >   if (Config->Bsymbolic)
> >     WriteVal(DT_FLAGS, DF_SYMBOLIC);
> >   if (Config->ZNow)
> >     WriteVal(DT_FLAGS_1, DF_1_NOW);
> >
>
> You're right. In fact, I was kinda tempted to make this change but
> immediately after I realized that my next changes (r250771) were
> going to switch back to the older form. So I went for that path.
>
>
> --
> Davide
>
> "There are no solved problems; there are only problems that are more
> or less solved" -- Henri Poincare
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151019/be02c02a/attachment.html>


More information about the llvm-commits mailing list