Displaying 20 results from an estimated 38 matches for "outputsection".
2016 Oct 19
2
LLD: creating linker-generated sections as input sections instead of output sections
.../reviews.llvm.org/D25627.
>
>>
>>Problem:
>>
>>Currently, LLD creates special sections that are not just concatenations of
>> input sections but need link-time data generation, such as .got, .plt,
>> interp, .mips.options, >etc., as output sections. We have OutputSectionBase
>> subclasses (e.g. GotSection, PltSection, etc.) to create data. Even though
>> this scheme works in most cases, >there are a few situations that doesn't
>> work well as you may have noticed. Here are a issues.
>>
> >- You cannot mix special sections with...
2016 Oct 19
3
LLD: creating linker-generated sections as input sections instead of output sections
...existing InputSections.
>
> The disadvantage with extra flexibility is that it increases the
> amount of opportunities for both implementers and users to make
> mistakes, and it makes some implementation details more complicated.
> Where we would have been able to guarantee a single OutputSection, we
> may have many clumps of InputSections distributed across several
> OutputSections. In some cases it is user error to split InputSections
> apart as they need to be contiguous, which requites diagnostics, and
> in some cases algorithms need to be careful, for example in embedded
&g...
2016 Oct 18
3
RFC: LLD: creating linker-generated sections as input sections instead of output sections
This idea popped up in the review thread for https://reviews.llvm.org/D25627
.
Problem:
Currently, LLD creates special sections that are not just concatenations of
input sections but need link-time data generation, such as .got, .plt,
interp, .mips.options, etc., as output sections. We have OutputSectionBase
subclasses (e.g. GotSection, PltSection, etc.) to create data. Even though
this scheme works in most cases, there are a few situations that doesn't
work well as you may have noticed. Here are a issues.
- You cannot mix special sections with other types of sections.
For example, using l...
2017 Apr 05
4
[LLD] RFC Range Thunks Implementation review for ARM and Mips
...> > Proposed implementation for range extension thunks
> > At a high-level we need to solve the following problems:
> > - Assign addresses more than once
> > - Maintain state between successive calls of createThunks()
> > - Synchronization of the linker script and the OutputSection after
> adding thunks
>
> This last past seems to be the messier. The issue is not with the
> patch, is with the existing infrastructure that uses a completely
> different representation for linker scripts and non linker scripts.
>
> What I think is needed is for the writer to...
2017 Apr 04
2
[LLD] RFC Range Thunks Implementation review for ARM and Mips
...ge
Where are we now with LLD and thunks
- We have moved the createThunks() function as late as it can be in
finalizeSections(), most importantly after all the content has been
added to the image.
- We only call createThunks() once and we don't calculate addresses
before createThunks().
- If an OutputSection is described by a LinkerScript then any thunks
created in it are put at the end of the OutputSection. This is due to
the LinkerScript not being aware of the thunks (InputSections) in the
InputSectionDescriptions.
Proposed implementation for range extension thunks
At a high-level we need to solve t...
2017 Sep 18
1
Do I need to modify the AddrLoc of LLD for ARC target?
...re
some comments.
>From your arc mapfiles it looks like that in the output both linker's
have given the .text output section the correct base address given the
alignment restrictions as the alignment requirement of .text from
lib_a-memset-bs.o is 4, therefor the alignment requirement of the
OutputSection .text should be 4:
LLD:
Address Size Alignment
00000000 00000080 4 .text
00000000 00000004 1 basic-arc.o:(.text)
00000000 00000000 0 main
00000004 0000007c 4 ... (lib_a-memset-bs.o):(.text)
LD
.text 0x0000000000000000...
2020 Nov 18
1
LTO with Linker Scripts
On 2020-11-18, Teresa Johnson via llvm-dev wrote:
>AFAIK this effort stalled when Tobias changed jobs. Adding Sergei who may
>know the current status of the support within Qualcomm.
>
>Teresa
>
>On Wed, Nov 18, 2020 at 11:12 AM Mitra, Gaurav via llvm-dev <
>llvm-dev at lists.llvm.org> wrote:
>
>> Hello All,
>>
>>
>>
>> I’d like to pick up
2017 Sep 19
1
Do I need to modify the AddrLoc of LLD for ARC target?
...directive in the file, or pass -mthumb to the assembler
via arm-linux-gnu-gcc -Wa,-mthumb (I think).
I'm not able to explain what you are seeing in your print out as it
doesn't quite match the map file. Looking at your source diff I think
I may have found a bug:
uint64_t AddrLoc = getOutputSection()->Addr + Offset;
RelExpr Expr = Rel.Expr;
+ if ((Expr == R_PC || Expr == R_GOT_PC) &&
+ (Config->EMachine == EM_ARC_COMPACT ||
+ Config->EMachine == EM_ARC_COMPACT2)) {
+ uint64_t M = 0;
+ if (Type == R_ARC_32_PCREL || Type == R_ARC_PC32 ||
+...
2017 Sep 14
4
Do I need to modify the AddrLoc of LLD for ARC target?
...he storage
unit affected by the relocation."
For LLD we are calculating the virtual address (VA) of P, as I
understand it this is equivalent to the vma used in BFD. Assuming that
the relocation is relocating a regular InputSection from the
basic-arc.o object then the LLD calculation of P =
getOutputSection()->Addr + getOffset(Rel.Offset); translates to: (VA
of OutputSection) + (Offset of InputSection within OutputSection) +
(Offset within InputSection given by r_offset)
The BFD linker seems to be doing the equivalent calculation with an
extra modification of the (Offset within InputSection given...
2017 Mar 10
3
[ELF] [RFC] Padding between executable sections
Hi,
I was doing some experiments with LLD and noticed that it pads out
OutputSections with null bytes in all cases (as far as I could tell).
However, for executable sections on some targets, 0x00 forms part of an
executable instruction that is not nop. In particular, for x86_64 targets
at least, the sequence 0x00 0x00 is an add instruction. This can result in
confusing disassembly....
2017 Mar 01
2
[lld] We call SymbolBody::getVA redundantly a lot...
...olTable::addFile)
The frontend work seems to be largely dominated by ObjectFile::parse (as
you would expect), though there is about 10% of total runtime slipping
through the cracks here in various other "frontend" tasks.
The backend work is split about evenly between scanRelocations and
OutputSection::writeTo. InputSectionBase::relocate is only about 10% of the
total runtime (part of OutputSection::writeTo).
Some slightly cleaned up `perf report` output with some more details:
https://reviews.llvm.org/P7972
So it seems like overall, the profile is basically split 3 ways (about 30%
each):
- fr...
2017 Apr 06
2
[LLD] RFC Range Thunks Implementation review for ARM and Mips
...pt->processNonSectionCommands() // This should only be done once
Correct.
> In theory all the other __start and __end symbols could still be kept
> separate if the linker script commands were created late, and in a
> compatible way. I also don't think that this means removing
> OutputSections::Sections just yet either?
Probably not, but it might got away in the future.
> I don't think that we are proposing to follow the ld.bfd model of
> driving the default case via a built in linker script yet? I think
> that this would be considerably more work than just this limited
&...
2020 Mar 27
2
[lld] RFC: Allow custom sections to be under GNU_RELRO
..._RTTI_start = .);
> *(.data.rel.ro.RTTI.*) ; PROVIDE_HIDDEN (__RTTI_end = .);
> *(.data.rel.ro.local*
> .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro .data.rel.ro.*
> .gnu.linkonce.d.rel.ro.*) }
>
> This would have your table contiguous in the .data.rel.ro OutputSection
> and can be found with the __RTTI_start and __RTTI_end symbols. It may not
> work so well if you are using SHF_LINK_ORDER for the RTTI sections as some
> linkers tend to handle these better when every InputSection in the
> OutputSection has SHF_LINK_ORDER.
>
> Peter
>
>
>...
2017 Jul 31
3
[RFC] Profile guided section layout
Hi Rafael,
On 07/31/2017 04:20 PM, Rafael Avila de Espindola via llvm-dev wrote:
> However, do we need to start with instrumentation? The original paper
> uses sampling with good results and current intel cpus can record every
> branch in a program.
>
> I would propose starting with just an lld patch that reads the call
> graph from a file. The format would be very similar to
2020 Mar 26
2
[lld] RFC: Allow custom sections to be under GNU_RELRO
Hey,
We would like to propose an idea that would help security harden
applications that define custom sections.
Motivation and Background
In Chromium we have a garbage collector that implements some RTTI machinery
in the form of a table. This table is used by the collector to trace and
finalize garbage collected objects. We're thinking of using
__attribute__((section(...))) so that the table
2017 Mar 01
2
[lld] We call SymbolBody::getVA redundantly a lot...
...o be largely dominated by ObjectFile::parse (as
>> you would expect), though there is about 10% of total runtime slipping
>> through the cracks here in various other "frontend" tasks.
>>
>> The backend work is split about evenly between scanRelocations and
>> OutputSection::writeTo. InputSectionBase::relocate is only about 10% of the
>> total runtime (part of OutputSection::writeTo).
>>
>> Some slightly cleaned up `perf report` output with some more details:
>> https://reviews.llvm.org/P7972
>>
>> So it seems like overall, the prof...
2016 Jan 21
3
Need to refactor relocation handlers in ELF LLD
We have fairly large and complex code to handle relocations in Writer.cpp,
Target.cpp, OutputSections.cpp and InputSections.cpp. They started with
simple code, but because each patch added a small piece of code to the
existing one, it is becoming out of control now. For example, we have lots
of entangled boolean flags in the functions that interfere with each other
in an obscure fashion. Even I do...
2018 May 15
1
[RFC] (Thin)LTO with Linker Scripts
...d if the output section is
> different.
>
Correct. Plus, others can be enabled if they're safe to apply when we know
things are going to the same output section.
> The common use cases that I can see that might not fit perfectly into
> that model:
> - Code that is in different OutputSections but it will be logically
> correct and in many cases desirable to perform transformations on as
> if they were in the same output section.
Right. The output section that the linker communicates for a symbol doesn't
need to correspond to a "physical" output section. So let'...
2017 Jun 15
7
[RFC] Profile guided section layout
...StringSwitch.h"
#include "llvm/Support/FileOutputBuffer.h"
#include "llvm/Support/raw_ostream.h"
#include <climits>
+#include <unordered_set>
using namespace llvm;
using namespace llvm::ELF;
@@ -922,6 +924,157 @@ static void sortBySymbolsOrder(ArrayRef<OutputSection *> OutputSections) {
Sec->sort([&](InputSectionBase *S) { return SectionOrder.lookup(S); });
}
+// Sort sections by the profile data provided in the .note.llvm.callgraph
+// sections.
+//
+// This algorithm is based on Call-Chain Clustering from:
+// Optimizing Function Placemen...
2017 Jan 04
5
RFC: LLD range extension thunks
...he sizes and addresses of all the
SyntheticSections are known. This would mean that the final address of
each caller and callee could be used, and after thunk creation there
would be no further content changes. This would mean:
- All code that runs prior to thunk creation may have the offset in
the OutputSection altered by the addition of thunks. In particular
scanRelocs() calculates the offset in the OutputSection of some
relocations. We would need to find alternative ways of handling these
cases so that they could either survive thunk creation or be patched
up afterwards.
- assignAddresses() will need to...