[Bug target/94391] gcc refers to absolute symbols with R_X86_64_PC32 relocation

2020-03-29 Thread i at maskray dot me
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94391 Fangrui Song changed: What|Removed |Added CC||i at maskray dot me --- Comment #5 from

[Bug target/94391] gcc refers to absolute symbols with R_X86_64_PC32 relocation

2020-03-29 Thread i at maskray dot me
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94391 --- Comment #6 from Fangrui Song --- > It is incorrect to reference a non-preemptible symbol with a PC relative > relocation in a -pie link. GNU ld allows it but the code can be incorrect at > runtime. Correction: It is incorrect to reference

[Bug target/94391] gcc refers to absolute symbols with R_X86_64_PC32 relocation

2020-03-29 Thread i at maskray dot me
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94391 --- Comment #10 from Fangrui Song --- > extern unsigned long _binary_a_c_size; > unsigned long foo() { return _binary_a_c_size; } This is incorrect. The code will treat the value of _binary_a_c_size as an address (load base + size) and dereferen

[Bug target/94391] gcc refers to absolute symbols with R_X86_64_PC32 relocation

2020-03-30 Thread i at maskray dot me
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94391 --- Comment #23 from Fangrui Song --- (In reply to Andrew Pinski from comment #18) > (In reply to Yuxuan Shui from comment #17) > > Sorry, I am here to report a bug, not to find a workaround for my use case. > > I gave you the correct usage for

[Bug preprocessor/77488] Proposal for __FILENAME_ONLY__

2020-04-25 Thread i at maskray dot me
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77488 Fangrui Song changed: What|Removed |Added CC||i at maskray dot me --- Comment #8 from

[Bug target/95095] New: Feature request: support -fno-unique-section-names

2020-05-12 Thread i at maskray dot me
Component: target Assignee: unassigned at gcc dot gnu.org Reporter: i at maskray dot me Target Milestone: --- -ffunction-sections produces sections .text.foo , .text.bar , etc, which can take significant amount of string table space. In clang, -fno-unique-section-names emits

[Bug debug/95096] New: Feature request: add -fsplit-dwarf

2020-05-12 Thread i at maskray dot me
Assignee: unassigned at gcc dot gnu.org Reporter: i at maskray dot me Target Milestone: --- -gsplit-dwarf has an undesired property: it sets the debug info level to 2. When plugged into a build system, this can enable debug info unnecessarily (when the user does not specify -g or

[Bug debug/95096] Feature request: add -fsplit-dwarf

2020-05-12 Thread i at maskray dot me
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95096 --- Comment #1 from Fangrui Song --- Created https://sourceware.org/pipermail/gcc-patches/2020-May/545638.html

[Bug target/95095] Feature request: support -fno-unique-section-names

2020-05-24 Thread i at maskray dot me
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95095 --- Comment #1 from Fangrui Song --- I just learned that `int main() {}` compiles to .text.startup in -O2 or -Os It seems that .text.startup. may be better to not accidentally move a C function named `startup` (`startup.` is not a valid C identi

[Bug debug/95482] New: Feature request: add -gsplit-dwarf=single

2020-06-02 Thread i at maskray dot me
: debug Assignee: unassigned at gcc dot gnu.org Reporter: i at maskray dot me Target Milestone: --- DWARF v5 Appendix F. says > The sections that do not require relocation, however, can be written to the > relocatable object (.o) file but ignored by the linker, or they

[Bug gcov-profile/96092] New: Should --coverage respect -ffile-prefix-map?

2020-07-06 Thread i at maskray dot me
: gcov-profile Assignee: unassigned at gcc dot gnu.org Reporter: i at maskray dot me CC: marxin at gcc dot gnu.org Target Milestone: --- % gcc-10 -ffile-prefix-map=/tmp/c=/src --coverage -c -g /tmp/c/a.c # -ffile-prefix-map implies -fdebug-prefix-map % llvm

[Bug gcov-profile/96092] Should --coverage respect -ffile-prefix-map?

2020-07-11 Thread i at maskray dot me
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96092 --- Comment #3 from Fangrui Song --- (In reply to Martin Liška from comment #2) > Apparently we've got a patch in queue that does something similar: > > +fprofile-prefix-path= > +Common·Joined·RejectNegative·Var(profile_prefix_path) > +remove·p

[Bug driver/93645] Support Clang 12 --ld-path=

2020-07-24 Thread i at maskray dot me
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93645 --- Comment #4 from Fangrui Song --- https://sourceware.org/pipermail/gcc-patches/2020-July/550659.html [PATCH v3] Add --ld-path= to specify an arbitrary executable as the linker I changed the title to --ld-path because -fuse-ld=/absolute/path/

[Bug middle-end/192] String literals don't obey -fdata-sections

2020-09-15 Thread i at maskray dot me
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=192 Fangrui Song changed: What|Removed |Added CC||i at maskray dot me --- Comment #19 from

[Bug gcov-profile/97062] New: [gcov] Don't repeat display of inline functions in headers

2020-09-15 Thread i at maskray dot me
ormal Priority: P3 Component: gcov-profile Assignee: unassigned at gcc dot gnu.org Reporter: i at maskray dot me CC: marxin at gcc dot gnu.org Target Milestone: --- This is a minor display issue. >a.cc cat<b.cc cat<a.h cat<

[Bug gcov-profile/91601] gcov: ICE in handle_cycle, at gcov.c:699 happen which get code coverage with lcov.

2020-09-15 Thread i at maskray dot me
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91601 Fangrui Song changed: What|Removed |Added CC||i at maskray dot me --- Comment #17 from

[Bug gcov-profile/97065] New: Support -fprofile-update=set (boolean counters)

2020-09-16 Thread i at maskray dot me
: gcov-profile Assignee: unassigned at gcc dot gnu.org Reporter: i at maskray dot me CC: marxin at gcc dot gnu.org Target Milestone: --- I can understand that defaulting -fprofile-update=prefer-atomic in GCC 7 and using atomic counters when -pthread is

[Bug gcov-profile/85351] [GCOV] Wrong coverage with exit() executed in a if statement within a called function

2020-09-16 Thread i at maskray dot me
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85351 Fangrui Song changed: What|Removed |Added CC||i at maskray dot me --- Comment #5 from

[Bug driver/93645] Support Clang 12 --ld-path=

2020-09-17 Thread i at maskray dot me
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93645 --- Comment #5 from Fangrui Song --- Ping

[Bug c++/92413] New: [temp.explicit] Explicit template instantiations should not define member functions that are not defined at the point of instantiation

2019-11-07 Thread i at maskray dot me
Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: i at maskray dot me Target Milestone: --- https://wg21.cmeerw.net/cwg/issue546 Change 17.8.2

[Bug c/93194] New: -fpatchable-function-entries : __patchable_function_entries has wrong sh_flags and sh_addralign

2020-01-07 Thread i at maskray dot me
Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: i at maskray dot me Target Milestone: --- % cat a.c void f(){} % gcc -fpatchable-function-entry=3 -c a.c % readelf -S a.o ... [Nr

[Bug middle-end/93194] -fpatchable-function-entries : __patchable_function_entries has wrong sh_flags and sh_addralign

2020-01-07 Thread i at maskray dot me
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93194 --- Comment #1 from Fangrui Song --- The SHF_WRITE issue has been fixed. https://gcc.gnu.org/ml/gcc-patches/2020-01/msg00271.html will fix sh_addralign

[Bug middle-end/93195] New: -fpatchable-function-entries : __patchable_function_entries should consider comdat groups

2020-01-07 Thread i at maskray dot me
: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: i at maskray dot me Target Milestone: --- % cat a.cc inline void foo() {} void bar() { foo(); } % cat b.cc inline void foo() {} void

[Bug middle-end/93197] New: -fpatchable-function-entries : __patchable_function_entries does not survive under --gc-sections

2020-01-08 Thread i at maskray dot me
Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: i at maskray dot me Target Milestone: --- __patchable_function_entries is not a GC root, and not referenced by a retained

[Bug target/92424] [aarch64] Broken code with -fpatchable-function-entry and BTI

2020-01-30 Thread i at maskray dot me
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92424 Fangrui Song changed: What|Removed |Added CC||i at maskray dot me --- Comment #8 from

[Bug target/93492] Broken code with -fpatchable-function-entry and -fcf-protection=full

2020-01-30 Thread i at maskray dot me
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93492 Fangrui Song changed: What|Removed |Added CC||i at maskray dot me --- Comment #2 from

[Bug target/93492] Broken code with -fpatchable-function-entry and -fcf-protection=full

2020-01-31 Thread i at maskray dot me
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93492 --- Comment #7 from Fangrui Song --- > Is -fasynchronous-unwind-tables compatible with -fpatchable-function-entry? Apparently the Linux kernel does not care about it. To make it usable in userspace, we should place .cfi_startproc in a reasonable

[Bug middle-end/93195] -fpatchable-function-entries : __patchable_function_entries should consider comdat groups

2020-02-01 Thread i at maskray dot me
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93195 --- Comment #1 from Fangrui Song --- This is similar to --gc-sections (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93536) but a bit different. The only reasonable fix I can think of is to place __patchable_function_entries in the same section g

[Bug target/93492] Broken code with -fpatchable-function-entry and -fcf-protection=full

2020-02-02 Thread i at maskray dot me
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93492 --- Comment #11 from Fangrui Song --- (In reply to H.J. Lu from comment #8) > Created attachment 47762 [details] > A patch to handle targetm.asm_out.post_cfi_startproc I don't work on GCC, so I am hoping other x86 maintainers can review. (I know

[Bug driver/93645] New: Support -fuse-ld=/absolute/path/to/ld

2020-02-09 Thread i at maskray dot me
Assignee: unassigned at gcc dot gnu.org Reporter: i at maskray dot me Target Milestone: --- This feature request generalizes -fuse-ld=bfd -fuse-ld=gold https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55470 and -fuse-ld=lld clang -fuse-ld= also supports the following forms: -fuse

[Bug driver/93645] Support -fuse-ld=/absolute/path/to/ld

2020-02-09 Thread i at maskray dot me
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93645 --- Comment #1 from Fangrui Song --- Posted a patch https://gcc.gnu.org/ml/gcc-patches/2020-02/msg00510.html I agree with https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59321#c4 we should use a new option, instead of overloading --print-prog-nam

[Bug driver/52982] add option to select particular linker

2020-02-09 Thread i at maskray dot me
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52982 Fangrui Song changed: What|Removed |Added CC||i at maskray dot me --- Comment #4 from

[Bug c/99587] New: warning: ‘retain’ attribute ignored while __has_attribute(retain) is true

2021-03-14 Thread i at maskray dot me via Gcc-bugs
: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: i at maskray dot me Target Milestone: --- If configure-time ld does not support SHF_GNU_RETAIN, __has_attribute(retain) may be true while using it will cause a warning. % cat x.c

[Bug c/99587] warning: ‘retain’ attribute ignored while __has_attribute(retain) is 1

2021-03-16 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99587 --- Comment #6 from Fangrui Song --- (In reply to Jakub Jelinek from comment #5) > (In reply to Florian Weimer from comment #4) > > For retain, something along these lines might work: > > > > diff --git a/gcc/c-family/c-attribs.c b/gcc/c-family/

[Bug libgcc/99759] New: morestack.S should support .init_array.0 besides .ctors.65535

2021-03-24 Thread i at maskray dot me via Gcc-bugs
Priority: P3 Component: libgcc Assignee: unassigned at gcc dot gnu.org Reporter: i at maskray dot me Target Milestone: --- to drop reliance on ld's default linker script .init_array: { PROVIDE_HIDDEN (__init_array_start = .);

[Bug target/99836] New: aarch64: -fpatchable-function-entry=N[,0] should place .cfi_startproc before NOPs

2021-03-30 Thread i at maskray dot me via Gcc-bugs
Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: i at maskray dot me Target Milestone: --- Extracted from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92424#c8 % echo 'int main() {}' > a.c % clang --t

[Bug gcov-profile/97507] New: Move __gcov_exit from per-object .fini_array.00100 to libgcov

2020-10-20 Thread i at maskray dot me via Gcc-bugs
Priority: P3 Component: gcov-profile Assignee: unassigned at gcc dot gnu.org Reporter: i at maskray dot me CC: marxin at gcc dot gnu.org Target Milestone: --- Per object file .fini_array.00100 wastes space. __gcov_exit can be called in libgcov. It

[Bug tree-optimization/66512] PRE fails to optimize calls to pure functions in C++, ok in C

2020-11-24 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66512 Fangrui Song changed: What|Removed |Added CC||i at maskray dot me --- Comment #4 from

[Bug target/98063] New: Emit R_X86_64_GOTOFF64 instead of R_X86_64_GOTPCRELX for -mcmodel=large -fno-plt

2020-11-29 Thread i at maskray dot me via Gcc-bugs
: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: i at maskray dot me Target Milestone: --- % cat a.c #include int main() { puts("meow"); } % gcc -mcmodel=large -fno-plt -O1 -S a.c -fpic -o - -O2 -fno-as

[Bug c/98112] New: Add -fdirect-access-external-data & drop HAVE_LD_PIE_COPYRELOC

2020-12-02 Thread i at maskray dot me via Gcc-bugs
rmal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: i at maskray dot me Target Milestone: --- After "x86-64: Optimize access to globals in PIE with copy reloc", GCC x86-64 asks the assembler to produce an R_X86_64_PC32 for an

[Bug target/98112] Add -fdirect-access-external-data & drop HAVE_LD_PIE_COPYRELOC

2020-12-03 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98112 --- Comment #2 from Fangrui Song --- Note: -fdirect-access-external-data is architecture-independent. For example, currently Clang on aarch64 can perform the following optimization: // clang -target aarch64 -fPIE -O3 adrpx8, :got:var ldr

[Bug gcov-profile/98257] New: Replace Donald B. Johnson's cycle enumeration with iterative loop finding

2020-12-12 Thread i at maskray dot me via Gcc-bugs
erity: normal Priority: P3 Component: gcov-profile Assignee: unassigned at gcc dot gnu.org Reporter: i at maskray dot me CC: marxin at gcc dot gnu.org Target Milestone: --- gcov used _J. C. Tiernan, An Efficient Search Algorithm to Find the Eleme

[Bug target/97827] bootstrap error building the amdgcn-amdhsa offload compiler with LLVM 11

2020-12-14 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97827 Fangrui Song changed: What|Removed |Added CC||i at maskray dot me --- Comment #9 from

[Bug target/97827] bootstrap error building the amdgcn-amdhsa offload compiler with LLVM 11

2020-12-14 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97827 --- Comment #10 from Fangrui Song --- Note: the section key is not just (name, group name "G"). It is a quadruple: (name, group name "G", linked-to "o", unique ID) Keeping just name works for the simplest case. If GCC decides to support PR95095

[Bug target/98112] Add -fdirect-access-external-data & drop HAVE_LD_PIE_COPYRELOC

2020-12-14 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98112 --- Comment #3 from Fangrui Song --- Are you happy with the option name -f[no-]direct-access-external-data ? https://reviews.llvm.org/D92633 is what I want to add to Clang. I want GCC and Clang to use the same option names...

[Bug middle-end/93195] -fpatchable-function-entries : __patchable_function_entries should consider comdat groups

2020-12-16 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93195 --- Comment #10 from Fangrui Song --- (In reply to Jakub Jelinek from comment #9) > I believe this broke building the kernel, see > https://gcc.gnu.org/pipermail/gcc-patches/2020-December/561974.html > for details. For > ld: .init.data has both

[Bug c/94722] implement __attribute__((no_stack_protector)) function attribute

2020-12-16 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94722 Fangrui Song changed: What|Removed |Added CC||i at maskray dot me --- Comment #7 from

[Bug target/98112] Add -fdirect-access-external-data & drop HAVE_LD_PIE_COPYRELOC

2020-12-28 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98112 --- Comment #5 from Fangrui Song --- (In reply to Segher Boessenkool from comment #4) > (In reply to Fangrui Song from comment #3) > > Are you happy with the option name -f[no-]direct-access-external-data ? > > Not at all, no :-( > > The name d

[Bug target/98112] Add -fdirect-access-external-data & drop HAVE_LD_PIE_COPYRELOC

2020-12-28 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98112 --- Comment #7 from Fangrui Song --- (In reply to Segher Boessenkool from comment #6) > (In reply to Fangrui Song from comment #5) > > Please read my first comment why copy relocs is a bad name. > > Since I reply to some of that (namely, your ar

[Bug target/95095] Feature request: support -fno-unique-section-names

2021-01-16 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95095 --- Comment #3 from Fangrui Song --- (In reply to Segher Boessenkool from comment #2) > Can't we use ".text%name" for -ffunction-sections, like we did originally, > in 1996? See cf4403481dd6. This does not conflict with other section > names, a

[Bug libstdc++/98785] New: _Unwind_ForcedUnwind going through a non-empty exception specification

2021-01-21 Thread i at maskray dot me via Gcc-bugs
Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: i at maskray dot me Target Milestone: --- gcc/testsuite/g++.dg/eh/forced3.C says forced unwinding calls std::unexpected going through a throw() function. gcc/testsuite/g++.dg

[Bug target/95095] Feature request: support -fno-unique-section-names

2021-01-21 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95095 --- Comment #5 from Fangrui Song --- Linux kernel include/asm-generic/vmlinux.lds.h currently has #define TEXT_TEXT \ ALIGN_FUNCTION(); \

[Bug target/95095] Feature request: support -fno-unique-section-names

2021-01-25 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95095 --- Comment #7 from Fangrui Song --- (In reply to Segher Boessenkool from comment #6) > I was under the impression this unique section thing needed the trailing > dot thing. This probably is not true. > > I still think the old "%" thing is much

[Bug target/95095] Feature request: support -fno-unique-section-names

2021-01-25 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95095 --- Comment #9 from Fangrui Song --- (In reply to Segher Boessenkool from comment #8) > I say nothing like that. I say that > .text.hot. > is nasty (is easily mistaken for .text.hot). > > I also say that and that named-per-function sections a

[Bug c/99282] New: Emit .cfi_sections without arguments for -fno-asynchronous-unwind-tables

2021-02-25 Thread i at maskray dot me via Gcc-bugs
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: i at maskray dot me Target Milestone: --- .cfi_* in inline asm is rare, but can be useful if the user wants precise unwind information. % cat a.c int main() { asm("pu

[Bug inline-asm/99282] Emit .cfi_sections without arguments for -fno-asynchronous-unwind-tables

2021-02-26 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99282 --- Comment #2 from Fangrui Song --- (In reply to Jakub Jelinek from comment #1) > There is the __GCC_HAVE_DWARF2_CFI_ASM predefined macro that tells if .cfi* > directives are used or not. And, inline asm that wishes to be usable in > both can u

[Bug demangler/100437] New: libiberty: Support more characters for function clones

2021-05-05 Thread i at maskray dot me via Gcc-bugs
Component: demangler Assignee: unassigned at gcc dot gnu.org Reporter: i at maskray dot me Target Milestone: --- In the demangler, the ('.' (alpha|'_')+) ('.' digit+)* scheme as implemented for PR40831 allows a decimal but not a hexadecimal. It'

[Bug c/100483] New: Extend -fno-semantic-interposition to global variables

2021-05-07 Thread i at maskray dot me via Gcc-bugs
Component: c Assignee: unassigned at gcc dot gnu.org Reporter: i at maskray dot me Target Milestone: --- % cat a.c int var; int foo() { return var; } (I implemented this for clang 11 x86) % clang -fpic -fno-semantic-interposition -O2 -S a.c % cat a.s ... foo

[Bug c/100593] New: [ELF] -fno-pic: Use GOT to take address of an external default visibility function

2021-05-13 Thread i at maskray dot me via Gcc-bugs
Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: i at maskray dot me Target Milestone: --- Most ELF targets use an absolute relocation (e.g. R_X86_64_32) to take the address of a default visibility non-definition

[Bug c/100483] Extend -fno-semantic-interposition to global variables

2021-05-13 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100483 --- Comment #1 from Fangrui Song --- Another request is a new option: -fno-semantic-interposition-function. With this option, we only assume functions cannot be interposed. -fno-semantic-interposition assumes both functions and variables cannot

[Bug c/100618] New: Add a -fno-semantic-interposition variant which allows variable interposition

2021-05-15 Thread i at maskray dot me via Gcc-bugs
: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: i at maskray dot me Target Milestone: --- Extracted from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100483 The documentation says -fno-semantic-interposition applies to

[Bug c/100618] Add a -fno-semantic-interposition variant which allows variable interposition

2021-05-15 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100618 --- Comment #1 from Fangrui Song --- Perhaps -fsemantic-interposition=function,variable (default -fpic/-fPIC) -fsemantic-interposition=variable (compatible with copy relocations but enable function optimizations) -fsemantic-interposition= (a

[Bug c/100483] Extend -fno-semantic-interposition to global variables

2021-05-16 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100483 Fangrui Song changed: What|Removed |Added Resolution|--- |INVALID Status|UNCONFIRMED

[Bug middle-end/100593] [ELF] -fno-pic: Use GOT to take address of an external default visibility function

2021-05-16 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100593 --- Comment #2 from Fangrui Song --- (In reply to Alexander Monakov from comment #1) > It is not necessary to change -fno-pic code generation to gain most of the > -Bsymbolic benefit It is necessary, otherwise the function address taken from th

[Bug middle-end/100593] [ELF] -fno-pic: Use GOT to take address of an external default visibility function

2021-05-17 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100593 --- Comment #4 from Fangrui Song --- (In reply to Alexander Monakov from comment #3) > I understand what you're saying, but it seems we're talking past each other. > > I agree that if a library is linked with any -Bsymbolic* flag, the main > ex

[Bug middle-end/100593] [ELF] -fno-pic: Use GOT to take address of an external default visibility function

2021-05-17 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100593 --- Comment #6 from Fangrui Song --- (In reply to Alexander Monakov from comment #5) > Hm, I still don't think I'm misunderstanding what you're saying. I'm > familiar with the ELF standard (and FWIW I have read your blog posts on > related matte

[Bug middle-end/100593] [ELF] -fno-pic: Use GOT to take address of an external default visibility function

2021-05-18 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100593 --- Comment #8 from Fangrui Song --- Seems that -fno-plt -fno-pic does have the required properties. A side effect is that all external calls use the (x86-64) call *f@GOTPCREL(%rip) (x86-32) call *f@GOT form. The instruction is one byte long

[Bug middle-end/100593] [ELF] -fno-pic: Use GOT to take address of an external default visibility function

2021-05-26 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100593 --- Comment #9 from Fangrui Song --- I have a patch to implement this Clang. It'd be good to have a name even if GCC wants to postpone the implementation for now. How about -fdirect-access-external-function & -fno-direct-access-external-functio

[Bug c/100618] Add a -fno-semantic-interposition variant which allows variable interposition

2021-06-04 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100618 Fangrui Song changed: What|Removed |Added Resolution|--- |FIXED Status|UNCONFIRMED

[Bug middle-end/100593] [ELF] -fno-pic: Use GOT to take address of an external default visibility function

2021-06-04 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100593 --- Comment #11 from Fangrui Song --- (In reply to Alexander Monakov from comment #10) > Is there something wrong or undesirable with making this under -fno-plt (or > the noplt attribute as in your example)? > > (after all, it is a kind of PLT-

[Bug middle-end/100593] [ELF] -fno-pic: Use GOT to take address of an external default visibility function

2021-06-06 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100593 --- Comment #13 from Fangrui Song --- (In reply to H.J. Lu from comment #12) > We should handle it in the whole Linux software stack: > > https://gitlab.com/x86-psABIs/x86-64-ABI/-/issues/8 > > not just in compiler. It is great that you have

[Bug driver/100937] New: configure: Add --enable-default-semantic-interposition

2021-06-06 Thread i at maskray dot me via Gcc-bugs
Component: driver Assignee: unassigned at gcc dot gnu.org Reporter: i at maskray dot me Target Milestone: --- Add a configure option --enable-default-semantic-interposition to customize -f(no-)semantic-interposition default. The suppression of interprocedural optimizations and

[Bug driver/100937] configure: Add --enable-default-semantic-interposition

2021-06-06 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100937 Fangrui Song changed: What|Removed |Added Resolution|WONTFIX |--- Status|RESOLVED

[Bug driver/100937] configure: Add --enable-default-semantic-interposition

2021-06-09 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100937 --- Comment #6 from Fangrui Song --- Then can you add a -fvisibility=protected variant which only applies to non-weak defined functions? Two issues need to be fixed: (1): https://sourceware.org/bugzilla/show_bug.cgi?id=27973 __attribute__((vi

[Bug gcov-profile/80223] RFE: Exclude functions from profile instrumentation

2021-06-14 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80223 Fangrui Song changed: What|Removed |Added CC||i at maskray dot me --- Comment #7 from

[Bug gcov-profile/80223] RFE: Exclude functions from profile instrumentation

2021-06-15 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80223 --- Comment #8 from Fangrui Song --- I am thinking of __attribute__((no_profile)). In Clang, -fprofile-generate(-fcs-profile-generate)/-fprofile-instr-generate/-fprofile-arcs are all different. It will make sense to have a attribute disabling al

[Bug gcov-profile/80223] RFE: Exclude functions from profile instrumentation

2021-06-21 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80223 --- Comment #14 from Fangrui Song --- (In reply to Martin Liška from comment #13) > What's likely missing is that the attribute should prevent inlining. I'm > going to test how it behaves right now. Then, the issue can be closed. It's not clear

[Bug gcov-profile/80223] RFE: Exclude functions from profile instrumentation

2021-06-23 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80223 --- Comment #18 from Fangrui Song --- (In reply to Nick Desaulniers from comment #15) > (In reply to Fangrui Song from comment #14) > > Can a no_profile_instrument_function function be inlined into a function > > without the attribute? This may b

[Bug gcov-profile/80223] RFE: Exclude functions from profile instrumentation

2021-06-23 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80223 --- Comment #20 from Fangrui Song --- (In reply to Marco Elver from comment #19) I am ok with "inlining suppression" as an implementation strategy and I agree that it should be useful. What I objected strongly is "promised inlining suppression".

[Bug gcov-profile/80223] RFE: Exclude functions from profile instrumentation

2021-06-23 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80223 --- Comment #21 from Fangrui Song --- (In reply to Fangrui Song from comment #20) > For example, if an inlining pass happens after instrumentation, then the > function attribute doesn't necessarily need to suppress inlining. After > instrumentati

[Bug target/108622] New: x86 -fno-pic: use DW_EH_PE_indirect|DW_EH_PE_pcrel for personality/ttype encoding

2023-01-31 Thread i at maskray dot me via Gcc-bugs
Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: i at maskray dot me Target Milestone: --- In .eh_frame and .gcc_except_table, the aarch64 and riscv ports use DW_EH_PE_indirect|DW_EH_PE_pcrel for both -fno-pic

[Bug target/108622] x86 -fno-pic: use DW_EH_PE_indirect|DW_EH_PE_pcrel for personality/ttype encoding

2023-01-31 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108622 --- Comment #1 from Fangrui Song --- https://gcc.gnu.org/pipermail/gcc-patches/2023-February/611081.html [PATCH] x86: Use DW_EH_PE_indirect|DW_EH_PE_pcrel encodings for -fno-pic code

[Bug c++/108761] New: Add option to produce a unique section for non-COMDAT __attribute__((section("foo"))) object

2023-02-10 Thread i at maskray dot me via Gcc-bugs
NCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: i at maskray dot me Target Milestone: --- % cat a.cc __attribute__((section("foo"))) void f() {} __attribute__((section("foo

[Bug c++/108761] Add option to produce a unique section for non-COMDAT __attribute__((section("foo"))) object

2023-02-12 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108761 --- Comment #3 from Fangrui Song --- New syntax setting the flags will be useful. Also, currently there is no way to customize the section type.

[Bug c/108978] New: Add __builtin_FILE_NAME() which behaves like the __FILE_NAME__ macro

2023-02-28 Thread i at maskray dot me via Gcc-bugs
: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: i at maskray dot me Target Milestone: --- PR c/42579 added __FILE_NAME__. On the Clang side someone is proposing __builtin_FILE_NAME (https://reviews.llvm.org/D144878) a la

[Bug target/99888] Add powerpc ELFv2 support for -fpatchable-function-entry*

2022-08-11 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99888 Fangrui Song changed: What|Removed |Added CC||i at maskray dot me --- Comment #5 from

[Bug driver/106897] New: driver: support -gz=zstd

2022-09-09 Thread i at maskray dot me via Gcc-bugs
Assignee: unassigned at gcc dot gnu.org Reporter: i at maskray dot me Target Milestone: --- Translate -gz=std to --compress-debug-sections=zstd for as and ld. This requires that binutils supports zstd, feature request: https://sourceware.org/bugzilla/show_bug.cgi?id=29397

[Bug driver/106897] driver: support -gz=zstd

2022-09-10 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106897 --- Comment #4 from Fangrui Song --- Yes, the change will be straightforward, basically the files touched by the pending https://gcc.gnu.org/pipermail/gcc-patches/2022-July/597586.html ("[PATCH] Remove legacy -gz=zlib-gnu"). I sent it because

[Bug driver/93645] Support Clang 12 --ld-path=

2021-12-22 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93645 --- Comment #13 from Fangrui Song --- (In reply to Martin Liška from comment #12) > (In reply to Fangrui Song from comment #11) > > (In reply to Martin Liška from comment #10) > > > I replied here: > > > https://gcc.gnu.org/pipermail/gcc-patches/

[Bug driver/93645] Support Clang 12 --ld-path=

2021-12-28 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93645 --- Comment #15 from Fangrui Song --- -- is definitely rare, but not non-existent. In GCC, there is {-,--}specs. In Clang, there are --cuda-path, --ptxas-path, --hip-path, --classpath, etc. (In reply to Martin Liška from comment #14) > > > > I t

[Bug target/100896] --enable-initfini-array should be enabled for cross compiler to Linux

2021-11-05 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100896 Fangrui Song changed: What|Removed |Added CC||i at maskray dot me --- Comment #4 from

[Bug target/100896] --enable-initfini-array should be enabled for cross compiler to Linux

2021-11-05 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100896 --- Comment #5 from Fangrui Song --- Ah, ok, my /tmp/glibc-many/src/gcc is at releases/gcc-11 while the fix is for 12.0? Anyway, you may want to clean up gcc/acinclude.m4

[Bug driver/100937] configure: Add --enable-default-semantic-interposition

2021-11-22 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100937 --- Comment #11 from Fangrui Song --- To enable interposition on Mach-O, one needs a non-default configuration like: ld -interposable, DYLD_FORCE_FLAT_NAMESPACE or __attribute__((section("__DATA,__interpose"))). On PE/COFF, such interposition ju

[Bug driver/103398] New: configure: Enable --enable-default-pie by default for Linux

2021-11-23 Thread i at maskray dot me via Gcc-bugs
Priority: P3 Component: driver Assignee: unassigned at gcc dot gnu.org Reporter: i at maskray dot me Target Milestone: --- Many Linux distros configure GCC with --enable-default-pie (at least Arch/Debian/Fedora/Gentoo/Ubuntu). I think it makes sense to default to

[Bug driver/103398] configure: Enable --enable-default-pie by default for Linux

2021-11-23 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103398 --- Comment #2 from Fangrui Song --- I want to switch the default because: * It seems to me that every Linux distro uses --enable-default-pie GCC. I use "many", but it is likely "most" at this point (2021). * When a user builds GCC on Linux, th

[Bug driver/93645] Support Clang 12 --ld-path=

2021-12-22 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93645 --- Comment #11 from Fangrui Song --- (In reply to Martin Liška from comment #10) > I replied here: > https://gcc.gnu.org/pipermail/gcc-patches/2021-June/573823.html There are people wanting to use mold https://www.reddit.com/r/rust/comments/rhc

[Bug c++/102168] New: -Wnon-virtual-dtor shouldn't fire for protected dtor in a class with a friend declaration

2021-09-01 Thread i at maskray dot me via Gcc-bugs
IRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: i at maskray dot me Target Milestone: --- class base; class b { public: void del(base *x); }; class base { friend b; public: virtual void a

[Bug c/102502] New: C11: _Static_assert disallows const int operand in -O0 while allows it in higher -O

2021-09-27 Thread i at maskray dot me via Gcc-bugs
Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: i at maskray dot me Target Milestone: --- Under some circumstances, const size_t allocation_size = 32768; _Static_assert (allocation_size >= sizeof (str

[Bug c/102502] C11: _Static_assert disallows const int operand in -O0 while allows it in higher -O

2021-09-27 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102502 --- Comment #3 from Fangrui Song --- OK, Andrew asked me to file it :) I just wanted to fix glibc and run away from the GCC inconsistency. I know that https://www.iso-9899.info/n1570.html#6.6 p10 says "An implementation may accept other forms o

[Bug libgcc/99759] morestack.S should support .init_array.0 besides .ctors.65535

2021-10-08 Thread i at maskray dot me via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99759 Fangrui Song changed: What|Removed |Added Resolution|--- |FIXED Status|NEW

  1   2   >