Re: DW_TAG_compile_unit's references to .debug_line and .loc directive extension

2024-07-19 Thread Fangrui Song
On Thu, Jul 4, 2024 at 12:42 PM Fangrui Song wrote: > > I have noticed that Meta Platforms folks have a proposal to extend the > .loc directive > https://discourse.llvm.org/t/rfc-extending-llvm-mc-loc-directive-with-labeling-support/79608 > . > I filed https://sourc

DW_TAG_compile_unit's references to .debug_line and .loc directive extension

2024-07-04 Thread Fangrui Song
I have noticed that Meta Platforms folks have a proposal to extend the .loc directive https://discourse.llvm.org/t/rfc-extending-llvm-mc-loc-directive-with-labeling-support/79608 . I filed https://sourceware.org/bugzilla/show_bug.cgi?id=31955 ("gas: Extend .loc directive to emit a label") and am

Re: Updated Sourceware infrastructure plans

2024-05-02 Thread Fangrui Song
On Thu, May 2, 2024 at 8:35 AM Pedro Alves wrote: > > On 2024-05-01 22:04, Simon Marchi wrote: > > The Change-Id trailer works very well for Gerrit: once you have the hook > > installed you basically never have to think about it again, and Gerrit > > is able to track patch versions perfectly accur

Re: CREL relocation format for ELF

2024-03-29 Thread Fangrui Song via Gcc
On Thu, Mar 28, 2024 at 2:23 AM Jan Beulich wrote: > > On 28.03.2024 08:43, Fangrui Song wrote: > > On Fri, Mar 22, 2024 at 6:51 PM Fangrui Song wrote: > >> > >> On Thu, Mar 14, 2024 at 5:16 PM Fangrui Song wrote: > >>> > >>> The relocat

Re: CREL relocation format for ELF (was: RELLEB)

2024-03-28 Thread Fangrui Song via Gcc
On Thu, Mar 28, 2024 at 6:04 AM Alan Modra wrote: > > On Fri, Mar 22, 2024 at 06:51:41PM -0700, Fangrui Song wrote: > > On Thu, Mar 14, 2024 at 5:16 PM Fangrui Song wrote: > > > I propose RELLEB, a new format offering significant file size > > > reductions: 17.2%

Re: CREL relocation format for ELF (was: RELLEB)

2024-03-28 Thread Fangrui Song via Gcc
On Fri, Mar 22, 2024 at 6:51 PM Fangrui Song wrote: > > On Thu, Mar 14, 2024 at 5:16 PM Fangrui Song wrote: > > > > The relocation formats REL and RELA for ELF are inefficient. In a > > release build of Clang for x86-64, .rela.* sections consume a > > significant po

CREL relocation format for ELF (was: RELLEB)

2024-03-22 Thread Fangrui Song via Gcc
On Thu, Mar 14, 2024 at 5:16 PM Fangrui Song wrote: > > The relocation formats REL and RELA for ELF are inefficient. In a > release build of Clang for x86-64, .rela.* sections consume a > significant portion (approximately 20.9%) of the file size. > > I propose RELLEB, a n

RELLEB relocation format for ELF

2024-03-14 Thread Fangrui Song via Gcc
The relocation formats REL and RELA for ELF are inefficient. In a release build of Clang for x86-64, .rela.* sections consume a significant portion (approximately 20.9%) of the file size. I propose RELLEB, a new format offering significant file size reductions: 17.2% (x86-64), 16.5% (aarch64), and

Re: RFC: Formalization of the Intel assembly syntax (PR53929)

2024-01-19 Thread Fangrui Song
On Thu, Jan 18, 2024 at 5:42 PM LIU Hao wrote: > > 在 2024-01-18 17:02, Fangrui Song 写道: > > Thanks for the proposal. I hope that -masm=intel becomes more useful:) > > > > Do you have a list of assembly in the unambiguous cases that fail to > > be parsed today as a ga

Re: RFC: Formalization of the Intel assembly syntax (PR53929)

2024-01-18 Thread Fangrui Song
On Wed, Jan 17, 2024 at 9:34 PM LIU Hao wrote: > > Hello, > > There hasn't been an solution to https://gcc.gnu.org/PR53929 since almost a > dozen years ago, mostly > due to compatibility with MASM. I was told that the ambiguity of Intel syntax > should be classified > as its own limitation and d

New ch_type value ELFCOMPRESS_ZSTD?

2022-06-26 Thread Fangrui Song
I created https://groups.google.com/g/generic-abi/c/satyPkuMisk ("Add new ch_type value: ELFCOMPRESS_ZSTD") after I saw that on LLVM side, Cole Kissane proposes that we add Zstandard as new compression method (mainly for .debug* sections, but also for some LLVM internal things) https://discourse.l

Re: [llvm-dev] RFC: Add GNU_PROPERTY_1_NEEDED

2021-06-18 Thread Fangrui Song via Gcc
On 2021-06-18, H.J. Lu via llvm-dev wrote: Add GNU_PROPERTY_1_NEEDED: #define GNU_PROPERTY_1_NEEDED GNU_PROPERTY_UINT32_OR_LO to indicate the needed properties by the object file. I am fine with this logical OR style usage. But see below, do we need it for ld.so runtime check? (As I me

Re: [llvm-dev] RFC: Add GNU_PROPERTY_UINT32_AND_XXX/GNU_PROPERTY_UINT32_OR_XXX

2021-06-17 Thread Fangrui Song via Gcc
On 2021-06-17, H.J. Lu via llvm-dev wrote: On Thu, Jan 21, 2021 at 7:02 AM H.J. Lu wrote: On Wed, Jan 13, 2021 at 9:06 AM H.J. Lu wrote: > > 1. GNU_PROPERTY_UINT32_AND_LO..GNU_PROPERTY_UINT32_AND_HI > > #define GNU_PROPERTY_UINT32_AND_LO 0xb000 > #define GNU_PROPERTY_UINT32_AND_HI 0xb00

ELF world with default STB_GLOBAL -Bsymbolic-functions

2021-05-15 Thread Fangrui Song
Hi, elves (people who work on ELF)! Motivated by a recent rant from Linus Torvalds on shared objects' performance issues and a previous post about CPython 1.3x speedup with -fno-semantic-interposition 1.3x, I have thought about an ELF world with STB_GLOBAL variant of -Bsymbolic-functions by defau

Re: RFC: Add GNU_PROPERTY_UINT32_AND_XXX/GNU_PROPERTY_UINT32_OR_XXX

2021-04-17 Thread Fangrui Song
On 2021-04-17, H.J. Lu wrote: On Thu, Jan 21, 2021 at 1:42 PM Fangrui Song wrote: On 2021-01-21, H.J. Lu via Gnu-gabi wrote: >On Wed, Jan 13, 2021 at 9:06 AM H.J. Lu wrote: >> >> 1. GNU_PROPERTY_UINT32_AND_LO..GNU_PROPERTY_UINT32_AND_HI >> >> #define GNU_PROPER

Re: RFC: Add GNU_PROPERTY_UINT32_AND_XXX/GNU_PROPERTY_UINT32_OR_XXX

2021-01-21 Thread Fangrui Song
On 2021-01-21, H.J. Lu via Gnu-gabi wrote: On Wed, Jan 13, 2021 at 9:06 AM H.J. Lu wrote: 1. GNU_PROPERTY_UINT32_AND_LO..GNU_PROPERTY_UINT32_AND_HI #define GNU_PROPERTY_UINT32_AND_LO 0xb000 #define GNU_PROPERTY_UINT32_AND_HI 0xb0007fff A bit in the output pr_data field is set only if i

Re: Add -fdirect-access-external-data

2021-01-07 Thread Fangrui Song
On Thu, Jan 7, 2021 at 6:07 PM H.J. Lu wrote: > > On Wed, Jan 6, 2021 at 10:32 PM Fangrui Song wrote: > > > > On Sat, Dec 26, 2020 at 7:39 AM H.J. Lu wrote: > > > > > > On Sat, Dec 26, 2020 at 7:32 AM Florian Weimer wrote: > > > > > > &

Re: Add -fdirect-access-external-data

2021-01-06 Thread Fangrui Song
On Sat, Dec 26, 2020 at 7:39 AM H.J. Lu wrote: > > On Sat, Dec 26, 2020 at 7:32 AM Florian Weimer wrote: > > > > * Fangrui Song: > > > > > Hi, I filed https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98112 which > > > proposes -fdirect-access-external-data

Add -fdirect-access-external-data

2020-12-16 Thread Fangrui Song
Hi, I filed https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98112 which proposes -fdirect-access-external-data to address some x86-64 GCC/binutils pain[1] and also benefit non-x86 architectures (also see [1] it can prevent copy relocations). [1] Mentioned in https://gcc.gnu.org/bugzilla/show_bug.cgi

Re: Future debug options: -f* or -g*?

2020-07-09 Thread Fangrui Song via Gcc
Fix email addresses:) On 2020-07-09, Fangrui Song wrote: Both GCC and Clang have implemented many debugging options under -f and -g. Whether options go to -f or -g appears to be pretty arbitrary decisions. A non-complete list of GCC supported debug options is documented here at https

Future debug options: -f* or -g*?

2020-07-09 Thread Fangrui Song via Gcc
Both GCC and Clang have implemented many debugging options under -f and -g. Whether options go to -f or -g appears to be pretty arbitrary decisions. A non-complete list of GCC supported debug options is documented here at https://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html I think there op

Re: Changes dueto server migration

2020-03-24 Thread Fangrui Song
On 2020-03-24, H.J. Lu via Binutils wrote: On Tue, Mar 24, 2020 at 11:02 AM Gunther Nikl wrote: Dear GCC developers! I just noticed that the server migration for GCC and sourceware.org brought a surprising change: The list archives are now provided with mailman. Maybe its only me, but IMO w

Eagerly evaluate __atomic_is_lock_free to 0 for oversized types

2020-02-10 Thread Fangrui Song
GCC never evaluates __atomic_is_lock_free to 0. (gcc/builtins.c:fold_builtin_atomic_always_lock_free) I'd like to change clang to eagerly evaluate __atomic_is_lock_free to 0 for apparently oversized types. This helps some platforms to avoid a dependency on libatomic. Either of the following cho

Re: __patchable_function_entries is flawed

2020-01-09 Thread Fangrui Song
On 2020-01-09, Fangrui Song wrote: On 2020-01-08, Fangrui Song wrote: On 2020-01-07, Szabolcs Nagy wrote: On 07/01/2020 07:25, Fangrui Song wrote: On 2020-01-06, Fangrui Song wrote: The addresses of NOPs are collected in a section named __patchable_function_entries. A

Re: __patchable_function_entries is flawed

2020-01-09 Thread Fangrui Song
On 2020-01-08, Fangrui Song wrote: On 2020-01-07, Szabolcs Nagy wrote: On 07/01/2020 07:25, Fangrui Song wrote: On 2020-01-06, Fangrui Song wrote: The addresses of NOPs are collected in a section named __patchable_function_entries. A __patchable_function_entries entry is relocated by a

__patchable_function_entries is flawed

2020-01-08 Thread Fangrui Song
On 2020-01-07, Szabolcs Nagy wrote: On 07/01/2020 07:25, Fangrui Song wrote: On 2020-01-06, Fangrui Song wrote: The addresses of NOPs are collected in a section named __patchable_function_entries. A __patchable_function_entries entry is relocated by a symbolic relocation (e.g. R_X86_64_64

Re: -fpatchable-function-entry should set SHF_WRITE and create one __patchable_function_entries per function

2020-01-06 Thread Fangrui Song
On 2020-01-06, Fangrui Song wrote: The addresses of NOPs are collected in a section named __patchable_function_entries. A __patchable_function_entries entry is relocated by a symbolic relocation (e.g. R_X86_64_64, R_AARCH64_ABS64, R_PPC64_ADDR64). In -shared or -pie mode, the linker will

-fpatchable-function-entry should set SHF_WRITE and create one __patchable_function_entries per function

2020-01-06 Thread Fangrui Song
The addresses of NOPs are collected in a section named __patchable_function_entries. A __patchable_function_entries entry is relocated by a symbolic relocation (e.g. R_X86_64_64, R_AARCH64_ABS64, R_PPC64_ADDR64). In -shared or -pie mode, the linker will create a dynamic relocation (non-preempti

Re: -fpatchable-function-entry: leverage multi-byte NOP on x86

2020-01-06 Thread Fangrui Song
On 2020-01-04, Fangrui Song wrote: -fpatchable-function-entry is used by Linux kernel arm64/parisc. The feature works for x86, but does not leverage multi-byte NOP. % cat a.c int foo() { return 0; } % gcc -fpatchable-function-entry=5,0 -c a.c % objdump -d a.o ... : 0: 90

-fpatchable-function-entry: leverage multi-byte NOP on x86

2020-01-04 Thread Fangrui Song
-fpatchable-function-entry is used by Linux kernel arm64/parisc. The feature works for x86, but does not leverage multi-byte NOP. % cat a.c int foo() { return 0; } % gcc -fpatchable-function-entry=5,0 -c a.c % objdump -d a.o ... : 0: 90 nop 1: 90

[x86-64] Default HAVE_LD_PIE_COPYRELOC to false

2019-05-24 Thread Fangrui Song
On x86-64, in PIE mode, accesses to external data don't use the conservative GOT-relative address, but rather use pcrel. A copy relocation will be created if the external data is defined in a DSO. // a.o // (x) GCC<5, movq a@GOTPCREL(%rip), %rax; movl (%rax), %eax // (y) GCC>=5 (since commit 13