Re: Range lists, zero-length functions, linker gc

2020-05-31 Thread David Blaikie via Elfutils-devel
On Sun, May 31, 2020 at 3:42 PM Mark Wielaard wrote: > > Hi, > > On Sun, May 31, 2020 at 01:47:38PM -0700, Fangrui Song via Elfutils-devel > wrote: > > On 2020-05-31, Mark Wielaard wrote: > > > I think this is a producer problem. If a (code) section can be totally > > > dropped then the associate

Re: Range lists, zero-length functions, linker gc

2020-05-31 Thread David Blaikie via Elfutils-devel
On Sun, May 31, 2020 at 3:30 PM Mark Wielaard wrote: > > Hi, > > On Sun, May 31, 2020 at 01:49:12PM -0700, David Blaikie wrote: > > On Sun, May 31, 2020 at 1:41 PM Mark Wielaard wrote: > > > On Sun, May 31, 2020 at 11:55:06AM -0700, Fangrui Song via Elfutils-devel > > > wrote: > > > > I am eager

Re: Range lists, zero-length functions, linker gc

2020-05-31 Thread Mark Wielaard
Hi, On Sun, May 31, 2020 at 01:49:12PM -0700, David Blaikie wrote: > On Sun, May 31, 2020 at 1:41 PM Mark Wielaard wrote: > > On Sun, May 31, 2020 at 11:55:06AM -0700, Fangrui Song via Elfutils-devel > > wrote: > > > I am eager to know what you think > > > of the ideas from binutils/gdb/elfutils

Re: Range lists, zero-length functions, linker gc

2020-05-31 Thread Mark Wielaard
Hi, On Sun, May 31, 2020 at 01:47:38PM -0700, Fangrui Song via Elfutils-devel wrote: > On 2020-05-31, Mark Wielaard wrote: > > I think this is a producer problem. If a (code) section can be totally > > dropped then the associated (.debug) sections should have been > > generated together with that

Re: Range lists, zero-length functions, linker gc

2020-05-31 Thread David Blaikie via Elfutils-devel
Thanks for getting this conversation started here, Fangrui, I might summarize things slightly differently (some corrections - some just different phrasing): Current situation: When a linker discards code (either chooses a comdat copy from another object file that's not identical (two inline func

Re: Range lists, zero-length functions, linker gc

2020-05-31 Thread David Blaikie via Elfutils-devel
On Sun, May 31, 2020 at 1:41 PM Mark Wielaard wrote: > > Hi, > > On Sun, May 31, 2020 at 11:55:06AM -0700, Fangrui Song via Elfutils-devel > wrote: > > what linkers should do regarding relocations referencing dropped > > functions (due to section group rules, --gc-sections, /DISCARD/, > > etc) in

Re: Range lists, zero-length functions, linker gc

2020-05-31 Thread Fangrui Song via Elfutils-devel
On 2020-05-31, Mark Wielaard wrote: Hi, On Sun, May 31, 2020 at 11:55:06AM -0700, Fangrui Song via Elfutils-devel wrote: what linkers should do regarding relocations referencing dropped functions (due to section group rules, --gc-sections, /DISCARD/, etc) in .debug_* As an example: __attrib

Re: Range lists, zero-length functions, linker gc

2020-05-31 Thread Mark Wielaard
Hi, On Sun, May 31, 2020 at 11:55:06AM -0700, Fangrui Song via Elfutils-devel wrote: > what linkers should do regarding relocations referencing dropped > functions (due to section group rules, --gc-sections, /DISCARD/, > etc) in .debug_* > > As an example: > > __attribute__((section(".text.x"))

Re: Range lists, zero-length functions, linker gc

2020-05-31 Thread Fangrui Song via Elfutils-devel
On 2020-05-31, Fangrui Song wrote: It is being discussed on llvm-dev (https://lists.llvm.org/pipermail/llvm-dev/2020-May/141885.html https://groups.google.com/forum/#!topic/llvm-dev/i0DFx6YSqDA) what linkers should do regarding relocations referencing dropped functions (due to section group rule

Range lists, zero-length functions, linker gc

2020-05-31 Thread Fangrui Song via Elfutils-devel
It is being discussed on llvm-dev (https://lists.llvm.org/pipermail/llvm-dev/2020-May/141885.html https://groups.google.com/forum/#!topic/llvm-dev/i0DFx6YSqDA) what linkers should do regarding relocations referencing dropped functions (due to section group rules, --gc-sections, /DISCARD/, etc) in