diff mbox series

abilist.awk: Treat .tdata like .tbss and reject unknown combinations.

Message ID 78f75872-ccdb-4b5e-4e54-f19cb1becbb5@redhat.com
State New
Headers show
Series abilist.awk: Treat .tdata like .tbss and reject unknown combinations. | expand

Commit Message

Carlos O'Donell Nov. 20, 2018, 10:26 p.m. UTC
abilist.awk: Treat .tdata like .tbss and reject unknown combinations.

Mathieu Desnoyers ran into an issue with his rseq patch where
he was the first person to add weak thread-local data and this
resulted in an ABI list update with entries like this:
"GLIBC_2.29 w ? D .tdata 0000000000000020".

The weakness of the symbol has nothing to do with the DSOs
ABI and so we should not write anything about weak symbols
here. The .tdata entries should be treated exactly like .tbss
entries and the output should have been:
"GLIBC_2.29 __rseq_abi T 0x20"

This change makes abilist.awk handle .tdata just like .tbss, while
at the same time adding an error case for the default. We never
want anyone to be able to add such entries to any ABI list files
and should see an immediate error and consult with experts.

Tested by Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
witht the rseq patch set and 'make update-all-abi'.

Tested myself with 'make update-all-abi' on x86_64 with no changes.

Signed-off-by: Carlos O'Donell <carlos@redhat.com>
---
 ChangeLog           |  4 ++++
 scripts/abilist.awk | 11 +++--------
 2 files changed, 7 insertions(+), 8 deletions(-)

Comments

Mathieu Desnoyers Nov. 20, 2018, 10:33 p.m. UTC | #1
----- On Nov 20, 2018, at 5:26 PM, carlos carlos@redhat.com wrote:

> abilist.awk: Treat .tdata like .tbss and reject unknown combinations.
> 
> Mathieu Desnoyers ran into an issue with his rseq patch where
> he was the first person to add weak thread-local data and this
> resulted in an ABI list update with entries like this:
> "GLIBC_2.29 w ? D .tdata 0000000000000020".
> 
> The weakness of the symbol has nothing to do with the DSOs
> ABI and so we should not write anything about weak symbols
> here. The .tdata entries should be treated exactly like .tbss
> entries and the output should have been:
> "GLIBC_2.29 __rseq_abi T 0x20"
> 
> This change makes abilist.awk handle .tdata just like .tbss, while
> at the same time adding an error case for the default. We never
> want anyone to be able to add such entries to any ABI list files
> and should see an immediate error and consult with experts.
> 
> Tested by Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
> witht the rseq patch set and 'make update-all-abi'.

witht -> with

Thanks!

Mathieu

> 
> Tested myself with 'make update-all-abi' on x86_64 with no changes.
> 
> Signed-off-by: Carlos O'Donell <carlos@redhat.com>
> ---
> ChangeLog           |  4 ++++
> scripts/abilist.awk | 11 +++--------
> 2 files changed, 7 insertions(+), 8 deletions(-)
> 
> diff --git a/ChangeLog b/ChangeLog
> index 9cdd3bad36..7038b583b6 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,3 +1,7 @@
> +2018-11-20  Carlos O'Donell  <carlos@redhat.com>
> +
> +	* scripts/abilist.awk: Handle .tdata. Error for unknown combinations.
> +
> 2018-11-20  DJ Delorie  <dj@redhat.com>
> 
> 	* malloc/malloc.c (tcache_entry): Add key field.
> diff --git a/scripts/abilist.awk b/scripts/abilist.awk
> index bad7c3807e..e914df57f0 100644
> --- a/scripts/abilist.awk
> +++ b/scripts/abilist.awk
> @@ -39,7 +39,6 @@ $2 == "l" { next }
> 
> # If the target uses ST_OTHER, it will be output before the symbol name.
> $2 == "g" || $2 == "w" && (NF == 7 || NF == 8) {
> -  weak = $2;
>   type = $3;
>   size = $5;
>   sub(/^0*/, "", size);
> @@ -55,7 +54,7 @@ $2 == "g" || $2 == "w" && (NF == 7 || NF == 8) {
>   if (version == "GLIBC_PRIVATE") next;
> 
>   desc = "";
> -  if (type == "D" && $4 == ".tbss") {
> +  if (type == "D" && ($4 == ".tbss" || $4 == ".tdata")) {
>     type = "T";
>   }
>   else if (type == "D" && $4 == ".opd") {
> @@ -90,14 +89,10 @@ $2 == "g" || $2 == "w" && (NF == 7 || NF == 8) {
>     size = "";
>   }
>   else {
> -    desc = symbol " " version " " weak " ? " type " " $4 " " $5;
> -  }
> -  if (size == " 0x") {
> -    desc = symbol " " version " " weak " ? " type " " $4 " " $5;
> +    print "Unable to handle this type of symbol."
> +    exit 1
>   }
> 
> -  # Disabled -- weakness should not matter to shared library ABIs any more.
> -  #if (weak == "w") type = tolower(type);
>   if (desc == "")
>     desc = symbol " " type size;
> 
> --
> 2.17.2
Carlos O'Donell Nov. 20, 2018, 10:35 p.m. UTC | #2
On 11/20/18 5:33 PM, Mathieu Desnoyers wrote:
> ----- On Nov 20, 2018, at 5:26 PM, carlos carlos@redhat.com wrote:
> 
>> abilist.awk: Treat .tdata like .tbss and reject unknown combinations.
>>
>> Mathieu Desnoyers ran into an issue with his rseq patch where
>> he was the first person to add weak thread-local data and this
>> resulted in an ABI list update with entries like this:
>> "GLIBC_2.29 w ? D .tdata 0000000000000020".
>>
>> The weakness of the symbol has nothing to do with the DSOs
>> ABI and so we should not write anything about weak symbols
>> here. The .tdata entries should be treated exactly like .tbss
>> entries and the output should have been:
>> "GLIBC_2.29 __rseq_abi T 0x20"
>>
>> This change makes abilist.awk handle .tdata just like .tbss, while
>> at the same time adding an error case for the default. We never
>> want anyone to be able to add such entries to any ABI list files
>> and should see an immediate error and consult with experts.
>>
>> Tested by Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
>> witht the rseq patch set and 'make update-all-abi'.
> 
> witht -> with

Thanks. Fixed (git commit --amend).
 
> Thanks!
> 
> Mathieu
> 
>>
>> Tested myself with 'make update-all-abi' on x86_64 with no changes.
>>
>> Signed-off-by: Carlos O'Donell <carlos@redhat.com>
>> ---
>> ChangeLog           |  4 ++++
>> scripts/abilist.awk | 11 +++--------
>> 2 files changed, 7 insertions(+), 8 deletions(-)
>>
>> diff --git a/ChangeLog b/ChangeLog
>> index 9cdd3bad36..7038b583b6 100644
>> --- a/ChangeLog
>> +++ b/ChangeLog
>> @@ -1,3 +1,7 @@
>> +2018-11-20  Carlos O'Donell  <carlos@redhat.com>
>> +
>> +	* scripts/abilist.awk: Handle .tdata. Error for unknown combinations.
>> +
>> 2018-11-20  DJ Delorie  <dj@redhat.com>
>>
>> 	* malloc/malloc.c (tcache_entry): Add key field.
>> diff --git a/scripts/abilist.awk b/scripts/abilist.awk
>> index bad7c3807e..e914df57f0 100644
>> --- a/scripts/abilist.awk
>> +++ b/scripts/abilist.awk
>> @@ -39,7 +39,6 @@ $2 == "l" { next }
>>
>> # If the target uses ST_OTHER, it will be output before the symbol name.
>> $2 == "g" || $2 == "w" && (NF == 7 || NF == 8) {
>> -  weak = $2;
>>   type = $3;
>>   size = $5;
>>   sub(/^0*/, "", size);
>> @@ -55,7 +54,7 @@ $2 == "g" || $2 == "w" && (NF == 7 || NF == 8) {
>>   if (version == "GLIBC_PRIVATE") next;
>>
>>   desc = "";
>> -  if (type == "D" && $4 == ".tbss") {
>> +  if (type == "D" && ($4 == ".tbss" || $4 == ".tdata")) {
>>     type = "T";
>>   }
>>   else if (type == "D" && $4 == ".opd") {
>> @@ -90,14 +89,10 @@ $2 == "g" || $2 == "w" && (NF == 7 || NF == 8) {
>>     size = "";
>>   }
>>   else {
>> -    desc = symbol " " version " " weak " ? " type " " $4 " " $5;
>> -  }
>> -  if (size == " 0x") {
>> -    desc = symbol " " version " " weak " ? " type " " $4 " " $5;
>> +    print "Unable to handle this type of symbol."
>> +    exit 1
>>   }
>>
>> -  # Disabled -- weakness should not matter to shared library ABIs any more.
>> -  #if (weak == "w") type = tolower(type);
>>   if (desc == "")
>>     desc = symbol " " type size;
>>
>> --
>> 2.17.2
>
Andreas Schwab Nov. 21, 2018, 9:19 a.m. UTC | #3
On Nov 20 2018, Carlos O'Donell <carlos@redhat.com> wrote:

> +2018-11-20  Carlos O'Donell  <carlos@redhat.com>
> +
> +	* scripts/abilist.awk: Handle .tdata. Error for unknown combinations.
> +
>  2018-11-20  DJ Delorie  <dj@redhat.com>
>  
>  	* malloc/malloc.c (tcache_entry): Add key field.
> diff --git a/scripts/abilist.awk b/scripts/abilist.awk
> index bad7c3807e..e914df57f0 100644
> --- a/scripts/abilist.awk
> +++ b/scripts/abilist.awk
> @@ -39,7 +39,6 @@ $2 == "l" { next }
>  
>  # If the target uses ST_OTHER, it will be output before the symbol name.
>  $2 == "g" || $2 == "w" && (NF == 7 || NF == 8) {
> -  weak = $2;
>    type = $3;
>    size = $5;
>    sub(/^0*/, "", size);
> @@ -55,7 +54,7 @@ $2 == "g" || $2 == "w" && (NF == 7 || NF == 8) {
>    if (version == "GLIBC_PRIVATE") next;
>  
>    desc = "";
> -  if (type == "D" && $4 == ".tbss") {
> +  if (type == "D" && ($4 == ".tbss" || $4 == ".tdata")) {
>      type = "T";
>    }
>    else if (type == "D" && $4 == ".opd") {
> @@ -90,14 +89,10 @@ $2 == "g" || $2 == "w" && (NF == 7 || NF == 8) {
>      size = "";
>    }
>    else {
> -    desc = symbol " " version " " weak " ? " type " " $4 " " $5;
> -  }
> -  if (size == " 0x") {
> -    desc = symbol " " version " " weak " ? " type " " $4 " " $5;
> +    print "Unable to handle this type of symbol."
> +    exit 1

Perhaps also exit here when seeing an unrecognized line?

{
  print "Don't grok this line:", $0
}

Andreas.
Carlos O'Donell Nov. 27, 2018, 2:25 a.m. UTC | #4
On 11/21/18 4:19 AM, Andreas Schwab wrote:
> On Nov 20 2018, Carlos O'Donell <carlos@redhat.com> wrote:
> 
>> +2018-11-20  Carlos O'Donell  <carlos@redhat.com>
>> +
>> +	* scripts/abilist.awk: Handle .tdata. Error for unknown combinations.
>> +
>>  2018-11-20  DJ Delorie  <dj@redhat.com>
>>  
>>  	* malloc/malloc.c (tcache_entry): Add key field.
>> diff --git a/scripts/abilist.awk b/scripts/abilist.awk
>> index bad7c3807e..e914df57f0 100644
>> --- a/scripts/abilist.awk
>> +++ b/scripts/abilist.awk
>> @@ -39,7 +39,6 @@ $2 == "l" { next }
>>  
>>  # If the target uses ST_OTHER, it will be output before the symbol name.
>>  $2 == "g" || $2 == "w" && (NF == 7 || NF == 8) {
>> -  weak = $2;
>>    type = $3;
>>    size = $5;
>>    sub(/^0*/, "", size);
>> @@ -55,7 +54,7 @@ $2 == "g" || $2 == "w" && (NF == 7 || NF == 8) {
>>    if (version == "GLIBC_PRIVATE") next;
>>  
>>    desc = "";
>> -  if (type == "D" && $4 == ".tbss") {
>> +  if (type == "D" && ($4 == ".tbss" || $4 == ".tdata")) {
>>      type = "T";
>>    }
>>    else if (type == "D" && $4 == ".opd") {
>> @@ -90,14 +89,10 @@ $2 == "g" || $2 == "w" && (NF == 7 || NF == 8) {
>>      size = "";
>>    }
>>    else {
>> -    desc = symbol " " version " " weak " ? " type " " $4 " " $5;
>> -  }
>> -  if (size == " 0x") {
>> -    desc = symbol " " version " " weak " ? " type " " $4 " " $5;
>> +    print "Unable to handle this type of symbol."
>> +    exit 1
> 
> Perhaps also exit here when seeing an unrecognized line?
> 
> {
>   print "Don't grok this line:", $0
> }

Good suggestion. We should absolutely do that. Done.

I've committed the results after re-testing on x86_64.
Joseph Myers Nov. 27, 2018, 4:42 p.m. UTC | #5
I'm now seeing compilation tests failing for i686-gnu.

LC_ALL=C gawk -f ../scripts/abilist.awk /scratch/jmyers/glibc-bot/build/glibcs/i686-gnu/glibc/mach/libmachuser.dynsym > /scratch/jmyers/glibc-bot/build/glibcs/i686-gnu/glibc/mach/libmachuser.symlistT
../Makerules:1344: recipe for target '/scratch/jmyers/glibc-bot/build/glibcs/i686-gnu/glibc/mach/libmachuser.symlist' failed
make[3]: *** [/scratch/jmyers/glibc-bot/build/glibcs/i686-gnu/glibc/mach/libmachuser.symlist] Error 1

These tests for libmachuser and libhurduser are XFAILed in 
sysdeps/mach/hurd/i386/Makefile, but that's for the comparison failing, 
whereas now the generation of the .symlist file fails ("ERROR: Unable to 
handle this type of symbol." - it would be helpful for that message to say 
exactly what the line is that generates the error) and so "make check" 
exits early.
Carlos O'Donell Nov. 27, 2018, 5:36 p.m. UTC | #6
On 11/27/18 11:42 AM, Joseph Myers wrote:
> I'm now seeing compilation tests failing for i686-gnu.
> 
> LC_ALL=C gawk -f ../scripts/abilist.awk /scratch/jmyers/glibc-bot/build/glibcs/i686-gnu/glibc/mach/libmachuser.dynsym > /scratch/jmyers/glibc-bot/build/glibcs/i686-gnu/glibc/mach/libmachuser.symlistT
> ../Makerules:1344: recipe for target '/scratch/jmyers/glibc-bot/build/glibcs/i686-gnu/glibc/mach/libmachuser.symlist' failed
> make[3]: *** [/scratch/jmyers/glibc-bot/build/glibcs/i686-gnu/glibc/mach/libmachuser.symlist] Error 1
> 
> These tests for libmachuser and libhurduser are XFAILed in 
> sysdeps/mach/hurd/i386/Makefile, but that's for the comparison failing, 
> whereas now the generation of the .symlist file fails ("ERROR: Unable to 
> handle this type of symbol." - it would be helpful for that message to say 
> exactly what the line is that generates the error) and so "make check" 
> exits early.
 
I did not run a build-many-glibc's test for this change, thinking that
it wouldn't impact any other machine/OS combinations.

I have just started a build-many-glibc's run to see if anything else
fails.

I'll add some debugging code and see if I can see what's wrong.
Florian Weimer Nov. 30, 2018, 3:48 p.m. UTC | #7
* Carlos O'Donell:

> On 11/27/18 11:42 AM, Joseph Myers wrote:
>> I'm now seeing compilation tests failing for i686-gnu.
>> 
>> LC_ALL=C gawk -f ../scripts/abilist.awk /scratch/jmyers/glibc-bot/build/glibcs/i686-gnu/glibc/mach/libmachuser.dynsym > /scratch/jmyers/glibc-bot/build/glibcs/i686-gnu/glibc/mach/libmachuser.symlistT
>> ../Makerules:1344: recipe for target '/scratch/jmyers/glibc-bot/build/glibcs/i686-gnu/glibc/mach/libmachuser.symlist' failed
>> make[3]: *** [/scratch/jmyers/glibc-bot/build/glibcs/i686-gnu/glibc/mach/libmachuser.symlist] Error 1
>> 
>> These tests for libmachuser and libhurduser are XFAILed in 
>> sysdeps/mach/hurd/i386/Makefile, but that's for the comparison failing, 
>> whereas now the generation of the .symlist file fails ("ERROR: Unable to 
>> handle this type of symbol." - it would be helpful for that message to say 
>> exactly what the line is that generates the error) and so "make check" 
>> exits early.
>  
> I did not run a build-many-glibc's test for this change, thinking that
> it wouldn't impact any other machine/OS combinations.
>
> I have just started a build-many-glibc's run to see if anything else
> fails.
>
> I'll add some debugging code and see if I can see what's wrong.

It's related to this from hurd/Versions, which looks rather questionable
to me because I assumed that _end ought to be a hidden symbol:

    # necessary for the Hurd brk implementation
    _end;

I checked the attached patch on i686-gnu (cross-test), x86_64-linux-gnu,
i686-linux-gnu, powerpc64le-linux-gnu, ia64-linux-gnu (cross-test).

Thanks,
Florian

-----
scripts/abilist.awk: Handle special _end symbol for Hurd

Hurd has this in libc.so:

0024db9c g    D  .bss   00000000  GLIBC_2.2.6 _end

This g/D combination was not recognized before.

2018-11-30  Florian Weimer  <fweimer@redhat.com>

	* scripts/abilist.awk: Print "0x0" for size 0. Handle "g"/"D".
	Extend error logging.
	* sysdeps/mach/hurd/i386/libc.abilist (GLIBC_2.2.6): Adjust _end
	symbol.

diff --git a/scripts/abilist.awk b/scripts/abilist.awk
index b40be91f82..a43400d5b4 100644
--- a/scripts/abilist.awk
+++ b/scripts/abilist.awk
@@ -42,7 +42,11 @@ $2 == "g" || $2 == "w" && (NF == 7 || NF == 8) {
   type = $3;
   size = $5;
   sub(/^0*/, "", size);
-  size = " 0x" size;
+  if (size == "") {
+      size = " 0x0";
+  } else {
+      size = " 0x" size;
+  }
   version = $6;
   symbol = $NF;
   gsub(/[()]/, "", version);
@@ -73,6 +77,9 @@ $2 == "g" || $2 == "w" && (NF == 7 || NF == 8) {
   else if ($4 == "*ABS*") {
     next;
   }
+  else if (type == "D") {
+    # Accept unchanged.
+  }
   else if (type == "DO") {
     type = "D";
   }
@@ -89,7 +96,7 @@ $2 == "g" || $2 == "w" && (NF == 7 || NF == 8) {
     size = "";
   }
   else {
-    print "ERROR: Unable to handle this type of symbol."
+    print "ERROR: Unable to handle this type of symbol:", $0
     exit 1
   }
 
diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
index d4c4a91c84..f3993cf994 100644
--- a/sysdeps/mach/hurd/i386/libc.abilist
+++ b/sysdeps/mach/hurd/i386/libc.abilist
@@ -554,7 +554,7 @@ GLIBC_2.2.6 __xstat64 F
 GLIBC_2.2.6 _authenticate F
 GLIBC_2.2.6 _dl_mcount_wrapper F
 GLIBC_2.2.6 _dl_mcount_wrapper_check F
-GLIBC_2.2.6 _end GLIBC_2.2.6 g ? D .bss 00000000
+GLIBC_2.2.6 _end D 0x0
 GLIBC_2.2.6 _environ D 0x4
 GLIBC_2.2.6 _exit F
 GLIBC_2.2.6 _flushlbf F
Carlos O'Donell Nov. 30, 2018, 9:20 p.m. UTC | #8
On 11/30/18 10:48 AM, Florian Weimer wrote:
> * Carlos O'Donell:
> 
>> On 11/27/18 11:42 AM, Joseph Myers wrote:
>>> I'm now seeing compilation tests failing for i686-gnu.
>>>
>>> LC_ALL=C gawk -f ../scripts/abilist.awk /scratch/jmyers/glibc-bot/build/glibcs/i686-gnu/glibc/mach/libmachuser.dynsym > /scratch/jmyers/glibc-bot/build/glibcs/i686-gnu/glibc/mach/libmachuser.symlistT
>>> ../Makerules:1344: recipe for target '/scratch/jmyers/glibc-bot/build/glibcs/i686-gnu/glibc/mach/libmachuser.symlist' failed
>>> make[3]: *** [/scratch/jmyers/glibc-bot/build/glibcs/i686-gnu/glibc/mach/libmachuser.symlist] Error 1
>>>
>>> These tests for libmachuser and libhurduser are XFAILed in 
>>> sysdeps/mach/hurd/i386/Makefile, but that's for the comparison failing, 
>>> whereas now the generation of the .symlist file fails ("ERROR: Unable to 
>>> handle this type of symbol." - it would be helpful for that message to say 
>>> exactly what the line is that generates the error) and so "make check" 
>>> exits early.
>>  
>> I did not run a build-many-glibc's test for this change, thinking that
>> it wouldn't impact any other machine/OS combinations.
>>
>> I have just started a build-many-glibc's run to see if anything else
>> fails.
>>
>> I'll add some debugging code and see if I can see what's wrong.
> 
> It's related to this from hurd/Versions, which looks rather questionable
> to me because I assumed that _end ought to be a hidden symbol:
> 
>     # necessary for the Hurd brk implementation
>     _end;
 
The default linker script does not mark them hidden, but from within
glibc's dynamic loader we add attribute_hidden to the reference, and
we don't generally want that symbol to be visible to the application
(even if it is in the implementation's name space).

I think this is a defect in:
sysdeps/mach/hurd/brk.c
where we have extern but without attribute_hidden.

In 2002 with 5c82e15e8646cd7d229bcd8287d01875e12df0b3 we started
marking _end as hidden.

> I checked the attached patch on i686-gnu (cross-test), x86_64-linux-gnu,
> i686-linux-gnu, powerpc64le-linux-gnu, ia64-linux-gnu (cross-test).
> 
> Thanks,
> Florian
> 
> -----
> scripts/abilist.awk: Handle special _end symbol for Hurd
> 
> Hurd has this in libc.so:
> 
> 0024db9c g    D  .bss   00000000  GLIBC_2.2.6 _end
> 
> This g/D combination was not recognized before.
> 
> 2018-11-30  Florian Weimer  <fweimer@redhat.com>
> 
> 	* scripts/abilist.awk: Print "0x0" for size 0. Handle "g"/"D".
> 	Extend error logging.
> 	* sysdeps/mach/hurd/i386/libc.abilist (GLIBC_2.2.6): Adjust _end
> 	symbol.

LGTM.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>

> 
> diff --git a/scripts/abilist.awk b/scripts/abilist.awk
> index b40be91f82..a43400d5b4 100644
> --- a/scripts/abilist.awk
> +++ b/scripts/abilist.awk
> @@ -42,7 +42,11 @@ $2 == "g" || $2 == "w" && (NF == 7 || NF == 8) {
>    type = $3;
>    size = $5;
>    sub(/^0*/, "", size);
> -  size = " 0x" size;
> +  if (size == "") {
> +      size = " 0x0";
> +  } else {
> +      size = " 0x" size;
> +  }

OK. Handle zero sized symbols like _end (entirely possible in other
instances too).

>    version = $6;
>    symbol = $NF;
>    gsub(/[()]/, "", version);
> @@ -73,6 +77,9 @@ $2 == "g" || $2 == "w" && (NF == 7 || NF == 8) {
>    else if ($4 == "*ABS*") {
>      next;
>    }
> +  else if (type == "D") {
> +    # Accept unchanged.
> +  }

OK. Handle initialized data section symbols being part of the ABI.

>    else if (type == "DO") {
>      type = "D";
>    }
> @@ -89,7 +96,7 @@ $2 == "g" || $2 == "w" && (NF == 7 || NF == 8) {
>      size = "";
>    }
>    else {
> -    print "ERROR: Unable to handle this type of symbol."
> +    print "ERROR: Unable to handle this type of symbol:", $0

OK, add a bit more debugging.

>      exit 1
>    }
>  
> diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist
> index d4c4a91c84..f3993cf994 100644
> --- a/sysdeps/mach/hurd/i386/libc.abilist
> +++ b/sysdeps/mach/hurd/i386/libc.abilist
> @@ -554,7 +554,7 @@ GLIBC_2.2.6 __xstat64 F
>  GLIBC_2.2.6 _authenticate F
>  GLIBC_2.2.6 _dl_mcount_wrapper F
>  GLIBC_2.2.6 _dl_mcount_wrapper_check F
> -GLIBC_2.2.6 _end GLIBC_2.2.6 g ? D .bss 00000000
> +GLIBC_2.2.6 _end D 0x0

OK. Ah! If I'd been clever I would have looked for existing instances of the now
removed fallback in ABI files.

[carlos@athas glibc]$ find . -name '*.abilist' | xargs grep '?'
./sysdeps/mach/hurd/i386/libc.abilist:GLIBC_2.2.6 _end GLIBC_2.2.6 g ? D .bss 00000000

There is only one, and you fixed it.

>  GLIBC_2.2.6 _environ D 0x4
>  GLIBC_2.2.6 _exit F
>  GLIBC_2.2.6 _flushlbf F
>
diff mbox series

Patch

diff --git a/ChangeLog b/ChangeLog
index 9cdd3bad36..7038b583b6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@ 
+2018-11-20  Carlos O'Donell  <carlos@redhat.com>
+
+	* scripts/abilist.awk: Handle .tdata. Error for unknown combinations.
+
 2018-11-20  DJ Delorie  <dj@redhat.com>
 
 	* malloc/malloc.c (tcache_entry): Add key field.
diff --git a/scripts/abilist.awk b/scripts/abilist.awk
index bad7c3807e..e914df57f0 100644
--- a/scripts/abilist.awk
+++ b/scripts/abilist.awk
@@ -39,7 +39,6 @@  $2 == "l" { next }
 
 # If the target uses ST_OTHER, it will be output before the symbol name.
 $2 == "g" || $2 == "w" && (NF == 7 || NF == 8) {
-  weak = $2;
   type = $3;
   size = $5;
   sub(/^0*/, "", size);
@@ -55,7 +54,7 @@  $2 == "g" || $2 == "w" && (NF == 7 || NF == 8) {
   if (version == "GLIBC_PRIVATE") next;
 
   desc = "";
-  if (type == "D" && $4 == ".tbss") {
+  if (type == "D" && ($4 == ".tbss" || $4 == ".tdata")) {
     type = "T";
   }
   else if (type == "D" && $4 == ".opd") {
@@ -90,14 +89,10 @@  $2 == "g" || $2 == "w" && (NF == 7 || NF == 8) {
     size = "";
   }
   else {
-    desc = symbol " " version " " weak " ? " type " " $4 " " $5;
-  }
-  if (size == " 0x") {
-    desc = symbol " " version " " weak " ? " type " " $4 " " $5;
+    print "Unable to handle this type of symbol."
+    exit 1
   }
 
-  # Disabled -- weakness should not matter to shared library ABIs any more.
-  #if (weak == "w") type = tolower(type);
   if (desc == "")
     desc = symbol " " type size;