[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/12291] "ld -r" doesn't work with mixed IR/non-IR objects
From: |
hjl.tools at gmail dot com |
Subject: |
[Bug ld/12291] "ld -r" doesn't work with mixed IR/non-IR objects |
Date: |
Tue, 13 Oct 2020 14:07:15 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=12291
--- Comment #6 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to H.J. Lu from comment #2)
> The proposal is at
>
> http://www.kernel.org/pub/linux/devel/gcc/lto/mixed-IR/mixed-IR.pdf
Here is the proposal:
Link with mixed IR/non-IR objects
* 2 kinds of object files
o non-IR object file has
* non-IR sections
o IR object file has
* IR sections
* non-IR sections
* The output of "ld -r" with mixed IR/non-IR objects should work with:
o Compilers/linkers with IR support.
o Compilers/linkers without IR support.
* Add the mixed object file which has
o IR sections
o non-IR sections:
* Object codes from IR sections.
* Object codes from non-IR object files.
o Object-only section:
* With section name ".gnu_object_only" and SHT_GNU_OBJECT_ONLY type
on ELF:
#define SHT_GNU_OBJECT_ONLY 0x6ffffff8 /* Object only */
* Contain non-IR object file.
* Input is discarded after link.
* Linker action:
o Classify each input object file:
* If there is a ".gnu_object_only" section, it is a mixed object file.
* If there is a IR section, it is an IR object file.
* Otherwise, it is a non-IR object file.
o Relocatable non-IR link:
* Prepare for an object-only output.
* Prepare for a regular output.
* For each mixed object file:
* Add IR and non-IR sections to the regular output.
* For object-only section:
* Extract object only file.
* Add it to the object-only output.
* Discard object-only section.
* For each IR object file:
* Add IR and non-IR sections to the regular output.
* For each non-IR object file:
* Add non-IR sections to the regular output.
* Add non-IR sections to the object-only output.
* Final output:
* If there are IR objects, non-IR objects and the object-only
output isn't empty:
* Put the object-only output into the object-only section.
* Add the object-only section to the regular output.
* Remove the object-only output.
o Normal link and relocatable IR link:
* Prepare for output.
* IR link:
* For each mixed object file:
* Compile and add IR sections to the output.
* Discard non-IR sections.
* Object-only section:
* Extract object only file.
* Add it to the output.
* Discard object-only section.
* For each IR object file:
* Compile and add IR sections to the output.
* Discard non-IR sections.
* For each non-IR object file:
* Add non-IR sections to the output.
* Non-IR link:
* For each mixed object file:
* Add non-IR sections to the output.
* Discard IR sections and object-only section.
* For each IR object file:
* Add non-IR sections to the output.
* Discard IR sections.
* For each non-IR object file:
* Add non-IR sections to the output.
>
> It is implemented on hjl/lto-mixed branch at
>
> http://git.kernel.org/?p=devel/binutils/hjl/x86.git;a=summary
It has been moved at:
https://gitlab.com/x86-binutils/binutils-gdb/-/tree/users/hjl/lto-mixed/master
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug ld/12291] "ld -r" doesn't work with mixed IR/non-IR objects,
hjl.tools at gmail dot com <=